Image-Text-to-Text
Transformers
Safetensors
qwen2_5_vl
multimodal
vision-language
spatial-reasoning
latent-reasoning
conversational
custom_code
text-generation-inference
Instructions to use array/Qwen2.5-VL-Mull with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use array/Qwen2.5-VL-Mull with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="array/Qwen2.5-VL-Mull", trust_remote_code=True) 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("array/Qwen2.5-VL-Mull", trust_remote_code=True) model = AutoModelForMultimodalLM.from_pretrained("array/Qwen2.5-VL-Mull", trust_remote_code=True, 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 array/Qwen2.5-VL-Mull with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "array/Qwen2.5-VL-Mull" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "array/Qwen2.5-VL-Mull", "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/array/Qwen2.5-VL-Mull
- SGLang
How to use array/Qwen2.5-VL-Mull 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 "array/Qwen2.5-VL-Mull" \ --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": "array/Qwen2.5-VL-Mull", "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 "array/Qwen2.5-VL-Mull" \ --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": "array/Qwen2.5-VL-Mull", "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 array/Qwen2.5-VL-Mull with Docker Model Runner:
docker model run hf.co/array/Qwen2.5-VL-Mull
Commit History
-
Model card: add Serving with vLLM section
Verified signatureDocuments that vLLM serves this checkpoint natively, that the chat template now supplies the latent block automatically, how to check the latent path is actually active (8.9 vs 101.2 mean output tokens with/without), and the max_pixels setting needed to reproduce the paper's numbers.a0a4e1b -
Serve correctly on vLLM: fix image_processor_type, pre-fill latent block in chat template, pin vision_config
Verified signature- preprocessor_config.json: image_processor_type Qwen2_5_VLImageProcessor -> Qwen2VLImageProcessor. The old name is the transformers-fork class and is not in the auto map, so stock transformers raised 'Unrecognized image processor'. The two classes produce bit-identical pixel_values. - chat_template: the add_generation_prompt branch now pre-fills the assistant turn with <think> + 20 x <|latent_pad|> + </think>. Without it a served model receives zero latent tokens and reverts to thinking in text (~11x the decode cost). Guarded by add_generation_prompt, so training and lmms-eval render byte-identically to before. Override per request with chat_template_kwargs {"num_latents": N}; 0 disables. - config.json: vision_config written out explicitly rather than relying on transformers class defaults. auto_map is kept.f9b2818
-
Upload README.md with huggingface_hub
Verified signatured9abb32
-
Upload folder using huggingface_hub
Verified signaturedccafa1
-
Upload mmlatentdiscrete_qwen_vl.py with huggingface_hub
Verified signatureb01fbda -
Upload processor
Verified signature4ce2f4c -
Upload Qwen2_5_VLForConditionalGeneration
Verified signature39d8a5e -
initial commit
Verified signature97c4624