Commit
•
f482083
1
Parent(s):
0af8278
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: GeneZC/MiniChat-2-3B
|
3 |
+
inference: True
|
4 |
+
model_type: Llama
|
5 |
+
---
|
6 |
+
# Nous-Hermes-2-Yi-34B
|
7 |
+
This repo contains pruned model files for [Nous-Hermes-2-Yi-34B ](https://huggingface.co/NousResearch/Nous-Hermes-2-Yi-34B).
|
8 |
+
|
9 |
+
This model was pruned with [SparseGPT](https://arxiv.org/abs/2301.00774), using [SparseML](https://github.com/neuralmagic/sparseml).
|
10 |
+
```python
|
11 |
+
import torch
|
12 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
13 |
+
prompt = "How to make banana bread?"
|
14 |
+
formatted_prompt = f"<|im_start|>User:{prompt}\n<|im_start|>assistant:\n"
|
15 |
+
model_id = "nm-testing/Nous-Hermes-2-Yi-34B-pruned50-24"
|
16 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype=torch.float16)
|
17 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
18 |
+
inputs = tokenizer(formatted_prompt, return_tensors="pt")
|
19 |
+
outputs = model.generate(**inputs, max_new_tokens=200)
|
20 |
+
print(tokenizer.batch_decode(outputs)[0])
|
21 |
+
"""
|
22 |
+
<|im_start|> User:How to make banana bread?
|
23 |
+
<|im_start|> assistant:
|
24 |
+
To make banana bread, you can follow these steps:
|
25 |
+
|
26 |
+
Ingredients:
|
27 |
+
- 2 ripe bananas
|
28 |
+
- 2 cups flour
|
29 |
+
- 1/2 cup sugar
|
30 |
+
- 1/2 cup butter
|
31 |
+
- 1/2 cup milk
|
32 |
+
- 1 teaspoon baking powder
|
33 |
+
- 1 teaspoon baking soda
|
34 |
+
- 1 teaspoon salt
|
35 |
+
|
36 |
+
Instructions:
|
37 |
+
1. Preheat the oven to 350°F (175°C).
|
38 |
+
2. In a mixing bowl, mash the bananas and mix them with the flour, sugar, butter, milk, baking powder, baking soda, and salt.
|
39 |
+
3. Mix the ingredients until they form a dough.
|
40 |
+
4. Pour the dough into a baking pan.
|
41 |
+
5. Bake the banana bread for 30 minutes.
|
42 |
+
6. Remove the banana bread from the oven and let it cool.
|
43 |
+
7. Enjoy your banana bread.
|
44 |
+
|
45 |
+
Note: You can adjust the ingredients
|
46 |
+
"""
|
47 |
+
|
48 |
+
```
|