You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* ocr: add unlimited-ocr-vllm.py recipe (Baidu Unlimited-OCR, 3.3B — single-image batch OCR)
Offline-vLLM batch recipe for baidu/Unlimited-OCR (3.3B, MIT, a DeepSeek-OCR
descendant; vLLM support landed upstream 2026-06-28), mirroring deepseek-ocr-vllm.py.
One image per row -> layout-grounded markdown; --strip-grounding for clean text,
--grounding-column to keep both clean text and the raw <|det|> bboxes. Runs on
Baidu's dedicated vllm/vllm-openai:unlimited-ocr image (arch not in a stable wheel;
vLLM/torch come from the image via PYTHONPATH).
Validated on HF Jobs: ufo-ColPali (5/5) and encyclopaedia-britannica-1771 (6/6
content pages ~= ground-truth ocr_text length).
Multi-page is single-image-only via vLLM (the integration garbles multi-image, and
is unproven upstream — PR vllm-project/vllm#46564 benchmarks single-page only).
Multi-page lives in the model's SGLang build: serving-unlimited-ocr.md now carries a
validated working SGLang command (pinned lmsysorg/sglang:v0.5.10.post1 + a100-large +
--attention-backend flashinfer; HF h200 nodes currently fail GPU init with CUDA
error 802) alongside the vLLM single-image serving option.
Also updates ocr/README.md (table row, serve line, modes table, dedicated-image
note) and ocr/CLAUDE.md (dev notes + full investigation). Additive only; superset
gate (tools/verify-superset.sh ocr uv-scripts/ocr) passes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* ocr: correct unlimited-ocr multi-page framing (vLLM works on clean docs)
Control test (same clean synthetic 2-page doc, vLLM server) returned both pages
<PAGE>-separated with real text — so the earlier "vLLM multi-page garbles/broken"
was an input-difficulty artifact (the hard Britannica/ufo scans), not an engine
failure. Corrected across the recipe docstring, serving-unlimited-ocr.md, README,
and CLAUDE.md: both engines read clean multi-page docs; SGLang is the *more robust*
path (held up on hard/degraded scans where vLLM hallucinated). Batch recipe stays
single-image; multi-page is a serving concern.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* ocr: address review on unlimited-ocr-vllm.py (column guard, upload retry, --model)
- guard add_column against an existing output/grounding column (fixes the
in-place multi-model append crash; parity with deepseek-ocr2-vllm.py)
- push_to_hub: 3-attempt retry + HF_HUB_DISABLE_XET fallback + max_shard_size="500MB"
- add --model flag (default baidu/Unlimited-OCR)
- CLAUDE.md: move the (Production Ready) entry to "Other OCR Scripts";
note the deferred SGLang multi-page-batch follow-up
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: ocr/README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ This will:
33
33
34
34
## Serve a model as a live endpoint
35
35
36
-
The recipes here run as batch jobs. To call a model interactively, from an agent, or with concurrent ad-hoc requests, you can instead run it as a temporary endpoint: [HF Jobs serving](https://huggingface.co/docs/hub/jobs-serving) exposes a port on a GPU Job, giving an OpenAI-compatible endpoint that runs until the job is cancelled or its `--timeout` is reached. See [serving-unlimited-ocr.md](serving-unlimited-ocr.md) for a worked example serving Baidu's [Unlimited-OCR](https://huggingface.co/baidu/Unlimited-OCR) with SGLang.
36
+
The recipes here run as batch jobs. To call a model interactively, from an agent, or with concurrent ad-hoc requests, you can instead run it as a temporary endpoint: [HF Jobs serving](https://huggingface.co/docs/hub/jobs-serving) exposes a port on a GPU Job, giving an OpenAI-compatible endpoint that runs until the job is cancelled or its `--timeout` is reached. See [serving-unlimited-ocr.md](serving-unlimited-ocr.md) for a worked example serving Baidu's [Unlimited-OCR](https://huggingface.co/baidu/Unlimited-OCR)— with vLLM (official image) or SGLang. To OCR a whole corpus of single-page images instead, the batch recipe `unlimited-ocr-vllm.py` is the better fit (it's single-image only). **Multi-page** documents need a server: both vLLM and SGLang read clean multi-page docs, but **SGLang is the more robust** — on hard/degraded scans vLLM multi-page hallucinated in our tests while SGLang held up.
|`unlimited-ocr-vllm.py`|[Unlimited-OCR](https://huggingface.co/baidu/Unlimited-OCR)| 3.3B | vLLM | DeepSeek-OCR-based; layout-grounded markdown (`--strip-grounding` for clean text). Single-image batch — needs Baidu's **dedicated `vllm/vllm-openai:unlimited-ocr` image** (`-cu129` on Hopper). Multi-page "long-horizon" parsing → serve it ([doc](serving-unlimited-ocr.md)); both engines do clean docs, **SGLang more robust** on hard scans. MIT |
|`unlimited-ocr-vllm.py`|`--strip-grounding` (drop `<\|det\|>`/`<\|ref\|>` grounding tags); needs the **`vllm/vllm-openai:unlimited-ocr`** image |
216
218
|`numarkdown-ocr.py`|`--include-thinking` (store the reasoning trace) |
217
219
|`nuextract3.py`|`--template` / `--schema` / `--enable-thinking` — see the NuExtract3 section above |
218
220
219
-
**Image-mode models** — `abot-ocr.py` and `nuextract3.py` (Qwen3.5 architecture) need the `vllm/vllm-openai` image because the default uv-script image lacks `nvcc`. Add `--image vllm/vllm-openai:latest --python /usr/bin/python3 -e PYTHONPATH=/usr/local/lib/python3.12/dist-packages` (see the NuExtract3 example above for the full command).
221
+
**Image-mode models** — `abot-ocr.py` and `nuextract3.py` (Qwen3.5 architecture) need the `vllm/vllm-openai` image because the default uv-script image lacks `nvcc`. Add `--image vllm/vllm-openai:latest --python /usr/bin/python3 -e PYTHONPATH=/usr/local/lib/python3.12/dist-packages` (see the NuExtract3 example above for the full command).`unlimited-ocr-vllm.py` is a special case — its architecture isn't in any stable vLLM wheel, so it needs Baidu's **dedicated**`vllm/vllm-openai:unlimited-ocr` image (tag `:unlimited-ocr-cu129` on Hopper), e.g. `--image vllm/vllm-openai:unlimited-ocr --python /usr/bin/python3 -e PYTHONPATH=/usr/local/lib/python3.12/dist-packages` (its docstring has the full command).
0 commit comments