We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 49782fc commit ccb58b2Copy full SHA for ccb58b2
benchmarks/backend_request_func.py
@@ -334,7 +334,8 @@ async def async_request_openai_chat_completions(
334
timestamp = time.perf_counter()
335
data = json.loads(chunk)
336
337
- if "content" in data["choices"][0]["delta"]:
+ delta = data["choices"][0]["delta"]
338
+ if delta.get("content", None):
339
# First token
340
if ttft == 0:
341
ttft = time.perf_counter() - st
@@ -345,8 +346,7 @@ async def async_request_openai_chat_completions(
345
346
output.itl.append(timestamp -
347
most_recent_timestamp)
348
- generated_text += data["choices"][0]["delta"][
349
- "content"]
+ generated_text += delta["content"]
350
351
most_recent_timestamp = timestamp
352
0 commit comments