Unverified Commit 89be30fa authored by Murali Andoorveedu's avatar Murali Andoorveedu Committed by GitHub
Browse files

Small async_llm_engine refactor (#2618)

parent f8ecb84c
......@@ -53,7 +53,7 @@ class AsyncStream:
self._queue.put_nowait(item)
def finish(self) -> None:
self._queue.put_nowait(StopIteration)
self._queue.put_nowait(StopAsyncIteration())
self._finished = True
@property
......@@ -65,9 +65,7 @@ class AsyncStream:
async def __anext__(self) -> RequestOutput:
result = await self._queue.get()
if result is StopIteration:
raise StopAsyncIteration
elif isinstance(result, Exception):
if isinstance(result, Exception):
raise result
return result
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment