Image-Text-to-Text
Transformers
Safetensors
Arabic
nemotron_parse
text-generation
ocr
arabic
document-ai
conversational
custom_code
Instructions to use g3ida/absir-arabic-ocr-mini with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use g3ida/absir-arabic-ocr-mini with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="g3ida/absir-arabic-ocr-mini", trust_remote_code=True) 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("g3ida/absir-arabic-ocr-mini", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use g3ida/absir-arabic-ocr-mini with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "g3ida/absir-arabic-ocr-mini" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "g3ida/absir-arabic-ocr-mini", "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/g3ida/absir-arabic-ocr-mini
- SGLang
How to use g3ida/absir-arabic-ocr-mini 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 "g3ida/absir-arabic-ocr-mini" \ --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": "g3ida/absir-arabic-ocr-mini", "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 "g3ida/absir-arabic-ocr-mini" \ --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": "g3ida/absir-arabic-ocr-mini", "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 g3ida/absir-arabic-ocr-mini with Docker Model Runner:
docker model run hf.co/g3ida/absir-arabic-ocr-mini
Download postprocessing.py from g3ida/absir-arabic-ocr-mini: direct link, hf CLI and curl.
- Browser
- Download file 502 Bytes
-
https://huggingface.co/g3ida/absir-arabic-ocr-mini/resolve/main/postprocessing.py
- Command line
-
hf download hf://g3ida/absir-arabic-ocr-mini/postprocessing.py
-
curl -L -o postprocessing.py https://huggingface.co/g3ida/absir-arabic-ocr-mini/resolve/main/postprocessing.py
502 Bytes
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | |
| # SPDX-License-Identifier: OpenMDW-1.1 | |
| """Backwards-compatible helpers backed by the shared document renderer.""" | |
| from nemotron_parse.postprocessing import ( | |
| PostprocessOptions, | |
| clean_raw_output, | |
| extract_classes_bboxes, | |
| transform_bbox_to_original, | |
| postprocess_text, | |
| remove_nemotron_formatting, | |
| convert_mmd_to_plain_text_ours, | |
| render_markdown, | |
| postprocess_document, | |
| ) | |