Instructions to use Reza2kn/surya-ocr-2-onnx-fp16-split-canary with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Reza2kn/surya-ocr-2-onnx-fp16-split-canary with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Reza2kn/surya-ocr-2-onnx-fp16-split-canary")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Reza2kn/surya-ocr-2-onnx-fp16-split-canary", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Reza2kn/surya-ocr-2-onnx-fp16-split-canary with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Reza2kn/surya-ocr-2-onnx-fp16-split-canary" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Reza2kn/surya-ocr-2-onnx-fp16-split-canary", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Reza2kn/surya-ocr-2-onnx-fp16-split-canary
- SGLang
How to use Reza2kn/surya-ocr-2-onnx-fp16-split-canary 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 "Reza2kn/surya-ocr-2-onnx-fp16-split-canary" \ --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": "Reza2kn/surya-ocr-2-onnx-fp16-split-canary", "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 "Reza2kn/surya-ocr-2-onnx-fp16-split-canary" \ --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": "Reza2kn/surya-ocr-2-onnx-fp16-split-canary", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Reza2kn/surya-ocr-2-onnx-fp16-split-canary with Docker Model Runner:
docker model run hf.co/Reza2kn/surya-ocr-2-onnx-fp16-split-canary
Surya OCR 2 ONNX FP16 Split Canary
This repository contains a converted/quantized artifact derived from datalab-to/surya-ocr-2.
What is included
- Source model:
datalab-to/surya-ocr-2 - Runtime/format: ONNX Runtime / WebGPU-oriented experimentation
- Quantization: not quantized; FP16 split vision + language last-logits ONNX canary
- Vision weights included: yes, included as
surya_vision.onnx - Created for: local OCR/document-understanding experiments and parity testing
Validation status
Export canary diff vs full PyTorch forward: max_abs_diff = 0.0 for the traced sample.
Known caveats
This is a fixed-shape split export canary, not a complete browser OCR app. The full-graph ONNX benchmark runner stalled during ORT session/generation; a split decode harness is still required.
Files
surya_vision.onnx, surya_language_last_logits.onnx, processor assets, and export_config.json.
Usage
Use the vision ONNX and language last-logits ONNX together with a custom decode loop matching export_config.json shapes.
Provenance
This artifact was generated non-destructively from the original Hugging Face checkpoint. It is not a new fine-tune.
If you need production parity, compare against the original model on your own document distribution before deployment.
Model tree for Reza2kn/surya-ocr-2-onnx-fp16-split-canary
Base model
datalab-to/surya-ocr-2