Unverified Commit 21de6d4b authored by Andreas Karatzas's avatar Andreas Karatzas Committed by GitHub
Browse files

[CI][Bugfix] Fix token counting in chunked prefill streaming test (#31565)


Signed-off-by: default avatarAndreas Karatzas <akaratza@amd.com>
parent 6c2cfb62
...@@ -116,7 +116,10 @@ async def test_chat_completion_stream_options_and_logprobs_with_long_prompts( ...@@ -116,7 +116,10 @@ async def test_chat_completion_stream_options_and_logprobs_with_long_prompts(
assert chunk.choices[0].logprobs is None assert chunk.choices[0].logprobs is None
empty_chunks_received += 1 empty_chunks_received += 1
else: else:
tokens_received += 1 # Count actual tokens from logprobs since multiple tokens
# can be batched into a single chunk
assert chunk.choices[0].logprobs and chunk.choices[0].logprobs.content
tokens_received += len(chunk.choices[0].logprobs.content)
if chunk.choices[0].finish_reason is not None: if chunk.choices[0].finish_reason is not None:
finished = True finished = True
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment