Skip to content

Commit

Permalink
Remove duplicate logger from PaiPDFReader
Browse files Browse the repository at this point in the history
  • Loading branch information
wwxxzz committed Nov 4, 2024
1 parent 6841318 commit a112b6e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/pai_rag/integrations/readers/pai_pdf_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

# 执行分类
Expand All @@ -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")
Expand All @@ -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(
Expand Down

0 comments on commit a112b6e

Please sign in to comment.