mwitiderrick
commited on
Commit
•
c319b00
1
Parent(s):
d710314
Update README.md
Browse files
README.md
CHANGED
@@ -8,4 +8,38 @@ This repo contains pruned model files for [Nous-Hermes-2-SOLAR-10.7B](https://hu
|
|
8 |
|
9 |
This model was pruned with [SparseGPT](https://arxiv.org/abs/2301.00774), using [SparseML](https://github.com/neuralmagic/sparseml).
|
10 |
```python
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
```
|
|
|
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"### User:\n{prompt}\n\n### Assistant:\n"
|
15 |
+
model_id = "nm-testing/Nous-Hermes-2-SOLAR-10.7B-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 |
+
<s> ### User:
|
23 |
+
How to make banana bread?
|
24 |
+
|
25 |
+
### Assistant:
|
26 |
+
To make banana bread, you will need the following ingredients:
|
27 |
+
|
28 |
+
- 1 cup of flour
|
29 |
+
- 1 cup of sugar
|
30 |
+
- 3 cups of bananas
|
31 |
+
- 1 cup of milk
|
32 |
+
- 1 cup of eggs
|
33 |
+
- 1 cup of baking powder
|
34 |
+
|
35 |
+
Instructions:
|
36 |
+
|
37 |
+
1. Mix the flour and sugar together.
|
38 |
+
2. Add the bananas to the mixture.
|
39 |
+
3. Add the milk and eggs to the mixture.
|
40 |
+
4. Add the baking powder to the mixture.
|
41 |
+
5. Mix all the ingredients together.
|
42 |
+
6. Pour the mixture into a baking pan.
|
43 |
+
7. Bake the mixture for 30 minutes at 350 degrees.<|im_end|>
|
44 |
+
"""
|
45 |
```
|