Unverified Commit c4774eb8 authored by Roger Wang's avatar Roger Wang Committed by GitHub
Browse files

[Bugfix] Fix snapshot download in serving benchmark (#6318)

parent fc17110b
...@@ -390,17 +390,17 @@ def remove_prefix(text: str, prefix: str) -> str: ...@@ -390,17 +390,17 @@ def remove_prefix(text: str, prefix: str) -> str:
return text 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': if os.getenv('VLLM_USE_MODELSCOPE', 'False').lower() == 'true':
from modelscope import snapshot_download from modelscope import snapshot_download
else:
from huggingface_hub import snapshot_download model_path = snapshot_download(
model_id=pretrained_model_name_or_path,
model_path = snapshot_download( local_files_only=huggingface_hub.constants.HF_HUB_OFFLINE,
model_id=pretrained_model_name_or_path, ignore_file_pattern=[".*.pt", ".*.safetensors", ".*.bin"])
local_files_only=huggingface_hub.constants.HF_HUB_OFFLINE,
ignore_file_pattern=[".*.pt", ".*.safetensors", ".*.bin"]) return model_path
return model_path return pretrained_model_name_or_path
def get_tokenizer( def get_tokenizer(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment