Skip to content

fix: disable OCR in RichDocument CI test to avoid modelscope.cn download - #888

Merged
ajbozarth merged 1 commit into
generative-computing:mainfrom
ajbozarth:fix/flaky-ci-rapidocr-download
Apr 22, 2026
Merged

ajbozarth merged 1 commit into
generative-computing:mainfrom
ajbozarth:fix/flaky-ci-rapidocr-download

Conversation

@ajbozarth

@ajbozarth ajbozarth commented Apr 20, 2026 •

Copy link
Copy Markdown
Member

Misc PR

Type of PR

  • Bug Fix
  • New Feature
  • Documentation
  • Other

Description

Add a do_ocr: bool = True parameter to RichDocument.from_document_file and pass it through to PdfPipelineOptions. The test fixture for test_richdocument now passes do_ocr=False since the arxiv PDF (1906.04043) is text-based and doesn't need OCR.

This eliminates the intermittent CI failure where Docling's RapidOCR initialization tries to download model weights from modelscope.cn (a Chinese CDN that is unreliable from GitHub's US-based runners). The RichDocumentSections example subclass was also updated to match the new signature.

Testing

  • Tests added to the respective file if code was changed
  • New code has 100% coverage if code as added
  • Ensure existing tests and github automation passes (a maintainer will kick off the github automation when the rest of the PR is populated)

Attribution

  • AI coding assistants used

Add do_ocr parameter to from_document_file and set it to False in the
test fixture. The arxiv PDF is text-based so OCR is unnecessary, and
modelscope.cn (where RapidOCR downloads weights from) is unreliable
from GitHub's US-based CI runners.\n\nCloses generative-computing#634\n\nAssisted-by: Claude Code

Signed-off-by: Alex Bozarth <[email protected]>
@ajbozarth ajbozarth self-assigned this Apr 20, 2026
@github-actions github-actions Bot added the bug Something isn't working label Apr 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The PR description has been updated. Please fill out the template for your PR to be reviewed.

@ajbozarth
ajbozarth marked this pull request as ready for review April 20, 2026 20:00
@ajbozarth
ajbozarth requested a review from a team as a code owner April 20, 2026 20:00
@ajbozarth
ajbozarth requested review from markstur and nrfulton April 20, 2026 20:00
@ajbozarth

Copy link
Copy Markdown
Member Author

@jakelorocco I'm not 100% sure this is the best solution, but it removes a flaky aspect of those tests that was unnecessary. If we'd rather not make this change I'd understand and can close out the original issue as "works as intended, will not fix"

@jakelorocco jakelorocco left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems like a reasonable change; lgtm

@ajbozarth
ajbozarth added this pull request to the merge queue Apr 22, 2026
@ajbozarth
ajbozarth removed this pull request from the merge queue due to a manual request Apr 22, 2026
@ajbozarth
ajbozarth added this pull request to the merge queue Apr 22, 2026
@ajbozarth
ajbozarth removed this pull request from the merge queue due to a manual request Apr 22, 2026
@ajbozarth
ajbozarth added this pull request to the merge queue Apr 22, 2026
Merged via the queue into generative-computing:main with commit 16b27be Apr 22, 2026
10 checks passed
@ajbozarth
ajbozarth deleted the fix/flaky-ci-rapidocr-download branch April 22, 2026 16:20
akihikokuroda pushed a commit to akihikokuroda/mellea that referenced this pull request May 27, 2026
…oad (generative-computing#888)

Add do_ocr parameter to from_document_file and set it to False in the
test fixture. The arxiv PDF is text-based so OCR is unnecessary, and
modelscope.cn (where RapidOCR downloads weights from) is unreliable
from GitHub's US-based CI runners.\n\nCloses generative-computing#634\n\nAssisted-by: Claude Code

Signed-off-by: Alex Bozarth <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky CI: RapidOCR model download from modelscope.cn fails intermittently

2 participants