---
title: DeepSeek-R1-Distill-Qwen-1.5B-GTPQ-Int4
canonical_url: "https://www.modelscope.ai/models/ModelScope-GTPQ/DeepSeek-R1-Distill-Qwen-1.5B-GTPQ-Int4"
md_url: "https://www.modelscope.ai/models/ModelScope-GTPQ/DeepSeek-R1-Distill-Qwen-1.5B-GTPQ-Int4.md"
repository: ModelScope-GTPQ/DeepSeek-R1-Distill-Qwen-1.5B-GTPQ-Int4
last_updated: 2025-09-06
license: "Apache License 2.0"
pipeline_tag: text-generation
tasks:
  - text-generation
model_type:
  - qwen2
base_model:
  - deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
base_model_relation: quantized
library_name:
  - transformer
  - safetensors
  - other
frameworks:
  - other
downloads: 140
stars: 0
---

# DeepSeek-R1-Distill-Qwen-1.5B-GTPQ-Int4

> DeepSeek-R1-Distill-Qwen-1.5B-GTPQ-Int4 - An open-source model by ModelScope-GTPQ on ModelScope. 使用GPTQModel从DeepSeek-R1-Distill-Qwen-1.5B模型量化而来。可使用如下代码加载：

ModelScope-GTPQ/DeepSeek-R1-Distill-Qwen-1.5B-GTPQ-Int4 is a text-generation model on ModelScope. licensed under Apache License 2.0. derived from deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B.

- **Repository**: ModelScope-GTPQ/DeepSeek-R1-Distill-Qwen-1.5B-GTPQ-Int4
- **License**: Apache License 2.0
- **Tasks**: text-generation
- **Base model**: deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
- **Downloads**: 140
- **Stars**: 0
- **Last updated**: 2025-09-06

Source: https://www.modelscope.ai/models/ModelScope-GTPQ/DeepSeek-R1-Distill-Qwen-1.5B-GTPQ-Int4

---

使用GPTQModel从[DeepSeek-R1-Distill-Qwen-1.5B](https://www.modelscope.cn/models/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B)模型量化而来。可使用如下代码加载：

```python
from modelscope import AutoModelForCausalLM, AutoTokenizer
from transformers import TextStreamer

model_name = "ModelScope-GTPQ/DeepSeek-R1-Distill-Qwen-1.5B-GTPQ-Int4"
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
streamer = TextStreamer(tokenizer, skip_prompt=True)
prompt = "Give me a short introduction to large language model."
messages = [
    {"role": "system", "content": "You are a helpful and harmless assistant. You should think step-by-step."},
    {"role": "user", "content": "Compute 562 + 32"},
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
generated_ids = model.generate(
    **model_inputs,
    streamer=streamer,
    max_new_tokens=2048
)
```
