Instructions to use cyttic/trocr-bigram5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cyttic/trocr-bigram5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="cyttic/trocr-bigram5")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("cyttic/trocr-bigram5") model = AutoModelForMultimodalLM.from_pretrained("cyttic/trocr-bigram5", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cyttic/trocr-bigram5 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cyttic/trocr-bigram5" # 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-bigram5", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/cyttic/trocr-bigram5
- SGLang
How to use cyttic/trocr-bigram5 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-bigram5" \ --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-bigram5", "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-bigram5" \ --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-bigram5", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use cyttic/trocr-bigram5 with Docker Model Runner:
docker model run hf.co/cyttic/trocr-bigram5
How to use from
SGLangUse 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-bigram5" \
--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-bigram5",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'Quick Links
trocr-bigram5
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.4484
- Cer: 0.0245
- Wer: 0.0695
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 |
|---|---|---|---|---|---|
| 5.1007 | 0.1290 | 2000 | 2.3098 | 0.2357 | 0.4602 |
| 3.7860 | 0.2581 | 4000 | 1.7228 | 0.1555 | 0.3295 |
| 2.9171 | 0.3871 | 6000 | 1.3482 | 0.1044 | 0.2393 |
| 2.3965 | 0.5161 | 8000 | 1.1463 | 0.0872 | 0.2014 |
| 2.2010 | 0.6452 | 10000 | 0.9637 | 0.0678 | 0.1679 |
| 1.9024 | 0.7742 | 12000 | 0.8735 | 0.0596 | 0.1500 |
| 1.6664 | 0.9032 | 14000 | 0.7796 | 0.0526 | 0.1344 |
| 1.3597 | 1.0323 | 16000 | 0.7268 | 0.0460 | 0.1207 |
| 1.1604 | 1.1613 | 18000 | 0.6860 | 0.0420 | 0.1127 |
| 1.2101 | 1.2903 | 20000 | 0.6513 | 0.0396 | 0.1051 |
| 1.0679 | 1.4194 | 22000 | 0.6164 | 0.0372 | 0.0994 |
| 1.0820 | 1.5484 | 24000 | 0.5783 | 0.0321 | 0.0892 |
| 1.0818 | 1.6774 | 26000 | 0.5519 | 0.0301 | 0.0856 |
| 1.0749 | 1.8065 | 28000 | 0.5298 | 0.0300 | 0.0841 |
| 0.9703 | 1.9355 | 30000 | 0.5098 | 0.0280 | 0.0792 |
| 0.7494 | 2.0645 | 32000 | 0.4943 | 0.0283 | 0.0785 |
| 0.7928 | 2.1935 | 34000 | 0.4828 | 0.0266 | 0.0742 |
| 0.6909 | 2.3226 | 36000 | 0.4806 | 0.0256 | 0.0727 |
| 0.7412 | 2.4516 | 38000 | 0.4683 | 0.0263 | 0.0726 |
| 0.7338 | 2.5806 | 40000 | 0.4625 | 0.0255 | 0.0711 |
| 0.7880 | 2.7097 | 42000 | 0.4548 | 0.0252 | 0.0700 |
| 0.7299 | 2.8387 | 44000 | 0.4489 | 0.0246 | 0.0693 |
| 0.7580 | 2.9677 | 46000 | 0.4480 | 0.0241 | 0.0689 |
| 0.7460 | 3.0 | 46500 | 0.4484 | 0.0245 | 0.0695 |
Framework versions
- Transformers 5.15.0
- Pytorch 2.11.0+cu128
- Datasets 5.0.1
- Tokenizers 0.22.2
- Downloads last month
- 37
Model tree for cyttic/trocr-bigram5
Base model
cyttic/exp2-frozen-benyehuda-cont
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-bigram5" \ --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-bigram5", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'