File size: 1,388 Bytes
43ae88e
 
5ae3c8d
 
 
 
43ae88e
 
f735258
43ae88e
5ae3c8d
73835d4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5ae3c8d
 
 
 
43ae88e
5ae3c8d
43ae88e
5ae3c8d
 
43ae88e
5ae3c8d
 
 
 
 
43ae88e
5ae3c8d
 
 
43ae88e
5ae3c8d
 
 
 
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
---
library_name: transformers
language:
- am
base_model:
- rasyosef/Llama-3.2-180M-Amharic
---

This model is an Instruction-Tuned version of [Llama 3.2 180M Amharic](https://huggingface.co./rasyosef/Llama-3.2-180M-Amharic).

### How to use
### Chat Format

Given the nature of the training data, the phi-2 instruct model is best suited for prompts using the chat format as follows. 
You can provide the prompt as a question with a generic template as follows:
```markdown
<|im_start|>user
ጥያቄ?<|im_end|>
<|im_start|>assistant
```

For example:
```markdown
<|im_start|>user
ሶስት የአፍሪካ ሀገራት ጥቀስልኝ<|im_end|>
<|im_start|>assistant
```
where the model generates the text after `<|im_start|>assistant` .

### Sample inference code
First, you need to install the latest version of transformers
```
pip install -Uq transformers
```

You can use this model directly with a pipeline for text generation:

```python
from transformers import pipeline

llama3_am = pipeline(
    "text-generation",
    model="rasyosef/Llama-3.2-180M-Amharic-Instruct",
    device_map="auto"
  )

messages = [{"role": "user", "content": "ሶስት የአፍሪካ ሀገራት ጥቀስልኝ"}]
llama3_am(messages, max_new_tokens=128, repetition_penalty=1.1, return_full_text=False)
```

Output:
```python
[{'generated_text': '1. ግብፅ 2. ኢትዮጵያ 3. ኬንያ'}]
```