Image-Text-to-Text
Transformers
TensorBoard
Safetensors
vision-encoder-decoder
Generated from Trainer
Instructions to use Serialtechlab/dhivehi-trocr-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Serialtechlab/dhivehi-trocr-small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Serialtechlab/dhivehi-trocr-small")# Load model directly from transformers import AutoTokenizer, AutoModelForImageTextToText tokenizer = AutoTokenizer.from_pretrained("Serialtechlab/dhivehi-trocr-small") model = AutoModelForImageTextToText.from_pretrained("Serialtechlab/dhivehi-trocr-small") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Serialtechlab/dhivehi-trocr-small with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Serialtechlab/dhivehi-trocr-small" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Serialtechlab/dhivehi-trocr-small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Serialtechlab/dhivehi-trocr-small
- SGLang
How to use Serialtechlab/dhivehi-trocr-small 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 "Serialtechlab/dhivehi-trocr-small" \ --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": "Serialtechlab/dhivehi-trocr-small", "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 "Serialtechlab/dhivehi-trocr-small" \ --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": "Serialtechlab/dhivehi-trocr-small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Serialtechlab/dhivehi-trocr-small with Docker Model Runner:
docker model run hf.co/Serialtechlab/dhivehi-trocr-small
| library_name: transformers | |
| base_model: microsoft/trocr-small-printed | |
| tags: | |
| - generated_from_trainer | |
| model-index: | |
| - name: dhivehi-trocr-small | |
| results: [] | |
| <!-- This model card has been generated automatically according to the information the Trainer had access to. You | |
| should probably proofread and complete it, then remove this comment. --> | |
| # dhivehi-trocr-small | |
| This model is a fine-tuned version of [microsoft/trocr-small-printed](https://huggingface.co/microsoft/trocr-small-printed) on the None dataset. | |
| It achieves the following results on the evaluation set: | |
| - Loss: 0.0606 | |
| - Cer: 0.1147 | |
| ## 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: 4e-05 | |
| - train_batch_size: 32 | |
| - eval_batch_size: 32 | |
| - seed: 42 | |
| - optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments | |
| - lr_scheduler_type: linear | |
| - num_epochs: 6 | |
| - mixed_precision_training: Native AMP | |
| ### Training results | |
| | Training Loss | Epoch | Step | Cer | Validation Loss | | |
| |:-------------:|:------:|:-----:|:------:|:---------------:| | |
| | 2.0301 | 0.1337 | 1000 | 0.4438 | 1.9695 | | |
| | 1.8511 | 0.2673 | 2000 | 0.4465 | 1.7758 | | |
| | 1.7348 | 0.4010 | 3000 | 0.4479 | 1.6484 | | |
| | 1.6226 | 0.5346 | 4000 | 0.4414 | 1.5418 | | |
| | 1.5449 | 0.6683 | 5000 | 0.4396 | 1.4657 | | |
| | 1.4864 | 0.8019 | 6000 | 0.4335 | 1.3844 | | |
| | 1.3952 | 0.9356 | 7000 | 0.4282 | 1.3176 | | |
| | 1.3033 | 1.0692 | 8000 | 0.4102 | 1.1908 | | |
| | 1.1261 | 1.2029 | 9000 | 0.3844 | 1.0153 | | |
| | 0.9671 | 1.3365 | 10000 | 0.3496 | 0.9206 | | |
| | 0.8140 | 1.4702 | 11000 | 0.3190 | 0.9407 | | |
| | 0.6986 | 1.6038 | 12000 | 0.2873 | 0.6398 | | |
| | 0.6410 | 1.7375 | 13000 | 0.2570 | 0.5260 | | |
| | 0.5472 | 1.8712 | 14000 | 0.2511 | 0.7460 | | |
| | 0.4880 | 2.0048 | 15000 | 0.2288 | 0.4803 | | |
| | 0.4308 | 2.1385 | 16000 | 0.2219 | 0.5494 | | |
| | 0.4045 | 2.2721 | 17000 | 0.2115 | 0.4733 | | |
| | 0.3729 | 2.4058 | 18000 | 0.2059 | 0.4428 | | |
| | 0.3587 | 2.5394 | 19000 | 0.1910 | 0.3564 | | |
| | 0.3318 | 2.6731 | 20000 | 0.1906 | 0.4022 | | |
| | 0.3069 | 2.8067 | 21000 | 0.1927 | 0.5067 | | |
| | 0.3014 | 2.9404 | 22000 | 0.1782 | 0.3107 | | |
| | 0.3963 | 1.2283 | 23000 | 0.2111 | 0.6155 | | |
| | 0.3335 | 1.2817 | 24000 | 0.1934 | 0.3839 | | |
| | 0.3227 | 1.3351 | 25000 | 0.1777 | 0.2538 | | |
| | 0.2834 | 1.3885 | 26000 | 0.1752 | 0.2734 | | |
| | 0.2660 | 1.4419 | 27000 | 0.1617 | 0.2125 | | |
| | 0.2424 | 1.4953 | 28000 | 0.1682 | 0.2456 | | |
| | 0.1846 | 3.2041 | 30000 | 0.3984 | 0.1719 | | |
| | 0.1262 | 3.7381 | 35000 | 0.1237 | 0.1373 | | |
| | 0.0982 | 4.2721 | 40000 | 0.0775 | 0.1236 | | |
| | 0.0712 | 4.8062 | 45000 | 0.1080 | 0.1265 | | |
| | 0.0616 | 5.3402 | 50000 | 0.0868 | 0.1191 | | |
| | 0.0527 | 5.8742 | 55000 | 0.0606 | 0.1147 | | |
| ### Framework versions | |
| - Transformers 5.0.0 | |
| - Pytorch 2.10.0+cu128 | |
| - Datasets 4.0.0 | |
| - Tokenizers 0.22.2 | |