Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python] Fix new logprobs computation in vllm_utils #2146

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ def update_multiple_sequences(cache, request_output, vllm_request_output):
cur_len] if prev_len < cur_len else completion_output.logprobs
new_logprobs = []
for token_id, logprobs in zip(new_token_ids, new_logprobs_list):
new_logprobs.append(logprobs[token_id].logprob)
for token_id_key, logprob in logprobs.items():
new_logprobs.append(logprobs[token_id].logprob)
top_tokens.append(
Token(id=token_id_key,
text=logprob.decoded_token,
Expand All @@ -137,7 +137,7 @@ def update_multiple_sequences(cache, request_output, vllm_request_output):
for i, (token_id, token_text, logprob) in enumerate(
zip(new_token_ids, output_token_texts, new_logprobs)):
token = Token(token_id, token_text, logprob)
is_last_token = i == (len(new_logprobs) -
is_last_token = i == (len(new_token_ids) -
1) and finish_reason is not None
request_output.sequences[sequence_index].set_next_token(
token, is_last_token)
Expand Down
Loading