Skip to content

Commit

Permalink
[ci][test] exclude model download time in server start time (vllm-pro…
Browse files Browse the repository at this point in the history
  • Loading branch information
youkaichao authored Aug 24, 2024
1 parent 7d9ffa2 commit ea9fa16
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import openai
import requests
from huggingface_hub import snapshot_download
from transformers import AutoTokenizer
from typing_extensions import ParamSpec

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

0 comments on commit ea9fa16

Please sign in to comment.