ソースを参照

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}