Skip to content

Commit

Permalink
fix(llm_aided): add enable flag check for LLM aided optimizations
Browse files Browse the repository at this point in the history
- Add enable flag check for formula, text, and title optimizations
  • Loading branch information
myhloli committed Jan 10, 2025
1 parent e7d7b34 commit aaff1a2
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 aaff1a2

Please sign in to comment.