dots-mocr: skip whole batch when an image fails to decode
davanstrien+1: Claude Opus 4.7 (1M context)HF Staff
1bb77ce
Same class of bug as pp-doclayout's (15cd760) and smoldocling's (8b99222)
fixes from yesterday: the list comprehension
`[dataset[i][image_column] for i in batch_indices]` lives outside the
existing try/except, so one PIL.UnidentifiedImageError takes down the
entire run.
Hit by an overnight 5k BHL run on l4x1 — crashed at batch 150/313 (48%)
after ~10h on a corrupt JP2, no output saved.
Now wrapped in its own try/except. On a corrupt image, the whole batch
is marked `[OCR SKIPPED — UNREADABLE IMAGE]` (length-preserving so the
final add_column still aligns) and the run continues.
Smoke-tested via hf jobs uv run on a 50-image clean slice — confirmed
happy path still works end-to-end (14.2 min, dataset pushed cleanly).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
smoldocling-ocr: skip whole batch when an image fails to decode
davanstrien+1: Claude Opus 4.7 (1M context)HF Staff
8b99222
Same class of bug as pp-doclayout's earlier fix today: the list
comprehension `[dataset[i][image_column] for i in batch_indices]` lives
outside the existing try/except, so one PIL.UnidentifiedImageError
takes down the entire run.
Now wrapped in its own try/except. On a corrupt image, the whole batch
is marked `[OCR SKIPPED — UNREADABLE IMAGE]` (length-preserving so the
final add_column still aligns) and the run continues.
Coarser than per-image skip, but matches the existing batch-level
error handling and the dots-mocr.py pattern.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
pp-doclayout: skip corrupt images instead of crashing the run
davanstrien+1: Claude Opus 4.7 (1M context)HF Staff
15cd760
Previously, a single corrupt image (UnidentifiedImageError or OSError)
in the source bucket or dataset would terminate the entire run via an
unhandled exception in the gen() iterator. On a 5000-image run, hitting
a truncated/unreadable file at sample 2400 wasted ~1 hour of GPU time.
Now both iter_bucket_images() and iter_dataset_images() catch
UnidentifiedImageError and OSError per image, log a WARNING with the
path, and continue. A summary "Skipped N unreadable image(s)" is logged
when the iterator exhausts. Run completes with whatever images were
readable.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
falcon-ocr-bucket: add --max-samples with early-termination scan
davanstrien+1: Claude Opus 4.7 (1M context)HF Staff
efa4eb1
Mirrors pp-doclayout's --max-samples flag for falcon-ocr-bucket. When
set, discover_files() stops scanning once the limit is reached instead
of materializing-and-sorting the full directory tree first. Useful for
smoke tests and bounded slices on large mounted buckets.
Without --max-samples: full sorted list (deterministic, unchanged).
With --max-samples N: up to N files in filesystem-traversal order.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add pp-doclayout.py to README (layout detection, separate from OCR)
PaddleOCR PP-DocLayout-L for document layout detection (text/title/table/figure/formula/...). Supports HF dataset and HF bucket source/sink, incremental parquet shards with resumable runs (snapshot-backed), JP2 input. Verified end-to-end on L4: dataset->dataset, dataset->bucket, bucket->dataset, bucket->bucket, resume.
Add AGENTS.md for coding agent discovery
davanstrien+1: Claude Opus 4.6 (1M context)HF Staff
800963f
Agent-facing doc that points at live sources of truth (CLI --help,
hf jobs hardware, model card eval results API) rather than duplicating
info that goes stale. Covers script selection, dataset vs bucket I/O
patterns, common flags, and gotchas.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
davanstrien+1: Claude Opus 4.6 (1M context)HF Staff
2f39cf8
Layout mode is currently broken upstream so highlighting plain mode
strengths instead: smallest in collection, #1 on multi-column docs
and tables in olmOCR benchmark.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Simplify falcon-ocr.py to plain mode only, add --progress flag
davanstrien+1: Claude Opus 4.6 (1M context)HF Staff
bd12d83
Layout mode is currently broken upstream (PPDocLayoutV3ImageProcessorFast
import fails with latest transformers). Removing it for now; can re-enable
once falcon-perception updates.
Also adds --progress flag to expose the engine's per-image tqdm bar,
and replaces script-level batch tqdm with logger.info messages.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix volume mount syntax in falcon-ocr-bucket.py examples
davanstrien+1: Claude Opus 4.6 (1M context)HF Staff
0b77b50
The hf jobs CLI expects 'hf://buckets/' (plural) not 'bucket/'.
Verified working end-to-end: 376 PDF pages OCR'd in 11.9 min on L4.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add Falcon OCR bucket script for directory/volume I/O
davanstrien+1: Claude Opus 4.6 (1M context)HF Staff
d0a2ced
Companion to falcon-ocr.py (dataset mode). Reads images/PDFs from a
directory, writes markdown files preserving structure. Designed for
HF Buckets mounted as volumes via -v flag.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
davanstrien+1: Claude Opus 4.6 (1M context)HF Staff
173e9b8
New OCR script using tiiuae/Falcon-OCR with the optimized falcon-perception
inference engine (CUDA graphs + batched paged inference). Achieves 0.31 img/s
on L4, 0.53 img/s on L40S. Supports plain OCR and layout-aware extraction.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
davanstrien+1: Claude Opus 4.6 (1M context)HF Staff
dafc1a9
- dots.mocr is the official final name for what was dots.ocr-1.5
- Model now on HF directly: rednote-hilab/dots.mocr (no ModelScope mirror needed)
- Added SVG prompt mode (--prompt-mode svg) with auto temperature/top_p
- SVG-optimized variant: rednote-hilab/dots.mocr-svg
- Updated README with new model entry and detailed docs
- Tested: OCR mode 3/3 on L4, SVG mode 3/3 on L4
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix dots-ocr-1.5.py for v1.5 model + document bbox coords
davanstrien+1: Claude Opus 4.6 (1M context)HF Staff
37431e4
- Add chat_template_content_format="string" to llm.chat() (required for
dots.ocr-1.5 which uses a string-only tokenizer chat template)
- Document bbox coordinate system (Qwen2VL smart_resize) in script and CLAUDE.md
- Fix README table link to point to davanstrien/dots.ocr-1.5 mirror
- Add full dots.ocr-1.5 section to CLAUDE.md with test results and usage notes
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- New firered-ocr.py using llm.chat() pattern from dots-ocr.py
- Model: FireRedTeam/FireRed-OCR (Apache 2.0)
- Tested: 10/10 on ufo-ColPali, L4 GPU, ~4.7 min
- Stable vLLM (>=0.15.1), no nightly needed
- README: added to model table and per-model docs
Pin dots-ocr-1.5.py + ocr-vllm-judge.py to stable vLLM (>=0.15.1)
- Pin vLLM >=0.15.1 (was >=0.9.1) to match other production scripts
- Add limit_mm_per_prompt={"image": 1} to LLM init for stable batch processing
- On batch failure, retry images individually so only broken images get [OCR ERROR]
Tested: 20/20 samples clean on A100 (davanstrien/ufo-ColPali, seed 42)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CommitScheduler uploads parquet batches in background (results never
lost on crash/timeout). --resume picks up from last completed batch.
CleanupScheduler deletes local shards after upload to prevent disk fill.
Validated on full 2724-page Encyclopaedia Britannica run (~$5, 0 errors).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Restructure README: cleaner intro, TOC table, common options
- Punchier intro with model count (13 models, 0.9B-8B)
- Quick start example switched to GLM-OCR
- Added collapsible TOC table with all scripts sorted by model size
- Moved common options section up with --help tip
- Added GLM-OCR usage example (OCR, table, formula modes)
- Collapsed detailed per-model docs into expandable section
- Stripped most emoji from headings
- Fixed stale PaddleOCR SOTA claim (GLM-OCR now scores higher)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pin nanonets-ocr2.py + paddleocr-vl.py to stable vLLM (>=0.15.1)
Both use architectures in stable vLLM. Also pins datasets>=4.0.0
and drops nightly index from paddleocr-vl.py.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pin nanonets-ocr.py to stable vLLM (>=0.15.1) + datasets>=4.0.0
RolmOCR (Qwen2.5-VL fine-tune) is in stable vLLM. Note: 8B model
needs a100 or larger GPU (OOMs on L4 with default max_model_len=16384).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Rewrite evaluation prompt to prioritize faithfulness over formatting,
heavily penalizing added commentary/interpretation
- Add --save-results flag to push judge results (comparisons, leaderboard,
metadata) to HF Hub dataset repo
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Switch hunyuan-ocr.py to stable vLLM (>=0.15.1), drop nightly index
HunyuanOCR architecture is in stable vLLM. Also pins datasets>=4.0.0
and removes disable_mm_preprocessor_cache (nightly-only arg).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Switch deepseek-ocr-vllm.py to stable vLLM (>=0.15.1), drop nightly index
LightOnOCR-2 architecture is in stable vLLM since 0.15.1.
Also bumps datasets>=4.0.0 and drops pyarrow<18 pin.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pin numarkdown-ocr.py to stable vLLM (>=0.15.1) + datasets>=4.0.0
Qwen2.5-VL architecture is in stable vLLM, no nightly needed.
Pinning datasets>=4.0.0 fixes pyarrow compatibility.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix config_name=None breaking push_to_hub + use cu129 nightly index
- Replace config_name=config with conditional spread to avoid passing
None, which generates invalid YAML (config_name: null) that fails
Hub validation. Applied to all 10 scripts with --config flag.
- Switch vLLM nightly URL from /nightly to /nightly/cu129 in 6 scripts
to get x86_64 wheels (bare /nightly only has ARM wheels currently).
- Includes accumulated improvements: --verbose flag, --config/--create-pr
support, upload retry with XET fallback, inference_info fixes.
- Adds dots-ocr-1.5.py and hunyuan-ocr.py (new scripts).
Verified via HF Jobs smoke tests (7/9 config-flag scripts completed).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
DeepSeek-OCR-2 model card only documents two prompts.
Remove image/figure/describe modes carried over from v1.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Switch back to nightly vLLM, add addict + matplotlib deps
DeepSeek-OCR-2 is not in stable vLLM 0.15.1 yet (only nightly).
The nightly x86_64 builds are back (dev142). Also add addict and
matplotlib which the model's custom code requires.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use stable vLLM (>=0.15.1) instead of nightly for DeepSeek-OCR-2
DeepSeek-OCR-2 support is in stable vLLM 0.15.1 (released Feb 5, 2026).
The nightly index currently only has ARM wheels, breaking x86_64 Jobs.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add DeepSeek-OCR-2 vLLM script (rewrite from fixed v1 pattern)
Rewrites the broken draft (base64/llm.chat/resolution modes) to use the
proven v1 pattern: llm.generate() with PIL images + NGramPerReqLogitsProcessor.
Key v2 change: limit_mm_per_prompt={"image": 1} for the new architecture.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rewrote inference core to match the official vLLM DeepSeek-OCR recipe:
- llm.generate() with PIL images instead of llm.chat() with base64
- Added NGramPerReqLogitsProcessor to prevent repetition loops
- Added enable_prefix_caching=False, mm_processor_cache_gb=0
- Added skip_special_tokens=False and ngram/window sampling params
- Removed resolution modes (only apply to transformers API, not vLLM)
- Removed deprecated HF_XET_HIGH_PERFORMANCE env var
- Bumped script_version to 2.0.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update nanonets-ocr.py HF Jobs syntax and add smoke test notes
- Replace deprecated `hfjobs run` with current `hf jobs uv run` syntax
- Add OCR smoke test dataset design notes to CLAUDE.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>