From 895a341d064c9930b2a9bd60cff0df42f91b52fa Mon Sep 17 00:00:00 2001 From: OlivierDehaene <23298448+OlivierDehaene@users.noreply.github.com> Date: Fri, 21 Oct 2022 10:59:15 +0200 Subject: [PATCH] fix(validation): Fix error messages --- router/src/validation.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/router/src/validation.rs b/router/src/validation.rs index 49a46b62..31b4c49f 100644 --- a/router/src/validation.rs +++ b/router/src/validation.rs @@ -127,7 +127,7 @@ fn validation_worker( if input_length > max_input_length { response_tx - .send(Err(ValidationError::InputLength(input_length))) + .send(Err(ValidationError::InputLength(input_length, max_input_length))) .unwrap_or(()); continue; } @@ -145,14 +145,14 @@ type ValidationRequest = ( pub enum ValidationError { #[error("Temperature must be strictly positive")] Temperature, - #[error("Top p must be <= 0.0 or > 1.0")] + #[error("Top p must be >= 0.0 or < 1.0")] TopP, #[error("Top k must be strictly positive")] TopK, - #[error("Max New Tokens must be < 512")] + #[error("Max New Tokens must be <= 512")] MaxNewTokens, - #[error("Inputs must have less than 1000 tokens. Given: {0}")] - InputLength(usize), + #[error("Inputs must have less than {1} tokens. Given: {0}")] + InputLength(usize, usize), } impl From for (StatusCode, String) {