From 74dde18c44e11abbcc5e53ed439dcb8797d6f605 Mon Sep 17 00:00:00 2001 From: Joe Runde Date: Thu, 28 Mar 2024 09:42:06 -0600 Subject: [PATCH] :bug: Update error messages for length and repetition penalties Signed-off-by: Joe Runde --- vllm/entrypoints/grpc/validation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vllm/entrypoints/grpc/validation.py b/vllm/entrypoints/grpc/validation.py index dcc30220f..1853d3b5c 100644 --- a/vllm/entrypoints/grpc/validation.py +++ b/vllm/entrypoints/grpc/validation.py @@ -21,8 +21,8 @@ class TGISValidationError(str, Enum): TopP = "top_p must be > 0.0 and <= 1.0" TopK = "top_k must be strictly positive" TypicalP = "typical_p must be <= 1.0" - RepetitionPenalty = "repetition_penalty must be > 0.0" - LengthPenalty = "length_penalty must be >= 1.0 and <= 10.0" + RepetitionPenalty = "repetition_penalty must be > 0.0 and <= 2.0" + LengthPenalty = "length_penalty.decay_factor must be >= 1.0 and <= 10.0" MaxNewTokens = "max_new_tokens must be <= {0}" MinNewTokens = "min_new_tokens must be <= max_new_tokens" InputLength = "input tokens ({0}) plus prefix length ({1}) plus min_new_tokens ({2}) must be <= {3}" @@ -68,7 +68,7 @@ def validate_params(params: Parameters, max_max_new_tokens: int): if decoding.length_penalty.decay_factor < 1.0 or decoding.length_penalty.decay_factor > 10.0: TGISValidationError.LengthPenalty.error() - if decoding.repetition_penalty < 0: + if decoding.repetition_penalty < 0 or decoding.repetition_penalty > 2: # (a value of 0 means no penalty / unset) TGISValidationError.RepetitionPenalty.error()