Unverified Commit c614dbdf authored by Yinghai Lu's avatar Yinghai Lu Committed by GitHub
Browse files

Nicer standalone engine inferface (#4480)

parent 927ca935
......@@ -249,6 +249,13 @@ class Engine:
"""Shutdown the engine"""
kill_process_tree(os.getpid(), include_parent=False)
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, traceback):
self.shutdown()
return False
def start_profile(self):
loop = asyncio.get_event_loop()
loop.run_until_complete(self.tokenizer_manager.start_profile())
......
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