Image-Text-to-Text
Transformers
Safetensors
English
qwen2_vl
quantization
4-bit precision
chain-of-zoom
super-resolution
vlm
bitsandbytes
conversational
Instructions to use humbleakh/qwen2.5-vl-3b-4bit-chain-of-zoom with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use humbleakh/qwen2.5-vl-3b-4bit-chain-of-zoom with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="humbleakh/qwen2.5-vl-3b-4bit-chain-of-zoom") 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("humbleakh/qwen2.5-vl-3b-4bit-chain-of-zoom") model = AutoModelForImageTextToText.from_pretrained("humbleakh/qwen2.5-vl-3b-4bit-chain-of-zoom") 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 humbleakh/qwen2.5-vl-3b-4bit-chain-of-zoom with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "humbleakh/qwen2.5-vl-3b-4bit-chain-of-zoom" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "humbleakh/qwen2.5-vl-3b-4bit-chain-of-zoom", "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/humbleakh/qwen2.5-vl-3b-4bit-chain-of-zoom
- SGLang
How to use humbleakh/qwen2.5-vl-3b-4bit-chain-of-zoom 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 "humbleakh/qwen2.5-vl-3b-4bit-chain-of-zoom" \ --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": "humbleakh/qwen2.5-vl-3b-4bit-chain-of-zoom", "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 "humbleakh/qwen2.5-vl-3b-4bit-chain-of-zoom" \ --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": "humbleakh/qwen2.5-vl-3b-4bit-chain-of-zoom", "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 humbleakh/qwen2.5-vl-3b-4bit-chain-of-zoom with Docker Model Runner:
docker model run hf.co/humbleakh/qwen2.5-vl-3b-4bit-chain-of-zoom
How to use from
vLLMUse Docker
docker model run hf.co/humbleakh/qwen2.5-vl-3b-4bit-chain-of-zoomQuick Links
Qwen2.5-VL-3B 4-bit Quantized for Chain-of-Zoom
π Model Description
4-bit quantized Vision-Language Model optimized for Chain-of-Zoom super-resolution
This model is part of the Chain-of-Zoom 4-bit Quantized Pipeline - a memory-optimized version of the original Chain-of-Zoom super-resolution framework.
π― Key Features
- 4-bit Quantization: Uses BitsAndBytes NF4 quantization for 75% memory reduction
- Maintained Quality: Comparable performance to full precision models
- Google Colab Compatible: Runs on T4 GPU (16GB VRAM)
- Memory Efficient: Optimized for low-resource environments
π Quantization Details
- Method: BitsAndBytes NF4 4-bit quantization
- Compute dtype: bfloat16/float16
- Double quantization: Enabled
- Memory reduction: ~75% compared to original
- Original memory: ~12GB β Quantized: ~3GB
π Usage
# Install required packages
pip install transformers accelerate bitsandbytes torch
# Load quantized model
from transformers import BitsAndBytesConfig
import torch
# 4-bit quantization config
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_use_double_quant=True,
bnb_4bit_compute_dtype=torch.bfloat16
)
# Model-specific loading code here
# (See complete notebook for detailed usage)
π Performance
- Quality: Maintained performance vs full precision
- Speed: 2-3x faster inference
- Memory: 75% reduction in VRAM usage
- Hardware: Compatible with T4, V100, A100 GPUs
π§ Technical Specifications
- Created: 2025-06-08 17:10:40
- Quantization Library: BitsAndBytes
- Framework: PyTorch + Transformers
- Precision: 4-bit NF4
- Model Size: 2899.8802061080933 MB
π Citation
@misc{chain-of-zoom-4bit-vlm,
title={Chain-of-Zoom 4-bit Quantized Qwen2.5-VL-3B 4-bit Quantized for Chain-of-Zoom},
author={humbleakh},
year={2024},
publisher={Hugging Face},
url={https://huggingface.co/humbleakh/qwen2.5-vl-3b-4bit-chain-of-zoom}
}
π Related Models
β οΈ Limitations
- Requires BitsAndBytes library for proper loading
- May have slight quality differences compared to full precision
- Optimized for inference, not fine-tuning
π License
Apache 2.0 - See original model licenses for specific components.
- Downloads last month
- 1
Model tree for humbleakh/qwen2.5-vl-3b-4bit-chain-of-zoom
Base model
Qwen/Qwen2.5-VL-3B-Instruct
Install from pip and serve model
# Install vLLM from pip: pip install vllm# Start the vLLM server: vllm serve "humbleakh/qwen2.5-vl-3b-4bit-chain-of-zoom"# Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "humbleakh/qwen2.5-vl-3b-4bit-chain-of-zoom", "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" } } ] } ] }'