Qwen-3-VL Collection
Collection
Quantized Qwen3-VL models for efficient image-text understanding (AutoRound W4A16). • 9 items • Updated
How to use Vishva007/Qwen3-VL-8B-Instruct-W4A16-AutoRound-AWQ with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-text-to-text", model="Vishva007/Qwen3-VL-8B-Instruct-W4A16-AutoRound-AWQ")
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("Vishva007/Qwen3-VL-8B-Instruct-W4A16-AutoRound-AWQ")
model = AutoModelForMultimodalLM.from_pretrained("Vishva007/Qwen3-VL-8B-Instruct-W4A16-AutoRound-AWQ", 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]:]))How to use Vishva007/Qwen3-VL-8B-Instruct-W4A16-AutoRound-AWQ with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Vishva007/Qwen3-VL-8B-Instruct-W4A16-AutoRound-AWQ"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Vishva007/Qwen3-VL-8B-Instruct-W4A16-AutoRound-AWQ",
"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 run hf.co/Vishva007/Qwen3-VL-8B-Instruct-W4A16-AutoRound-AWQ
How to use Vishva007/Qwen3-VL-8B-Instruct-W4A16-AutoRound-AWQ with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Vishva007/Qwen3-VL-8B-Instruct-W4A16-AutoRound-AWQ" \
--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": "Vishva007/Qwen3-VL-8B-Instruct-W4A16-AutoRound-AWQ",
"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 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 "Vishva007/Qwen3-VL-8B-Instruct-W4A16-AutoRound-AWQ" \
--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": "Vishva007/Qwen3-VL-8B-Instruct-W4A16-AutoRound-AWQ",
"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"
}
}
]
}
]
}'How to use Vishva007/Qwen3-VL-8B-Instruct-W4A16-AutoRound-AWQ with Docker Model Runner:
docker model run hf.co/Vishva007/Qwen3-VL-8B-Instruct-W4A16-AutoRound-AWQ
This model is the AWQ (Activation-aware Weight Quantization) export of Qwen/Qwen3-VL-8B-Instruct.
It combines the speed of AWQ with the accuracy of AutoRound. The weights were fine-tuned for 800 steps to ensure the 4-bit degradation is negligible. The vision tower remains in full precision (FP16) to maintain top-tier performance on OCR and visual tasks.
vLLM serving and Transformers.pip install vllm
from vllm import LLM, SamplingParams
model_id = "Vishva007/Qwen3-VL-8B-Instruct-W4A16-AutoRound-AWQ"
llm = LLM(
model=model_id,
quantization="awq",
trust_remote_code=True,
max_model_len=4096
)
# ... (Standard vLLM inference code)
pip install autoawq transformers
from transformers import Qwen2VLForConditionalGeneration, AutoProcessor
import torch
model_id = "Vishva007/Qwen3-VL-8B-Instruct-W4A16-AutoRound-AWQ"
# Load with Flash Attention 2 for best performance
model = Qwen2VLForConditionalGeneration.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto",
attn_implementation="flash_attention_2"
)
processor = AutoProcessor.from_pretrained(model_id)
# Inference Example
messages = [
{
"role": "user",
"content": [
{"type": "image", "image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg"},
{"type": "text", "text": "What does this image show?"},
],
}
]
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
image_inputs, video_inputs = process_vision_info(messages)
inputs = processor(
text=[text],
images=image_inputs,
videos=video_inputs,
padding=True,
return_tensors="pt",
).to("cuda")
generated_ids = model.generate(**inputs, max_new_tokens=128)
print(processor.batch_decode(generated_ids, skip_special_tokens=True))
@misc{qwen3technicalreport,
title={Qwen3 Technical Report},
author={Qwen Team},
year={2025}
}
Base model
Qwen/Qwen3-VL-8B-Instruct