[ci][test] exclude model download time in server start time (#7834)
This commit is contained in:
parent
7d9ffa2ae1
commit
ea9fa160e3
@ -11,6 +11,7 @@ from typing import Any, Callable, Dict, List, Optional
|
|||||||
|
|
||||||
import openai
|
import openai
|
||||||
import requests
|
import requests
|
||||||
|
from huggingface_hub import snapshot_download
|
||||||
from transformers import AutoTokenizer
|
from transformers import AutoTokenizer
|
||||||
from typing_extensions import ParamSpec
|
from typing_extensions import ParamSpec
|
||||||
|
|
||||||
@ -64,6 +65,10 @@ class RemoteOpenAIServer:
|
|||||||
env_dict: Optional[Dict[str, str]] = None,
|
env_dict: Optional[Dict[str, str]] = None,
|
||||||
auto_port: bool = True,
|
auto_port: bool = True,
|
||||||
max_wait_seconds: Optional[float] = None) -> None:
|
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 auto_port:
|
||||||
if "-p" in cli_args or "--port" in cli_args:
|
if "-p" in cli_args or "--port" in cli_args:
|
||||||
raise ValueError("You have manually specified the port"
|
raise ValueError("You have manually specified the port"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user