File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -418,6 +418,26 @@ def throughput_test(
418
418
ServerArgs .add_cli_args (parser )
419
419
BenchArgs .add_cli_args (parser )
420
420
args = parser .parse_args ()
421
+
422
+ # handling ModelScope model downloads
423
+ if os .getenv ("SGLANG_USE_MODELSCOPE" , "false" ).lower () in ("true" , "1" ):
424
+ if os .path .exists (args .model_path ):
425
+ print (f"Using local model path: { args .model_path } " )
426
+ else :
427
+ try :
428
+ from modelscope import snapshot_download
429
+
430
+ print (f"Using ModelScope to download model: { args .model_path } " )
431
+
432
+ # download the model and replace args.model_path
433
+ args .model_path = snapshot_download (
434
+ args .model_path ,
435
+ )
436
+ print (f"Model downloaded to: { args .model_path } " )
437
+ except Exception as e :
438
+ print (f"ModelScope download failed: { str (e )} " )
439
+ raise e
440
+
421
441
server_args = ServerArgs .from_cli_args (args )
422
442
bench_args = BenchArgs .from_cli_args (args )
423
443
You can’t perform that action at this time.
0 commit comments