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
{{ message }}
Repository navigation
Flaky CI: RapidOCR model download from modelscope.cn fails intermittently #634
I ran into some flack CI tests and had Claude do some investigating and share potential solutions. I opened this since I was unsure which fix to apply and as it's just flaky it's low priority.
test_richdocument tests fail intermittently in CI with a 502 Bad Gateway from modelscope.cn when RapidOCR tries to download OCR model weights during Docling's PDF pipeline initialization.
This is flaky because:
CI runners start fresh, so models aren't cached
modelscope.cn (hosted in China) is unreliable from GitHub's US-based runners
Locally the models are cached in .venv/lib/.../rapidocr/models/ after the first run, so this never reproduces
The test fixture (test/stdlib/components/docs/test_richdocument.py) fetches a PDF from arxiv and processes it through Docling, which initializes RapidOCR → triggers model download → hits modelscope.cn → 502.
Suggested Fix
Disable OCR in the Docling converter for this test. The arxiv PDF (1906.04043) is text-based and doesn't need OCR. This avoids RapidOCR initialization entirely, eliminating the modelscope.cn dependency without changing what the test validates.
This would require threading an OCR-disable option through RichDocument.from_document_file or configuring the DocumentConverter directly in the test fixture.
Alternatives Considered
Pre-download models in CI: Adds CI complexity, still depends on modelscope.cn (just moves the failure point)
Skip on network failure: Masks real regressions when tests silently skip
Local test PDF / pre-converted JSON: Licensing concerns with bundling the paper; pre-converted JSON skips testing from_document_file
Checked current main (2026-04-20) — this is still not fixed.
mellea/stdlib/components/docs/richdocument.py still creates PdfPipelineOptions(images_scale=2.0, generate_picture_images=True) without disabling OCR, and the test fixture still fetches the arxiv PDF through the full pipeline with no override. No commits have touched OCR settings since this was filed.
The suggested fix (pass do_ocr=False to PdfPipelineOptions in from_document_file) still needs to be applied.
Activity
planetf1 commentedon Mar 17, 2026
Agree with need for this. I've seen this failing intermittently - either network connectivity or site outage.
ajbozarth commentedon Apr 20, 2026
Updated status from Claude:
Checked current
main(2026-04-20) — this is still not fixed.mellea/stdlib/components/docs/richdocument.pystill createsPdfPipelineOptions(images_scale=2.0, generate_picture_images=True)without disabling OCR, and the test fixture still fetches the arxiv PDF through the full pipeline with no override. No commits have touched OCR settings since this was filed.The suggested fix (pass
do_ocr=FalsetoPdfPipelineOptionsinfrom_document_file) still needs to be applied.fix: disable OCR in RichDocument CI test to avoid modelscope.cn downl…
fix: disable OCR in RichDocument CI test to avoid modelscope.cn downl…