Image-Text-to-Text
Transformers
TensorBoard
Safetensors
vision-encoder-decoder
Generated from Trainer
Instructions to use Ransaka/sinhala-ocr-model-v3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Ransaka/sinhala-ocr-model-v3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Ransaka/sinhala-ocr-model-v3")# Load model directly from transformers import AutoTokenizer, AutoModelForImageTextToText tokenizer = AutoTokenizer.from_pretrained("Ransaka/sinhala-ocr-model-v3") model = AutoModelForImageTextToText.from_pretrained("Ransaka/sinhala-ocr-model-v3") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Ransaka/sinhala-ocr-model-v3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Ransaka/sinhala-ocr-model-v3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ransaka/sinhala-ocr-model-v3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Ransaka/sinhala-ocr-model-v3
- SGLang
How to use Ransaka/sinhala-ocr-model-v3 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 "Ransaka/sinhala-ocr-model-v3" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ransaka/sinhala-ocr-model-v3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Ransaka/sinhala-ocr-model-v3" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ransaka/sinhala-ocr-model-v3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Ransaka/sinhala-ocr-model-v3 with Docker Model Runner:
docker model run hf.co/Ransaka/sinhala-ocr-model-v3
sinhala-ocr-model-v3
This model is a fine-tuned version of Ransaka/sinhala-ocr-model on an unknown dataset. It achieves the following results on the evaluation set:
- Loss: 4.7242
- Cer: 0.2764
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: 1e-05
- train_batch_size: 8
- eval_batch_size: 8
- seed: 42
- gradient_accumulation_steps: 2
- total_train_batch_size: 16
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- training_steps: 6000
- mixed_precision_training: Native AMP
Training results
| Training Loss | Epoch | Step | Validation Loss | Cer |
|---|---|---|---|---|
| 3.6711 | 6.54 | 500 | 4.9311 | 0.4178 |
| 2.3499 | 13.07 | 1000 | 4.5366 | 0.3482 |
| 1.5601 | 19.61 | 1500 | 4.4634 | 0.3204 |
| 0.987 | 26.14 | 2000 | 4.4804 | 0.3011 |
| 0.6487 | 32.68 | 2500 | 4.6310 | 0.2863 |
| 0.3816 | 39.22 | 3000 | 4.6093 | 0.2788 |
| 0.3494 | 45.75 | 3500 | 4.6291 | 0.2827 |
| 0.2357 | 52.29 | 4000 | 4.6399 | 0.2780 |
| 0.2188 | 58.82 | 4500 | 4.6313 | 0.2798 |
| 0.1413 | 65.36 | 5000 | 4.6828 | 0.2768 |
| 0.0985 | 71.9 | 5500 | 4.7135 | 0.2772 |
| 0.1086 | 78.43 | 6000 | 4.7242 | 0.2764 |
Framework versions
- Transformers 4.35.2
- Pytorch 2.0.0
- Datasets 2.16.0
- Tokenizers 0.15.0
- Downloads last month
- 8
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support
Model tree for Ransaka/sinhala-ocr-model-v3
Base model
Ransaka/sinhala-ocr-model