Upload README.md
Browse files
README.md
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: other
|
3 |
+
language:
|
4 |
+
- en
|
5 |
+
pipeline_tag: text-generation
|
6 |
+
tags:
|
7 |
+
- gguf
|
8 |
+
- imatrix
|
9 |
+
- stablelm-zephyr-3b
|
10 |
+
- stabilityai
|
11 |
+
---
|
12 |
+
Quantizations of https://huggingface.co/stabilityai/stablelm-zephyr-3b
|
13 |
+
|
14 |
+
# From original readme
|
15 |
+
|
16 |
+
## Usage
|
17 |
+
|
18 |
+
`StableLM Zephyr 3B` uses the following instruction format:
|
19 |
+
```
|
20 |
+
<|user|>
|
21 |
+
List 3 synonyms for the word "tiny"<|endoftext|>
|
22 |
+
<|assistant|>
|
23 |
+
1. Dwarf
|
24 |
+
2. Little
|
25 |
+
3. Petite<|endoftext|>
|
26 |
+
```
|
27 |
+
|
28 |
+
This format is also available through the tokenizer's `apply_chat_template` method:
|
29 |
+
|
30 |
+
```python
|
31 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
32 |
+
|
33 |
+
tokenizer = AutoTokenizer.from_pretrained('stabilityai/stablelm-zephyr-3b')
|
34 |
+
model = AutoModelForCausalLM.from_pretrained(
|
35 |
+
'stabilityai/stablelm-zephyr-3b',
|
36 |
+
device_map="auto"
|
37 |
+
)
|
38 |
+
|
39 |
+
prompt = [{'role': 'user', 'content': 'List 3 synonyms for the word "tiny"'}]
|
40 |
+
inputs = tokenizer.apply_chat_template(
|
41 |
+
prompt,
|
42 |
+
add_generation_prompt=True,
|
43 |
+
return_tensors='pt'
|
44 |
+
)
|
45 |
+
|
46 |
+
tokens = model.generate(
|
47 |
+
inputs.to(model.device),
|
48 |
+
max_new_tokens=1024,
|
49 |
+
temperature=0.8,
|
50 |
+
do_sample=True
|
51 |
+
)
|
52 |
+
|
53 |
+
print(tokenizer.decode(tokens[0], skip_special_tokens=False))
|
54 |
+
```
|
55 |
+
|
56 |
+
You can also see how to run a performance optimized version of this model [here](https://github.com/openvinotoolkit/openvino_notebooks/blob/main/notebooks/273-stable-zephyr-3b-chatbot/273-stable-zephyr-3b-chatbot.ipynb) using [OpenVINO](https://docs.openvino.ai/2023.2/home.html) from Intel.
|