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
7ca7e599
Unverified
Commit
7ca7e599
authored
Dec 06, 2024
by
Xiaomeng Zhao
Committed by
GitHub
Dec 06, 2024
Browse files
Merge pull request #1198 from myhloli/dev
perf(model): optimize model initialization
parents
92ad41ce
ce592f8b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
magic_pdf/model/sub_modules/model_init.py
magic_pdf/model/sub_modules/model_init.py
+4
-1
No files found.
magic_pdf/model/sub_modules/model_init.py
View file @
7ca7e599
...
@@ -102,10 +102,13 @@ class AtomModelSingleton:
...
@@ -102,10 +102,13 @@ class AtomModelSingleton:
with
self
.
_lock
:
with
self
.
_lock
:
if
key
not
in
self
.
_models
:
if
key
not
in
self
.
_models
:
self
.
_models
[
key
]
=
atom_model_init
(
model_name
=
atom_model_name
,
**
kwargs
)
self
.
_models
[
key
]
=
atom_model_init
(
model_name
=
atom_model_name
,
**
kwargs
)
else
:
return
self
.
_models
[
key
]
else
:
else
:
if
key
not
in
self
.
_models
:
if
key
not
in
self
.
_models
:
self
.
_models
[
key
]
=
atom_model_init
(
model_name
=
atom_model_name
,
**
kwargs
)
self
.
_models
[
key
]
=
atom_model_init
(
model_name
=
atom_model_name
,
**
kwargs
)
return
self
.
_models
[
key
]
else
:
return
self
.
_models
[
key
]
def
atom_model_init
(
model_name
:
str
,
**
kwargs
):
def
atom_model_init
(
model_name
:
str
,
**
kwargs
):
...
...
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