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
e86ecbac
Commit
e86ecbac
authored
Oct 11, 2022
by
Olivier Dehaene
Browse files
ValidationError was not correctly handled
parent
4c693e65
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
router/src/server.rs
router/src/server.rs
+5
-3
No files found.
router/src/server.rs
View file @
e86ecbac
...
...
@@ -69,13 +69,15 @@ async fn generate(
)
->
poem
::
Result
<
Json
<
serde_json
::
Value
>>
{
let
start
=
Instant
::
now
();
let
(
input_length
,
validated_request
)
=
validation
let
(
input_length
,
validated_request
)
=
match
validation
.validate
(
GenerateRequest
{
inputs
:
req
.inputs
.clone
(),
parameters
:
req
.parameters
.clone
(),
})
.await
.unwrap
();
.await
{
Ok
(
result
)
=>
result
,
Err
(
_
)
=>
return
Err
(
poem
::
Error
::
from_status
(
StatusCode
::
INTERNAL_SERVER_ERROR
))
};
let
output
=
infer
.infer
(
input_length
,
validated_request
)
.await
;
...
...
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