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
1793bdfc
"src/graph/transform/cuda/cuda_to_block.hip" did not exist on "46af76c30e12e85532b76a512e7d4da85bb03fac"
Commit
1793bdfc
authored
Jun 14, 2025
by
myhloli
Browse files
fix: update configure_model to use environment variable for config file name
parent
6e399282
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
mineru/cli/models_download.py
mineru/cli/models_download.py
+3
-3
No files found.
mineru/cli/models_download.py
View file @
1793bdfc
...
@@ -43,7 +43,7 @@ def download_and_modify_json(url, local_filename, modifications):
...
@@ -43,7 +43,7 @@ def download_and_modify_json(url, local_filename, modifications):
def
configure_model
(
model_dir
,
model_type
):
def
configure_model
(
model_dir
,
model_type
):
"""配置模型"""
"""配置模型"""
json_url
=
'https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/mineru.template.json'
json_url
=
'https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/mineru.template.json'
config_file_name
=
'mineru.json'
config_file_name
=
os
.
getenv
(
'MINERU_TOOLS_CONFIG_JSON'
,
'mineru.json'
)
home_dir
=
os
.
path
.
expanduser
(
'~'
)
home_dir
=
os
.
path
.
expanduser
(
'~'
)
config_file
=
os
.
path
.
join
(
home_dir
,
config_file_name
)
config_file
=
os
.
path
.
join
(
home_dir
,
config_file_name
)
...
@@ -119,13 +119,13 @@ def download_models(model_source, model_type):
...
@@ -119,13 +119,13 @@ def download_models(model_source, model_type):
click
.
echo
(
f
"Downloading model:
{
model_path
}
"
)
click
.
echo
(
f
"Downloading model:
{
model_path
}
"
)
download_finish_path
=
auto_download_and_get_model_root_path
(
model_path
,
repo_mode
=
'pipeline'
)
download_finish_path
=
auto_download_and_get_model_root_path
(
model_path
,
repo_mode
=
'pipeline'
)
click
.
echo
(
f
"Pipeline models downloaded successfully to:
{
download_finish_path
}
"
)
click
.
echo
(
f
"Pipeline models downloaded successfully to:
{
download_finish_path
}
"
)
configure_model
(
download_finish_path
,
model_type
)
configure_model
(
download_finish_path
,
"pipeline"
)
def
download_vlm_models
():
def
download_vlm_models
():
"""下载VLM模型"""
"""下载VLM模型"""
download_finish_path
=
auto_download_and_get_model_root_path
(
"/"
,
repo_mode
=
'vlm'
)
download_finish_path
=
auto_download_and_get_model_root_path
(
"/"
,
repo_mode
=
'vlm'
)
click
.
echo
(
f
"VLM models downloaded successfully to:
{
download_finish_path
}
"
)
click
.
echo
(
f
"VLM models downloaded successfully to:
{
download_finish_path
}
"
)
configure_model
(
download_finish_path
,
model_type
)
configure_model
(
download_finish_path
,
"vlm"
)
try
:
try
:
if
model_type
==
'pipeline'
:
if
model_type
==
'pipeline'
:
...
...
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