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
change
sglang
Commits
04913430
Unverified
Commit
04913430
authored
Aug 01, 2025
by
yrk111222
Committed by
GitHub
Jul 31, 2025
Browse files
Feature/modelscope model download (#8083)
Co-authored-by:
ronnie_zheng
<
zl19940307@163.com
>
parent
0ad098b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
python/sglang/bench_offline_throughput.py
python/sglang/bench_offline_throughput.py
+20
-0
No files found.
python/sglang/bench_offline_throughput.py
View file @
04913430
...
@@ -418,6 +418,26 @@ if __name__ == "__main__":
...
@@ -418,6 +418,26 @@ if __name__ == "__main__":
ServerArgs
.
add_cli_args
(
parser
)
ServerArgs
.
add_cli_args
(
parser
)
BenchArgs
.
add_cli_args
(
parser
)
BenchArgs
.
add_cli_args
(
parser
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
# handling ModelScope model downloads
if
os
.
getenv
(
"SGLANG_USE_MODELSCOPE"
,
"false"
).
lower
()
in
(
"true"
,
"1"
):
if
os
.
path
.
exists
(
args
.
model_path
):
print
(
f
"Using local model path:
{
args
.
model_path
}
"
)
else
:
try
:
from
modelscope
import
snapshot_download
print
(
f
"Using ModelScope to download model:
{
args
.
model_path
}
"
)
# download the model and replace args.model_path
args
.
model_path
=
snapshot_download
(
args
.
model_path
,
)
print
(
f
"Model downloaded to:
{
args
.
model_path
}
"
)
except
Exception
as
e
:
print
(
f
"ModelScope download failed:
{
str
(
e
)
}
"
)
raise
e
server_args
=
ServerArgs
.
from_cli_args
(
args
)
server_args
=
ServerArgs
.
from_cli_args
(
args
)
bench_args
=
BenchArgs
.
from_cli_args
(
args
)
bench_args
=
BenchArgs
.
from_cli_args
(
args
)
...
...
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