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
6162ae2b
Unverified
Commit
6162ae2b
authored
Jun 19, 2025
by
Xiaomeng Zhao
Committed by
GitHub
Jun 19, 2025
Browse files
Merge pull request #2742 from myhloli/dev
fix: update model path handling in model.py and models_download_utils.py
parents
ac5db5d4
fa9aaaa7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
mineru/model/vlm_sglang_model/model.py
mineru/model/vlm_sglang_model/model.py
+1
-1
mineru/utils/models_download_utils.py
mineru/utils/models_download_utils.py
+6
-2
No files found.
mineru/model/vlm_sglang_model/model.py
View file @
6162ae2b
...
...
@@ -62,7 +62,7 @@ class Mineru2QwenForCausalLM(nn.Module):
# load vision tower
mm_vision_tower
=
self
.
config
.
mm_vision_tower
model_root_path
=
auto_download_and_get_model_root_path
(
"/"
,
"vlm"
)
model_root_path
=
auto_download_and_get_model_root_path
(
mm_vision_tower
,
"vlm"
)
mm_vision_tower
=
f
"
{
model_root_path
}
/
{
mm_vision_tower
}
"
if
"clip"
in
mm_vision_tower
:
...
...
mineru/utils/models_download_utils.py
View file @
6162ae2b
...
...
@@ -57,8 +57,12 @@ def auto_download_and_get_model_root_path(relative_path: str, repo_mode='pipelin
relative_path
=
relative_path
.
strip
(
'/'
)
cache_dir
=
snapshot_download
(
repo
,
allow_patterns
=
[
relative_path
,
relative_path
+
"/*"
])
elif
repo_mode
==
'vlm'
:
# VLM 模式下,直接下载整个模型目录
# VLM 模式下,根据 relative_path 的不同处理方式
if
relative_path
==
"/"
:
cache_dir
=
snapshot_download
(
repo
)
else
:
relative_path
=
relative_path
.
strip
(
'/'
)
cache_dir
=
snapshot_download
(
repo
,
allow_patterns
=
[
relative_path
,
relative_path
+
"/*"
])
if
not
cache_dir
:
raise
FileNotFoundError
(
f
"Failed to download model:
{
relative_path
}
from
{
repo
}
"
)
...
...
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