Skip to content

Commit ea9fa16

Browse files
authored
[ci][test] exclude model download time in server start time (#7834)
1 parent 7d9ffa2 commit ea9fa16

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import openai
1313
import requests
14+
from huggingface_hub import snapshot_download
1415
from transformers import AutoTokenizer
1516
from typing_extensions import ParamSpec
1617

@@ -64,6 +65,10 @@ def __init__(self,
6465
env_dict: Optional[Dict[str, str]] = None,
6566
auto_port: bool = True,
6667
max_wait_seconds: Optional[float] = None) -> None:
68+
if not model.startswith("/"):
69+
# download the model if it's not a local path
70+
# to exclude the model download time from the server start time
71+
model = snapshot_download(model)
6772
if auto_port:
6873
if "-p" in cli_args or "--port" in cli_args:
6974
raise ValueError("You have manually specified the port"

0 commit comments

Comments
 (0)