[CI] balance unit tests (#1977)
This commit is contained in:
@@ -114,9 +114,16 @@ async def health() -> Response:
|
||||
@app.get("/health_generate")
|
||||
async def health_generate(request: Request) -> Response:
|
||||
"""Check the health of the inference server by generating one token."""
|
||||
gri = GenerateReqInput(
|
||||
text="s", sampling_params={"max_new_tokens": 1, "temperature": 0.7}
|
||||
)
|
||||
|
||||
if tokenizer_manager.is_generation:
|
||||
gri = GenerateReqInput(
|
||||
input_ids=[0], sampling_params={"max_new_tokens": 1, "temperature": 0.7}
|
||||
)
|
||||
else:
|
||||
gri = EmbeddingReqInput(
|
||||
input_ids=[0], sampling_params={"max_new_tokens": 1, "temperature": 0.7}
|
||||
)
|
||||
|
||||
try:
|
||||
async for _ in tokenizer_manager.generate_request(gri, request):
|
||||
break
|
||||
|
||||
@@ -442,7 +442,7 @@ def popen_launch_server(
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
"Authorization": f"Bearer {api_key}",
|
||||
}
|
||||
response = requests.get(f"{base_url}/v1/models", headers=headers)
|
||||
response = requests.get(f"{base_url}/health_generate", headers=headers)
|
||||
if response.status_code == 200:
|
||||
return process
|
||||
except requests.RequestException:
|
||||
@@ -637,8 +637,8 @@ def calculate_rouge_l(output_strs_list1, output_strs_list2):
|
||||
return rouge_l_scores
|
||||
|
||||
|
||||
STDOUT_FILENAME = "stdout.txt"
|
||||
STDERR_FILENAME = "stderr.txt"
|
||||
STDOUT_FILENAME = "stdout.txt"
|
||||
|
||||
|
||||
def read_output(output_lines):
|
||||
|
||||
Reference in New Issue
Block a user