Instructions to use ademax/trocr-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ademax/trocr-small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ademax/trocr-small")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("ademax/trocr-small") model = AutoModelForMultimodalLM.from_pretrained("ademax/trocr-small", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ademax/trocr-small with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ademax/trocr-small" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ademax/trocr-small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ademax/trocr-small
- SGLang
How to use ademax/trocr-small 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 "ademax/trocr-small" \ --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": "ademax/trocr-small", "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 "ademax/trocr-small" \ --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": "ademax/trocr-small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ademax/trocr-small with Docker Model Runner:
docker model run hf.co/ademax/trocr-small
Download decoder_model_quantized.onnx from ademax/trocr-small: direct link, hf CLI and curl.
- Browser
- Download file 33.1 MB
-
https://huggingface.co/ademax/trocr-small/resolve/main/decoder_model_quantized.onnx
- Command line
-
hf download hf://ademax/trocr-small/decoder_model_quantized.onnx
-
curl -L -o decoder_model_quantized.onnx https://huggingface.co/ademax/trocr-small/resolve/main/decoder_model_quantized.onnx
33.1 MB
- Xet hash:
- aca884943a42f9ca41228af462d6b8d4410fe29cef06e5037592ae2681be9ac4
- Size of remote file:
- 33.1 MB
- SHA256:
- f0e7a44280a154a988538a6e883bfc53765138fb44f826c4781dfb6b3fd3286a
·
Xet efficiently stores Large Files inside Git, intelligently splitting files into unique chunks and accelerating uploads and downloads. More info.