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

@@ -20,6 +20,7 @@ from sglang.srt.managers.io_struct import (
BatchStrOut,
GenerateReqInput,
TokenizedGenerateReqInput,
FlushCacheReq,
)
from sglang.srt.mm_utils import expand2square, process_anyres_image
from sglang.srt.sampling_params import SamplingParams
@@ -228,6 +229,10 @@ class TokenizerManager:
yield output_list
async def flush_cache(self):
flush_cache_req = FlushCacheReq()
self.send_to_router.send_pyobj(flush_cache_req)
async def create_handle_loop(self):
self.to_create_loop = False
loop = asyncio.get_event_loop()