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
norm
vllm
Commits
89be30fa
Unverified
Commit
89be30fa
authored
Jan 27, 2024
by
Murali Andoorveedu
Committed by
GitHub
Jan 27, 2024
Browse files
Small async_llm_engine refactor (#2618)
parent
f8ecb84c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
vllm/engine/async_llm_engine.py
vllm/engine/async_llm_engine.py
+2
-4
No files found.
vllm/engine/async_llm_engine.py
View file @
89be30fa
...
@@ -53,7 +53,7 @@ class AsyncStream:
...
@@ -53,7 +53,7 @@ class AsyncStream:
self
.
_queue
.
put_nowait
(
item
)
self
.
_queue
.
put_nowait
(
item
)
def
finish
(
self
)
->
None
:
def
finish
(
self
)
->
None
:
self
.
_queue
.
put_nowait
(
StopIteration
)
self
.
_queue
.
put_nowait
(
Stop
Async
Iteration
()
)
self
.
_finished
=
True
self
.
_finished
=
True
@
property
@
property
...
@@ -65,9 +65,7 @@ class AsyncStream:
...
@@ -65,9 +65,7 @@ class AsyncStream:
async
def
__anext__
(
self
)
->
RequestOutput
:
async
def
__anext__
(
self
)
->
RequestOutput
:
result
=
await
self
.
_queue
.
get
()
result
=
await
self
.
_queue
.
get
()
if
result
is
StopIteration
:
if
isinstance
(
result
,
Exception
):
raise
StopAsyncIteration
elif
isinstance
(
result
,
Exception
):
raise
result
raise
result
return
result
return
result
...
...
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