Flush Cache API (#103)

This commit is contained in:
Liangsheng Yin
2024-01-26 13:32:59 +08:00
committed by GitHub
parent 3a581e9949
commit 81561f8e2d
6 changed files with 48 additions and 64 deletions

View File

@@ -71,6 +71,15 @@ async def get_model_info():
return result
@app.get("/flush_cache")
async def flush_cache():
await tokenizer_manager.flush_cache()
return Response(
content="Cache flushed.\nPlease check backend logs for more details. (When there are running or waiting requests, the operation will not be performed.)\n",
status_code=200,
)
async def stream_generator(obj):
async for out in tokenizer_manager.generate_request(obj):
yield out