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 preprocessor_config.json from g3ida/absir-arabic-ocr-mini: direct link, hf CLI and curl.
- Browser
- Download file 593 Bytes
-
https://huggingface.co/g3ida/absir-arabic-ocr-mini/resolve/main/preprocessor_config.json
- Command line
-
hf download hf://g3ida/absir-arabic-ocr-mini/preprocessor_config.json
-
curl -L -o preprocessor_config.json https://huggingface.co/g3ida/absir-arabic-ocr-mini/resolve/main/preprocessor_config.json
593 Bytes
| { | |
| "feature_extractor_type": "NemotronParseImageProcessor", | |
| "image_processor_type": "NemotronParseImageProcessor", | |
| "processor_class": "NemotronParseProcessor", | |
| "size": { | |
| "height": 2048, | |
| "width": 1664, | |
| "longest_edge": [ | |
| 2048, | |
| 1664 | |
| ] | |
| }, | |
| "final_size": [ | |
| 2048, | |
| 1664 | |
| ], | |
| "do_normalize": true, | |
| "navit_packing": true, | |
| "navit_padding_mode": "top_left_white", | |
| "navit_coordinate_frame": "content_normalized", | |
| "image_mean": [ | |
| 0.48145466, | |
| 0.4578275, | |
| 0.40821073 | |
| ], | |
| "image_std": [ | |
| 0.26862954, | |
| 0.26130258, | |
| 0.27577711 | |
| ] | |
| } |