Upload folder using huggingface_hub
Browse files- README.md +54 -0
- adapter_config.json +26 -0
- adapter_model.safetensors +3 -0
- special_tokens_map.json +23 -0
- tokenizer.model +3 -0
- tokenizer_config.json +42 -0
README.md
CHANGED
@@ -1,3 +1,57 @@
|
|
1 |
---
|
|
|
|
|
2 |
license: llama2
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
library_name: transformers
|
3 |
+
base_model: meta-llama/Llama-2-7b-hf
|
4 |
license: llama2
|
5 |
+
pipeline_tag: text-generation
|
6 |
+
language:
|
7 |
+
- multilingual
|
8 |
+
datasets:
|
9 |
+
- cis-lmu/Glot500
|
10 |
---
|
11 |
+
|
12 |
+
# MaLA-500: Massive Language Adaptation of Large Language Models
|
13 |
+
|
14 |
+
MaLA-500 is a novel large language model designed to cover an extensive range of 534 languages. This model builds upon LLaMA 2 7B and integrates continued pretraining with vocabulary extension, with an expanded vocabulary size of 260,164, and LoRA low-rank adaptation.
|
15 |
+
|
16 |
+
|
17 |
+
- **Continued Pretraining:** Enhances the model's ability to adapt to a wide range of languages.
|
18 |
+
- **LoRA Low-Rank Adaptation:** LoRA low-rank adaptation refines the model's adaptation capabilities.
|
19 |
+
- **Vocabulary Extension:** MaLA-500 boasts an extended vocabulary size of 260,164.
|
20 |
+
- **Multilingual Proficiency:** Trained on Glot500-c, covering 534 languages.
|
21 |
+
|
22 |
+
With vocabulary extension and LoRA modules, the MaLA-500 introduces additional 2.1B trainable parameters, making the total parameters to be 10.7B.
|
23 |
+
|
24 |
+
Please refer to [our paper](https://arxiv.org/pdf/2401.13303.pdf) for more details.
|
25 |
+
|
26 |
+
## How to Get Started with the Model
|
27 |
+
|
28 |
+
Requirements:
|
29 |
+
```
|
30 |
+
transformers>=4.36.1
|
31 |
+
peft>=0.6.2
|
32 |
+
```
|
33 |
+
|
34 |
+
Use the code below to get started with the model.
|
35 |
+
|
36 |
+
``` python
|
37 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
38 |
+
from peft import PeftModel
|
39 |
+
|
40 |
+
base_model = AutoModelForCausalLM.from_pretrained('meta-llama/Llama-2-7b-hf')
|
41 |
+
base_model.resize_token_embeddings(260164)
|
42 |
+
tokenizer = AutoTokenizer.from_pretrained('MaLA-LM/mala-500-10b')
|
43 |
+
model = PeftModel.from_pretrained(base_model, 'MaLA-LM/mala-500-10b')
|
44 |
+
```
|
45 |
+
|
46 |
+
## Citation
|
47 |
+
|
48 |
+
```
|
49 |
+
@misc{lin2024mala500,
|
50 |
+
title={MaLA-500: Massive Language Adaptation of Large Language Models},
|
51 |
+
author={Peiqin Lin and Shaoxiong Ji and Jörg Tiedemann and André F. T. Martins and Hinrich Schütze},
|
52 |
+
year={2024},
|
53 |
+
eprint={2401.13303},
|
54 |
+
archivePrefix={arXiv},
|
55 |
+
primaryClass={cs.CL}
|
56 |
+
}
|
57 |
+
```
|
adapter_config.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"alpha_pattern": {},
|
3 |
+
"auto_mapping": null,
|
4 |
+
"base_model_name_or_path": "meta-llama/Llama-2-7b-hf",
|
5 |
+
"bias": "none",
|
6 |
+
"fan_in_fan_out": false,
|
7 |
+
"inference_mode": true,
|
8 |
+
"init_lora_weights": true,
|
9 |
+
"layers_pattern": null,
|
10 |
+
"layers_to_transform": null,
|
11 |
+
"lora_alpha": 32.0,
|
12 |
+
"lora_dropout": 0.1,
|
13 |
+
"modules_to_save": [
|
14 |
+
"embed_tokens",
|
15 |
+
"lm_head"
|
16 |
+
],
|
17 |
+
"peft_type": "LORA",
|
18 |
+
"r": 8,
|
19 |
+
"rank_pattern": {},
|
20 |
+
"revision": null,
|
21 |
+
"target_modules": [
|
22 |
+
"v_proj",
|
23 |
+
"q_proj"
|
24 |
+
],
|
25 |
+
"task_type": "CAUSAL_LM"
|
26 |
+
}
|
adapter_model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3607bf5fe0e4f5da8ce537530404eadf88d969c7f56ccdd0bcf9f5af7a4ca44d
|
3 |
+
size 4270933608
|
special_tokens_map.json
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "</s>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"unk_token": {
|
17 |
+
"content": "<unk>",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
}
|
23 |
+
}
|
tokenizer.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:728e0df348a26f222dc309d5fc27408d659aaab88e1d822d6cba2c4500324e76
|
3 |
+
size 4455279
|
tokenizer_config.json
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": true,
|
3 |
+
"add_eos_token": false,
|
4 |
+
"added_tokens_decoder": {
|
5 |
+
"0": {
|
6 |
+
"content": "<unk>",
|
7 |
+
"lstrip": false,
|
8 |
+
"normalized": false,
|
9 |
+
"rstrip": false,
|
10 |
+
"single_word": false,
|
11 |
+
"special": true
|
12 |
+
},
|
13 |
+
"1": {
|
14 |
+
"content": "<s>",
|
15 |
+
"lstrip": false,
|
16 |
+
"normalized": false,
|
17 |
+
"rstrip": false,
|
18 |
+
"single_word": false,
|
19 |
+
"special": true
|
20 |
+
},
|
21 |
+
"2": {
|
22 |
+
"content": "</s>",
|
23 |
+
"lstrip": false,
|
24 |
+
"normalized": false,
|
25 |
+
"rstrip": false,
|
26 |
+
"single_word": false,
|
27 |
+
"special": true
|
28 |
+
}
|
29 |
+
},
|
30 |
+
"bos_token": "<s>",
|
31 |
+
"clean_up_tokenization_spaces": false,
|
32 |
+
"eos_token": "</s>",
|
33 |
+
"legacy": true,
|
34 |
+
"model_max_length": 1000000000000000019884624838656,
|
35 |
+
"pad_token": null,
|
36 |
+
"sp_model_kwargs": {},
|
37 |
+
"spaces_between_special_tokens": false,
|
38 |
+
"tokenizer_class": "LlamaTokenizer",
|
39 |
+
"unk_token": "<unk>",
|
40 |
+
"use_default_system_prompt": false,
|
41 |
+
"use_fast": true
|
42 |
+
}
|