Skip to content

Commit

Permalink
fix: check if waveform is pt tensor before cpu conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
jaketae committed Aug 10, 2023
1 parent a331aeb commit a3a3fe7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions TTS/utils/synthesizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def tts(
# run vocoder model
# [1, T, C]
waveform = self.vocoder_model.inference(vocoder_input.to(vocoder_device))
if waveform.device != torch.device("cpu") and not use_gl:
if torch.is_tensor(waveform) and waveform.device != torch.device("cpu") and not use_gl:
waveform = waveform.cpu()
if not use_gl:
waveform = waveform.numpy()
Expand Down Expand Up @@ -474,7 +474,7 @@ def tts(
# run vocoder model
# [1, T, C]
waveform = self.vocoder_model.inference(vocoder_input.to(vocoder_device))
if waveform.device != torch.device("cpu"):
if torch.is_tensor(waveform) and waveform.device != torch.device("cpu"):
waveform = waveform.cpu()
if not use_gl:
waveform = waveform.numpy()
Expand Down

0 comments on commit a3a3fe7

Please sign in to comment.