Skip to content

Commit

Permalink
[Bugfix] Fix snapshot download in serving benchmark (vllm-project#6318)
Browse files Browse the repository at this point in the history
  • Loading branch information
ywang96 authored and jimpang committed Jul 24, 2024
1 parent a71e080 commit 4a8fd1d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions benchmarks/backend_request_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,17 +390,17 @@ def remove_prefix(text: str, prefix: str) -> str:
return text


def get_model(pretrained_model_name_or_path: str):
def get_model(pretrained_model_name_or_path: str) -> str:
if os.getenv('VLLM_USE_MODELSCOPE', 'False').lower() == 'true':
from modelscope import snapshot_download
else:
from huggingface_hub import snapshot_download

model_path = snapshot_download(
model_id=pretrained_model_name_or_path,
local_files_only=huggingface_hub.constants.HF_HUB_OFFLINE,
ignore_file_pattern=[".*.pt", ".*.safetensors", ".*.bin"])
return model_path

model_path = snapshot_download(
model_id=pretrained_model_name_or_path,
local_files_only=huggingface_hub.constants.HF_HUB_OFFLINE,
ignore_file_pattern=[".*.pt", ".*.safetensors", ".*.bin"])

return model_path
return pretrained_model_name_or_path


def get_tokenizer(
Expand Down

0 comments on commit 4a8fd1d

Please sign in to comment.