Skip to content

Add upper bounds to dependencies - #2221

Merged
apsonawane merged 5 commits into
mainfrom
asonawane/num_beams
Jun 30, 2026
Merged

Add upper bounds to dependencies#2221
apsonawane merged 5 commits into
mainfrom
asonawane/num_beams

Conversation

@apsonawane

Copy link
Copy Markdown
Contributor

This pull request adds stricter validation for generation parameters in the Generator constructor to prevent invalid or out-of-bounds values.

Parameter validation improvements:

  • Enforced that batch_size must be between 1 and 256, updating the error message to reflect the valid range.
  • Added a new check to ensure num_beams is also between 1 and 256, throwing a descriptive error if the value is out of bounds.

Copilot AI review requested due to automatic review settings June 11, 2026 23:04
@apsonawane
apsonawane requested a review from a team as a code owner June 11, 2026 23:04
@apsonawane
apsonawane enabled auto-merge (squash) June 11, 2026 23:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens runtime validation in the Generator constructor to reject invalid generation/search parameters early, preventing out-of-range settings from reaching backend search implementations.

Changes:

  • Enforce batch_size to be within [1, 256] and update the thrown error message accordingly.
  • Add constructor-time validation that num_beams is within an allowed range, with a descriptive error message.

Comment thread src/generators.cpp Outdated
Comment thread src/generators.cpp Outdated
Comment thread src/generators.cpp Outdated
@apsonawane
apsonawane merged commit 4ebc7fd into main Jun 30, 2026
63 of 69 checks passed
@apsonawane
apsonawane deleted the asonawane/num_beams branch June 30, 2026 07:27
tianleiwu pushed a commit that referenced this pull request Jul 11, 2026
This pull request adds stricter validation for generation parameters in
the `Generator` constructor to prevent invalid or out-of-bounds values.

Parameter validation improvements:

* Enforced that `batch_size` must be between 1 and 256, updating the
error message to reflect the valid range.
* Added a new check to ensure `num_beams` is also between 1 and 256,
throwing a descriptive error if the value is out of bounds.
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.

3 participants