Skip to content

Commit

Permalink
[Bugfix] Fix IndexError when output.logprobs is []
Browse files Browse the repository at this point in the history
  • Loading branch information
CatherineSue committed Oct 1, 2024
1 parent 82f3937 commit e23545f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vllm/entrypoints/openai/serving_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@ async def chat_completion_stream_generator(
if finish_reason_sent[i]:
continue

if request.logprobs and request.top_logprobs is not None:
if (output.text and request.logprobs
and request.top_logprobs is not None):
assert output.logprobs is not None, (
"Did not output logprobs")
logprobs = self._create_chat_logprobs(
Expand Down

0 comments on commit e23545f

Please sign in to comment.