浏览代码

feat: replace print statements with logger for model download notifications

myhloli 4 月之前
父节点
当前提交
51fec09d4a
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      mineru/cli/models_download.py

+ 4 - 4
mineru/cli/models_download.py

@@ -55,7 +55,7 @@ def configure_model(model_dir, model_type):
     }
     }
 
 
     download_and_modify_json(json_url, config_file, json_mods)
     download_and_modify_json(json_url, config_file, json_mods)
-    print(f'The configuration file has been successfully configured, the path is: {config_file}')
+    logger.info(f'The configuration file has been successfully configured, the path is: {config_file}')
 
 
 
 
 def download_pipeline_models():
 def download_pipeline_models():
@@ -70,16 +70,16 @@ def download_pipeline_models():
     ]
     ]
     download_finish_path = ""
     download_finish_path = ""
     for model_path in model_paths:
     for model_path in model_paths:
-        click.echo(f"Downloading model: {model_path}")
+        logger.info(f"Downloading model: {model_path}")
         download_finish_path = auto_download_and_get_model_root_path(model_path, repo_mode='pipeline')
         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}")
+    logger.info(f"Pipeline models downloaded successfully to: {download_finish_path}")
     configure_model(download_finish_path, "pipeline")
     configure_model(download_finish_path, "pipeline")
 
 
 
 
 def download_vlm_models():
 def download_vlm_models():
     """下载VLM模型"""
     """下载VLM模型"""
     download_finish_path = auto_download_and_get_model_root_path("/", repo_mode='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}")
+    logger.info(f"VLM models downloaded successfully to: {download_finish_path}")
     configure_model(download_finish_path, "vlm")
     configure_model(download_finish_path, "vlm")