Reject repetition_penalty=0 in SamplingParams.verify() (#24874)
Co-authored-by: RulinJuice <265952454+RulinJuice@users.noreply.github.com>
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user