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, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("humbleakh/qwen2.5-vl-3b-4bit-chain-of-zoom") model = AutoModelForMultimodalLM.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 Settings
- 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
File size: 2,743 Bytes
a0a9a96 7d33284 a0a9a96 7d33284 a0a9a96 7d33284 a0a9a96 7d33284 a0a9a96 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | ---
library_name: transformers
tags:
- quantization
- 4-bit
- chain-of-zoom
- super-resolution
- vlm
- bitsandbytes
base_model: Qwen/Qwen2.5-VL-3B-Instruct
license: apache-2.0
language:
- en
pipeline_tag: image-text-to-text
---
# 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
```python
# 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
```bibtex
@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
- [Complete Chain-of-Zoom 4-bit Pipeline](humbleakh/chain-of-zoom-4bit-complete)
- [Original Chain-of-Zoom](https://github.com/bryanswkim/Chain-of-Zoom)
## β οΈ 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.
|