Instructions to use cyttic/trocr-freefonts-s42 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cyttic/trocr-freefonts-s42 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="cyttic/trocr-freefonts-s42")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("cyttic/trocr-freefonts-s42") model = AutoModelForMultimodalLM.from_pretrained("cyttic/trocr-freefonts-s42", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cyttic/trocr-freefonts-s42 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cyttic/trocr-freefonts-s42" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cyttic/trocr-freefonts-s42", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/cyttic/trocr-freefonts-s42
- SGLang
How to use cyttic/trocr-freefonts-s42 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 "cyttic/trocr-freefonts-s42" \ --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": "cyttic/trocr-freefonts-s42", "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 "cyttic/trocr-freefonts-s42" \ --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": "cyttic/trocr-freefonts-s42", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use cyttic/trocr-freefonts-s42 with Docker Model Runner:
docker model run hf.co/cyttic/trocr-freefonts-s42
trocr-freefonts-s42
This model is a fine-tuned version of cyttic/exp2-frozen-benyehuda-cont on an unknown dataset. It achieves the following results on the evaluation set:
- Loss: 0.4985
- Cer: 0.0265
- Wer: 0.0737
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: 8
- eval_batch_size: 8
- seed: 42
- gradient_accumulation_steps: 2
- total_train_batch_size: 16
- 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
- lr_scheduler_warmup_steps: 3712
- num_epochs: 3
Training results
| Training Loss | Epoch | Step | Validation Loss | Cer | Wer |
|---|---|---|---|---|---|
| 4.7562 | 0.1617 | 2000 | 2.1726 | 0.2026 | 0.4062 |
| 3.6432 | 0.3233 | 4000 | 1.6432 | 0.1259 | 0.2877 |
| 2.7686 | 0.4850 | 6000 | 1.2582 | 0.0945 | 0.2224 |
| 2.4240 | 0.6466 | 8000 | 1.0569 | 0.0731 | 0.1818 |
| 1.9056 | 0.8083 | 10000 | 0.9249 | 0.0622 | 0.1577 |
| 1.7642 | 0.9700 | 12000 | 0.8333 | 0.0554 | 0.1418 |
| 1.2725 | 1.1316 | 14000 | 0.7680 | 0.0479 | 0.1269 |
| 1.3085 | 1.2933 | 16000 | 0.7127 | 0.0441 | 0.1166 |
| 1.1557 | 1.4549 | 18000 | 0.6728 | 0.0414 | 0.1093 |
| 1.1567 | 1.6166 | 20000 | 0.6353 | 0.0385 | 0.1012 |
| 1.1508 | 1.7782 | 22000 | 0.6103 | 0.0344 | 0.0927 |
| 1.1195 | 1.9399 | 24000 | 0.5686 | 0.0311 | 0.0872 |
| 0.7635 | 2.1015 | 26000 | 0.5583 | 0.0310 | 0.0854 |
| 0.8668 | 2.2632 | 28000 | 0.5392 | 0.0298 | 0.0826 |
| 0.7609 | 2.4248 | 30000 | 0.5275 | 0.0285 | 0.0796 |
| 0.8330 | 2.5865 | 32000 | 0.5138 | 0.0276 | 0.0759 |
| 0.7614 | 2.7482 | 34000 | 0.5056 | 0.0273 | 0.0756 |
| 0.8053 | 2.9098 | 36000 | 0.5016 | 0.0266 | 0.0740 |
| 0.7447 | 3.0 | 37116 | 0.4985 | 0.0265 | 0.0737 |
Framework versions
- Transformers 5.15.0
- Pytorch 2.11.0+cu128
- Datasets 5.0.1
- Tokenizers 0.22.2
- Downloads last month
- 22
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support
Model tree for cyttic/trocr-freefonts-s42
Base model
cyttic/exp2-frozen-benyehuda-cont