"tests/L1/compare_python_vs_extensions/main_amp.py" did not exist on "cf45c54cdec3ae37b9d5ffcfb02e425280d66d05"
Commit 941f36f5 authored by myhloli's avatar myhloli
Browse files

fix: ensure title_aided_config is defined before accessing its properties

parent 92d43c7b
......@@ -12,15 +12,16 @@ from mineru.version import __version__
heading_level_import_success = False
llm_aided_config = get_llm_aided_config()
title_aided_config = llm_aided_config.get('title_aided', {})
if llm_aided_config and title_aided_config.get('enable', False):
try:
from mineru.utils.llm_aided import llm_aided_title
from mineru.backend.pipeline.model_init import AtomModelSingleton
heading_level_import_success = True
except Exception as e:
logger.warning("The heading level feature cannot be used. If you need to use the heading level feature, "
"please execute `pip install mineru[core]` to install the required packages.")
if llm_aided_config:
title_aided_config = llm_aided_config.get('title_aided', {})
if title_aided_config.get('enable', False):
try:
from mineru.utils.llm_aided import llm_aided_title
from mineru.backend.pipeline.model_init import AtomModelSingleton
heading_level_import_success = True
except Exception as e:
logger.warning("The heading level feature cannot be used. If you need to use the heading level feature, "
"please execute `pip install mineru[core]` to install the required packages.")
def token_to_page_info(token, image_dict, page, image_writer, page_index) -> dict:
......
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