diff --git a/router/src/batcher.rs b/router/src/batcher.rs index 074c54bc..aacc9634 100644 --- a/router/src/batcher.rs +++ b/router/src/batcher.rs @@ -220,7 +220,7 @@ impl From for (StatusCode, Json) { fn from(err: InferError) -> Self { match err { InferError::GenerationError(_) => ( - StatusCode::INTERNAL_SERVER_ERROR, + StatusCode::FAILED_DEPENDENCY, Json(ErrorResponse { error: err.to_string(), }), diff --git a/router/src/validation.rs b/router/src/validation.rs index 43c246f0..a8437e39 100644 --- a/router/src/validation.rs +++ b/router/src/validation.rs @@ -101,7 +101,7 @@ fn validation_worker( ) { // Loop over requests while let Some((request, response_tx)) = receiver.blocking_recv() { - if request.parameters.temperature < 0.0 { + if request.parameters.temperature <= 0.0 { response_tx .send(Err(ValidationError::Temperature)) .unwrap_or(()); @@ -162,7 +162,7 @@ pub enum ValidationError { impl From for (StatusCode, Json) { fn from(err: ValidationError) -> Self { ( - StatusCode::BAD_REQUEST, + StatusCode::UNPROCESSABLE_ENTITY, Json(ErrorResponse { error: err.to_string(), }),