Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,56 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
datasets:
|
4 |
+
- andersonbcdefg/supernatural-instructions-2m
|
5 |
+
language:
|
6 |
+
- en
|
7 |
+
base_model:
|
8 |
+
- Qwen/Qwen2.5-3B-Instruct
|
9 |
+
pipeline_tag: text-generation
|
10 |
+
library_name: transformers
|
11 |
+
tags:
|
12 |
+
- SuperNatural
|
13 |
+
- QwQ
|
14 |
+
---
|
15 |
+
# **QwQ-SuperNatural-3B**
|
16 |
+
|
17 |
+
QwQ-SuperNatural-3B is a Qwen2.5-based supernatural model designed to provide context-based supernatural responses from the input it receives. It has 3 billion parameters and is a domain-specific, supervised fine-tuned model. The model demonstrates significant improvements in instruction following, generating long texts (over 8K tokens), understanding structured data (e.g., tables), and generating structured outputs, especially in JSON format. It is also more resilient to the diversity of system prompts, enhancing role-play implementation and condition-setting for chatbots.
|
18 |
+
|
19 |
+
# **Quickstart with Transformers**
|
20 |
+
|
21 |
+
Here provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents.
|
22 |
+
|
23 |
+
```python
|
24 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
25 |
+
|
26 |
+
model_name = "prithivMLmods/QwQ-SuperNatural-3B"
|
27 |
+
|
28 |
+
model = AutoModelForCausalLM.from_pretrained(
|
29 |
+
model_name,
|
30 |
+
torch_dtype="auto",
|
31 |
+
device_map="auto"
|
32 |
+
)
|
33 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
34 |
+
|
35 |
+
prompt = "Give me a short introduction to large language model."
|
36 |
+
messages = [
|
37 |
+
{"role": "system", "content": "You are an Super Natural Bot, You are a helpful assistant."},
|
38 |
+
{"role": "user", "content": prompt}
|
39 |
+
]
|
40 |
+
text = tokenizer.apply_chat_template(
|
41 |
+
messages,
|
42 |
+
tokenize=False,
|
43 |
+
add_generation_prompt=True
|
44 |
+
)
|
45 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
46 |
+
|
47 |
+
generated_ids = model.generate(
|
48 |
+
**model_inputs,
|
49 |
+
max_new_tokens=512
|
50 |
+
)
|
51 |
+
generated_ids = [
|
52 |
+
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
53 |
+
]
|
54 |
+
|
55 |
+
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
56 |
+
```
|