Skip to content

Commit

Permalink
🐛 Update error messages for length and repetition penalties
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Runde <[email protected]>
  • Loading branch information
joerunde committed Mar 28, 2024
1 parent 620c2b6 commit 74dde18
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vllm/entrypoints/grpc/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 74dde18

Please sign in to comment.