Test the case when max_new_tokens is very large (#1038)

This commit is contained in:
Lianmin Zheng
2024-08-11 16:41:03 -07:00
committed by GitHub
parent d785412077
commit d84c5e70f7
7 changed files with 100 additions and 14 deletions

View File

@@ -398,6 +398,8 @@ def popen_launch_server(
timeout: float,
api_key: Optional[str] = None,
other_args: tuple = (),
env: Optional[dict] = None,
return_stdout_stderr: bool = False,
):
_, host, port = base_url.split(":")
host = host[2:]
@@ -417,7 +419,16 @@ def popen_launch_server(
if api_key:
command += ["--api-key", api_key]
process = subprocess.Popen(command, stdout=None, stderr=None)
if return_stdout_stderr:
process = subprocess.Popen(
command,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
env=env,
text=True,
)
else:
process = subprocess.Popen(command, stdout=None, stderr=None, env=env)
start_time = time.time()
while time.time() - start_time < timeout: