Image-Text-to-Text
Transformers
Safetensors
qwen2_5_vl
model-merging
optmerge
multimodal
qwen2.5-vl
ocr
conversational
text-generation-inference
Instructions to use yongxianwei/Qwen2.5-VL-32B-OCR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yongxianwei/Qwen2.5-VL-32B-OCR with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="yongxianwei/Qwen2.5-VL-32B-OCR") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("yongxianwei/Qwen2.5-VL-32B-OCR") model = AutoModelForMultimodalLM.from_pretrained("yongxianwei/Qwen2.5-VL-32B-OCR", device_map="auto") 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yongxianwei/Qwen2.5-VL-32B-OCR with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yongxianwei/Qwen2.5-VL-32B-OCR" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yongxianwei/Qwen2.5-VL-32B-OCR", "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/yongxianwei/Qwen2.5-VL-32B-OCR
- SGLang
How to use yongxianwei/Qwen2.5-VL-32B-OCR 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 "yongxianwei/Qwen2.5-VL-32B-OCR" \ --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": "yongxianwei/Qwen2.5-VL-32B-OCR", "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 "yongxianwei/Qwen2.5-VL-32B-OCR" \ --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": "yongxianwei/Qwen2.5-VL-32B-OCR", "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 yongxianwei/Qwen2.5-VL-32B-OCR with Docker Model Runner:
docker model run hf.co/yongxianwei/Qwen2.5-VL-32B-OCR
Qwen2.5-VL-32B-OCR
The OCR expert of the OptMerge MLLM merging benchmark (ICLR 2026). It is one of five capability experts (VQA, Geometry, Chart, OCR, Grounding) fine-tuned from the same base model, so that they can be merged into one model without training data.
- Paper: OptMerge: Unifying Multimodal LLM Capabilities and Modalities via Model Merging (OpenReview)
- Code: WalkerWorldPeace/MLLMerging
- All experts: MLLMerging collection
Training
- Base model: Qwen/Qwen2.5-VL-32B-Instruct
- Method: Supervised fine-tuning of Qwen2.5-VL-32B-Instruct (see "Model scales" in the paper). This repository stores full weights; load it directly, no PEFT adapter is needed.
- Data: OCRVQA, TextCaps, SynthDoG, LLaVAR, ST-VQA, TextVQA, DocVQA, DeepForm, KLC, TabFact (238K samples, Table 1 of the paper), plus additional high-quality fine-tuning data.
Results
From Table 9 of the paper. The last row merges this expert with the other four experts using OptMerge.
| Model | VizWiz | GQA | MathVista | MATH-Vision | ChartQA | TextVQA | OCRVQA | RefCOCO | RefCOCO+ | RefCOCOg | Avg. |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Qwen2.5-VL-32B-Instruct (base model) | 41.39 | 59.34 | 79.21 | 47.36 | 83.64 | 79.62 | 64.58 | 88.01 | 82.41 | 84.06 | 70.96 |
| Qwen2.5-VL-32B-OCR | 42.65 | 61.04 | 75.28 | 34.21 | 87.00 | 81.42 | 67.32 | 89.63 | 83.76 | 84.62 | 70.69 |
| OptMerge (5 experts merged) | 43.52 | 62.50 | 80.01 | 43.42 | 88.92 | 81.91 | 66.37 | 89.94 | 83.97 | 84.68 | 72.52 |
Usage
from transformers import AutoProcessor, Qwen2_5_VLForConditionalGeneration
model_id = "yongxianwei/Qwen2.5-VL-32B-OCR"
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(model_id, torch_dtype="auto", device_map="auto")
processor = AutoProcessor.from_pretrained(model_id)
# Build chat messages and call model.generate(...) as in the official Qwen2.5-VL model card.
To merge the five experts yourself, see Reproducing OptMerge.
Citation
If you use these checkpoints or the MLLMerging code, please cite both OptMerge and its extended version:
@inproceedings{wei2025optmerge,
title={OptMerge: Unifying Multimodal LLM Capabilities and Modalities via Model Merging},
author={Wei, Yongxian and Cheng, Runxi and Jin, Weike and Yang, Enneng and Shen, Li and Hou, Lu and Du, Sinan and Yuan, Chun and Cao, Xiaochun and Tao, Dacheng},
booktitle={The Fourteenth International Conference on Learning Representations},
year={2026},
url={https://openreview.net/forum?id=Me0n0iESJY}
}
@article{wei2026swudi,
title={Closed-Form Spectral Regularization for Multi-Task Model Merging},
author={Wei, Yongxian and Cheng, Runxi and Zhang, Xingxuan and Shen, Li and Yuan, Chun and Cui, Peng and Tao, Dacheng},
journal={arXiv preprint arXiv:2606.07289},
year={2026}
}
- Downloads last month
- 594
Model tree for yongxianwei/Qwen2.5-VL-32B-OCR
Collection including yongxianwei/Qwen2.5-VL-32B-OCR
Collection
25 items • Updated • 3