Instructions to use yongxianwei/Qwen2-VL-7B-Geometry with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yongxianwei/Qwen2-VL-7B-Geometry with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="yongxianwei/Qwen2-VL-7B-Geometry") 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-VL-7B-Geometry") model = AutoModelForMultimodalLM.from_pretrained("yongxianwei/Qwen2-VL-7B-Geometry", 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-VL-7B-Geometry with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yongxianwei/Qwen2-VL-7B-Geometry" # 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-VL-7B-Geometry", "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-VL-7B-Geometry
- SGLang
How to use yongxianwei/Qwen2-VL-7B-Geometry 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-VL-7B-Geometry" \ --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-VL-7B-Geometry", "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-VL-7B-Geometry" \ --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-VL-7B-Geometry", "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-VL-7B-Geometry with Docker Model Runner:
docker model run hf.co/yongxianwei/Qwen2-VL-7B-Geometry
Qwen2-VL-7B-Geometry
The Geometry 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)
- Extended version (SWUDI): Closed-Form Spectral Regularization for Multi-Task Model Merging, which also uses these experts in its multimodal merging benchmark
- Code: WalkerWorldPeace/MLLMerging
- All experts: MLLMerging collection
Training
- Base model: Qwen/Qwen2-VL-7B
- Method: LoRA fine-tuning (rank 8, learning rate 1e-5, warmup ratio 0.1, cosine schedule, 1 epoch). The LoRA weights are merged into this full checkpoint.
- Data: GeoQA+ (zh), G-LLaVA (190K samples, Table 1 of the paper).
Results
From Table 3 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-VL-7B (base model) | 5.52 | 5.39 | 47.85 | 23.68 | 0.36 | 20.22 | 1.07 | 45.32 | 37.55 | 31.26 | 21.82 |
| Qwen2-VL-7B-Geometry | 35.57 | 44.63 | 42.50 | 28.95 | 14.56 | 73.95 | 45.96 | 5.57 | 2.31 | 3.90 | 29.79 |
| OptMerge (5 experts merged) | 41.61 | 61.16 | 48.66 | 40.79 | 74.08 | 81.54 | 60.06 | 80.92 | 65.90 | 78.24 | 63.30 |
Usage
from transformers import AutoProcessor, Qwen2VLForConditionalGeneration
model_id = "yongxianwei/Qwen2-VL-7B-Geometry"
model = Qwen2VLForConditionalGeneration.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-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
- 308