add profile in offline benchmark & update doc (#2123)

Co-authored-by: root <bjmsong@126.com>
This commit is contained in:
bjmsong
2024-11-28 06:57:13 +08:00
committed by GitHub
parent dd5eba4c88
commit 91e5dbf554
3 changed files with 86 additions and 3 deletions

View File

@@ -169,9 +169,19 @@ async def flush_cache():
)
def start_profile():
"""Start profiling."""
tokenizer_manager.start_profile()
def stop_profile():
"""Stop profiling."""
tokenizer_manager.stop_profile()
@app.get("/start_profile")
@app.post("/start_profile")
async def start_profile():
async def start_profile_async():
"""Start profiling."""
tokenizer_manager.start_profile()
return Response(
@@ -182,7 +192,7 @@ async def start_profile():
@app.get("/stop_profile")
@app.post("/stop_profile")
async def stop_profile():
async def stop_profile_async():
"""Stop profiling."""
tokenizer_manager.stop_profile()
return Response(