Image-Text-to-Text
Transformers
Safetensors
Arabic
English
arabic
vision
image-captioning
image-understanding
siglip2
jais
Run this model with HF Jobs
Run dhadlab/dhad-vision on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/dhadlab/dhad-vision. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/dhadlab/dhad-vision on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/dhadlab/dhad-vision. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/dhadlab/dhad-vision. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use dhadlab/dhad-vision with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dhadlab/dhad-vision with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="dhadlab/dhad-vision")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("dhadlab/dhad-vision", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use dhadlab/dhad-vision with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dhadlab/dhad-vision" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dhadlab/dhad-vision", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/dhadlab/dhad-vision
- SGLang
How to use dhadlab/dhad-vision with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "dhadlab/dhad-vision" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dhadlab/dhad-vision", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "dhadlab/dhad-vision" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dhadlab/dhad-vision", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use dhadlab/dhad-vision with Docker Model Runner:
docker model run hf.co/dhadlab/dhad-vision
model card: focus on this model
Browse files14 unmodified lines1516171819202122232425262728293031323334353637383940414243441 unmodified line46474849505152535410 unmodified lines6566676869707111 unmodified lines838485868788899030 unmodified lines1211221231241251261271281291303 unmodified lines13413513613713813914012 unmodified lines1531541551561571581591604 unmodified lines16516616716816917017117217314 unmodified lines- image-understanding- siglip2- jais- dhad---# dhad-1-vision-preview (رؤية)**Preview** image-understanding connector for **Dhad** (ضاد), an Arabic assistant. It gives a*frozen* Jais-3-0.9B language model image input: a frozen SigLIP2 encoder turns the image into576 patch features, a small trained **connector** maps them to 144 soft tokens (64 in low-tokenmode), and the tokens are spliced into the trunk's input embeddings through two learned markervectors.This is a **preview**: only **stage 1** (the connector) was finished. It answers withcaption-style text and was not passed through the formal release gate. Stage 2 (a vision LoRAexpert that answers free-form questions about the image) is included as an **unfinished** extra(stopped at step 675 of 1,435).- Part of release **`dhad-1`** · public name **`dhad-1-vision-preview`** · Arabic **رؤية**- Family / org: **Dhad / `dhadlab`**## What is in this repository| File | What ||---|---|| `connector.pt` | **The model.** A `torch.save` dict with `connector` (7,080,961 params) and `markers` (2 × 1536 = 3,072 params). Stage-1 released weights. || `MANIFEST.json` | Provenance: sources, sha256, parameter counts, training recipe, gate notes. || `requirements.txt` | Runtime Python packages. || `LICENSE` | Apache License 2.0 text. |1 unmodified line| `code/graft.py` | Splices the soft tokens into the frozen Jais trunk (`inputs_embeds`) and generates. || `code/infer.py` | `describe(image, prompt)` helper + CLI. || `code/encoder.py` | Runs the frozen SigLIP2 encoder on raw images → `[576, 768]` features. || `stage2-step675/` | **UNFINISHED** stage-2 snapshot: its own `connector.pt` + `vision_lora/` (rank-32 LoRA, 27,983,872 params). See `stage2-step675/UNFINISHED.md`. |The **base models are not re-uploaded**: load `inception42/Jais-3-0.9B` (Apache-2.0) and`google/siglip2-base-patch16-naflex` (Apache-2.0) yourself.## Parameter count10 unmodified lines- **Data:** 29,800 train + 200 held-out pairs of (image, Arabic caption) from`FreedomIntelligence/ALLaVA-4V` images with `FreedomIntelligence/ALLaVA-4V-Arabic` captions(machine translation of GPT-4V captions). Captions trimmed to their first 1–2 sentences.See `MANIFEST.json` and the training data notes below.- **Recipe:** cosine LR 1e-3, 64 samples/step, 2 epochs (930 steps), bf16, gradientcheckpointing, 30 % of steps in 64-token mode.- **Probe at step 930:** caption loss on the true image 2.4456 vs shuffled image 3.007111 unmodified linescd dhad-1-vision-preview-1.2b```Or download it from the **Files** tab of this page. (The code also lives athttps://github.com/dhadlab/dhad-vision.)### 2. Install30 unmodified lines(64-token mode), `CONNECTOR=<dir>`, `JAIS_PATH` / `SIGLIP2_PATH` (local base-model copies).Expect caption-style output, not chat: this model **describes** an image; it does not reliablyanswer questions about it (that was stage 2).To use the **unfinished** stage-2 snapshot, point the stage-2 loader at `stage2-step675/` (itneeds the PeftModel of the text experts); expect degraded, ungated answers.## Intended use and limits3 unmodified linescaptions themselves are GPT-4V output, not native ground truth.- No safety/NSFW filtering was applied to training images.- Stage 1 is a captioner; free-form image Q&A and image-follow-up turns belong to the unfinishedstage 2 and are not supported by the released weights.## Licence and data provenance12 unmodified lines- Training images/captions: `FreedomIntelligence/ALLaVA-4V` (CC-BY-NC-4.0 card) and`FreedomIntelligence/ALLaVA-4V-Arabic` (Apache-2.0 card, derived from the GPT-4V captions).See `NOTICE.md` for the full third-party list. This is not legal advice; the licence reading isdocumented in the project's licence audit.## Files and checksums4 unmodified lines```bibtex@misc{dhad1visionpreview,title = {dhad-1-vision-preview: an Arabic image-captioning connector for Dhad},author = {Dhad},year = {2026},note = {Preview release, part of dhad-1. https://huggingface.co/dhadlab/dhad-vision}}```14 unmodified lines1516171819202122232425262728293031323334353637383940411 unmodified line43444546474849505110 unmodified lines6263646566676811 unmodified lines8081828384858630 unmodified lines1171181191201211221233 unmodified lines12712812913013113213312 unmodified lines1461471481491501511524 unmodified lines15715815916016116216316416514 unmodified lines- image-understanding- siglip2- jais---# dhad-1-vision-preview (رؤية)An **Arabic image-captioning model**: give it a picture, it writes a short Arabic description.A frozen SigLIP2 vision encoder turns the image into 576 patch features; a small trained**connector** maps them to 144 soft tokens (64 in low-token mode); the tokens are spliced into afrozen Jais-3-0.9B language model through two learned marker vectors, and the model writes thecaption.**Preview.** Only stage 1 (the connector) was finished. Its output is caption-style text and itdid not go through a formal release gate. An unfinished stage-2 snapshot (a vision LoRA thatanswers free-form questions about an image, stopped at step 675 of 1,435) is included as anextra, clearly labelled `UNFINISHED`.## What is in this repository| File | What ||---|---|| `connector.pt` | **The model.** A `torch.save` dict with `connector` (7,080,961 params) and `markers` (2 × 1536 = 3,072 params). || `MANIFEST.json` | Provenance: sources, sha256, parameter counts, training recipe, gate notes. || `requirements.txt` | Runtime Python packages. || `LICENSE` | Apache License 2.0 text. |1 unmodified line| `code/graft.py` | Splices the soft tokens into the frozen Jais trunk (`inputs_embeds`) and generates. || `code/infer.py` | `describe(image, prompt)` helper + CLI. || `code/encoder.py` | Runs the frozen SigLIP2 encoder on raw images → `[576, 768]` features. || `stage2-step675/` | UNFINISHED stage-2 snapshot: its own `connector.pt` + `vision_lora/` (rank-32 LoRA, 27,983,872 params). See `stage2-step675/UNFINISHED.md`. |The base models are not re-uploaded: load `inception42/Jais-3-0.9B` (Apache-2.0) and`google/siglip2-base-patch16-naflex` (Apache-2.0) yourself.## Parameter count10 unmodified lines- **Data:** 29,800 train + 200 held-out pairs of (image, Arabic caption) from`FreedomIntelligence/ALLaVA-4V` images with `FreedomIntelligence/ALLaVA-4V-Arabic` captions(machine translation of GPT-4V captions). Captions trimmed to their first 1–2 sentences.See `MANIFEST.json`.- **Recipe:** cosine LR 1e-3, 64 samples/step, 2 epochs (930 steps), bf16, gradientcheckpointing, 30 % of steps in 64-token mode.- **Probe at step 930:** caption loss on the true image 2.4456 vs shuffled image 3.007111 unmodified linescd dhad-1-vision-preview-1.2b```Or download it from the **Files** tab of this page.### 2. Install30 unmodified lines(64-token mode), `CONNECTOR=<dir>`, `JAIS_PATH` / `SIGLIP2_PATH` (local base-model copies).Expect caption-style output, not chat: this model **describes** an image; it does not reliablyanswer questions about it (that was the unfinished stage 2).## Intended use and limits3 unmodified linescaptions themselves are GPT-4V output, not native ground truth.- No safety/NSFW filtering was applied to training images.- Stage 1 is a captioner; free-form image Q&A and image-follow-up turns belong to the unfinishedstage-2 snapshot and are not supported by the released weights.## Licence and data provenance12 unmodified lines- Training images/captions: `FreedomIntelligence/ALLaVA-4V` (CC-BY-NC-4.0 card) and`FreedomIntelligence/ALLaVA-4V-Arabic` (Apache-2.0 card, derived from the GPT-4V captions).See `NOTICE.md` for the full third-party list.## Files and checksums4 unmodified lines```bibtex@misc{dhad1visionpreview,title = {dhad-1-vision-preview: an Arabic image-captioning connector},author = {Dhad},year = {2026},note = {Preview release, stage 1 only. https://huggingface.co/dhadlab/dhad-vision}}```
README.md+19-27