Skip to content

Commit

Permalink
🐛 fixup length penalty and min token validation
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Runde <[email protected]>
  • Loading branch information
joerunde committed Mar 27, 2024
1 parent f477ba3 commit 4814afc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vllm/entrypoints/grpc/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def validate_params(params: Parameters, max_max_new_tokens: int):
if decoding.HasField("length_penalty"):
# TODO: remove this when we support length penalty
TGISValidationError.LengthPenaltyUnsupported.error()
if decoding.length_penalty < 1 or decoding.length_penalty > 10:
if decoding.length_penalty.decay_factor < 1.0 or decoding.length_penalty.decay_factor > 10.0:
TGISValidationError.LengthPenalty.error()

if decoding.repetition_penalty < 0:
Expand All @@ -77,7 +77,7 @@ def validate_params(params: Parameters, max_max_new_tokens: int):
if stopping.max_new_tokens > max_max_new_tokens:
TGISValidationError.MaxNewTokens.error(max_max_new_tokens)

if stopping.min_new_tokens > stopping.max_new_tokens:
if stopping.max_new_tokens and stopping.min_new_tokens > stopping.max_new_tokens:
TGISValidationError.MinNewTokens.error()

if stopping.stop_sequences and (
Expand Down

0 comments on commit 4814afc

Please sign in to comment.