From f0d6619d8021de9004afe006975841d715498b34 Mon Sep 17 00:00:00 2001 From: Piotr Mlocek Date: Wed, 18 Oct 2023 12:57:14 -0700 Subject: [PATCH] Allow top_p == 1.0 --- clients/python/text_generation/types.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clients/python/text_generation/types.py b/clients/python/text_generation/types.py index aa02d8d8..6a3652a4 100644 --- a/clients/python/text_generation/types.py +++ b/clients/python/text_generation/types.py @@ -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")