Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
MinerU
Commits
343eaac1
Unverified
Commit
343eaac1
authored
Jul 11, 2025
by
Xiaomeng Zhao
Committed by
GitHub
Jul 11, 2025
Browse files
Merge pull request #2990 from myhloli/dev
feat: simplify heading level feature configuration and error handling
parents
82eb7473
1caf6c2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
mineru/backend/vlm/token_to_middle_json.py
mineru/backend/vlm/token_to_middle_json.py
+8
-11
No files found.
mineru/backend/vlm/token_to_middle_json.py
View file @
343eaac1
...
...
@@ -12,17 +12,14 @@ from mineru.version import __version__
heading_level_import_success
=
False
llm_aided_config
=
get_llm_aided_config
()
if
llm_aided_config
is
not
None
:
title_aided_config
=
llm_aided_config
.
get
(
'title_aided'
,
None
)
if
title_aided_config
is
not
None
:
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."
)
if
llm_aided_config
and
llm_aided_config
.
get
(
'title_aided'
,
{}).
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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment