Allow top_p == 1.0

This commit is contained in:
Piotr Mlocek 2023-10-18 12:57:14 -07:00 committed by GitHub
parent 3af1a11401
commit f0d6619d80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -87,8 +87,8 @@ class Parameters(BaseModel):
@validator("top_p")
def valid_top_p(cls, v):
if v is not None and (v <= 0 or v >= 1.0):
raise ValidationError("`top_p` must be > 0.0 and < 1.0")
if v is not None and (v <= 0 or v > 1.0):
raise ValidationError("`top_p` must be > 0.0 and <= 1.0")
return v
@validator("truncate")