Skip to content

Commit

Permalink
Terminate AsyncLLMEngine task gracefully (#13)
Browse files Browse the repository at this point in the history
Co-authored-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
  • Loading branch information
jbkyang-nvi and pskiran1 authored Oct 13, 2023
1 parent 18ee579 commit 751b58a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ async def await_shutdown(self):
)
await asyncio.sleep(5)

for task in asyncio.all_tasks(loop=self._loop):
if task is not asyncio.current_task():
task.cancel()

self.logger.log_info("Shutdown complete")

def get_sampling_params_dict(self, params_json):
Expand Down

0 comments on commit 751b58a

Please sign in to comment.