From 690063380a21262f11c83392d509a813805c87c9 Mon Sep 17 00:00:00 2001 From: try-er Date: Wed, 20 Dec 2023 07:14:17 +0530 Subject: [PATCH] fixing torch device error when synthesizer is called with use_cuda=True --- TTS/tts/models/forward_tts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TTS/tts/models/forward_tts.py b/TTS/tts/models/forward_tts.py index b6e9ac8a14..95d79d2cbc 100644 --- a/TTS/tts/models/forward_tts.py +++ b/TTS/tts/models/forward_tts.py @@ -398,7 +398,7 @@ def _forward_encoder( """ if hasattr(self, "emb_g"): g = g.type(torch.LongTensor) - g = self.emb_g(g) # [B, C, 1] + g = self.emb_g(g.to("cuda") if torch.cuda.is_available() else g.to("cpu")) # [B, C, 1] if g is not None: g = g.unsqueeze(-1) # [B, T, C]