Commit
·
99280c4
1
Parent(s):
4c4256d
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: mistralai/Mistral-7B-Instruct-v0.2
|
3 |
+
datasets:
|
4 |
+
- mwitiderrick/SwahiliAlpaca
|
5 |
+
inference: true
|
6 |
+
model_type: llama
|
7 |
+
prompt_template: |
|
8 |
+
### Instruction:\n
|
9 |
+
{prompt}
|
10 |
+
### Response:
|
11 |
+
created_by: mwitiderrick
|
12 |
+
tags:
|
13 |
+
- transformers
|
14 |
+
license: apache-2.0
|
15 |
+
language:
|
16 |
+
- en
|
17 |
+
library_name: transformers
|
18 |
+
pipeline_tag: text-generation
|
19 |
+
|
20 |
+
|
21 |
+
---
|
22 |
+
# Swahili Instruct
|
23 |
+
|
24 |
+
This is a [Mistral Instruct](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2) that has been fine-tuned on 1 epoch of the
|
25 |
+
[SwahiliPlatypus](mwitiderrick/SwahiliAlpaca) dataset.
|
26 |
+
|
27 |
+
## Prompt Template
|
28 |
+
```
|
29 |
+
### Maelekezo:
|
30 |
+
|
31 |
+
{query}
|
32 |
+
|
33 |
+
### Jibu:
|
34 |
+
<Leave new line for model to respond>
|
35 |
+
```
|
36 |
+
## Usage
|
37 |
+
```python
|
38 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
|
39 |
+
|
40 |
+
tokenizer = AutoTokenizer.from_pretrained("mwitiderrick/SwahiliInstruct-v0.1")
|
41 |
+
model = AutoModelForCausalLM.from_pretrained("mwitiderrick/SwahiliInstruct-v0.1", device_map="auto")
|
42 |
+
query = "Nipe maagizo ya kutengeneza mkate wa mandizi"
|
43 |
+
text_gen = pipeline(task="text-generation", model=model, tokenizer=tokenizer, max_length=200, do_sample=True, repetition_penalty=1.1)
|
44 |
+
output = text_gen(f"### Maelekezo:\n{query}\n### Jibu:\n")
|
45 |
+
print(output[0]['generated_text'])
|
46 |
+
"""
|
47 |
+
Maagizo ya Kutengeneza Mkate wa Mandazi1.
|
48 |
+
Washa tanuri kamili hadi 350 ° F (175°C) na uweka sufuria ya kuoka katikati.
|
49 |
+
2. Katika bakuli, changanya mikasi yote pamoja na chumvi kitamu.
|
50 |
+
3. Ongeza mayai, siagi na sukari, koroga hadi viwe sawasawa.
|
51 |
+
4. Panda mchanganyiko kwenye pan katika mkusanyo unaotuleta tayari kwa mtiririko.
|
52 |
+
5. Kata misingo kuburudisha kila mahali na uwatazama ikiwa yanapasuka y
|
53 |
+
|
54 |
+
"""
|
55 |
+
```
|