{"record":{"id":"02bf71be6b0c5b3e","repo":"opendatalab/MinerU","slug":"unsupported-hybrid-effort-effort","errorCode":null,"errorMessage":"Unsupported hybrid effort: {effort}","messagePattern":"Unsupported hybrid effort: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mineru/backend/hybrid/hybrid_analyze.py","lineNumber":1035,"sourceCode":"                                hybrid_pipeline_model=hybrid_pipeline_model,\n                            )\n                        else:\n                            with predictor_execution_guard(predictor):\n                                window_model_list = predictor.batch_two_step_extract(\n                                    images=images_pil_list,\n                                    not_extract_list=not_extract_list,\n                                    image_analysis=effective_image_analysis,\n                                )\n                            window_model_list = _process_ocr_and_formulas(\n                                images_pil_list,\n                                window_model_list,\n                                inline_formula_enable,\n                                batch_ratio=batch_ratio,\n                                images_layout_res=images_layout_res,\n                                hybrid_pipeline_model=hybrid_pipeline_model,\n                            )\n                    else:\n                        raise ValueError(f\"Unsupported hybrid effort: {effort}\")\n\n                    _apply_layout_title_split(\n                        window_model_list,\n                        images_layout_res,\n                        page_sizes,\n                    )\n                    model_list.extend(window_model_list)\n                    if progress_bar is None:\n                        progress_bar = tqdm(total=page_count, desc=\"Processing pages\")\n                    else:\n                        exclude_progress_bar_idle_time(\n                            progress_bar,\n                            last_append_end_time,\n                            now=time.time(),\n                        )\n                    append_page_model_list_to_middle_json(\n                        middle_json,\n                        window_model_list,","sourceCodeStart":1017,"sourceCodeEnd":1053,"githubUrl":"https://github.com/opendatalab/MinerU/blob/4fe4bde114a23ee5dd637eae99b767f4669bf58c/mineru/backend/hybrid/hybrid_analyze.py#L1017-L1053","documentation":"A defensive guard in the synchronous hybrid analysis loop (hybrid_analyze.py:1035) reached when effort matches neither the medium nor the high branch of the effort dispatch chain. In principle _validate_parse_effort() should have rejected such values earlier, so hitting this line means validation was bypassed or the dispatch branches got out of sync with the allowed set.","triggerScenarios":"effort passing early validation but not matching any if/elif branch in the page-window loop; typically only possible with inconsistent code paths, monkeypatched validators, or an internal call that skips validation.","commonSituations":"Calling the internal analysis loop directly instead of the public API; patched/older copies of the module mixed at runtime; a new effort value added to HYBRID_ANALYZE_EFFORTS without a matching branch here.","solutions":["Use the public entry point that runs _validate_parse_effort() and pass effort=\"medium\" or \"high\".","Ensure only one mineru version is importable (pip show mineru; check for stale copies in site-packages or cwd).","If you maintain a fork adding a new effort level, add its dispatch branch alongside the raise."],"exampleFix":"# before\nmodel_list = hybrid_page_loop(windows, effort=\"ultra\")  # internal call, no validation\n\n# after\nfrom mineru.backend.hybrid.hybrid_analyze import _validate_parse_effort\neffort = _validate_parse_effort(\"high\")\nmodel_list = hybrid_page_loop(windows, effort=effort)","handlingStrategy":"validation","validationCode":"from mineru.backend.hybrid.hybrid_analyze import _validate_parse_effort\n\n# call the public API; if you must call internals, validate first:\neffort = _validate_parse_effort(request.args.get(\"effort\", \"medium\"))","typeGuard":"ALLOWED = {\"medium\", \"high\"}\n\ndef is_valid_effort(v: object) -> bool:\n    return isinstance(v, str) and v in ALLOWED","tryCatchPattern":"try:\n    model_list = hybrid_page_loop(windows, effort=effort)\nexcept ValueError as e:\n    if \"Unsupported hybrid effort\" in str(e):\n        raise ConfigError(\"hybrid effort out of range; use medium/high\") from e\n    raise","preventionTips":["Always go through the validated public entry point.","Keep a single installed mineru version per env to avoid branch/constant drift.","If forking, add tests asserting every allowed effort has a sync dispatch branch."],"tags":["hybrid","internal","defensive","effort"],"backgroundTag":null,"analyzedSha":"4fe4bde114a23ee5dd637eae99b767f4669bf58c","analyzedAt":"2026-08-14T21:29:18.456Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}