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
3dd9a832
Commit
3dd9a832
authored
Jun 13, 2025
by
myhloli
Browse files
feat: add default model path handling in server.py if not provided
parent
89c98537
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
mineru/model/vlm_sglang_model/server.py
mineru/model/vlm_sglang_model/server.py
+15
-4
No files found.
mineru/model/vlm_sglang_model/server.py
View file @
3dd9a832
...
...
@@ -27,16 +27,27 @@ async def custom_generate_request(obj: GenerateReqInput, request: Request):
def
main
():
server_args
=
prepare_server_args
(
sys
.
argv
[
1
:])
# 检查命令行参数中是否包含--model-path
args
=
sys
.
argv
[
1
:]
has_model_path_arg
=
False
for
i
,
arg
in
enumerate
(
args
):
if
arg
==
"--model-path"
or
arg
.
startswith
(
"--model-path="
):
has_model_path_arg
=
True
break
# 如果没有--model-path参数,在参数列表中添加它
if
not
has_model_path_arg
:
default_path
=
auto_download_and_get_model_root_path
(
"/"
,
"vlm"
)
args
.
extend
([
"--model-path"
,
default_path
])
server_args
=
prepare_server_args
(
args
)
if
server_args
.
chat_template
is
None
:
server_args
.
chat_template
=
"chatml"
server_args
.
enable_custom_logit_processor
=
True
if
server_args
.
model_path
is
None
:
server_args
.
model_path
=
auto_download_and_get_model_root_path
(
"/"
,
"vlm"
)
try
:
launch_server
(
server_args
)
finally
:
...
...
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