浏览代码

add empty cache

lyuxiang.lx 1 年之前
父节点
当前提交
ee9e87b4d3
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      cosyvoice/cli/model.py

+ 1 - 0
cosyvoice/cli/model.py

@@ -56,4 +56,5 @@ class CosyVoiceModel:
                                       prompt_feat_len=prompt_speech_feat_len.to(self.device),
                                       embedding=flow_embedding.to(self.device))
         tts_speech = self.hift.inference(mel=tts_mel).cpu()
+        torch.cuda.empty_cache()
         return {'tts_speech': tts_speech}