Upload README.md
Browse files
README.md
CHANGED
@@ -6,7 +6,7 @@ datasets:
|
|
6 |
inference: false
|
7 |
language:
|
8 |
- en
|
9 |
-
license:
|
10 |
model-index:
|
11 |
- name: zephyr-7b-alpha
|
12 |
results: []
|
@@ -336,7 +336,7 @@ Zephyr is a series of language models that are trained to act as helpful assista
|
|
336 |
|
337 |
- **Model type:** A 7B parameter GPT-like model fine-tuned on a mix of publicly available, synthetic datasets.
|
338 |
- **Language(s) (NLP):** Primarily English
|
339 |
-
- **License:**
|
340 |
- **Finetuned from model:** [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1)
|
341 |
|
342 |
### Model Sources
|
@@ -358,11 +358,23 @@ from transformers import pipeline
|
|
358 |
|
359 |
pipe = pipeline("text-generation", model="HuggingFaceH4/zephyr-7b-alpha", torch_dtype=torch.bfloat16, device_map="auto")
|
360 |
|
361 |
-
# We use
|
362 |
-
|
363 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
364 |
outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
365 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
366 |
```
|
367 |
|
368 |
## Bias, Risks, and Limitations
|
@@ -392,6 +404,7 @@ Zephyr 7B Alpha achieves the following results on the evaluation set:
|
|
392 |
### Training hyperparameters
|
393 |
|
394 |
The following hyperparameters were used during training:
|
|
|
395 |
- learning_rate: 5e-07
|
396 |
- train_batch_size: 2
|
397 |
- eval_batch_size: 4
|
|
|
6 |
inference: false
|
7 |
language:
|
8 |
- en
|
9 |
+
license: mit
|
10 |
model-index:
|
11 |
- name: zephyr-7b-alpha
|
12 |
results: []
|
|
|
336 |
|
337 |
- **Model type:** A 7B parameter GPT-like model fine-tuned on a mix of publicly available, synthetic datasets.
|
338 |
- **Language(s) (NLP):** Primarily English
|
339 |
+
- **License:** MIT
|
340 |
- **Finetuned from model:** [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1)
|
341 |
|
342 |
### Model Sources
|
|
|
358 |
|
359 |
pipe = pipeline("text-generation", model="HuggingFaceH4/zephyr-7b-alpha", torch_dtype=torch.bfloat16, device_map="auto")
|
360 |
|
361 |
+
# We use the tokenizer's chat template to format each message - see https://huggingface.co/docs/transformers/main/en/chat_templating
|
362 |
+
messages = [
|
363 |
+
{
|
364 |
+
"role": "system",
|
365 |
+
"content": "You are a friendly chatbot who always responds in the style of a pirate",
|
366 |
+
},
|
367 |
+
{"role": "user", "content": "How many helicopters can a human eat in one sitting?"},
|
368 |
+
]
|
369 |
+
prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
370 |
outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
371 |
+
print(outputs[0]["generated_text"])
|
372 |
+
# <|system|>
|
373 |
+
# You are a friendly chatbot who always responds in the style of a pirate.</s>
|
374 |
+
# <|user|>
|
375 |
+
# How many helicopters can a human eat in one sitting?</s>
|
376 |
+
# <|assistant|>
|
377 |
+
# Ah, me hearty matey! But yer question be a puzzler! A human cannot eat a helicopter in one sitting, as helicopters are not edible. They be made of metal, plastic, and other materials, not food!
|
378 |
```
|
379 |
|
380 |
## Bias, Risks, and Limitations
|
|
|
404 |
### Training hyperparameters
|
405 |
|
406 |
The following hyperparameters were used during training:
|
407 |
+
|
408 |
- learning_rate: 5e-07
|
409 |
- train_batch_size: 2
|
410 |
- eval_batch_size: 4
|