From 0fa95a223180d5c977c1c5265ea3a1e265f2d661 Mon Sep 17 00:00:00 2001 From: Jake Tae Date: Thu, 10 Aug 2023 15:41:05 -0400 Subject: [PATCH] fix: add necessary vocoder output device check --- TTS/utils/synthesizer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TTS/utils/synthesizer.py b/TTS/utils/synthesizer.py index 5f8b900d7a..6669df1edd 100644 --- a/TTS/utils/synthesizer.py +++ b/TTS/utils/synthesizer.py @@ -410,7 +410,7 @@ def tts( # run vocoder model # [1, T, C] waveform = self.vocoder_model.inference(vocoder_input.to(vocoder_device)) - if not use_gl and waveform.device != torch.device("cpu"): + if waveform.device != torch.device("cpu") and not use_gl: waveform = waveform.cpu() if not use_gl: waveform = waveform.numpy() @@ -474,7 +474,7 @@ def tts( # run vocoder model # [1, T, C] waveform = self.vocoder_model.inference(vocoder_input.to(vocoder_device)) - if not use_gl and waveform.device != torch.device("cpu"): + if waveform.device != torch.device("cpu"): waveform = waveform.cpu() if not use_gl: waveform = waveform.numpy()