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
ab93f856
Commit
ab93f856
authored
Jun 10, 2025
by
myhloli
Browse files
refactor: add 'local' option for model source and comment out timing logs
parent
29d26261
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
mineru/backend/vlm/vlm_analyze.py
mineru/backend/vlm/vlm_analyze.py
+3
-3
mineru/cli/client.py
mineru/cli/client.py
+1
-1
No files found.
mineru/backend/vlm/vlm_analyze.py
View file @
ab93f856
...
@@ -47,11 +47,11 @@ def doc_analyze(
...
@@ -47,11 +47,11 @@ def doc_analyze(
if
predictor
is
None
:
if
predictor
is
None
:
predictor
=
ModelSingleton
().
get_model
(
backend
,
model_path
,
server_url
)
predictor
=
ModelSingleton
().
get_model
(
backend
,
model_path
,
server_url
)
load_images_start
=
time
.
time
()
#
load_images_start = time.time()
images_list
,
pdf_doc
=
load_images_from_pdf
(
pdf_bytes
)
images_list
,
pdf_doc
=
load_images_from_pdf
(
pdf_bytes
)
images_base64_list
=
[
image_dict
[
"img_base64"
]
for
image_dict
in
images_list
]
images_base64_list
=
[
image_dict
[
"img_base64"
]
for
image_dict
in
images_list
]
load_images_time
=
round
(
time
.
time
()
-
load_images_start
,
2
)
#
load_images_time = round(time.time() - load_images_start, 2)
logger
.
info
(
f
"load images cost:
{
load_images_time
}
, speed:
{
round
(
len
(
images_base64_list
)
/
load_images_time
,
3
)
}
images/s"
)
#
logger.info(f"load images cost: {load_images_time}, speed: {round(len(images_base64_list)/load_images_time, 3)} images/s")
infer_start
=
time
.
time
()
infer_start
=
time
.
time
()
results
=
predictor
.
batch_predict
(
images
=
images_base64_list
)
results
=
predictor
.
batch_predict
(
images
=
images_base64_list
)
...
...
mineru/cli/client.py
View file @
ab93f856
...
@@ -129,7 +129,7 @@ from .common import do_parse, read_fn, pdf_suffixes, image_suffixes
...
@@ -129,7 +129,7 @@ from .common import do_parse, read_fn, pdf_suffixes, image_suffixes
'-r'
,
'-r'
,
'--repo'
,
'--repo'
,
'model_source'
,
'model_source'
,
type
=
click
.
Choice
([
'huggingface'
,
'modelscope'
]),
type
=
click
.
Choice
([
'huggingface'
,
'modelscope'
,
'local'
]),
help
=
"""
help
=
"""
The source of the model repository. Default is 'huggingface'.
The source of the model repository. Default is 'huggingface'.
"""
,
"""
,
...
...
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