File size: 1,935 Bytes
9dc8e5a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e0aad2a
9dc8e5a
 
 
 
e0aad2a
 
 
 
 
9dc8e5a
 
 
 
 
 
f85e584
 
 
 
 
 
 
 
 
 
3f1796e
 
f85e584
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

---
license: llama2
language:
- ar
base_model: meta-llama/Llama-2-7b-hf
library_name: transformers
---
# Llama2 7B for Arabic: 100 target vocabulary size + Align target vocabulary initialization + 512 training

This model is built on top of Llama2 7B adapted for Arabic using 30K target language sentences sampled from CC-100.

## Model Details

* **Vocabulary**: This model has an additional 100 target vocabulary.
* **Target vocabulary initialization**: The target weights of the embedding and LM head were initialized using Align initialization.
* **Training**: This model was additionally pre-trained on 30K target language sentences sampled from CC-100. The training was conducted with the 512 strategies introduced in the paper.

## Model Description

- **Language:** Arabic
- **License:** Llama 2 Community License Agreement
- **Fine-tuned from model:** meta-llama/Llama-2-7b-hf


## Model Sources

- **Repository:** https://github.com/gucci-j/lowres-cve
- **Paper:** https://arxiv.org/abs/2406.11477

## How to Get Started with the Model
Use the code below to get started with the model.
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModelForCausalLM

model = AutoModelForCausalLM.from_pretrained(
    "atsuki-yamaguchi/Llama-2-7b-hf-ar-30K-align-512"
)
model = PeftModelForCausalLM.from_pretrained(
    model,
    "atsuki-yamaguchi/Llama-2-7b-hf-ar-30K-align-512"
)
model = model.merge_and_unload()
tokenizer = AutoTokenizer.from_pretrained(
    "atsuki-yamaguchi/Llama-2-7b-hf-ar-30K-align-512"
)
```


## Citation
```
@article{yamaguchi-etal-2024-effectively,
    title={How Can We Effectively Expand the Vocabulary of LLMs with 0.01GB of Target Language Text?}, 
    author={Atsuki Yamaguchi and Aline Villavicencio and Nikolaos Aletras},
    year={2024},
    journal={ArXiv},
    year={2024},
    volume={abs/2406.11477},
    url={https://arxiv.org/abs/2406.11477}, 
}
```