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

[fix] Seq2Seq model fix for lmi-dist #1991

Merged
merged 1 commit into from
May 30, 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 @@ -43,12 +43,16 @@ def update_request_cache_with_output(request_cache: OrderedDict,
prev_len = request_cache[request_id]['num_generated_tokens']
cur_len = len(seq_output.token_ids)

new_token_ids = seq_output.token_ids[prev_len:cur_len]
new_token_ids = seq_output.token_ids[
prev_len:cur_len] if prev_len < cur_len else seq_output.token_ids
output_token_texts = []
if hasattr(seq_output, "output_token_texts"):
output_token_texts = seq_output.output_token_texts[prev_len:cur_len]
output_token_texts = seq_output.output_token_texts[
prev_len:
cur_len] if prev_len < cur_len else seq_output.output_token_texts
if seq_output.logprobs:
new_logprobs_list = seq_output.logprobs[prev_len:cur_len]
new_logprobs_list = seq_output.logprobs[
prev_len:cur_len] if prev_len < cur_len else seq_output.logprobs
new_logprobs = [
# NOTE: vLLM 0.4.1 changed logprob type
logprobs[token_id] if isinstance(logprobs[token_id], float) else
Expand Down
Loading