Views
No views yet
uv sync1uv run python test_inference.py \
2 --model . \
3 --image assets/Unlimited-OCR.png \
4 --prompt '<image>document parsing.'1uv run --with onnx --with onnxscript python scripts/export_onnx.py \
2 --model . \
3 --image-sequence-length 512 \
4 --output onnx/unlimited_ocr.onnxgenerate() loop or PIL preprocessing from model.infer().
ONNX export uses float16 on CUDA and float32 on CPU when --dtype auto is
used. bfloat16 exports are not compatible with ONNX Runtime for this graph's
convolution nodes.
The image ONNX graph is fixed-length because the model's MoE routing is
data-dependent. Increase --image-sequence-length if prompt tokens plus
generated tokens exceed the default capacity.
The exporter traces with padded attention-mask slots; re-export old ONNX files
if inference returns no visible text.
ONNX export uses a dense tensor-only MoE route for correctness, so it can be
slower than the PyTorch expert-dispatch path.1uv run --with onnx --with onnxscript python scripts/export_onnx.py \
2 --target text \
3 --dynamic-text \
4 --output onnx/unlimited_ocr_text.onnx1uv run --with onnxruntime python scripts/inference_onnx.py \
2 --onnx onnx/unlimited_ocr.onnx \
3 --model . \
4 --image assets/Unlimited-OCR.png \
5 --prompt '<image>document parsing.'float16 ONNX graph, run inference with onnxruntime-gpu so
CUDAExecutionProvider is available.onnx/ and are ignored by git.