Update README.md
Browse files
README.md
CHANGED
@@ -24,9 +24,7 @@ tags:
|
|
24 |
datasets:
|
25 |
- masakhane/african-ultrachat
|
26 |
---
|
27 |
-
|
28 |
-
# Llama-3.1 8B Instruct African-Ultrachat
|
29 |
-
|
30 |
|
31 |
- **Developed by:** vutuka
|
32 |
- **License:** apache-2.0
|
@@ -40,31 +38,17 @@ datasets:
|
|
40 |
- `58 GB RAM`
|
41 |
- `150 GB Storage`
|
42 |
|
|
|
43 |
|
44 |
-
|
45 |
|
46 |
-
|
47 |
-
from unsloth.chat_templates import get_chat_template
|
48 |
|
49 |
-
|
50 |
-
tokenizer,
|
51 |
-
chat_template = "llama-3", # Supports zephyr, chatml, mistral, llama, alpaca, vicuna, vicuna_old, unsloth
|
52 |
-
mapping={
|
53 |
-
"role": "role",
|
54 |
-
"content": "content",
|
55 |
-
"user": "",
|
56 |
-
"assistant": "",
|
57 |
-
}
|
58 |
-
)
|
59 |
|
60 |
-
|
61 |
-
convos = examples["messages"]
|
62 |
-
texts = [tokenizer.apply_chat_template(convo, tokenize = False, add_generation_prompt = False) for convo in convos]
|
63 |
-
return { "text" : texts, }
|
64 |
-
pass
|
65 |
-
```
|
66 |
|
67 |
-
|
68 |
|
69 |
```py
|
70 |
trainer = SFTTrainer(
|
@@ -97,6 +81,42 @@ trainer = SFTTrainer(
|
|
97 |
)
|
98 |
```
|
99 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
## Inference with Unsloth
|
101 |
|
102 |
```py
|
|
|
24 |
datasets:
|
25 |
- masakhane/african-ultrachat
|
26 |
---
|
27 |
+
# Llama-3.1-8B Instruct African Ultrachat
|
|
|
|
|
28 |
|
29 |
- **Developed by:** vutuka
|
30 |
- **License:** apache-2.0
|
|
|
38 |
- `58 GB RAM`
|
39 |
- `150 GB Storage`
|
40 |
|
41 |
+
## Introducing Llama 3.1-8B Instruct Fine-Tuned on the Masakhane African UltraChat Dataset
|
42 |
|
43 |
+
We are excited to announce the fine-tuned version of the Llama 3.1-8B Instruct model, which has been trained on the Masakhane African UltraChat dataset. This fine-tuning leverages the robust architecture of the Llama 3.1 model, designed for high-performance multilingual tasks and long context processing, to enhance its capabilities in understanding and generating responses in African languages.
|
44 |
|
45 |
+
#### Model Overview
|
|
|
46 |
|
47 |
+
**Llama 3.1-8B Instruct** is part of the Llama 3 family, developed by Meta. It features an optimized transformer architecture and supports multiple languages, including English, German, French, Italian, Portuguese, Hindi, Spanish, and Thai. This model variant is particularly suited for instruction-tuned tasks, making it ideal for dialogue and assistant-like applications.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
+
#### Training and Fine-Tuning
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
+
The model was fine-tuned using the Masakhane African UltraChat dataset, which is a diverse and extensive collection of conversational data aimed at promoting and enhancing NLP capabilities for African languages. The fine-tuning process involved supervised fine-tuning (SFT) and reinforcement learning with human feedback (RLHF), ensuring the model aligns well with human preferences for helpfulness and safety.
|
52 |
|
53 |
```py
|
54 |
trainer = SFTTrainer(
|
|
|
81 |
)
|
82 |
```
|
83 |
|
84 |
+
#### Performance and Capabilities
|
85 |
+
|
86 |
+
The fine-tuned Llama 3.1-8B model demonstrates improved performance in understanding and generating text in African languages, providing accurate and contextually appropriate responses. It is designed to handle various conversational tasks, from casual dialogue to more complex inquiries, making it a valuable tool for applications targeting African language users.
|
87 |
+
|
88 |
+
#### Key Features
|
89 |
+
|
90 |
+
- **Multilingual Support**: Enhanced capabilities in multiple languages, including African languages.
|
91 |
+
- **Long Context Handling**: Supports up to 128k tokens, making it suitable for long-form conversations.
|
92 |
+
- **Instruction-Tuned**: Optimized for generating accurate and helpful responses based on user instructions.
|
93 |
+
- **High Performance**: Utilizes advanced techniques like Grouped-Query Attention (GQA) for improved scalability and efficiency.
|
94 |
+
|
95 |
+
|
96 |
+
## Tokenizer & Chat Format
|
97 |
+
|
98 |
+
```py
|
99 |
+
from unsloth.chat_templates import get_chat_template
|
100 |
+
|
101 |
+
tokenizer = get_chat_template(
|
102 |
+
tokenizer,
|
103 |
+
chat_template = "llama-3", # Supports zephyr, chatml, mistral, llama, alpaca, vicuna, vicuna_old, unsloth
|
104 |
+
mapping={
|
105 |
+
"role": "role",
|
106 |
+
"content": "content",
|
107 |
+
"user": "",
|
108 |
+
"assistant": "",
|
109 |
+
}
|
110 |
+
)
|
111 |
+
|
112 |
+
def formatting_prompts_func(examples):
|
113 |
+
convos = examples["messages"]
|
114 |
+
texts = [tokenizer.apply_chat_template(convo, tokenize = False, add_generation_prompt = False) for convo in convos]
|
115 |
+
return { "text" : texts, }
|
116 |
+
pass
|
117 |
+
```
|
118 |
+
|
119 |
+
|
120 |
## Inference with Unsloth
|
121 |
|
122 |
```py
|