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: []
|
@@ -378,7 +378,7 @@ Zephyr is a series of language models that are trained to act as helpful assista
|
|
378 |
|
379 |
- **Model type:** A 7B parameter GPT-like model fine-tuned on a mix of publicly available, synthetic datasets.
|
380 |
- **Language(s) (NLP):** Primarily English
|
381 |
-
- **License:**
|
382 |
- **Finetuned from model:** [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1)
|
383 |
|
384 |
### Model Sources
|
@@ -400,11 +400,23 @@ from transformers import pipeline
|
|
400 |
|
401 |
pipe = pipeline("text-generation", model="HuggingFaceH4/zephyr-7b-alpha", torch_dtype=torch.bfloat16, device_map="auto")
|
402 |
|
403 |
-
# We use
|
404 |
-
|
405 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
406 |
outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
407 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
408 |
```
|
409 |
|
410 |
## Bias, Risks, and Limitations
|
@@ -434,6 +446,7 @@ Zephyr 7B Alpha achieves the following results on the evaluation set:
|
|
434 |
### Training hyperparameters
|
435 |
|
436 |
The following hyperparameters were used during training:
|
|
|
437 |
- learning_rate: 5e-07
|
438 |
- train_batch_size: 2
|
439 |
- eval_batch_size: 4
|
|
|
6 |
inference: false
|
7 |
language:
|
8 |
- en
|
9 |
+
license: mit
|
10 |
model-index:
|
11 |
- name: zephyr-7b-alpha
|
12 |
results: []
|
|
|
378 |
|
379 |
- **Model type:** A 7B parameter GPT-like model fine-tuned on a mix of publicly available, synthetic datasets.
|
380 |
- **Language(s) (NLP):** Primarily English
|
381 |
+
- **License:** MIT
|
382 |
- **Finetuned from model:** [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1)
|
383 |
|
384 |
### Model Sources
|
|
|
400 |
|
401 |
pipe = pipeline("text-generation", model="HuggingFaceH4/zephyr-7b-alpha", torch_dtype=torch.bfloat16, device_map="auto")
|
402 |
|
403 |
+
# We use the tokenizer's chat template to format each message - see https://huggingface.co/docs/transformers/main/en/chat_templating
|
404 |
+
messages = [
|
405 |
+
{
|
406 |
+
"role": "system",
|
407 |
+
"content": "You are a friendly chatbot who always responds in the style of a pirate",
|
408 |
+
},
|
409 |
+
{"role": "user", "content": "How many helicopters can a human eat in one sitting?"},
|
410 |
+
]
|
411 |
+
prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
412 |
outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
413 |
+
print(outputs[0]["generated_text"])
|
414 |
+
# <|system|>
|
415 |
+
# You are a friendly chatbot who always responds in the style of a pirate.</s>
|
416 |
+
# <|user|>
|
417 |
+
# How many helicopters can a human eat in one sitting?</s>
|
418 |
+
# <|assistant|>
|
419 |
+
# 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!
|
420 |
```
|
421 |
|
422 |
## Bias, Risks, and Limitations
|
|
|
446 |
### Training hyperparameters
|
447 |
|
448 |
The following hyperparameters were used during training:
|
449 |
+
|
450 |
- learning_rate: 5e-07
|
451 |
- train_batch_size: 2
|
452 |
- eval_batch_size: 4
|