lodrick-the-lafted
commited on
Commit
•
f13d0df
1
Parent(s):
35afa4e
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
datasets:
|
4 |
+
- lodrick-the-lafted/Hermes-40K
|
5 |
+
---
|
6 |
+
|
7 |
+
[Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2) trained with some of [teknium/openhermes](https://huggingface.co/datasets/teknium/openhermes), in Alpaca format.
|
8 |
+
|
9 |
+
|
10 |
+
|
11 |
+
|
12 |
+
## 💻 Usage
|
13 |
+
|
14 |
+
```python
|
15 |
+
from transformers import AutoTokenizer
|
16 |
+
import transformers
|
17 |
+
import torch
|
18 |
+
|
19 |
+
model = "lodrick-the-lafted/Hermes-Instruct-7B-v0.2"
|
20 |
+
|
21 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
22 |
+
pipeline = transformers.pipeline(
|
23 |
+
"text-generation",
|
24 |
+
model=model,
|
25 |
+
model_kwargs={"torch_dtype": torch.bfloat16},
|
26 |
+
)
|
27 |
+
|
28 |
+
messages = [{"role": "user", "content": "Give me a cooking recipe for an apple pie."}]
|
29 |
+
prompt = pipeline.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
30 |
+
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_p=0.95)
|
31 |
+
print(outputs[0]["generated_text"])
|
32 |
+
```
|
33 |
+
|