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
f27320c2
Unverified
Commit
f27320c2
authored
Feb 21, 2025
by
Xiaomeng Zhao
Committed by
GitHub
Feb 21, 2025
Browse files
Merge pull request #1738 from myhloli/dev
fix(model): handle import errors and improve exception logging
parents
c0d7e095
66f0899a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
magic_pdf/model/sub_modules/model_init.py
magic_pdf/model/sub_modules/model_init.py
+4
-2
No files found.
magic_pdf/model/sub_modules/model_init.py
View file @
f27320c2
...
...
@@ -16,7 +16,9 @@ try:
license_key
=
load_license
()
logger
.
info
(
f
'Using Ascend Plugin Success, License expired at
{
license_key
[
"payload"
][
"date"
][
"end_date"
]
}
'
)
except
Exception
as
e
:
if
isinstance
(
e
,
LicenseFormatError
):
if
isinstance
(
e
,
ImportError
):
pass
elif
isinstance
(
e
,
LicenseFormatError
):
logger
.
error
(
"Ascend Plugin: Invalid license format. Please check the license file."
)
elif
isinstance
(
e
,
LicenseSignatureError
):
logger
.
error
(
"Ascend Plugin: Invalid signature. The license may be tampered with."
)
...
...
@@ -25,7 +27,7 @@ except Exception as e:
elif
isinstance
(
e
,
FileNotFoundError
):
logger
.
error
(
"Ascend Plugin: Not found License file."
)
else
:
pass
logger
.
error
(
f
"Ascend Plugin:
{
e
}
"
)
from
magic_pdf.model.sub_modules.ocr.paddleocr.ppocr_273_mod
import
ModifiedPaddleOCR
# from magic_pdf.model.sub_modules.ocr.paddleocr.ppocr_291_mod import ModifiedPaddleOCR
from
magic_pdf.model.sub_modules.table.rapidtable.rapid_table
import
RapidTableModel
...
...
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