Commit 895a341d authored by OlivierDehaene's avatar OlivierDehaene
Browse files

fix(validation): Fix error messages

parent f16f2f5a
...@@ -127,7 +127,7 @@ fn validation_worker( ...@@ -127,7 +127,7 @@ fn validation_worker(
if input_length > max_input_length { if input_length > max_input_length {
response_tx response_tx
.send(Err(ValidationError::InputLength(input_length))) .send(Err(ValidationError::InputLength(input_length, max_input_length)))
.unwrap_or(()); .unwrap_or(());
continue; continue;
} }
...@@ -145,14 +145,14 @@ type ValidationRequest = ( ...@@ -145,14 +145,14 @@ type ValidationRequest = (
pub enum ValidationError { pub enum ValidationError {
#[error("Temperature must be strictly positive")] #[error("Temperature must be strictly positive")]
Temperature, Temperature,
#[error("Top p must be <= 0.0 or > 1.0")] #[error("Top p must be >= 0.0 or < 1.0")]
TopP, TopP,
#[error("Top k must be strictly positive")] #[error("Top k must be strictly positive")]
TopK, TopK,
#[error("Max New Tokens must be < 512")] #[error("Max New Tokens must be <= 512")]
MaxNewTokens, MaxNewTokens,
#[error("Inputs must have less than 1000 tokens. Given: {0}")] #[error("Inputs must have less than {1} tokens. Given: {0}")]
InputLength(usize), InputLength(usize, usize),
} }
impl From<ValidationError> for (StatusCode, String) { impl From<ValidationError> for (StatusCode, String) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment