From a112b6e092525e095b666f054b58c2ef1be24be1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AD=B1=E6=96=87?= Date: Mon, 4 Nov 2024 19:27:55 +0800 Subject: [PATCH] Remove duplicate logger from PaiPDFReader --- src/pai_rag/integrations/readers/pai_pdf_reader.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/pai_rag/integrations/readers/pai_pdf_reader.py b/src/pai_rag/integrations/readers/pai_pdf_reader.py index 20fc1262..85136735 100644 --- a/src/pai_rag/integrations/readers/pai_pdf_reader.py +++ b/src/pai_rag/integrations/readers/pai_pdf_reader.py @@ -298,7 +298,7 @@ def parse_pdf( elif parse_method == "ocr": pipe = OCRPipe(pdf_bytes, model_json, image_writer) else: - logger("unknown parse method, only auto, ocr, txt allowed") + logger.error("unknown parse method, only auto, ocr, txt allowed") exit(1) # 执行分类 @@ -309,12 +309,9 @@ def parse_pdf( if model_config.__use_inside_model__: pipe.pipe_analyze() # 解析 else: - logger("need model list input") + logger.error("need model list input") exit(1) - # Some dirty code from mineru modified log level to warning - logging.getLogger().setLevel(logging.INFO) - # 执行解析 pipe.pipe_parse() content_list = pipe.pipe_mk_uni_format(temp_file_path, drop_mode="none") @@ -328,7 +325,7 @@ def parse_pdf( return new_md_content except Exception as e: - logger(e) + logger.error(e) return None def load_data(