Skip to content

Commit 0b7229a

Browse files
b8zhongAlex4210987
authored andcommitted
[Bugfix][Benchmarks] Ensure async_request_deepspeed_mii uses the OpenAI choices key (vllm-project#15926)
Signed-off-by: Brayden Zhong <[email protected]> Signed-off-by: xinyuxiao <[email protected]>
1 parent bd716dd commit 0b7229a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

benchmarks/backend_request_func.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,15 @@ async def async_request_deepspeed_mii(
219219
if response.status == 200:
220220
parsed_resp = await response.json()
221221
output.latency = time.perf_counter() - st
222-
output.generated_text = parsed_resp["text"][0]
222+
if "choices" in parsed_resp:
223+
output.generated_text = parsed_resp["choices"][0][
224+
"text"]
225+
elif "text" in parsed_resp:
226+
output.generated_text = parsed_resp["text"][0]
227+
else:
228+
output.error = ("Unexpected response format: "
229+
"neither 'choices' nor 'text' found")
230+
output.success = False
223231
output.success = True
224232
else:
225233
output.error = response.reason or ""

0 commit comments

Comments
 (0)