---
title: DeepSeek-V2-Chat-0628-gptq-4bit
canonical_url: "https://www.modelscope.cn/models/LLM-Research/DeepSeek-V2-Chat-0628-gptq-4bit"
md_url: "https://www.modelscope.cn/models/LLM-Research/DeepSeek-V2-Chat-0628-gptq-4bit.md"
repository: LLM-Research/DeepSeek-V2-Chat-0628-gptq-4bit
last_updated: 2024-07-26
pipeline_tag: text-generation
tasks:
  - text-generation
model_type:
  - deepseek_v2
architectures:
  - DeepseekV2ForCausalLM
parameters: 32.6B
tensor_type:
  - F16
  - I32
  - BF16
library_name:
  - 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: 19772
stars: 1
---

# DeepSeek-V2-Chat-0628-gptq-4bit

> DeepSeek-V2-Chat-0628-gptq-4bit - LLM-Research 在 ModelScope 开源的模型。This model has been quantized using GPTQModel.

LLM-Research/DeepSeek-V2-Chat-0628-gptq-4bit 是 ModelScope 魔搭社区上的 32.6B 参数text-generation模型，可用 deploy_task text/emb、lmdeploy 0.9.1、lmdeploy_turbomind 0.9.1 部署。

- **Repository**: LLM-Research/DeepSeek-V2-Chat-0628-gptq-4bit
- **Tasks**: text-generation
- **Parameters**: 32.6B
- **Inference backends**: deploy_task text/emb, lmdeploy 0.9.1, lmdeploy_turbomind 0.9.1, sglang 0.5.2, vllm 0.9.2
- **Downloads**: 19772
- **Stars**: 1
- **Last updated**: 2024-07-26

Source: https://www.modelscope.cn/models/LLM-Research/DeepSeek-V2-Chat-0628-gptq-4bit

---

This model has been quantized using [GPTQModel](https://github.com/ModelCloud/GPTQModel).

- **bits**: 4
- **group_size**: 128
- **desc_act**: true
- **static_groups**: false
- **sym**: true
- **lm_head**: false
- **damp_percent**: 0.01
- **true_sequential**: true
- **model_name_or_path**: ""
- **model_file_base_name**: "model"
- **quant_method**: "gptq"
- **checkpoint_format**: "gptq"
- **meta**：
  - **quantizer**: "gptqmodel:0.9.9-dev0"


You can use [GPTQModel](https://github.com/ModelCloud/GPTQModel) for model inference.
```python
import torch
from transformers import AutoTokenizer, GenerationConfig
from gptqmodel import GPTQModel
model_name = "ModelCloud/DeepSeek-V2-Chat-0628-gptq-4bit"
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
# `max_memory` should be set based on your devices
max_memory = {i: "75GB" for i in range(2)}
# `device_map` cannot be set to `auto`
model = GPTQModel.from_quantized(model_name, trust_remote_code=True, device_map="sequential", max_memory=max_memory, torch_dtype=torch.float16, attn_implementation="eager")

model.generation_config = GenerationConfig.from_pretrained(model_name)
model.generation_config.pad_token_id = model.generation_config.eos_token_id

messages = [
    {"role": "user", "content": "Write a piece of quicksort code in C++"}
]
input_tensor = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
outputs = model.generate(input_ids=input_tensor.to(model.device), max_new_tokens=100)
result = tokenizer.decode(outputs[0][input_tensor.shape[1]:], skip_special_tokens=True)
print(result)
 
```
