Update README.md
Browse files
README.md
CHANGED
@@ -10,9 +10,9 @@ tags:
|
|
10 |
- sft
|
11 |
- generated_from_trainer
|
12 |
datasets:
|
13 |
-
-
|
14 |
model-index:
|
15 |
-
- name: zephyr-7b-gemma-sft-alpaca
|
16 |
results: []
|
17 |
language:
|
18 |
- af
|
@@ -27,7 +27,7 @@ should probably proofread and complete it, then remove this comment. -->
|
|
27 |
|
28 |
# zephyr-7b-gemma-sft-alpaca
|
29 |
|
30 |
-
This model is a fine-tuned version of [google/gemma-7b](https://huggingface.co/google/gemma-7b) on the
|
31 |
It achieves the following results on the evaluation set:
|
32 |
- Loss: 0.2737
|
33 |
|
@@ -76,4 +76,39 @@ The following hyperparameters were used during training:
|
|
76 |
- Transformers 4.39.0.dev0
|
77 |
- Pytorch 2.2.1+cu121
|
78 |
- Datasets 2.14.6
|
79 |
-
- Tokenizers 0.15.2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
- sft
|
11 |
- generated_from_trainer
|
12 |
datasets:
|
13 |
+
- masakhane/african-translated-alpaca
|
14 |
model-index:
|
15 |
+
- name: zephyr-7b-gemma-sft-african-alpaca
|
16 |
results: []
|
17 |
language:
|
18 |
- af
|
|
|
27 |
|
28 |
# zephyr-7b-gemma-sft-alpaca
|
29 |
|
30 |
+
This model is a fine-tuned version of [google/gemma-7b](https://huggingface.co/google/gemma-7b) on the masakhane/african-translated-alpaca dataset.
|
31 |
It achieves the following results on the evaluation set:
|
32 |
- Loss: 0.2737
|
33 |
|
|
|
76 |
- Transformers 4.39.0.dev0
|
77 |
- Pytorch 2.2.1+cu121
|
78 |
- Datasets 2.14.6
|
79 |
+
- Tokenizers 0.15.2
|
80 |
+
|
81 |
+
|
82 |
+
|
83 |
+
|
84 |
+
### Usage
|
85 |
+
|
86 |
+
```python
|
87 |
+
|
88 |
+
# Install transformers from source - only needed for versions <= v4.34
|
89 |
+
# pip install git+https://github.com/huggingface/transformers.git
|
90 |
+
# pip install accelerate
|
91 |
+
|
92 |
+
import torch
|
93 |
+
from transformers import pipeline
|
94 |
+
|
95 |
+
pipe = pipeline("text-generation", model="israel/zephyr-7b-gemma-sft-alpaca", torch_dtype=torch.bfloat16, device_map="auto")
|
96 |
+
|
97 |
+
# We use the tokenizer's chat template to format each message - see https://huggingface.co/docs/transformers/main/en/chat_templating
|
98 |
+
messages = [
|
99 |
+
{
|
100 |
+
"role": "system",
|
101 |
+
"content": "You are a friendly chatbot who answewrs question in given language",
|
102 |
+
},
|
103 |
+
{"role": "user", "content": "what is the 3 biggest countrys in Africa?"},
|
104 |
+
]
|
105 |
+
prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
106 |
+
outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
107 |
+
print(outputs[0]["generated_text"])
|
108 |
+
# <|system|>
|
109 |
+
# You are a friendly chatbot who always responds in the style of a pirate<eos>
|
110 |
+
# <|user|>
|
111 |
+
# what is the 3 biggest countrys in Africa?<eos>
|
112 |
+
# <|assistant|>
|
113 |
+
# The 3 biggest countries in Africa are Nigeria, Ethiopia and South Africa.
|
114 |
+
```
|