Views
No views yet
1# Install required packages
2pip install transformers accelerate bitsandbytes torch
3
4# Load quantized model
5from transformers import BitsAndBytesConfig
6import torch
7
8# 4-bit quantization config
9bnb_config = BitsAndBytesConfig(
10 load_in_4bit=True,
11 bnb_4bit_quant_type="nf4",
12 bnb_4bit_use_double_quant=True,
13 bnb_4bit_compute_dtype=torch.bfloat16
14)
15
16# Model-specific loading code here
17# (See complete notebook for detailed usage)1@misc{chain-of-zoom-4bit-vlm,
2 title={Chain-of-Zoom 4-bit Quantized Qwen2.5-VL-3B 4-bit Quantized for Chain-of-Zoom},
3 author={humbleakh},
4 year={2024},
5 publisher={Hugging Face},
6 url={https://huggingface.co/humbleakh/qwen2.5-vl-3b-4bit-chain-of-zoom}
7}