lrl-modelcloud
commited on
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
license_link: https://huggingface.co/Qwen/QwQ-32B-Preview/blob/main/LICENSE
|
4 |
+
language:
|
5 |
+
- en
|
6 |
+
base_model:
|
7 |
+
- Qwen/QwQ-32B-Preview
|
8 |
+
pipeline_tag: text-generation
|
9 |
+
tags:
|
10 |
+
- gptqmodel
|
11 |
+
- modelcloud
|
12 |
+
- chat
|
13 |
+
- qwen2
|
14 |
+
- qwq
|
15 |
+
- instruct
|
16 |
+
- gptq
|
17 |
+
- gguf
|
18 |
+
---
|
19 |
+
|
20 |
+
![image/png](https://cdn-uploads.huggingface.co/production/uploads/641c13e7999935676ec7bc03/F7pXCPgPKmXdW_jWFQQ6L.png)
|
21 |
+
|
22 |
+
## Example with transformers:
|
23 |
+
```python
|
24 |
+
import torch
|
25 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
26 |
+
|
27 |
+
model_id = "ModelCloud/QwQ-32B-Preview-gguf-vortex-v1"
|
28 |
+
filename = "QwQ-32B-Preview-Q4_K_M.gguf"
|
29 |
+
|
30 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, gguf_file=filename)
|
31 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, gguf_file=filename, device_map="cuda", torch_dtype=torch.float16)
|
32 |
+
|
33 |
+
messages = [
|
34 |
+
{"role": "system", "content": "You are a helpful and harmless assistant. You are Qwen developed by Alibaba. You should think step-by-step."},
|
35 |
+
{"role": "user", "content": "How can I design a data structure in C++ to store the top 5 largest integer numbers?"},
|
36 |
+
]
|
37 |
+
input_tensor = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
|
38 |
+
|
39 |
+
outputs = model.generate(input_ids=input_tensor.to(model.device), max_new_tokens=512)
|
40 |
+
result = tokenizer.decode(outputs[0][input_tensor.shape[1]:], skip_special_tokens=True)
|
41 |
+
|
42 |
+
print(result)
|
43 |
+
```
|