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
9bfb3e9e
"references/vscode:/vscode.git/clone" did not exist on "5c1e62ff67fb40e8e1bf70714d8d4b3c7d151f41"
Commit
9bfb3e9e
authored
Jun 13, 2025
by
myhloli
Browse files
feat: enhance model downloading logic to support different repository modes
parent
41ecaedc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
mineru/utils/models_download_utils.py
mineru/utils/models_download_utils.py
+10
-2
No files found.
mineru/utils/models_download_utils.py
View file @
9bfb3e9e
...
@@ -51,9 +51,17 @@ def auto_download_and_get_model_root_path(relative_path: str, repo_mode='pipelin
...
@@ -51,9 +51,17 @@ def auto_download_and_get_model_root_path(relative_path: str, repo_mode='pipelin
else
:
else
:
raise
ValueError
(
f
"未知的仓库类型:
{
model_source
}
"
)
raise
ValueError
(
f
"未知的仓库类型:
{
model_source
}
"
)
cache_dir
=
None
if
repo_mode
==
'pipeline'
:
relative_path
=
relative_path
.
strip
(
'/'
)
relative_path
=
relative_path
.
strip
(
'/'
)
cache_dir
=
snapshot_download
(
repo
,
allow_patterns
=
[
relative_path
,
relative_path
+
"/*"
])
cache_dir
=
snapshot_download
(
repo
,
allow_patterns
=
[
relative_path
,
relative_path
+
"/*"
])
elif
repo_mode
==
'vlm'
:
# VLM 模式下,直接下载整个模型目录
cache_dir
=
snapshot_download
(
repo
)
if
not
cache_dir
:
raise
FileNotFoundError
(
f
"Failed to download model:
{
relative_path
}
from
{
repo
}
"
)
return
cache_dir
return
cache_dir
...
...
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