---
title: VideoChat-R1_7B
canonical_url: "https://www.modelscope.cn/models/Shanghai_AI_Laboratory/VideoChat-R1_7B"
md_url: "https://www.modelscope.cn/models/Shanghai_AI_Laboratory/VideoChat-R1_7B.md"
repository: Shanghai_AI_Laboratory/VideoChat-R1_7B
last_updated: 2025-04-22
license: apache-2.0
model_type:
  - qwen2_5_vl
architectures:
  - Qwen2_5_VLForConditionalGeneration
base_model:
  - Qwen/Qwen2.5-VL-7B-Instruct
base_model_relation: finetune
parameters: 8.3B
tensor_type:
  - BF16
library_name:
  - transformer
  - safetensors
  - pytorch
frameworks:
  - pytorch
language:
  - en
inference_backends:
  - "deploy_task vlm/text/emb"
  - "lmdeploy 0.9.1"
  - "sglang 0.5.2"
  - "vllm 0.9.2"
downloads: 520
stars: 0
tags:
  - multimodal
---

# VideoChat-R1_7B

> VideoChat-R1_7B - Shanghai_AI_Laboratory 在 ModelScope 开源的模型。[\[📂 GitHub\]](https://github.com/OpenGVLab/VideoChat-R1) [\[📜 Tech Report\]](https://arxiv.org/pdf/2504.06958)

Shanghai_AI_Laboratory/VideoChat-R1_7B 是 ModelScope 魔搭社区上的 8.3B 参数机器学习模型，采用 apache-2.0 许可，基于 Qwen/Qwen2.5-VL-7B-Instruct 构建，可用 deploy_task vlm/text/emb、lmdeploy 0.9.1、sglang 0.5.2 部署。

- **Repository**: Shanghai_AI_Laboratory/VideoChat-R1_7B
- **License**: apache-2.0
- **Parameters**: 8.3B
- **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**: 520
- **Stars**: 0
- **Last updated**: 2025-04-22

Source: https://www.modelscope.cn/models/Shanghai_AI_Laboratory/VideoChat-R1_7B

---

# 💡 VideoChat-R1_7B

[\[📂 GitHub\]](https://github.com/OpenGVLab/VideoChat-R1)  
[\[📜 Tech Report\]](https://arxiv.org/pdf/2504.06958) 


## 🚀 How to use the model

We provide a simple installation example below:
```
pip install transformers
pip install qwen_vl_utils
```
Then you could use our model:
```python
from transformers import Qwen2_5_VLForConditionalGeneration, AutoTokenizer, AutoProcessor
from qwen_vl_utils import process_vision_info

model_path = "OpenGVLab/VideoChat-R1_7B"
# default: Load the model on the available device(s)
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
    model_path, torch_dtype="auto", device_map="auto",
    attn_implementation="flash_attention_2"
)

# default processer
processor = AutoProcessor.from_pretrained(model_path)

video_path = "your_video.mp4"
question = "Where is the final cup containing the object?"

messages = [
    {
        "role": "user",
        "content": [
            {
                "type": "video",
                "video": video_path,
                "max_pixels": 460800,
                "nframes": 32
            },
            {"type": "text", "text": f"""{question}
            Provide your final answer within the <answer> </answer> tags.
             """},
        ],
    }
]



#In Qwen 2.5 VL, frame rate information is also input into the model to align with absolute time.
# Preparation for inference
text = processor.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True
)
image_inputs, video_inputs, video_kwargs = process_vision_info(messages, return_video_kwargs=True)
inputs = processor(
    text=[text],
    images=image_inputs,
    videos=video_inputs,
    padding=True,
    return_tensors="pt",
    **video_kwargs,
)
inputs = inputs.to("cuda")

# Inference
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)
```

## ✏️ Citation

```bibtex

@article{li2025videochatr1,
  title={VideoChat-R1: Enhancing Spatio-Temporal Perception via Reinforcement Fine-Tuning},
  author={Li, Xinhao and Yan, Ziang and Meng, Desen and Dong, Lu and Zeng, Xiangyu and He, Yinan and Wang, Yali and Qiao, Yu and Wang, Yi and Wang, Limin},
  journal={arXiv preprint arXiv:2504.06958},
  year={2025}
}
```
