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 encoder_model_quantized.onnx from ademax/trocr-small: direct link, hf CLI and curl.
- Browser
- Download file 23.1 MB
-
https://huggingface.co/ademax/trocr-small/resolve/main/encoder_model_quantized.onnx
- Command line
-
hf download hf://ademax/trocr-small/encoder_model_quantized.onnx
-
curl -L -o encoder_model_quantized.onnx https://huggingface.co/ademax/trocr-small/resolve/main/encoder_model_quantized.onnx
23.1 MB
- Xet hash:
- ecd30f1351911f8448c6f99d6aa3c0c2dd551d423cbfad381870ca138cb843cb
- Size of remote file:
- 23.1 MB
- SHA256:
- ab242cf46a36a9d7041559cb3ff3a0ce9f1621f9eb83ae49de558fb8e4d323a6
·
Xet efficiently stores Large Files inside Git, intelligently splitting files into unique chunks and accelerating uploads and downloads. More info.