Instructions to use SCreates/Modi-TrOCR-Final with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SCreates/Modi-TrOCR-Final with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="SCreates/Modi-TrOCR-Final")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("SCreates/Modi-TrOCR-Final") model = AutoModelForMultimodalLM.from_pretrained("SCreates/Modi-TrOCR-Final", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SCreates/Modi-TrOCR-Final with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SCreates/Modi-TrOCR-Final" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SCreates/Modi-TrOCR-Final", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/SCreates/Modi-TrOCR-Final
- SGLang
How to use SCreates/Modi-TrOCR-Final 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 "SCreates/Modi-TrOCR-Final" \ --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": "SCreates/Modi-TrOCR-Final", "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 "SCreates/Modi-TrOCR-Final" \ --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": "SCreates/Modi-TrOCR-Final", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use SCreates/Modi-TrOCR-Final with Docker Model Runner:
docker model run hf.co/SCreates/Modi-TrOCR-Final
Modi-TrOCR-Final
This model is a fine-tuned version of SCreates/Modi-TrOCR-Synthetic on an unknown dataset. It achieves the following results on the evaluation set:
- Loss: 1.3125
- Cer: 0.8972
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: 2e-05
- train_batch_size: 16
- eval_batch_size: 16
- 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: 15
- mixed_precision_training: Native AMP
Training results
| Training Loss | Epoch | Step | Cer | Validation Loss |
|---|---|---|---|---|
| 3.7382 | 0.8696 | 100 | 0.8934 | 1.8319 |
| 3.5762 | 1.7391 | 200 | 0.9024 | 1.7493 |
| 3.4447 | 2.6087 | 300 | 0.8939 | 1.6899 |
| 3.3490 | 3.4783 | 400 | 0.8971 | 1.6324 |
| 3.2533 | 4.3478 | 500 | 1.6137 | 0.9022 |
| 3.1613 | 5.2174 | 600 | 1.5621 | 0.9080 |
| 3.0370 | 6.0870 | 700 | 1.5066 | 0.8984 |
| 2.9625 | 6.9565 | 800 | 1.4612 | 0.9013 |
| 2.8664 | 7.8261 | 900 | 1.4233 | 0.9017 |
| 2.8030 | 8.6957 | 1000 | 1.3973 | 0.9024 |
| 2.7140 | 9.5652 | 1100 | 1.3715 | 0.8967 |
| 2.6395 | 10.4348 | 1200 | 1.3604 | 0.8968 |
| 2.5984 | 11.3043 | 1300 | 1.3392 | 0.8972 |
| 2.5495 | 12.1739 | 1400 | 1.3325 | 0.8982 |
| 2.5302 | 13.0435 | 1500 | 1.3240 | 0.8974 |
| 2.5043 | 13.9130 | 1600 | 1.3132 | 0.8972 |
| 2.4682 | 14.7826 | 1700 | 1.3125 | 0.8972 |
Framework versions
- Transformers 5.0.0
- Pytorch 2.10.0+cu128
- Datasets 4.8.3
- Tokenizers 0.22.2
- Downloads last month
- 16
Model tree for SCreates/Modi-TrOCR-Final
Base model
microsoft/trocr-base-handwritten Finetuned
SCreates/Modi-TrOCR-Synthetic