Instructions to use WaltonFuture/Qwen2.5VL-7b-RLCS with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use WaltonFuture/Qwen2.5VL-7b-RLCS with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="WaltonFuture/Qwen2.5VL-7b-RLCS") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("WaltonFuture/Qwen2.5VL-7b-RLCS") model = AutoModelForImageTextToText.from_pretrained("WaltonFuture/Qwen2.5VL-7b-RLCS") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use WaltonFuture/Qwen2.5VL-7b-RLCS with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "WaltonFuture/Qwen2.5VL-7b-RLCS" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "WaltonFuture/Qwen2.5VL-7b-RLCS", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/WaltonFuture/Qwen2.5VL-7b-RLCS
- SGLang
How to use WaltonFuture/Qwen2.5VL-7b-RLCS with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "WaltonFuture/Qwen2.5VL-7b-RLCS" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "WaltonFuture/Qwen2.5VL-7b-RLCS", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "WaltonFuture/Qwen2.5VL-7b-RLCS" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "WaltonFuture/Qwen2.5VL-7b-RLCS", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use WaltonFuture/Qwen2.5VL-7b-RLCS with Docker Model Runner:
docker model run hf.co/WaltonFuture/Qwen2.5VL-7b-RLCS
- 🐙 GitHub Repo: waltonfuture/RL-with-Cold-Start
- 📜 Paper (arXiv): Advancing Multimodal Reasoning via Reinforcement Learning with Cold Start (arXiv:2505.22334)
Cold Start Stage
We conduct supervised fine-tuning on Qwen2.5-VL-3B and Qwen2.5-VL-7B using ms-swift. In this stage, please refer to this curated dataset distilled from Qwen2.5-VL-32B using rejection sampling.
Setup
git clone https://github.com/waltonfuture/RL-with-Cold-Start.git
cd RL-with-Cold-Start/SFT
pip install -e .
Prepare Data
python convert_data.py
SFT
bash qwen2.5vl_sft.sh
The checkpoint can be found in SFT/output.
RL Stage
We further conduct GRPO using EasyR1. Please refer to this dataset for the GRPO training.
Setup
git clone https://github.com/waltonfuture/RL-with-Cold-Start.git
cd RL-with-Cold-Start/GRPO
pip install -e .
GRPO Training (replace the checkpoint with the model after SFT)
bash examples/qwen2_5_vl_7b_grpo.sh
Merge Checkpoint in Hugging Face Format
python3 scripts/model_merger.py --local_dir checkpoints/easyr1/qwen2_5_vl_7b_grpo/global_step_80/actor
Data Access
Our two stage datasets are now available on Huggingface.
| Stage | Data |
|---|---|
| Cold Start | Multimodal-Cold-Start |
| RL | Multimodal-RL-Data |
Model Access
Our models are now available on Huggingface.
| Backbone | Our model |
|---|---|
| Qwen2.5-VL-7b | Qwen2.5VL-7b-RL-with-Cold-Start |
| Qwen2.5-VL-3b | Qwen2.5VL-3b-RL-with-Cold-Start |
Acknowledgment
Our models are built upon the amazing Qwen2.5-VL family. We thank EasyR1 and ms-swift for their training codes.
Contact
Please contact Lai Wei (waltonfuture@sjtu.edu.cn) if needed.
Citation
@article{wei2025advancing,
title={Advancing Multimodal Reasoning via Reinforcement Learning with Cold Start},
author={Wei, Lai and Li, Yuting and Zheng, Kaipeng and Wang, Chen and Wang, Yue and Kong, Linghe and Sun, Lichao and Huang, Weiran},
journal={arXiv preprint arXiv:2505.22334},
year={2025}
}
- Downloads last month
- 8