fixing torch device error when synthesizer is called with use_cuda=True

This commit is contained in:
try-er 2023-12-20 07:14:17 +05:30
parent 55c7063724
commit 690063380a
1 changed files with 1 additions and 1 deletions

View File

@ -398,7 +398,7 @@ class ForwardTTS(BaseTTS):
"""
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]