Image-to-Text
Transformers
Safetensors
Arabic
lfm2_vl
image-text-to-text
arabic
vlm
image-captioning
siglip2
lfm2-vl
emhotob
Instructions to use oddadmix/Nawah-VL-50M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use oddadmix/Nawah-VL-50M 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-50M")# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("oddadmix/Nawah-VL-50M") model = AutoModelForMultimodalLM.from_pretrained("oddadmix/Nawah-VL-50M", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Link dataset and the 25M sibling
Browse files
README.md
CHANGED
|
@@ -18,7 +18,7 @@ An Arabic image-captioning VLM, assembled from existing parts rather than traine
|
|
| 18 |
|---|---|---:|---|
|
| 19 |
| Vision tower | SigLIP2 (NaFlex) from `LiquidAI/LFM2.5-VL-450M` | 85.8M | frozen |
|
| 20 |
| Connector | `Lfm2VlMultiModalProjector`, 3072→2048→512 | 7.1M | yes |
|
| 21 |
-
| Language model | `oddadmix/50M-2048-Emhotob` (Llama, hidden 512, 12 layers) | 51.8M | stage 2 |
|
| 22 |
|
| 23 |
**145M total.** Generates Modern Standard Arabic captions for a single image.
|
| 24 |
|
|
@@ -77,6 +77,15 @@ confidently wrong. The training
|
|
| 77 |
captions are themselves doubly machine-generated (BLIP English → NLLB Arabic), which caps how much
|
| 78 |
reference-based metrics mean.
|
| 79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
## Attribution
|
| 81 |
|
| 82 |
The language model is `oddadmix/50M-2048-Emhotob`, trained from scratch on Arabic. The vision
|
|
@@ -88,7 +97,7 @@ weights remain LiquidAI's and their licence terms apply to that component.
|
|
| 88 |
`cc-by-nc-4.0`, inherited from the training data — **non-commercial use only**.
|
| 89 |
|
| 90 |
|
| 91 |
-
## Compared with `oddadmix/Nawah-VL-25M`
|
| 92 |
|
| 93 |
| metric | 25M | 50M |
|
| 94 |
|---|---:|---:|
|
|
@@ -98,5 +107,10 @@ weights remain LiquidAI's and their licence terms apply to that component.
|
|
| 98 |
| grounding gap | 2.09 | **2.36** |
|
| 99 |
|
| 100 |
Same vision tower, same 405,526 pairs, same schedule -- only the language backbone differs.
|
| 101 |
-
The grounding gap rising while loss fell
|
| 102 |
-
not into memorising Arabic caption phrasing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|---|---|---:|---|
|
| 19 |
| Vision tower | SigLIP2 (NaFlex) from `LiquidAI/LFM2.5-VL-450M` | 85.8M | frozen |
|
| 20 |
| Connector | `Lfm2VlMultiModalProjector`, 3072→2048→512 | 7.1M | yes |
|
| 21 |
+
| Language model | `oddadmix/50M-2048-Emhotob` (Llama, hidden 512, 12 layers, 2048 ctx) | 51.8M | stage 2 |
|
| 22 |
|
| 23 |
**145M total.** Generates Modern Standard Arabic captions for a single image.
|
| 24 |
|
|
|
|
| 77 |
captions are themselves doubly machine-generated (BLIP English → NLLB Arabic), which caps how much
|
| 78 |
reference-based metrics mean.
|
| 79 |
|
| 80 |
+
## Reproducing
|
| 81 |
+
|
| 82 |
+
Everything needed is in `training/` in this repo. The filtered corpus is published at
|
| 83 |
+
[`oddadmix/laion-coco-nllb-arabic-filtered`](https://huggingface.co/datasets/oddadmix/laion-coco-nllb-arabic-filtered),
|
| 84 |
+
so `data_prep.py` can be skipped. `training/HOWTO.md` covers the four non-obvious parts, including
|
| 85 |
+
the projector scale calibration without which alignment stalls.
|
| 86 |
+
|
| 87 |
+
Set `ARABIC_VLM_LM=oddadmix/50M-2048-Emhotob` and run `scripts/run_training_50m.sh`.
|
| 88 |
+
|
| 89 |
## Attribution
|
| 90 |
|
| 91 |
The language model is `oddadmix/50M-2048-Emhotob`, trained from scratch on Arabic. The vision
|
|
|
|
| 97 |
`cc-by-nc-4.0`, inherited from the training data — **non-commercial use only**.
|
| 98 |
|
| 99 |
|
| 100 |
+
## Compared with [`oddadmix/Nawah-VL-25M`](https://huggingface.co/oddadmix/Nawah-VL-25M)
|
| 101 |
|
| 102 |
| metric | 25M | 50M |
|
| 103 |
|---|---:|---:|
|
|
|
|
| 107 |
| grounding gap | 2.09 | **2.36** |
|
| 108 |
|
| 109 |
Same vision tower, same 405,526 pairs, same schedule -- only the language backbone differs.
|
| 110 |
+
The grounding gap rising while loss fell is the part worth noting: the extra capacity went into
|
| 111 |
+
using the image, not into memorising Arabic caption phrasing. A larger model that had simply learned
|
| 112 |
+
the caption distribution better would show the opposite.
|
| 113 |
+
|
| 114 |
+
In practice the 50M fixes most of the 25M's Arabic agreement errors and invents far fewer details.
|
| 115 |
+
Where the 25M writes `زجاجة ماء "سوبر" مع مقبض أحمر` for a plain red bottle, this one writes
|
| 116 |
+
`زجاجة ماء حمراء مع غطاء أبيض`, which is correct on both colour and part.
|