Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
29862b88
Unverified
Commit
29862b88
authored
Nov 07, 2024
by
Nick Hill
Committed by
GitHub
Nov 06, 2024
Browse files
[Frontend] Adjust try/except blocks in API impl (#10056)
Signed-off-by:
Nick Hill
<
nhill@redhat.com
>
parent
d3859f18
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
11 deletions
+5
-11
vllm/entrypoints/openai/serving_completion.py
vllm/entrypoints/openai/serving_completion.py
+2
-6
vllm/entrypoints/openai/serving_embedding.py
vllm/entrypoints/openai/serving_embedding.py
+3
-5
No files found.
vllm/entrypoints/openai/serving_completion.py
View file @
29862b88
...
...
@@ -189,13 +189,7 @@ class OpenAIServingCompletion(OpenAIServing):
try
:
async
for
i
,
res
in
result_generator
:
final_res_batch
[
i
]
=
res
except
asyncio
.
CancelledError
:
return
self
.
create_error_response
(
"Client disconnected"
)
except
ValueError
as
e
:
# TODO: Use a vllm-specific Validation Error
return
self
.
create_error_response
(
str
(
e
))
try
:
for
i
,
final_res
in
enumerate
(
final_res_batch
):
assert
final_res
is
not
None
...
...
@@ -217,6 +211,8 @@ class OpenAIServingCompletion(OpenAIServing):
tokenizer
,
request_metadata
,
)
except
asyncio
.
CancelledError
:
return
self
.
create_error_response
(
"Client disconnected"
)
except
ValueError
as
e
:
# TODO: Use a vllm-specific Validation Error
return
self
.
create_error_response
(
str
(
e
))
...
...
vllm/entrypoints/openai/serving_embedding.py
View file @
29862b88
...
...
@@ -205,12 +205,8 @@ class OpenAIServingEmbedding(OpenAIServing):
try
:
async
for
i
,
res
in
result_generator
:
final_res_batch
[
i
]
=
res
except
asyncio
.
CancelledError
:
return
self
.
create_error_response
(
"Client disconnected"
)
try
:
for
final_res
in
final_res_batch
:
assert
final_res
is
not
None
assert
all
(
final_res
is
not
None
for
final_res
in
final_res_batch
)
final_res_batch_checked
=
cast
(
List
[
EmbeddingRequestOutput
],
final_res_batch
)
...
...
@@ -218,6 +214,8 @@ class OpenAIServingEmbedding(OpenAIServing):
response
=
request_output_to_embedding_response
(
final_res_batch_checked
,
request_id
,
created_time
,
model_name
,
encoding_format
)
except
asyncio
.
CancelledError
:
return
self
.
create_error_response
(
"Client disconnected"
)
except
ValueError
as
e
:
# TODO: Use a vllm-specific Validation Error
return
self
.
create_error_response
(
str
(
e
))
...
...
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