Skip to content

generate: drop stale num_return_sequences warning on continuous batching path#45582

Open
joaquinhuigomez wants to merge 3 commits intohuggingface:mainfrom
joaquinhuigomez:fix/paged-num-return-sequences-warning
Open

generate: drop stale num_return_sequences warning on continuous batching path#45582
joaquinhuigomez wants to merge 3 commits intohuggingface:mainfrom
joaquinhuigomez:fix/paged-num-return-sequences-warning

Conversation

@joaquinhuigomez
Copy link
Copy Markdown

The continuous-batching branch in generate warned that num_return_sequences was unsupported alongside num_beams, but generate_batch() already honors generation_config.num_return_sequences when expanding requests. The warning fires for any run that explicitly sets num_return_sequences even though the feature works, cluttering logs and misleading users.

Drop the num_return_sequences half of the warning; keep the num_beams guard since beam search is still unsupported on the CB path.

Fixes #45563

…ing path

The continuous-batching branch warned that num_return_sequences was
unsupported alongside num_beams, but generate_batch() already honors
generation_config.num_return_sequences when expanding requests.  The
warning fires for any run that explicitly sets num_return_sequences
even though the feature works, cluttering logs and misleading users.

Drop the num_return_sequences half of the warning; keep the num_beams
guard since beam search is still unsupported on the CB path.

Fixes huggingface#45563
Copy link
Copy Markdown
Collaborator

@remi-or remi-or left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the fix.

@remi-or
Copy link
Copy Markdown
Collaborator

remi-or commented Apr 23, 2026

@bot /style

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 23, 2026

Style fix bot fixed some files and pushed the changes.

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Paged generate() emits a stale warning for num_return_sequences

3 participants