Browse Source

add empty cache

lyuxiang.lx 1 năm trước cách đây
mục cha
commit
ee9e87b4d3
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  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}