Vishva R commited on
Create README.md
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293---base_model: Qwen/Qwen3-VL-8B-Instructlibrary_name: auto-roundlicense: apache-2.0tags:- auto-round- intel- qwen- qwen3-vl- vision-language-model- quantization- 4-bit- W4A16pipeline_tag: image-text-to-textmodel_type: qwen2_vl---
# Qwen3-VL-8B-Instruct-W4A16-AutoRound
## Model OverviewThis is a **4-bit quantized** version of the powerful [Qwen/Qwen3-VL-8B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-8B-Instruct) vision-language model.
It was optimized using **Intel's AutoRound** algorithm, which calibrates weights for 1000 iterations to minimize quantization loss. This version retains the original **BF16 vision tower**, ensuring that visual capabilities (OCR, spatial reasoning, chart analysis) remain degradation-free.
### Quantization Specifications- **Method**: [AutoRound](https://github.com/intel/auto-round) (Advanced Weight-Only Quantization)- **Scheme**: `W4A16` (4-bit weights, 16-bit activations)- **Symmetric**: `True`- **Group Size**: 128- **Vision Tower**: Kept in BF16 (Unquantized for max accuracy)- **Calibration**: 512 samples, 1000 iterations
## Quickstart
### 1. InstallationTo use this model in its native AutoRound format, you need the `auto-round` library.
```bashpip install auto-round transformers torch```
### 2. Inference Code
```pythonfrom transformers import AutoModelForCausalLM, AutoTokenizer, AutoProcessorfrom auto_round import AutoRoundConfig
model_id = "Vishva007/Qwen3-VL-8B-Instruct-W4A16-AutoRound"
# Load Modelmodel = AutoModelForCausalLM.from_pretrained( model_id, device_map="auto", trust_remote_code=True)processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
# Prepare Inputmessages = [ { "role": "user", "content": [ {"type": "image", "image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg"}, {"type": "text", "text": "Describe this image detailly."}, ], }]
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(model.device)
# Generategenerated_ids = model.generate(**inputs, max_new_tokens=128)print(processor.batch_decode(generated_ids, skip_special_tokens=True))```
## Citation```bibtex@article{cheng2023optimize, title={Optimize Weight Rounding via Signed Gradient Descent for the Quantization of LLMs}, author={Cheng, Wenhua and Zhang, Weiwei and Shen, Haihao and Cai, Yiyang and He, Xin and Lv, Kaokao}, journal={arXiv preprint arXiv:2309.05516}, year={2023}}```README.mdAdded+93