[BugFix] Fix handling of stop strings and stop token ids#3672
Merged
njhill merged 3 commits intovllm-project:mainfrom Apr 11, 2024
Merged
[BugFix] Fix handling of stop strings and stop token ids#3672njhill merged 3 commits intovllm-project:mainfrom
njhill merged 3 commits intovllm-project:mainfrom
Conversation
This was referenced Mar 28, 2024
73766bd to
25fe99f
Compare
This addresses the following bugs: - Stop strings ends having to align with token boundaries - Stop string not being excluded properly from output when it spans multiple tokens and include_stop_str_in_output==True - Incorrect output truncation when stopping due to a token in stop_token_ids that is a special token when skip_special_tokens==True
caea3d4 to
7e5fa65
Compare
Member
Author
|
Thank you @dgoupil! |
sroy745
reviewed
Apr 10, 2024
Collaborator
sroy745
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the fix.
| # Check if the sequence has generated the EOS token. | ||
| if ((not sampling_params.ignore_eos) | ||
| and seq.get_last_token_id() == seq.eos_token_id): | ||
| seq.status = SequenceStatus.FINISHED_STOPPED |
Collaborator
There was a problem hiding this comment.
Do we want to set seq.stop_reason to eos_token_id here?
Member
Author
ywang96
approved these changes
Apr 11, 2024
Member
ywang96
left a comment
There was a problem hiding this comment.
Left a few comments/questions - Thanks for the fix!
Member
Author
|
Thanks alot for the review @ywang96! |
andy-neuma
pushed a commit
to neuralmagic/nm-vllm
that referenced
this pull request
Apr 12, 2024
z103cb
pushed a commit
to z103cb/opendatahub_vllm
that referenced
this pull request
Apr 22, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This addresses the following bugs:
include_stop_str_in_output==False(primarily a problem when streaming output)stop_token_idsthat is a special token whenskip_special_tokens==TrueFixes #3574
Fixes #3572
Fixes #2577
Fixes #3026