Instructions to use SOUHAILF77/qwen35-arabic-ocr with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SOUHAILF77/qwen35-arabic-ocr with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="SOUHAILF77/qwen35-arabic-ocr") 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 AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("SOUHAILF77/qwen35-arabic-ocr") model = AutoModelForMultimodalLM.from_pretrained("SOUHAILF77/qwen35-arabic-ocr", 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SOUHAILF77/qwen35-arabic-ocr with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SOUHAILF77/qwen35-arabic-ocr" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SOUHAILF77/qwen35-arabic-ocr", "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/SOUHAILF77/qwen35-arabic-ocr
- SGLang
How to use SOUHAILF77/qwen35-arabic-ocr 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 "SOUHAILF77/qwen35-arabic-ocr" \ --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": "SOUHAILF77/qwen35-arabic-ocr", "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 "SOUHAILF77/qwen35-arabic-ocr" \ --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": "SOUHAILF77/qwen35-arabic-ocr", "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 SOUHAILF77/qwen35-arabic-ocr with Docker Model Runner:
docker model run hf.co/SOUHAILF77/qwen35-arabic-ocr
OCR arabe โ checkpoint Markdown 1442 โ fusion FP32
Modรจle complet autonome, fusionnรฉ en FP32 et publiรฉ dans ce dรฉpรดt privรฉ. Instantanรฉ du meilleur checkpoint observรฉ lors de sa sรฉlection, le 18 octobre 2026. L'entraรฎnement d'origine n'a pas รฉtรฉ arrรชtรฉ ou reconfigurรฉ pour cet export.
Checkpoint et prรฉcision
Base Qwen/Qwen3.5-9B, rรฉvision c202236235762e1c871ad0ccb60c8ee5ba337b9a. Checkpoint choisi au dรฉbut de l'opรฉration par la meilleure validation disponible : รฉtape de phase 1442, รฉtape cumulรฉe 15797, 553728 exemples de la nouvelle phase. SHA-256 : 7c760c468606721272e67b12fc75a5aced61d078634689a0b17f0c5cc7a28954. Eval loss 0,1683539901, mesurรฉe sur le suivi fixe de 256 pages (128 avec tableaux et 128 contrรดles), pondรฉrรฉe par tokens. Ce checkpoint est intermรฉdiaire ; le nouvel entraรฎnement n'est pas terminรฉ.
LoRA rank16, alpha32, 128 modules. Formule de fusion : FP32(W_base) + 2 ร FP32(B) @ FP32(A). Les poids flottants restent en FP32, sans quantification ou arrondi BF16. 38 612 417 472 octets de tenseurs dans des fichiers safetensors indexรฉs. Les quatre shards de base correspondent par SHA-256 ร la rรฉvision HF indiquรฉe. Les 775 tenseurs enregistrรฉs ont รฉtรฉ relus et comparรฉs ; 128 modules adaptรฉs. Les rรฉfรฉrences FP64 de poids ont passรฉ les contrรดles.
Sur les quatre images rรฉelles, comparaison numรฉrique de la rรฉfรฉrence LoRA FP32 et du modรจle fusionnรฉ relu : 128 tokens identiques par page, รฉcart maximal des logits 0.00058937073, accord top-1 minimal 100.000000%. Les dรฉtails sont dans evaluation-summary.json. La gรฉnรฉration BF16-base + LoRA FP32 peut diffรฉrer de la gรฉnรฉration fusionnรฉe entiรจrement FP32 : une fusion correcte n'implique pas une identitรฉ bit ร bit avec l'exรฉcution BF16 originale.
Infรฉrence
Exemple : python inference_example.py page.png --model . --output page.md Transformers 5.8.x, PyTorch, Pillow et GPU suffisamment grand requis. Charger explicitement dtype=torch.float32 ; ne pas activer autocast BF16 si l'objectif est de conserver la prรฉcision du prรฉsent modรจle. Prรฉvoir au moins 38,7 Go pour les seuls poids, plus les activations/cache. Les tests ont utilisรฉ un H200 libre sรฉparรฉ du GPU d'entraรฎnement. Les chemins PyTorch natifs sont utilisรฉs pour delta/conv/norm FP32 ; le SDPA cuDNN a รฉtรฉ dรฉsactivรฉ aprรจs un blocage de compilation NVRTC observรฉ. L'exemple configure ces choix de faรงon explicite.
Contexte d'entraรฎnement 8192, inchangรฉ. Tests avec 1463 tokens d'entrรฉe, 6000 tokens de sortie possibles (7463 au total, sous 8192). Image entiรจre, redimensionnement proportionnel ร 1344 pixels maximum, sans recadrage, sans vรฉritรฉ terrain dans la requรชte. Le plus grand contexte natif dans config.json vient de Qwen et est conservรฉ ; il n'a pas รฉtรฉ validรฉ par ces tests et ne dรฉcrit pas le contexte d'entraรฎnement.
Limites
Quatre pages illustratives : BO 5500 pages 1, 8, 22 et BO 5702 page 157. La rรฉfรฉrence non fusionnรฉe et le modรจle fusionnรฉ ont รฉtรฉ testรฉs sรฉparรฉment. Chaque arrรชt par EOS est enregistrรฉ, mais un EOS ne prouve pas l'exhaustivitรฉ. Ces essais ne constituent pas un benchmark CER/WER global. Des omissions, erreurs sur les nombres ou hallucinations de cellules restent possibles. Les tableaux Markdown ne reproduisent pas exactement les cellules fusionnรฉes. Les transcriptions brutes et les images sont livrรฉes dans le rapport sรฉparรฉ, sans correction manuelle des sorties.
Licence Apache 2.0 du modรจle de base conservรฉe dans LICENSE.
- Downloads last month
- 10