Update README.md
Browse files
README.md
CHANGED
|
@@ -5,4 +5,16 @@ language:
|
|
| 5 |
base_model:
|
| 6 |
- deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
|
| 7 |
---
|
| 8 |
-
AWQ 4 bits quantization from DeepSeek-R1-Distill-Qwen-7B commit 393119fcd6a873e5776c79b0db01c96911f5f0fc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
base_model:
|
| 6 |
- deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
|
| 7 |
---
|
| 8 |
+
AWQ 4 bits quantization from DeepSeek-R1-Distill-Qwen-7B commit 393119fcd6a873e5776c79b0db01c96911f5f0fc
|
| 9 |
+
|
| 10 |
+
```python
|
| 11 |
+
from awq import AutoAWQForCausalLM
|
| 12 |
+
from transformers import AutoTokenizer
|
| 13 |
+
model_name = "deepseek-ai/DeepSeek-R1-Distill-Qwen-7B"
|
| 14 |
+
commit_hash = "393119fcd6a873e5776c79b0db01c96911f5f0fc"
|
| 15 |
+
# Download the model and tokenizer at the specific commit hash
|
| 16 |
+
model = AutoAWQForCausalLM.from_pretrained(model_name, revision=commit_hash)
|
| 17 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, revision=commit_hash)
|
| 18 |
+
quant_config = { "zero_point": True, "q_group_size": 128, "w_bit": 4, "version": "GEMV" }
|
| 19 |
+
model.quantize(tokenizer, quant_config=quant_config)
|
| 20 |
+
```
|