This repository contains a production-oriented ONNX export/bundle for GLM-OCR with static graph wiring and quantization-aware layout for edge/browser deployment workflows.
Please cite and credit the original GLM-OCR authors for model architecture, training, and benchmark claims.
The bundle is organized so quantized assets are clearly separated from fp16 assets.
1python run_onnx_static.py \
2 --artifact_dir . \
3 --image ./examples/source/page.png \
4 --task document \
5 --device cuda \
6 --cuda_no_fallback \
7 --official_quality \
8 --vision_policy table_quant \
9 --out_text ./pred.md
1import * as ort from "onnxruntime-web";
2
3const manifest = await fetch("manifest.web.json").then((r) => r.json());
4const visionPath = manifest.graphs.vision; // or manifest.graphs.vision_quant
5const session = await ort.InferenceSession.create(visionPath, {
6 executionProviders: ["webgpu"], // fallback to "wasm" when needed
7});
This deployment artifact follows the upstream GLM-OCR license metadata (
MIT at time of packaging).
Always verify upstream license/terms at:
https://huggingface.co/zai-org/GLM-OCR