From 1793bdfc7d8e61a67f3575b9e65f95eb221285a1 Mon Sep 17 00:00:00 2001 From: myhloli Date: Sat, 14 Jun 2025 22:20:07 +0800 Subject: [PATCH] fix: update configure_model to use environment variable for config file name --- mineru/cli/models_download.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mineru/cli/models_download.py b/mineru/cli/models_download.py index f1cd3b6b..03b4293b 100644 --- a/mineru/cli/models_download.py +++ b/mineru/cli/models_download.py @@ -43,7 +43,7 @@ def download_and_modify_json(url, local_filename, modifications): def configure_model(model_dir, model_type): """配置模型""" json_url = 'https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/mineru.template.json' - config_file_name = 'mineru.json' + config_file_name = os.getenv('MINERU_TOOLS_CONFIG_JSON', 'mineru.json') home_dir = os.path.expanduser('~') config_file = os.path.join(home_dir, config_file_name) @@ -119,13 +119,13 @@ def download_models(model_source, model_type): click.echo(f"Downloading model: {model_path}") download_finish_path = auto_download_and_get_model_root_path(model_path, repo_mode='pipeline') click.echo(f"Pipeline models downloaded successfully to: {download_finish_path}") - configure_model(download_finish_path, model_type) + configure_model(download_finish_path, "pipeline") def download_vlm_models(): """下载VLM模型""" download_finish_path = auto_download_and_get_model_root_path("/", repo_mode='vlm') click.echo(f"VLM models downloaded successfully to: {download_finish_path}") - configure_model(download_finish_path, model_type) + configure_model(download_finish_path, "vlm") try: if model_type == 'pipeline':