Instructions to use Alsamir/Abjad-checkpoint-9750 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Alsamir/Abjad-checkpoint-9750 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Alsamir/Abjad-checkpoint-9750") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Alsamir/Abjad-checkpoint-9750") model = AutoModelForMultimodalLM.from_pretrained("Alsamir/Abjad-checkpoint-9750", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Alsamir/Abjad-checkpoint-9750 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Alsamir/Abjad-checkpoint-9750" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Alsamir/Abjad-checkpoint-9750", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/Alsamir/Abjad-checkpoint-9750
- SGLang
How to use Alsamir/Abjad-checkpoint-9750 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 "Alsamir/Abjad-checkpoint-9750" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Alsamir/Abjad-checkpoint-9750", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "Alsamir/Abjad-checkpoint-9750" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Alsamir/Abjad-checkpoint-9750", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use Alsamir/Abjad-checkpoint-9750 with Docker Model Runner:
docker model run hf.co/Alsamir/Abjad-checkpoint-9750
Abjad — checkpoint 9750
Standalone BF16 Transformers export of Qwen/Qwen3-VL-4B-Instruct with the Abjad stage-2 LoRA checkpoint-9750 merged into its weights. No separate adapter is required. This uses Transformers rather than the older MLX release format.
Training status
This checkpoint stores step 9,750 of 11,000 planned steps. Training was interrupted; this is not a completed 11,000-step run. No verified total of unique training images or accuracy score is claimed. Earlier-stage lineage has not been independently audited.
Pre-merge and post-merge outputs matched on one dataset image. This checks export behavior only, not OCR accuracy. The image may have been used for training. Repetition, omissions, incorrect letters/digits, and layout errors remain possible. Review output against the source, especially names and numbers.
Usage
Install PyTorch, Accelerate, Pillow, and a Transformers version supporting Qwen3-VL. Exact export versions are recorded in release_manifest.json.
import torch
from PIL import Image
from transformers import AutoProcessor, AutoModelForImageTextToText
repo = "Alsamir/Abjad-checkpoint-9750"
processor = AutoProcessor.from_pretrained(repo)
model = AutoModelForImageTextToText.from_pretrained(repo, dtype=torch.bfloat16, device_map="auto").eval()
image = Image.open("page.png").convert("RGB")
messages = [{"role":"user", "content":[{"type":"image"}, {"type":"text", "text":"Transcribe all visible Arabic text exactly. Preserve Arabic letters and digits. Return only the transcription."}]}]
prompt = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = processor(text=[prompt], images=[image], return_tensors="pt").to(model.device)
with torch.inference_mode():
result = model.generate(**inputs, max_new_tokens=2048, do_sample=False)
print(processor.batch_decode(result[:, inputs["input_ids"].shape[1]:], skip_special_tokens=True)[0])
Convert PDF pages to images before inference. Long pages may hit the token limit. Word conversion and exact layout reconstruction need a separate document pipeline. Use hardware supporting the selected dtype; CPU inference may be slow.
Contents and provenance
Includes full model shards, tokenizer, processor, configuration and a checksum/provenance manifest. Training documents, optimizer state, credentials and machine-specific paths are excluded. The original checkpoint is retained separately. The base model is licensed under Apache 2.0. No dataset is redistributed.
Windows and OCI
The published repository is a standalone Transformers model. It contains no adapter and no machine-specific paths. Windows users can run it with NVIDIA CUDA, Python 3.10 or 3.11, and a CUDA-enabled PyTorch build. OCI users can use the same files in a CUDA Linux image. A GPU with enough VRAM for the BF16 model is recommended.
py -3.11 -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
# Install the CUDA-enabled PyTorch wheel matching your driver from pytorch.org
pip install -r requirements-windows.txt
python run_ocr_windows.py page.png --output result.txt
The runner selects CUDA when available and falls back to CPU. Rasterize PDFs into PNG or TIFF pages first. Long pages may require cropping. Review names, numbers, tables, stamps, and signatures against the source document.
- Downloads last month
- 17
Model tree for Alsamir/Abjad-checkpoint-9750
Base model
Qwen/Qwen3-VL-4B-Instruct