Ver código fonte

add empty cache

lyuxiang.lx 1 ano atrás
pai
commit
ee9e87b4d3
1 arquivos alterados com 1 adições e 0 exclusões
  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}