Views
No views yet
| Metric | Value |
|---|---|
| Scheme | tritplane3 (3-plane progressive ternary) |
| Components quantized | text_backbone, multimodal_connector (196 linear layers) |
| Vision encoder | Kept in FP16 |
| Stored size | 7341 MB (~7.2 GB) |
| FP16 size | 13051 MB (~12.7 GB) |
| Compression ratio | 1.8x |
1from ternary_quant.inference import load_ternary_model
2
3model, processor = load_ternary_model(
4 "AsadIsmail/Qwen2.5-VL-7B-Instruct-ternary",
5 runtime_mode="metal" # "cached" for NVIDIA/CPU
6)
7
8from PIL import Image
9image = Image.open("photo.jpg")
10inputs = processor(text="What is shown in this image?", images=image, return_tensors="pt")
11inputs = {k: v.to(model.device) for k, v in inputs.items()}
12outputs = model.generate(**inputs, max_new_tokens=256)
13print(processor.decode(outputs[0], skip_special_tokens=True))1pip install ternary-quant
2ternary-quant quantize-broad Qwen/Qwen2.5-VL-7B-Instruct \
3 --output ./Qwen2.5-VL-7B-Instruct-ternary \
4 --components text_backbone multimodal_connector \
5 --scheme tritplane3 --dtype float16 --eval