Views
No views yet

| Eval | Zamba2-VL-2.7B | InternVL3.5-2B | Qwen3-VL-2B | PerceptionLM-3B | Molmo2-4B | Qwen3-VL-4B | InternVL3.5-4B |
|---|---|---|---|---|---|---|---|
| AI2D (test) | 85.8 | 88.6 | 86.2 | 92.2 | 93.8 | 91.8 | 92.0 |
| ChartQA (test) | 79.6 | 81.6 | 78.7 | 85.1 | 86.1 | 81.8 | 86.4 |
| DocVQA (test) | 90.9 | 89.4 | 93.3 | 93.8 | 87.8 | 95.3 | 92.4 |
| InfoVQA (test) | 66.5 | 70.8 | 72.4 | 74.6 | 78.6 | 80.3 | 78.0 |
| TextVQA (val) | 77.4 | 76.5 | 79.9 | 80.0 | 83.1 | 81.5 | 77.6 |
| OCRBench | 73.6 | 83.4 | 84.1 | 80.1 | 62.0 | 84.1 | 82.0 |
| VQA v2.0 (val) | 79.6 | 73.6 | 78.8 | 76.9 | 85.3 | 80.7 | 76.4 |
| MathVista (mini) | 51.0 | 61.4 | 51.8 | 61.6 | 56.5 | 63.6 | 72.8 |
| MMMU (val) | 37.7 | 49.9 | 40.9 | 41.4 | 48.8 | 51.4 | 57.2 |
| SEED (image) | 73.0 | 75.2 | 74.8 | 78.3 | 78.0 | 77.3 | 76.3 |
| BLINK (val) | 42.3 | 51.3 | 53.2 | 49.8 | 63.5 | 63.2 | 58.2 |
| RealWorldQA | 61.7 | 61.6 | 66.0 | 73.1 | 73.8 | 71.0 | 67.8 |
| CountBenchQA | 87.5 | 70.0 | 87.9 | 88.1 | 91.2 | 87.3 | 82.5 |
| PixMoCount (test) | 82.5 | 32.8 | 55.7 | 41.6 | 87.0 | 89.2 | 47.3 |
| Point-Bench (avg) | 61.2 | -- | 53.5 | -- | 68.5 | 65.1 | -- |
zamba2-vl branch from our fork of transformers library, which is based on the v4.57.1 of transformers:1pip install "transformers @ git+https://github.com/Zyphra/transformers.git@zamba2-vl"
2pip install qwen-vl-utils==0.0.2
3pip install flash_attntransformers v4.57.1 being installed in your environment. If you're installing in a fresh Python environment, you might want to specify a specific extra, like [dev-torch], to install all the dependencies:pip install "transformers[dev-torch] @ git+https://github.com/Zyphra/transformers.git@zamba2-vl"mamba-ssm from source (due to compatibility issues with PyTorch) as well as causal-conv1d:1pip install --no-build-isolation "causal-conv1d @ git+https://github.com/Zyphra/z-causal-conv1d.git@zamba2-vl"
2pip install --no-build-isolation "mamba-ssm @ git+https://github.com/Zyphra/mamba.git@zamba2-vl"1from transformers import Zamba2_VLForConditionalGeneration, Zamba2_VLProcessor
2import torch
3from PIL import Image
4from qwen_vl_utils import process_vision_info
5import requests
6
7device = "cuda"
8processor = Zamba2_VLProcessor.from_pretrained("Zyphra/Zamba2-VL-2.7B", temporal_patch_size=1)
9model = Zamba2_VLForConditionalGeneration.from_pretrained("Zyphra/Zamba2-VL-2.7B", device_map=device, torch_dtype=torch.bfloat16, attn_implementation="flash_attention_2")
10
11url = "http://images.cocodataset.org/val2017/000000039769.jpg"
12image = Image.open(requests.get(url, stream=True).raw)
13question = "What do you see in the image? Give us some detail."
14num_img_tokens = 3400
15
16conversation = [
17 {"role": "user", "content": [
18 {"type": "image", "image": image, "max_pixels" : num_img_tokens * 28 * 28, "min_pixels" : 10 * 28 * 28},
19 {"type": "text", "text": question},
20 ]
21 },
22]
23prompt = processor.apply_chat_template(conversation, add_generation_prompt=True)
24images, _ = process_vision_info(conversation)
25inputs = processor(text=prompt, images=images, add_special_tokens=True, return_tensors="pt")
26inputs = {key: value.to(device) for key, value in inputs.items()}
27
28outputs = model.generate(**inputs, max_new_tokens=100)
29print(processor.tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))