Skip to content

Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.

refactor: add environment variable check to control pipeline enablement in OCR processing

myhloli6cecafd99d85
diff --git a/mineru/backend/hybrid/hybrid_analyze.py b/mineru/backend/hybrid/hybrid_analyze.py
index cea5b188..8f690e55 100644
--- a/mineru/backend/hybrid/hybrid_analyze.py
+++ b/mineru/backend/hybrid/hybrid_analyze.py
@@ -388,7 +388,8 @@ def doc_analyze(
_ocr_enable = ocr_classify(pdf_bytes, parse_method=parse_method)
_vlm_ocr_enable = False
- if _ocr_enable and language in ["ch", "en"] and inline_formula_enable:
+ _force_pipeline_enable = os.getenv("MINERU_HYBRID_FORCE_PIPELINE_ENABLE", "0").lower() in ("1", "true", "yes")
+ if _ocr_enable and language in ["ch", "en"] and inline_formula_enable and not _force_pipeline_enable:
_vlm_ocr_enable = True
results = predictor.batch_two_step_extract(images=images_pil_list)
else: