---
title: Qwen2.5-VL-7B-Instruct-GPTQ-Int4
canonical_url: "https://www.modelscope.cn/models/ChineseAlpacaGroup/Qwen2.5-VL-7B-Instruct-GPTQ-Int4"
md_url: "https://www.modelscope.cn/models/ChineseAlpacaGroup/Qwen2.5-VL-7B-Instruct-GPTQ-Int4.md"
repository: ChineseAlpacaGroup/Qwen2.5-VL-7B-Instruct-GPTQ-Int4
last_updated: 2025-02-26
license: apache-2.0
pipeline_tag: image-text-to-text
tasks:
  - image-text-to-text
model_type:
  - qwen2_5_vl
architectures:
  - Qwen2_5_VLForConditionalGeneration
base_model:
  - Qwen/Qwen2.5-VL-7B-Instruct
base_model_relation: quantized
parameters: 2.6B
tensor_type:
  - F16
  - I32
  - BF16
library_name:
  - transformer
  - safetensors
  - pytorch
frameworks:
  - Pytorch
language:
  - zh
  - en
inference_backends:
  - "deploy_task vlm/text/emb"
  - "lmdeploy 0.9.1"
  - "sglang 0.5.2"
  - "vllm 0.9.2"
downloads: 350555
stars: 12
tags:
  - multimodal
---

# Qwen2.5-VL-7B-Instruct-GPTQ-Int4

> Qwen2.5-VL-7B-Instruct-GPTQ-Int4 - ChineseAlpacaGroup 在 ModelScope 开源的模型。Qwen2.5-VL-7B-Instruct-GPTQ-Int4

ChineseAlpacaGroup/Qwen2.5-VL-7B-Instruct-GPTQ-Int4 是 ModelScope 魔搭社区上的 2.6B 参数image-text-to-text模型，采用 apache-2.0 许可，基于 Qwen/Qwen2.5-VL-7B-Instruct 构建，可用 deploy_task vlm/text/emb、lmdeploy 0.9.1、sglang 0.5.2 部署。

- **Repository**: ChineseAlpacaGroup/Qwen2.5-VL-7B-Instruct-GPTQ-Int4
- **License**: apache-2.0
- **Tasks**: image-text-to-text
- **Parameters**: 2.6B
- **Base model**: Qwen/Qwen2.5-VL-7B-Instruct
- **Inference backends**: deploy_task vlm/text/emb, lmdeploy 0.9.1, sglang 0.5.2, vllm 0.9.2
- **Tags**: multimodal
- **Downloads**: 350555
- **Stars**: 12
- **Last updated**: 2025-02-26

Source: https://www.modelscope.cn/models/ChineseAlpacaGroup/Qwen2.5-VL-7B-Instruct-GPTQ-Int4

---

# Qwen2.5-VL-7B-Instruct-GPTQ-Int4

This is an **UNOFFICIAL** GPTQ-Int4 quantized version of the `Qwen2.5-VL-7B-Instruct` model using `gptqmodel` library. 

The model is compatible with the latest `transformers` library (which can run non-quantized Qwen2.5-VL models).

### Performance

| Model                                                        | Size (Disk) | ChartQA (test) | OCRBench |
| ------------------------------------------------------------ | :---------: | :------------: | :------: |
| [Qwen2.5-VL-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-VL-3B-Instruct) |   7.1 GB    |     83.48      |   791    |
| [Qwen2.5-VL-3B-Instruct-AWQ](https://huggingface.co/Qwen/Qwen2.5-VL-3B-Instruct-AWQ) |   3.2 GB    |     82.52      |   786    |
| **Qwen2.5-VL-3B-Instruct-GPTQ-Int4**                         |   3.2 GB    |     82.56      |   784    |
| [Qwen2.5-VL-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-VL-7B-Instruct) |   16.0 GB   |      83.2      |   846    |
| [Qwen2.5-VL-7B-Instruct-AWQ](https://huggingface.co/Qwen/Qwen2.5-VL-7B-Instruct-AWQ) |   6.5 GB    |     79.68      |   837    |
| **Qwen2.5-VL-7B-Instruct-GPTQ-Int4**                         |   6.5 GB    |     81.48      |   845    |


#### Note

- Evaluations are performed using [lmms-eval](https://github.com/EvolvingLMMs-Lab/lmms-eval) with default setting. 
- GPTQ models are computationally more effective (fewer VRAM usage, faster inference speed) than AWQ series in these evaluations.

### Quick Tour

Install the required libraries:
```
pip install git+https://github.com/huggingface/transformers accelerate qwen-vl-utils
pip install gptqmodel tokenicer # optional
```

Sample code:
```python
from transformers import Qwen2_5_VLForConditionalGeneration, AutoTokenizer, AutoProcessor
from qwen_vl_utils import process_vision_info

model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
    "hfl/Qwen2.5-VL-7B-Instruct-GPTQ-Int4", 
    attn_implementation="flash_attention_2",
    device_map="auto"
)
processor = AutoProcessor.from_pretrained("hfl/Qwen2.5-VL-7B-Instruct-GPTQ-Int4")

messages = [{
    "role": "user",
    "content": [
        {"type": "image", "image": "https://raw.githubusercontent.com/ymcui/Chinese-LLaMA-Alpaca-3/refs/heads/main/pics/banner.png"},
        {"type": "text", "text": "请你描述一下这张图片。"},
    ],
}]

text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
image_inputs, video_inputs = process_vision_info(messages)
inputs = processor(
    text=[text], images=image_inputs, videos=video_inputs,
    padding=True, return_tensors="pt",
).to("cuda")

generated_ids = model.generate(**inputs, max_new_tokens=512)
generated_ids_trimmed = [out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)]
output_text = processor.batch_decode(generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False)
print(output_text)
```

Results:
```
['这张图片展示了一个标志或图标，包含以下内容：\n\n1. 左侧有一个圆形的图标，里面有一幅插画，描绘了两只羊驼（Alpaca），背景中有树木和一座亭子。\n2. 中间部分用中文写着“中文LLaMA & Alpaca大模型”，意思是“Chinese LLaMA & Alpaca Large Language Models”。\n3. 右侧有一个黑色的数字“3”，旁边有一些电路板的图案。\n\n整体来看，这个标志可能与中文的大型语言模型（LLaMA和Alpaca）有关，可能是一个项目、平台或产品的名称。']
```

### Disclaimer
- **This is NOT an official model by Qwen. Use at your own risk.**
- For detailed usage, please check [Qwen2.5-VL's page](https://huggingface.co/Qwen/Qwen2.5-VL-7B-Instruct).
