Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
license_link: https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct/blob/main/LICENSE
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
base_model: Qwen/Qwen2.5-0.5B
|
| 7 |
+
pipeline_tag: text-generation
|
| 8 |
+
tags:
|
| 9 |
+
- gptqmodel
|
| 10 |
+
- modelcloud
|
| 11 |
+
- chat
|
| 12 |
+
- qwen2
|
| 13 |
+
- instruct
|
| 14 |
+
- int4
|
| 15 |
+
- gptq
|
| 16 |
+
- 4bit
|
| 17 |
+
- W4A16
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
This model has been quantized using [GPTQModel](https://github.com/ModelCloud/GPTQModel).
|
| 21 |
+
|
| 22 |
+
- **bits**: 4
|
| 23 |
+
- **dynamic**: null
|
| 24 |
+
- **group_size**: 128
|
| 25 |
+
- **desc_act**: true
|
| 26 |
+
- **static_groups**: false
|
| 27 |
+
- **sym**: true
|
| 28 |
+
- **lm_head**: false
|
| 29 |
+
- **true_sequential**: true
|
| 30 |
+
- **quant_method**: "gptq"
|
| 31 |
+
- **checkpoint_format**: "gptq"
|
| 32 |
+
- **meta**:
|
| 33 |
+
- **quantizer**: gptqmodel:1.7.0
|
| 34 |
+
- **uri**: https://github.com/modelcloud/gptqmodel
|
| 35 |
+
- **damp_percent**: 0.1
|
| 36 |
+
- **damp_auto_increment**: 0.0025
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
## Example:
|
| 40 |
+
```python
|
| 41 |
+
from transformers import AutoTokenizer
|
| 42 |
+
from gptqmodel import GPTQModel
|
| 43 |
+
|
| 44 |
+
tokenizer = AutoTokenizer.from_pretrained("ModelCloud/Qwen2.5-0.5B-Instruct-gptqmodel-4bit")
|
| 45 |
+
model = GPTQModel.load("ModelCloud/Qwen2.5-0.5B-Instruct-gptqmodel-4bit")
|
| 46 |
+
|
| 47 |
+
messages = [
|
| 48 |
+
{"role": "system", "content": "You are a helpful and harmless assistant. You are Qwen developed by Alibaba. You should think step-by-step."},
|
| 49 |
+
{"role": "user", "content": "How can I design a data structure in C++ to store the top 5 largest integer numbers?"},
|
| 50 |
+
]
|
| 51 |
+
input_tensor = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
|
| 52 |
+
|
| 53 |
+
outputs = model.generate(input_ids=input_tensor.to(model.device), max_new_tokens=512)
|
| 54 |
+
result = tokenizer.decode(outputs[0][input_tensor.shape[1]:], skip_special_tokens=True)
|
| 55 |
+
|
| 56 |
+
print(result)
|
| 57 |
+
```
|