Skip to content

Commit c4774eb

Browse files
authored
[Bugfix] Fix snapshot download in serving benchmark (#6318)
1 parent fc17110 commit c4774eb

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

benchmarks/backend_request_func.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -390,17 +390,17 @@ def remove_prefix(text: str, prefix: str) -> str:
390390
return text
391391

392392

393-
def get_model(pretrained_model_name_or_path: str):
393+
def get_model(pretrained_model_name_or_path: str) -> str:
394394
if os.getenv('VLLM_USE_MODELSCOPE', 'False').lower() == 'true':
395395
from modelscope import snapshot_download
396-
else:
397-
from huggingface_hub import snapshot_download
398-
399-
model_path = snapshot_download(
400-
model_id=pretrained_model_name_or_path,
401-
local_files_only=huggingface_hub.constants.HF_HUB_OFFLINE,
402-
ignore_file_pattern=[".*.pt", ".*.safetensors", ".*.bin"])
403-
return model_path
396+
397+
model_path = snapshot_download(
398+
model_id=pretrained_model_name_or_path,
399+
local_files_only=huggingface_hub.constants.HF_HUB_OFFLINE,
400+
ignore_file_pattern=[".*.pt", ".*.safetensors", ".*.bin"])
401+
402+
return model_path
403+
return pretrained_model_name_or_path
404404

405405

406406
def get_tokenizer(

0 commit comments

Comments
 (0)