mwitiderrick
commited on
Commit
·
06ac3b5
1
Parent(s):
6e2eedc
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: mistralai/Mistral-7B-Instruct-v0.2
|
3 |
+
datasets:
|
4 |
+
- mwitiderrick/SwahiliAlpaca
|
5 |
+
inference: true
|
6 |
+
model_type: mistral
|
7 |
+
|
8 |
+
created_by: mwitiderrick
|
9 |
+
tags:
|
10 |
+
- transformers
|
11 |
+
license: apache-2.0
|
12 |
+
language:
|
13 |
+
- en
|
14 |
+
library_name: transformers
|
15 |
+
pipeline_tag: text-generation
|
16 |
+
|
17 |
+
---
|
18 |
+
# SwahiliInstruct
|
19 |
+
|
20 |
+
This is a [Mistral model](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2) that has been fine-tuned on the [Wikipedia Swahili dataset](https://huggingface.co/datasets/mwitiderrick/SwahiliAlpaca) for 3 epochs.
|
21 |
+
|
22 |
+
|
23 |
+
## Usage
|
24 |
+
```python
|
25 |
+
# Load model directly
|
26 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
27 |
+
|
28 |
+
tokenizer = AutoTokenizer.from_pretrained("mwitiderrick/SwahiliInstruct-v0.2")
|
29 |
+
model = AutoModelForCausalLM.from_pretrained("mwitiderrick/SwahiliInstruct-v0.2", device_map="auto")
|
30 |
+
query = "Nipe maagizo ya kutengeneza mkate wa mandizi"
|
31 |
+
text_gen = pipeline(task="text-generation", model=model, tokenizer=tokenizer, max_length=200, do_sample=True, repetition_penalty=1.1)
|
32 |
+
output = text_gen(f"### Maelekezo:\n{query}\n### Jibu:\n")
|
33 |
+
print(output[0]['generated_text'])
|
34 |
+
|
35 |
+
|
36 |
+
"""
|
37 |
+
|
38 |
+
"""
|
39 |
+
```
|