---
title: DeepSeek-R1-Distill-Qwen-1.5B-Code
canonical_url: "https://www.modelscope.cn/models/LYtech/DeepSeek-R1-Distill-Qwen-1.5B-Code"
md_url: "https://www.modelscope.cn/models/LYtech/DeepSeek-R1-Distill-Qwen-1.5B-Code.md"
repository: LYtech/DeepSeek-R1-Distill-Qwen-1.5B-Code
chinese_name: "基于DeepSeek-R1-Distill-Qwen-1.5B微调的代码生成模型"
last_updated: 2025-02-18
pipeline_tag: text-classification
tasks:
  - text-classification
model_type:
  - qwen2
architectures:
  - Qwen2ForCausalLM
parameters: 1.8B
tensor_type:
  - BF16
library_name:
  - transformer
  - safetensors
  - pytorch
frameworks:
  - Pytorch
inference_backends:
  - "deploy_task text/emb"
  - "lmdeploy 0.9.1"
  - "lmdeploy_turbomind 0.9.1"
  - "sglang 0.5.2"
  - "vllm 0.9.2"
downloads: 378
stars: 1
---

# DeepSeek-R1-Distill-Qwen-1.5B-Code

> DeepSeek-R1-Distill-Qwen-1.5B-Code - LYtech 在 ModelScope 开源的模型。Pytorch license: Apache License 2.0 tasks: text-classification

LYtech/DeepSeek-R1-Distill-Qwen-1.5B-Code 是 ModelScope 魔搭社区上的 1.8B 参数text-classification模型，可用 deploy_task text/emb、lmdeploy 0.9.1、lmdeploy_turbomind 0.9.1 部署。

- **Repository**: LYtech/DeepSeek-R1-Distill-Qwen-1.5B-Code
- **Tasks**: text-classification
- **Parameters**: 1.8B
- **Inference backends**: deploy_task text/emb, lmdeploy 0.9.1, lmdeploy_turbomind 0.9.1, sglang 0.5.2, vllm 0.9.2
- **Downloads**: 378
- **Stars**: 1
- **Last updated**: 2025-02-18

Source: https://www.modelscope.cn/models/LYtech/DeepSeek-R1-Distill-Qwen-1.5B-Code

---

frameworks:

- Pytorch
  license: Apache License 2.0
  tasks:
- text-classification

#model-type:
##如 gpt、phi、llama、chatglm、baichuan 等
#- gpt

#domain:
##如 nlp、cv、audio、multi-modal
#- nlp

#language:
##语言代码列表 https://help.aliyun.com/document_detail/215387.html?spm=a2c4g.11186623.0.0.9f8d7467kni6Aa
#- cn 

#metrics:
##如 CIDEr、Blue、ROUGE 等
#- CIDEr

#tags:
##各种自定义，包括 pretrained、fine-tuned、instruction-tuned、RL-tuned 等训练方法和其他
#- pretrained

#tools:
##如 vllm、fastchat、llamacpp、AdaSeq 等

#- vllm
---

### 当前模型的贡献者未提供更加详细的模型介绍。模型文件和权重，可浏览“模型文件”页面获取。

#### 您可以通过如下git clone命令，或者ModelScope SDK来下载模型

SDK下载

```bash
#安装ModelScope
pip install modelscope
#SDK模型下载
from modelscope import snapshot_download
model_dir = snapshot_download('LYtech/DeepSeek-R1-Distill-Qwen-1.5B-Code')
```

Git下载

```
#Git模型下载
git clone https://www.modelscope.cn/LYtech/DeepSeek-R1-Distill-Qwen-1.5B-Code.git
```

模型使用

```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model_dir = "模型目录"
# Original code structure remains unchanged
model = AutoModelForCausalLM.from_pretrained(model_dir).to("cuda")
tokenizer = AutoTokenizer.from_pretrained(model_dir)

prompt = "vue3是什么"  #  user prompt
messages = [
    {"role": "system", "content": "You are an expert Python developer specializing in algorithms."},  #  system prompt
    {"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)


# input processing logic
generated_ids = model.generate(**model_inputs, max_new_tokens=1500)
generated_ids = [output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)]


response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
```
