Skip to content

Commit

Permalink
Merge pull request #1497 from opendatalab/release-1.0.0
Browse files Browse the repository at this point in the history
fix(llm_aided): add enable flag check for LLM aided optimizations
  • Loading branch information
myhloli authored Jan 10, 2025
2 parents 4c5a469 + 705720c commit 24b77bb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions magic_pdf/pdf_parse_union_core_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -860,15 +860,18 @@ def pdf_parse_union(
"""公式优化"""
formula_aided_config = llm_aided_config.get('formula_aided', None)
if formula_aided_config is not None:
llm_aided_formula(pdf_info_dict, formula_aided_config)
if formula_aided_config.get('enable', False):
llm_aided_formula(pdf_info_dict, formula_aided_config)
"""文本优化"""
text_aided_config = llm_aided_config.get('text_aided', None)
if text_aided_config is not None:
llm_aided_text(pdf_info_dict, text_aided_config)
if text_aided_config.get('enable', False):
llm_aided_text(pdf_info_dict, text_aided_config)
"""标题优化"""
title_aided_config = llm_aided_config.get('title_aided', None)
if title_aided_config is not None:
llm_aided_title(pdf_info_dict, title_aided_config)
if title_aided_config.get('enable', False):
llm_aided_title(pdf_info_dict, title_aided_config)

"""dict转list"""
pdf_info_list = dict_to_list(pdf_info_dict)
Expand Down

0 comments on commit 24b77bb

Please sign in to comment.