Instructions to use mustaphaelkady/arabic-historical-ocr-1.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use mustaphaelkady/arabic-historical-ocr-1.0 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-VL-3B-Instruct") model = PeftModel.from_pretrained(base_model, "mustaphaelkady/arabic-historical-ocr-1.0") - Transformers
How to use mustaphaelkady/arabic-historical-ocr-1.0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mustaphaelkady/arabic-historical-ocr-1.0") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mustaphaelkady/arabic-historical-ocr-1.0", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mustaphaelkady/arabic-historical-ocr-1.0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mustaphaelkady/arabic-historical-ocr-1.0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mustaphaelkady/arabic-historical-ocr-1.0", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mustaphaelkady/arabic-historical-ocr-1.0
- SGLang
How to use mustaphaelkady/arabic-historical-ocr-1.0 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 "mustaphaelkady/arabic-historical-ocr-1.0" \ --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": "mustaphaelkady/arabic-historical-ocr-1.0", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "mustaphaelkady/arabic-historical-ocr-1.0" \ --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": "mustaphaelkady/arabic-historical-ocr-1.0", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use mustaphaelkady/arabic-historical-ocr-1.0 with Docker Model Runner:
docker model run hf.co/mustaphaelkady/arabic-historical-ocr-1.0
arabic-historical-ocr-1.0
This model is a fine-tuned version of Qwen/Qwen2.5-VL-3B-Instruct on the arabhist_ocr_train_v1 dataset. It achieves the following results on the evaluation set:
- Loss: 1.4923
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 5e-05
- train_batch_size: 1
- eval_batch_size: 1
- seed: 42
- distributed_type: multi-GPU
- num_devices: 2
- gradient_accumulation_steps: 4
- total_train_batch_size: 8
- total_eval_batch_size: 2
- optimizer: Use OptimizerNames.ADAMW_8BIT with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: cosine
- lr_scheduler_warmup_steps: 0.05
- num_epochs: 10.0
- mixed_precision_training: Native AMP
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 2.3714 | 0.2535 | 50 | 1.8164 |
| 2.2474 | 0.5070 | 100 | 1.8791 |
| 2.0310 | 0.7605 | 150 | 1.7697 |
| 1.7838 | 1.0101 | 200 | 1.7236 |
| 1.6217 | 1.2636 | 250 | 1.6629 |
| 1.5266 | 1.5171 | 300 | 1.6241 |
| 1.4800 | 1.7706 | 350 | 1.5940 |
| 1.4212 | 2.0203 | 400 | 1.5697 |
| 1.2989 | 2.2738 | 450 | 1.5681 |
| 1.2542 | 2.5272 | 500 | 1.5486 |
| 1.1763 | 2.7807 | 550 | 1.5173 |
| 1.1718 | 3.0304 | 600 | 1.5278 |
| 1.0947 | 3.2839 | 650 | 1.5202 |
| 1.0830 | 3.5374 | 700 | 1.5131 |
| 1.0671 | 3.7909 | 750 | 1.4961 |
| 1.0030 | 4.0406 | 800 | 1.5113 |
| 0.9156 | 4.2940 | 850 | 1.5067 |
| 0.9285 | 4.5475 | 900 | 1.4923 |
| 0.9160 | 4.8010 | 950 | 1.4996 |
| 0.8849 | 5.0507 | 1000 | 1.5226 |
| 0.8052 | 5.3042 | 1050 | 1.5199 |
| 0.8333 | 5.5577 | 1100 | 1.5141 |
| 0.8189 | 5.8112 | 1150 | 1.5036 |
| 0.7346 | 6.0608 | 1200 | 1.5354 |
| 0.7169 | 6.3143 | 1250 | 1.5426 |
| 0.6911 | 6.5678 | 1300 | 1.5454 |
| 0.7211 | 6.8213 | 1350 | 1.5392 |
| 0.6831 | 7.0710 | 1400 | 1.5729 |
| 0.6381 | 7.3245 | 1450 | 1.5762 |
| 0.6018 | 7.5779 | 1500 | 1.5727 |
| 0.6316 | 7.8314 | 1550 | 1.5750 |
| 0.6091 | 8.0811 | 1600 | 1.6014 |
| 0.5753 | 8.3346 | 1650 | 1.6046 |
| 0.5923 | 8.5881 | 1700 | 1.6060 |
| 0.6013 | 8.8416 | 1750 | 1.6076 |
| 0.5749 | 9.0913 | 1800 | 1.6127 |
| 0.5576 | 9.3447 | 1850 | 1.6180 |
| 0.5575 | 9.5982 | 1900 | 1.6191 |
| 0.5533 | 9.8517 | 1950 | 1.6190 |
| 0.5809 | 10.0 | 1980 | 1.6190 |
Framework versions
- PEFT 0.18.1
- Transformers 5.8.0
- Pytorch 2.8.0+cu128
- Datasets 4.0.0
- Tokenizers 0.22.2
- Downloads last month
- 437
Model tree for mustaphaelkady/arabic-historical-ocr-1.0
Base model
Qwen/Qwen2.5-VL-3B-Instruct