Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
text-generation-inference
Commits
895a341d
Commit
895a341d
authored
Oct 21, 2022
by
OlivierDehaene
Browse files
fix(validation): Fix error messages
parent
f16f2f5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
router/src/validation.rs
router/src/validation.rs
+5
-5
No files found.
router/src/validation.rs
View file @
895a341d
...
...
@@ -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
<
ValidationError
>
for
(
StatusCode
,
String
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment