Reject repetition_penalty=0 in SamplingParams.verify() (#24874)

Co-authored-by: RulinJuice <265952454+RulinJuice@users.noreply.github.com>
This commit is contained in:
RulinJuice
2026-05-12 21:25:23 -07:00
committed by GitHub
co-authored by RulinJuice
parent 622baa17bd
commit 3f048c80b8
3 changed files with 22 additions and 8 deletions
@@ -139,10 +139,10 @@ class SamplingParams:
raise ValueError(
"presence_penalty must be in [-2, 2], got " f"{self.presence_penalty}."
)
if not 0.0 <= self.repetition_penalty <= 2.0:
if not 0.0 < self.repetition_penalty <= 2.0:
raise ValueError(
"repetition_penalty must be in [0, 2], got "
f"{self.repetition_penalty}."
"repetition_penalty must be in (0, 2] (1.0 = no penalty), "
f"got {self.repetition_penalty}."
)
if not 0 <= self.min_new_tokens:
raise ValueError(