Instructions to use cyttic/trocr-fonts4-BY with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cyttic/trocr-fonts4-BY with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="cyttic/trocr-fonts4-BY")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("cyttic/trocr-fonts4-BY") model = AutoModelForMultimodalLM.from_pretrained("cyttic/trocr-fonts4-BY", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cyttic/trocr-fonts4-BY with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cyttic/trocr-fonts4-BY" # 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-fonts4-BY", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/cyttic/trocr-fonts4-BY
- SGLang
How to use cyttic/trocr-fonts4-BY 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-fonts4-BY" \ --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-fonts4-BY", "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-fonts4-BY" \ --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-fonts4-BY", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use cyttic/trocr-fonts4-BY with Docker Model Runner:
docker model run hf.co/cyttic/trocr-fonts4-BY
trocr-fonts4-BY
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.5785
- Cer: 0.0288
- Wer: 0.0835
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: 4650
- num_epochs: 3
Training results
| Training Loss | Epoch | Step | Validation Loss | Cer | Wer |
|---|---|---|---|---|---|
| 3.2506 | 0.1290 | 2000 | 1.3979 | 0.1357 | 0.3218 |
| 3.0892 | 0.2581 | 4000 | 1.2984 | 0.1078 | 0.2610 |
| 2.6392 | 0.3871 | 6000 | 1.1938 | 0.0900 | 0.2314 |
| 2.4386 | 0.5161 | 8000 | 1.0925 | 0.0772 | 0.2023 |
| 2.1732 | 0.6452 | 10000 | 0.9920 | 0.0672 | 0.1819 |
| 1.8626 | 0.7742 | 12000 | 0.9253 | 0.0584 | 0.1573 |
| 1.8217 | 0.9032 | 14000 | 0.8651 | 0.0545 | 0.1497 |
| 1.5199 | 1.0323 | 16000 | 0.8429 | 0.0521 | 0.1446 |
| 1.4386 | 1.1613 | 18000 | 0.7980 | 0.0474 | 0.1337 |
| 1.3417 | 1.2903 | 20000 | 0.7651 | 0.0419 | 0.1200 |
| 1.3424 | 1.4194 | 22000 | 0.7518 | 0.0455 | 0.1255 |
| 1.1817 | 1.5484 | 24000 | 0.7200 | 0.0388 | 0.1118 |
| 1.2652 | 1.6774 | 26000 | 0.7001 | 0.0388 | 0.1119 |
| 1.2499 | 1.8065 | 28000 | 0.6671 | 0.0362 | 0.1054 |
| 1.1419 | 1.9355 | 30000 | 0.6419 | 0.0323 | 0.0955 |
| 0.9739 | 2.0645 | 32000 | 0.6341 | 0.0342 | 0.0972 |
| 0.9297 | 2.1935 | 34000 | 0.6193 | 0.0335 | 0.0958 |
| 0.8984 | 2.3226 | 36000 | 0.6189 | 0.0328 | 0.0922 |
| 0.9154 | 2.4516 | 38000 | 0.6053 | 0.0322 | 0.0914 |
| 0.8222 | 2.5806 | 40000 | 0.5969 | 0.0311 | 0.0889 |
| 0.9493 | 2.7097 | 42000 | 0.5885 | 0.0295 | 0.0857 |
| 0.9631 | 2.8387 | 44000 | 0.5804 | 0.0295 | 0.0842 |
| 0.9087 | 2.9677 | 46000 | 0.5787 | 0.0291 | 0.0843 |
| 0.8677 | 3.0 | 46500 | 0.5785 | 0.0288 | 0.0835 |
Framework versions
- Transformers 5.15.0
- Pytorch 2.11.0+cu128
- Datasets 5.0.1
- Tokenizers 0.22.2
- Downloads last month
- -
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support
Model tree for cyttic/trocr-fonts4-BY
Base model
cyttic/exp2-frozen-benyehuda-cont