Views
No views yet
| Metric | Score |
|---|---|
| Exact Match | 0.4334 |
| Accuracy | 43.34% |
| Correct / Total | 218 / 503 |
1from transformers import AutoProcessor, Qwen2_5_VLForConditionalGeneration
2from PIL import Image
3import torch
4
5model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
6 "Manar01/qwen-vl-arabic",
7 torch_dtype=torch.float16,
8 device_map="auto"
9)
10processor = AutoProcessor.from_pretrained("Manar01/qwen-vl-arabic")
11
12image = Image.open("image.jpg").convert("RGB")
13
14messages = [{
15 "role": "user",
16 "content": [
17 {"type": "image", "image": image},
18 {"type": "text", "text": "your question in Arabic"},
19 ],
20}]
21
22text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
23inputs = processor(text=[text], images=[image], return_tensors="pt").to(model.device)
24
25with torch.no_grad():
26 output = model.generate(**inputs, max_new_tokens=256, do_sample=False)
27
28generated = output[0][inputs["input_ids"].shape[1]:]
29print(processor.decode(generated, skip_special_tokens=True))1@misc{arabicvlr2026,
2 title = {ArabicVL-R: Arabic Vision Language Model Reasoning},
3 author = {Sarah and Manar and Hadeel and Ragheed and Mourad},
4 year = {2025},
5 url = {https://github.com/hadeelalseni/ArabicVL-R}
6}