Commit 192047a1 authored by myhloli's avatar myhloli
Browse files

refactor(magic_pdf): remove unnecessary logging statements

- Comment out logging statements for title list, title completion, and length comparison
- Improve code readability and reduce clutter by removing unused debug information
parent 0a468eca
...@@ -84,7 +84,7 @@ def llm_aided_title(pdf_info_dict, title_aided_config): ...@@ -84,7 +84,7 @@ def llm_aided_title(pdf_info_dict, title_aided_config):
title_text = merge_para_with_text(block) title_text = merge_para_with_text(block)
title_dict[f"{i}"] = title_text title_dict[f"{i}"] = title_text
i += 1 i += 1
logger.info(f"Title list: {title_dict}") # logger.info(f"Title list: {title_dict}")
title_optimize_prompt = f"""输入的内容是一篇文档中所有标题组成的字典,请根据以下指南优化标题的结果,使结果符合正常文档的层次结构: title_optimize_prompt = f"""输入的内容是一篇文档中所有标题组成的字典,请根据以下指南优化标题的结果,使结果符合正常文档的层次结构:
...@@ -118,9 +118,9 @@ Corrected title list: ...@@ -118,9 +118,9 @@ Corrected title list:
json_completion = json.loads(completion.choices[0].message.content) json_completion = json.loads(completion.choices[0].message.content)
logger.info(f"Title completion: {json_completion}") # logger.info(f"Title completion: {json_completion}")
logger.info(f"len(json_completion): {len(json_completion)}, len(title_dict): {len(title_dict)}") # logger.info(f"len(json_completion): {len(json_completion)}, len(title_dict): {len(title_dict)}")
if len(json_completion) == len(title_dict): if len(json_completion) == len(title_dict):
try: try:
for i, origin_title_block in enumerate(origin_title_list): for i, origin_title_block in enumerate(origin_title_list):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment