Image-Text-to-Text
Transformers
Safetensors
qwen2_5_vl
quantized
int8
w8a8
vllm
compressed-tensors
vision-language
conversational
text-generation-inference
8-bit precision
Instructions to use lsm0729/Qwen2.5-VL-3B-Instruct-quantized.w8a8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lsm0729/Qwen2.5-VL-3B-Instruct-quantized.w8a8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="lsm0729/Qwen2.5-VL-3B-Instruct-quantized.w8a8") 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("lsm0729/Qwen2.5-VL-3B-Instruct-quantized.w8a8") model = AutoModelForMultimodalLM.from_pretrained("lsm0729/Qwen2.5-VL-3B-Instruct-quantized.w8a8", 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use lsm0729/Qwen2.5-VL-3B-Instruct-quantized.w8a8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lsm0729/Qwen2.5-VL-3B-Instruct-quantized.w8a8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lsm0729/Qwen2.5-VL-3B-Instruct-quantized.w8a8", "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/lsm0729/Qwen2.5-VL-3B-Instruct-quantized.w8a8
- SGLang
How to use lsm0729/Qwen2.5-VL-3B-Instruct-quantized.w8a8 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 "lsm0729/Qwen2.5-VL-3B-Instruct-quantized.w8a8" \ --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": "lsm0729/Qwen2.5-VL-3B-Instruct-quantized.w8a8", "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 "lsm0729/Qwen2.5-VL-3B-Instruct-quantized.w8a8" \ --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": "lsm0729/Qwen2.5-VL-3B-Instruct-quantized.w8a8", "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 lsm0729/Qwen2.5-VL-3B-Instruct-quantized.w8a8 with Docker Model Runner:
docker model run hf.co/lsm0729/Qwen2.5-VL-3B-Instruct-quantized.w8a8
Qwen2.5-VL-3B-Instruct W8A8 Quantized
This is an INT8 quantized version of Qwen/Qwen2.5-VL-3B-Instruct using W8A8 (8-bit weights, 8-bit activations) quantization scheme.
Model Details
- Base Model: Qwen/Qwen2.5-VL-3B-Instruct
- Quantization Method: W8A8 INT8 (Weights: INT8, Activations: INT8 Dynamic)
- Quantization Library: llm-compressor
- Format: compressed-tensors
- Compatible Runtime: vLLM
Quantization Details
- Weight Quantization: Static per-channel symmetric INT8
- Activation Quantization: Dynamic per-token symmetric INT8
- Quantization Strategy: Token-wise for activations, channel-wise for weights
- Calibration Dataset: flickr30k (64 samples)
Usage
With vLLM
from vllm import LLM, SamplingParams
# Load the quantized model
llm = LLM(
model="lsm0729/Qwen2.5-VL-3B-Instruct-quantized.w8a8",
trust_remote_code=True,
max_model_len=4096,
)
# Generate
sampling_params = SamplingParams(temperature=0.7, top_p=0.9, max_tokens=512)
outputs = llm.generate(prompts, sampling_params)
Requirements
pip install vllm>=0.14.0
pip install qwen-vl-utils
Performance
This quantized model provides:
- ~2x memory reduction compared to FP16
- Faster inference with INT8 compute kernels
- Minimal accuracy degradation
Citation
If you use this model, please cite the original Qwen2.5-VL paper and model:
@article{qwen2.5-vl,
title={Qwen2.5-VL: Pushing the Limits of Visual Understanding},
author={Qwen Team},
year={2024}
}
License
This quantized model inherits the license from the base model: Apache 2.0
See the original model card for more details.
Acknowledgements
- Original model by Qwen Team at Alibaba Cloud
- Quantization performed using llm-compressor
- Deployed with vLLM for efficient inference
- Downloads last month
- 11
Model tree for lsm0729/Qwen2.5-VL-3B-Instruct-quantized.w8a8
Base model
Qwen/Qwen2.5-VL-3B-Instruct