[Inference] Fix request handler and add recycle logic (#5260)

* fix request handler

* fix comment
This commit is contained in:
Jianghai
2024-01-15 17:50:46 +08:00
committed by GitHub
parent c597678da4
commit d8db500efc
3 changed files with 37 additions and 7 deletions

View File

@@ -134,6 +134,16 @@ class Sequence:
"""
self.status = RequestStatus.ABORTED
def recycle(self) -> None:
"""
Recycle a running sequnce to waiitting list
"""
assert (
not self.status.is_finished and not self.status == RequestStatus.ABORTED
), "The running sequence \
is already done but it still in running list"
self.status = RequestStatus.WAITING
def __repr__(self) -> str:
return (
f"(request_id={self.request_id}, "