Instructions to use cyttic/trocr-noise-bigram2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cyttic/trocr-noise-bigram2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="cyttic/trocr-noise-bigram2")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("cyttic/trocr-noise-bigram2") model = AutoModelForMultimodalLM.from_pretrained("cyttic/trocr-noise-bigram2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cyttic/trocr-noise-bigram2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cyttic/trocr-noise-bigram2" # 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-noise-bigram2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/cyttic/trocr-noise-bigram2
- SGLang
How to use cyttic/trocr-noise-bigram2 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-noise-bigram2" \ --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-noise-bigram2", "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-noise-bigram2" \ --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-noise-bigram2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use cyttic/trocr-noise-bigram2 with Docker Model Runner:
docker model run hf.co/cyttic/trocr-noise-bigram2
| library_name: transformers | |
| base_model: cyttic/exp2-frozen-benyehuda-cont | |
| tags: | |
| - generated_from_trainer | |
| metrics: | |
| - wer | |
| model-index: | |
| - name: trocr-noise-bigram2 | |
| 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. --> | |
| # trocr-noise-bigram2 | |
| This model is a fine-tuned version of [cyttic/exp2-frozen-benyehuda-cont](https://huggingface.co/cyttic/exp2-frozen-benyehuda-cont) on an unknown dataset. | |
| It achieves the following results on the evaluation set: | |
| - Loss: 0.5353 | |
| - Cer: 0.0311 | |
| - Wer: 0.0865 | |
| ## 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: 0.1 | |
| - num_epochs: 2 | |
| ### Training results | |
| | Training Loss | Epoch | Step | Validation Loss | Cer | Wer | | |
| |:-------------:|:------:|:-----:|:---------------:|:------:|:------:| | |
| | 4.4701 | 0.1290 | 2000 | 2.0749 | 0.1892 | 0.3917 | | |
| | 3.4282 | 0.2581 | 4000 | 1.5678 | 0.1288 | 0.2889 | | |
| | 2.6796 | 0.3871 | 6000 | 1.2115 | 0.0937 | 0.2210 | | |
| | 2.3398 | 0.5161 | 8000 | 1.0724 | 0.0778 | 0.1845 | | |
| | 1.9402 | 0.6452 | 10000 | 0.9204 | 0.0661 | 0.1640 | | |
| | 1.8243 | 0.7742 | 12000 | 0.8303 | 0.0570 | 0.1429 | | |
| | 1.6875 | 0.9032 | 14000 | 0.7434 | 0.0509 | 0.1294 | | |
| | 1.2807 | 1.0323 | 16000 | 0.6928 | 0.0457 | 0.1188 | | |
| | 1.2310 | 1.1613 | 18000 | 0.6552 | 0.0419 | 0.1105 | | |
| | 1.1186 | 1.2903 | 20000 | 0.6258 | 0.0380 | 0.1035 | | |
| | 1.0514 | 1.4194 | 22000 | 0.6097 | 0.0380 | 0.1000 | | |
| | 1.1760 | 1.5484 | 24000 | 0.5739 | 0.0346 | 0.0934 | | |
| | 1.0901 | 1.6774 | 26000 | 0.5598 | 0.0339 | 0.0922 | | |
| | 1.0063 | 1.8065 | 28000 | 0.5434 | 0.0328 | 0.0888 | | |
| | 0.9992 | 1.9355 | 30000 | 0.5368 | 0.0309 | 0.0861 | | |
| | 1.0274 | 2.0 | 31000 | 0.5353 | 0.0311 | 0.0865 | | |
| ### Framework versions | |
| - Transformers 5.9.0 | |
| - Pytorch 2.11.0+cu128 | |
| - Datasets 5.0.1 | |
| - Tokenizers 0.22.2 | |