Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- garage-bAInd/Open-Platypus
|
| 5 |
+
- jondurbin/airoboros-3.2
|
| 6 |
+
---
|
| 7 |
+
|
| 8 |
+
<img src=https://huggingface.co/lodrick-the-lafted/Platyboros-Instruct-7B/resolve/main/platyboros.png>
|
| 9 |
+
|
| 10 |
+
# Platyboros-Instruct-7B
|
| 11 |
+
|
| 12 |
+
[Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2) trained with [jondurbin/airoboros-3.2](https://huggingface.co/datasets/jondurbin/airoboros-3.2) and [garage-bAInd/Open-Platypus](https://huggingface.co/datasets/garage-bAInd/Open-Platypus), in Alpaca format.
|
| 13 |
+
|
| 14 |
+
<br />
|
| 15 |
+
<br />
|
| 16 |
+
|
| 17 |
+
# Prompt Format
|
| 18 |
+
|
| 19 |
+
Both the default Mistral-Instruct tags and Alpaca are fine, so either:
|
| 20 |
+
```
|
| 21 |
+
<s>[INST] {sys_prompt} {instruction} [/INST]
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
or
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
```
|
| 28 |
+
{sys_prompt}
|
| 29 |
+
|
| 30 |
+
### Instruction:
|
| 31 |
+
{instruction}
|
| 32 |
+
|
| 33 |
+
### Response:
|
| 34 |
+
|
| 35 |
+
```
|
| 36 |
+
The tokenizer default is Alpaca this time around.
|
| 37 |
+
|
| 38 |
+
<br />
|
| 39 |
+
<br />
|
| 40 |
+
|
| 41 |
+
# Usage
|
| 42 |
+
|
| 43 |
+
```python
|
| 44 |
+
from transformers import AutoTokenizer
|
| 45 |
+
import transformers
|
| 46 |
+
import torch
|
| 47 |
+
|
| 48 |
+
model = "lodrick-the-lafted/Platyboros-Instruct-7B"
|
| 49 |
+
|
| 50 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
| 51 |
+
pipeline = transformers.pipeline(
|
| 52 |
+
"text-generation",
|
| 53 |
+
model=model,
|
| 54 |
+
model_kwargs={"torch_dtype": torch.bfloat16},
|
| 55 |
+
)
|
| 56 |
+
|
| 57 |
+
messages = [{"role": "user", "content": "Give me a cooking recipe for an apple pie."}]
|
| 58 |
+
prompt = pipeline.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 59 |
+
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_p=0.95)
|
| 60 |
+
print(outputs[0]["generated_text"])
|
| 61 |
+
```
|
| 62 |
+
|