[python] Fix new logprobs computation in vllm_utils #2146
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This bug is only in master, not in 0.28.0. This fixes the LMI no-code low code CI failures.
Even if we set logprobs=1, sometimes, vLLM sends more than one log probabilities. Here for new log probs, we add all the log probabilities that are return by vLLM to new_logprobs dict.
But when we determine whether it is last token or not,
i == (len(new_logprobs) -1)
and this fails, because now it has more than one new probs, this case will never be true. So last_token never occurred, so it returned broken json without any details. Hence the CI failed.Will add unit test cases for this use-cases as well in the next PR.