Skip to content

Commit

Permalink
fixing torch device error when synthesizer is called with use_cuda=True
Browse files Browse the repository at this point in the history
  • Loading branch information
TRY-ER committed Dec 20, 2023
1 parent 55c7063 commit 6900633
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion TTS/tts/models/forward_tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 6900633

Please sign in to comment.