Skip to content

surya-ocr.py: cap surya-ocr below 0.24 so --task table works - #214

Merged
davanstrien merged 2 commits into
mainfrom
chore/ty-easy
Nov 26, 2026
Merged

davanstrien merged 2 commits into
mainfrom
chore/ty-easy

Conversation

@davanstrien

Copy link
Copy Markdown
Owner

ocr/surya-ocr.py --task table stopped working on 2026-11-13. This PR caps surya-ocr<0.24 to fix it.

Cause

surya 0.24.0, released 2026-11-13, removed the mode argument from TableRecPredictor.__call__. The script passes mode=table_mode, and its surya-ocr dependency was unpinned. As a result, every table batch fails with TypeError: ... unexpected keyword argument 'mode'.

The script catches the error and stores the batch as error rows. The Job therefore exits successfully and pushes a dataset that holds only [SURYA GENERATE ERROR].

0.23.0 still accepts mode, and it was the version in use at the last passing smoke test on 2026-11-06. surya-ocr-bucket.py pins 0.20.0, so it is not affected.

Smoke tests

All three ran on a10g-small with vllm/vllm-openai:v0.20.1, and each processed 3 rows:

Run Input Result
main, --task table cognaize/table-image-html-pairs (train_00005) 0/3 rows; all are error rows with the TypeError above (job)
this branch, --task table same 3/3 rows; the HTML tables match the ground-truth headers and row labels (job)
this branch, --task ocr uv-scripts/ocr-demo 3/3 rows of text, no error rows (job)

--table-mode simple and --task layout were not run.

All three runs are recorded in maintenance/verifications.jsonl, and STATUS.md is regenerated. tools/recipe-status.py --check reports 0 problems.

Not changed

A failed batch becomes an error row, and the Job still reports success. That is why this went unnoticed. Whether a recipe should exit non-zero when every row fails is a separate question, so this PR does not change it.

🤖 Generated with Claude Code

https://claude.ai/code/session_016isSPo9kUNVE79vUKWm9i7

davanstrien and others added 2 commits November 26, 2026 09:13
surya 0.24 (2026-11-13) removed the mode= argument from
TableRecPredictor.__call__. The script passes mode=table_mode, so every
table batch failed with a TypeError, was stored as an error row, and the
Job still exited 0. 0.23.0 still has mode= and was the version in use at
the last passing smoke test (2026-11-06).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016isSPo9kUNVE79vUKWm9i7
…ass with the cap

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016isSPo9kUNVE79vUKWm9i7
@davanstrien
davanstrien merged commit 75f7af8 into main Nov 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant