serving xpu memory opt (#10358)

This commit is contained in:
Yina Chen 2024-03-11 15:21:22 +08:00 committed by GitHub
parent be29833b2b
commit d7b765fd3f

View file

@ -256,6 +256,8 @@ class ModelWorker(BaseModelWorker):
self.context_len, self.context_len,
self.stream_interval, self.stream_interval,
): ):
if self.device == "xpu":
torch.xpu.empty_cache()
ret = { ret = {
"text": output["text"], "text": output["text"],
"error_code": 0, "error_code": 0,