Instructions to use oddadmix/Nawah-VL-25M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use oddadmix/Nawah-VL-25M with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("image-to-text", model="oddadmix/Nawah-VL-25M")# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("oddadmix/Nawah-VL-25M") model = AutoModelForMultimodalLM.from_pretrained("oddadmix/Nawah-VL-25M", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Nawah-VL-25M
An Arabic image-captioning VLM, assembled from existing parts rather than trained from scratch.
| Part | Source | Params | Trained |
|---|---|---|---|
| Vision tower | SigLIP2 NaFlex from LiquidAI/LFM2.5-VL-450M, patch 16 |
85.8M | frozen |
| Connector | Lfm2VlMultiModalProjector, 3072→2048→384 |
7.1M | yes |
| Language model | oddadmix/Emhotob-25M-v2 (Llama, hidden 384, 8 layers, 2048 ctx) |
25.3M | stage 2 |
118M total. Generates Modern Standard Arabic captions for a single image.
Usage
from transformers import AutoProcessor, AutoModelForImageTextToText
from PIL import Image
model = AutoModelForImageTextToText.from_pretrained("oddadmix/Nawah-VL-25M")
proc = AutoProcessor.from_pretrained("oddadmix/Nawah-VL-25M")
inputs = proc(text=["<s><image>"], images=[[Image.open("photo.jpg").convert("RGB")]],
return_tensors="pt", padding=True, padding_side="left")
out = model.generate(**inputs, max_new_tokens=40)
print(proc.batch_decode(out[:, inputs["input_ids"].shape[1]:], skip_special_tokens=True)[0])
There is no chat template — the prompt is literally BOS followed by one <image> token, which the
processor expands into 32–64 placeholders depending on aspect ratio.
Results
Held-out test split of visheratin/laion-coco-nllb:
| metric | value |
|---|---|
| chrF++ | 27.4 |
| BLEU | 8.2 |
| perplexity | 12.2 |
| grounding gap | 2.09 |
| distinct captions | 98.7% |
Grounding gap is eval loss with images rotated by one position minus loss with correct pairings. Near zero would mean the model ignores the image and generates from a language prior; 2.09 says the captions are driven by pixels.
Training
Two stages on 405,526 image/caption pairs, from
oddadmix/laion-coco-nllb-arabic-filtered
(the filtered arb_Arab slice of LAION-COCO-NLLB; 753,883 rows survive filtering, of
which 405,526 images were still reachable):
- Align — projector only, 2000 updates, LR 1e-3
- Finetune — projector + language model, 8000 updates, LR 2e-4 / 5e-5
The projector's linear_1 is warm-started from LFM2.5-VL (identical 2048×3072 shape); linear_2 is
randomly initialised and then rescaled so visual tokens enter the residual stream at the same
magnitude as text tokens. Without that calibration the visual tokens were ~36× larger and alignment
stalled.
Limitations
25.3M parameters in the language model (~13M non-embedding) is far below any standard VLM backbone. It names the main subject and its colour reliably and stops cleanly, but reads text in images poorly, sometimes invents a plausible brand, and its Arabic agreement occasionally slips. The training captions are themselves doubly machine-generated (BLIP English → NLLB Arabic), which caps how much reference-based metrics mean.
The 50M variant
oddadmix/Nawah-VL-50M is the same recipe on a
larger Arabic backbone and is better on every measure taken. It is released.
| metric | this model (25M) | 50M |
|---|---|---|
| chrF++ | 27.4 | 29.0 |
| BLEU | 8.2 | 9.5 |
| perplexity | 12.2 | 8.6 |
| grounding gap | 2.09 | 2.36 |
Reproducing
Everything needed is in training/ in this repo, and the filtered corpus is published
separately. training/HOWTO.md covers the four non-obvious parts.
A 50M-backbone version is available at oddadmix/Nawah-VL-50M.
Attribution
The language model is oddadmix/Emhotob-25M-v2, trained from scratch on Arabic. The vision
tower is SigLIP2 as distributed in LiquidAI/LFM2.5-VL-450M, used unmodified and frozen; those
weights remain LiquidAI's and their licence terms apply to that component.
License
cc-by-nc-4.0, inherited from the training data — non-commercial use only.
- Downloads last month
- 34
Model tree for oddadmix/Nawah-VL-25M
Base model
oddadmix/Emhotob-25M-v2