Views
No views yet
AutoGPTQ, Transformers, and older vLLM versions that support GPTQ.| Feature | Detail |
|---|---|
| Quantization Format | GPTQ |
| Quantization Scheme | W4A16 (4-bit weights, 16-bit activations) |
| Optimization Algo | Intel AutoRound (Symmetric, Group Size 128) |
| Vision Tower | FP16 (Original Precision) |
| Model Size | ~5.5 GB (vs ~16GB Original) |
| VRAM Requirement | ~6-8 GB for Inference |
transformers and the auto-gptq kernel library.pip install auto-gptq transformers torch1from transformers import Qwen2VLForConditionalGeneration, AutoProcessor
2from qwen_vl_utils import process_vision_info
3import torch
4
5# 1. Load the Model
6model_id = "Vishva007/Qwen3-VL-8B-Instruct-W4A16-AutoRound-GPTQ"
7
8model = Qwen2VLForConditionalGeneration.from_pretrained(
9 model_id,
10 torch_dtype=torch.float16,
11 device_map="auto",
12 trust_remote_code=True,
13)
14
15# 2. Load the Processor
16processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
17
18# 3. Prepare Input (Image + Text)
19messages = [
20 {
21 "role": "user",
22 "content": [
23 {
24 "type": "image",
25 "image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg",
26 },
27 {"type": "text", "text": "Describe this image in detail."},
28 ],
29 }
30]
31
32# 4. Process Inputs
33text = processor.apply_chat_template(
34 messages, tokenize=False, add_generation_prompt=True
35)
36image_inputs, video_inputs = process_vision_info(messages)
37inputs = processor(
38 text=[text],
39 images=image_inputs,
40 videos=video_inputs,
41 padding=True,
42 return_tensors="pt",
43).to(model.device)
44
45# 5. Generate Output
46generated_ids = model.generate(**inputs, max_new_tokens=128)
47generated_ids_trimmed = [
48 out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
49]
50output_text = processor.batch_decode(
51 generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
52)
53
54print(f"Model Response:\n{output_text}")1@misc{qwen3technicalreport,
2 title={Qwen3 Technical Report},
3 author={Qwen Team},
4 year={2025}
5}