Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(llm_aided): add enable flag check for LLM aided optimizations #1495

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading