Fix stop_profile does not wait for finishing (#4741)
This commit is contained in:
@@ -321,7 +321,8 @@ class Engine(EngineBase):
|
||||
loop.run_until_complete(self.tokenizer_manager.start_profile())
|
||||
|
||||
def stop_profile(self):
|
||||
self.tokenizer_manager.stop_profile()
|
||||
loop = asyncio.get_event_loop()
|
||||
loop.run_until_complete(self.tokenizer_manager.stop_profile())
|
||||
|
||||
def get_server_info(self):
|
||||
loop = asyncio.get_event_loop()
|
||||
|
||||
@@ -355,7 +355,7 @@ async def start_profile_async(obj: Optional[ProfileReqInput] = None):
|
||||
@app.api_route("/stop_profile", methods=["GET", "POST"])
|
||||
async def stop_profile_async():
|
||||
"""Stop profiling."""
|
||||
_global_state.tokenizer_manager.stop_profile()
|
||||
await _global_state.tokenizer_manager.stop_profile()
|
||||
return Response(
|
||||
content="Stop profiling. This will take some time.\n",
|
||||
status_code=200,
|
||||
|
||||
Reference in New Issue
Block a user