serving xpu memory opt (#10358)
This commit is contained in:
parent
be29833b2b
commit
d7b765fd3f
1 changed files with 2 additions and 0 deletions
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue