Image-Text-to-Text
Transformers
TensorBoard
Safetensors
vision-encoder-decoder
Generated from Trainer
Instructions to use Serialtechlab/dhivehi-trocr-small-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Serialtechlab/dhivehi-trocr-small-v2 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-v2")# Load model directly from transformers import AutoTokenizer, AutoModelForImageTextToText tokenizer = AutoTokenizer.from_pretrained("Serialtechlab/dhivehi-trocr-small-v2") model = AutoModelForImageTextToText.from_pretrained("Serialtechlab/dhivehi-trocr-small-v2") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Serialtechlab/dhivehi-trocr-small-v2 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-v2" # 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-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Serialtechlab/dhivehi-trocr-small-v2
- SGLang
How to use Serialtechlab/dhivehi-trocr-small-v2 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-v2" \ --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-v2", "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-v2" \ --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-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Serialtechlab/dhivehi-trocr-small-v2 with Docker Model Runner:
docker model run hf.co/Serialtechlab/dhivehi-trocr-small-v2
| library_name: transformers | |
| tags: | |
| - generated_from_trainer | |
| model-index: | |
| - name: dhivehi-trocr-small-v2 | |
| 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-v2 | |
| This model was trained from scratch on the None dataset. | |
| It achieves the following results on the evaluation set: | |
| - Loss: 0.0533 | |
| - Cer: 0.1894 | |
| ## 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: 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: 3 | |
| - mixed_precision_training: Native AMP | |
| ### Training results | |
| | Training Loss | Epoch | Step | Validation Loss | Cer | | |
| |:-------------:|:------:|:-----:|:---------------:|:------:| | |
| | 0.1992 | 0.2350 | 5000 | 0.2111 | 0.1751 | | |
| | 0.1335 | 0.4700 | 10000 | 0.1193 | 0.1761 | | |
| | 0.1055 | 0.7050 | 15000 | 0.0941 | 0.1838 | | |
| | 0.0928 | 0.9400 | 20000 | 0.0898 | 0.1903 | | |
| | 0.0806 | 1.1750 | 25000 | 0.0911 | 0.1823 | | |
| | 0.0698 | 1.4100 | 30000 | 0.0699 | 0.1954 | | |
| | 0.0666 | 1.6450 | 35000 | 0.0662 | 0.1899 | | |
| | 0.0619 | 1.8801 | 40000 | 0.0674 | 0.1960 | | |
| | 0.0577 | 2.1151 | 45000 | 0.0584 | 0.1895 | | |
| | 0.0579 | 2.3501 | 50000 | 0.0686 | 0.1932 | | |
| | 0.0515 | 2.5851 | 55000 | 0.0551 | 0.1892 | | |
| | 0.0528 | 2.8201 | 60000 | 0.0533 | 0.1894 | | |
| ### Framework versions | |
| - Transformers 5.0.0 | |
| - Pytorch 2.10.0+cu128 | |
| - Datasets 4.0.0 | |
| - Tokenizers 0.22.2 | |