fix(generation): remove stale warning for num_return_sequences in paged generate#45575
Closed
CodersAcademy006 wants to merge 1 commit intohuggingface:mainfrom
Closed
Conversation
…ed generate Closes huggingface#45563. generate_batch() already uses generation_config.num_return_sequences to expand the number of requests, so warning that num_return_sequences is unsupported for continuous batching is incorrect. Split the check: keep the warning only for num_beams > 1 (beam search is genuinely unsupported), remove it for num_return_sequences. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Fixes #45563.
generate(..., cache_implementation=paged) incorrectly warned that num_return_sequences is unsupported for continuous batching. This warning is stale: generate_batch() already uses generation_config.num_return_sequences to expand the number of requests.
Changes: Split the guard in src/transformers/generation/utils.py — keep warning only for num_beams > 1 (beam search is genuinely unsupported), remove the warning for num_return_sequences.
Test plan:
Reference: oleksii-tumanov@f7a939d