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
d08fe271
Unverified
Commit
d08fe271
authored
Jan 16, 2025
by
Xiaomeng Zhao
Committed by
GitHub
Jan 16, 2025
Browse files
Merge pull request #1553 from myhloli/dev
fix(magic_pdf): correct end page index and improve error handling
parents
2aea5d6f
f209ddea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
magic_pdf/model/doc_analyze_by_custom_model.py
magic_pdf/model/doc_analyze_by_custom_model.py
+1
-1
magic_pdf/post_proc/llm_aided.py
magic_pdf/post_proc/llm_aided.py
+1
-1
No files found.
magic_pdf/model/doc_analyze_by_custom_model.py
View file @
d08fe271
...
@@ -158,7 +158,7 @@ def doc_analyze(
...
@@ -158,7 +158,7 @@ def doc_analyze(
table_enable
=
None
,
table_enable
=
None
,
)
->
InferenceResult
:
)
->
InferenceResult
:
end_page_id
=
end_page_id
if
end_page_id
else
len
(
dataset
)
end_page_id
=
end_page_id
if
end_page_id
else
len
(
dataset
)
-
1
model_manager
=
ModelSingleton
()
model_manager
=
ModelSingleton
()
custom_model
=
model_manager
.
get_model
(
custom_model
=
model_manager
.
get_model
(
...
...
magic_pdf/post_proc/llm_aided.py
View file @
d08fe271
...
@@ -151,7 +151,7 @@ Corrected title list:
...
@@ -151,7 +151,7 @@ Corrected title list:
logger
.
warning
(
"The number of titles in the optimized result is not equal to the number of titles in the input."
)
logger
.
warning
(
"The number of titles in the optimized result is not equal to the number of titles in the input."
)
retry_count
+=
1
retry_count
+=
1
except
Exception
as
e
:
except
Exception
as
e
:
if
e
is
json
.
JSONDecodeError
:
if
isinstance
(
e
,
json
.
decoder
.
JSONDecodeError
)
:
logger
.
warning
(
f
"JSON decode error on attempt
{
retry_count
+
1
}
:
{
e
}
"
)
logger
.
warning
(
f
"JSON decode error on attempt
{
retry_count
+
1
}
:
{
e
}
"
)
else
:
else
:
logger
.
exception
(
e
)
logger
.
exception
(
e
)
...
...
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