Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.
Python ai4sciencedocument-analysisdocxextract-datalayout-analysisocrparserpdfpdf-converterpdf-extractor-llmpdf-extractor-pretrainpdf-extractor-ragpdf-parserpptxpythonxlsx
feat: enhance model downloading logic to support different repository modes
myhloli9bfb3e9ec3f7
diff --git a/mineru/utils/models_download_utils.py b/mineru/utils/models_download_utils.pyindex 1b0299a1..b2c17156 100644--- a/mineru/utils/models_download_utils.py+++ b/mineru/utils/models_download_utils.py@@ -51,9 +51,17 @@ def auto_download_and_get_model_root_path(relative_path: str, repo_mode='pipelinelse:raise ValueError(f"未知的仓库类型: {model_source}")- relative_path = relative_path.strip('/')- cache_dir = snapshot_download(repo, allow_patterns=[relative_path, relative_path+"/*"])+ cache_dir = None+ if repo_mode == 'pipeline':+ relative_path = relative_path.strip('/')+ cache_dir = snapshot_download(repo, allow_patterns=[relative_path, relative_path+"/*"])+ elif repo_mode == 'vlm':+ # VLM 模式下,直接下载整个模型目录+ cache_dir = snapshot_download(repo)++ if not cache_dir:+ raise FileNotFoundError(f"Failed to download model: {relative_path} from {repo}")return cache_dir