Views
No views yet
| Metric | Value |
|---|---|
| Original (FP16) | ~16.0 GB |
| Quantized (W4A16) | ~6.18 GB |
| Reduction | ~61.4% |
| Memory Saved | ~9.8 GB |
1from transformers import AutoModelForVision2Seq, AutoProcessor
2from PIL import Image
3import requests
4
5# Load model and processor
6model = AutoModelForVision2Seq.from_pretrained(
7 "ronantakizawa/idefics3-8b-llama3-awq-w4a16",
8 trust_remote_code=True,
9 device_map="auto"
10)
11processor = AutoProcessor.from_pretrained(
12 "ronantakizawa/idefics3-8b-llama3-awq-w4a16",
13 trust_remote_code=True
14)
15
16# Prepare inputs
17url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/cats.png"
18image = Image.open(requests.get(url, stream=True).raw)
19
20messages = [{
21 "role": "user",
22 "content": [
23 {"type": "image"},
24 {"type": "text", "text": "Describe this image in detail."}
25 ]
26}]
27
28text = processor.apply_chat_template(messages, add_generation_prompt=True)
29inputs = processor(text=text, images=[image], return_tensors="pt").to("cuda")
30
31# Generate
32outputs = model.generate(**inputs, max_new_tokens=256)
33print(processor.decode(outputs[0], skip_special_tokens=True))1from vllm import LLM, SamplingParams
2
3llm = LLM(
4 model="ronantakizawa/idefics3-8b-llama3-awq-w4a16",
5 trust_remote_code=True,
6 max_model_len=2048
7)
8
9# vLLM will automatically use AWQ quantization for faster inference1@misc{idefics3-awq,
2 title={IDEFICS3-8B-Llama3 AWQ 4-bit},
3 author={Quantized by ronantakizawa},
4 year={2025},
5 url={https://huggingface.co/ronantakizawa/idefics3-8b-llama3-awq-w4a16}
6}