Views
No views yet
W4A16 (4-bit weights, 16-bit activations)Trueauto-round library.pip install auto-round transformers torch1from transformers import AutoModelForCausalLM, AutoTokenizer, AutoProcessor
2from auto_round import AutoRoundConfig
3
4model_id = "Vishva007/Qwen3-VL-2B-Instruct-W4A16-AutoRound"
5
6# Load Model
7model = AutoModelForCausalLM.from_pretrained(
8 model_id,
9 device_map="auto",
10 trust_remote_code=True
11)
12processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
13
14# Prepare Input
15messages = [
16 {
17 "role": "user",
18 "content": [
19 {"type": "image", "image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg"},
20 {"type": "text", "text": "Describe this image detailly."},
21 ],
22 }
23]
24
25text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
26image_inputs, video_inputs = process_vision_info(messages)
27
28inputs = processor(
29 text=[text],
30 images=image_inputs,
31 videos=video_inputs,
32 padding=True,
33 return_tensors="pt",
34).to(model.device)
35
36# Generate
37generated_ids = model.generate(**inputs, max_new_tokens=128)
38print(processor.batch_decode(generated_ids, skip_special_tokens=True))🎁 Need GPU compute? Sign up via RunPod and get $5–$500 in free credits when you add your first $10.
| Template | CUDA Version | Docker Image | Template ID | Deploy |
|---|---|---|---|---|
| PyTorch 2.13 (CUDA 12.6) | 12.6 | vishva123/cuda-12.6-pytorch-2.13-runpod | gmlupxnxfk | |
| PyTorch 2.13 (CUDA 13.0) | 13.0 | vishva123/cuda-13.0-pytorch-2.13-runpod | y3j8xvk4f4 | |
| PyTorch 2.13 (CUDA 13.2) | 13.2 | vishva123/cuda-13.2-pytorch-2.13-runpod | vigpissn5w |
| Template | CUDA Version | Docker Image | Template ID | Deploy |
|---|---|---|---|---|
| PyTorch 2.12 (CUDA 12.6) | 12.6 | vishva123/cuda-12.6-pytorch-2.12-runpod | ctmz86zmf0 | |
| PyTorch 2.12 (CUDA 13.0) | 13.0 | vishva123/cuda-13.0-pytorch-2.12-runpod | qjko5yiwzi | |
| PyTorch 2.12 (CUDA 13.2) | 13.2 | vishva123/cuda-13.2-pytorch-2.12-runpod | ifg6xmye0f |
1@article{cheng2023optimize,
2 title={Optimize Weight Rounding via Signed Gradient Descent for the Quantization of LLMs},
3 author={Cheng, Wenhua and Zhang, Weiwei and Shen, Haihao and Cai, Yiyang and He, Xin and Lv, Kaokao},
4 journal={arXiv preprint arXiv:2309.05516},
5 year={2023}
6}