mirror of
https://github.com/coqui-ai/TTS.git
synced 2026-07-12 13:31:01 +02:00
Improve robostness on cpu / gpu model mix
This commit is contained in:
@@ -37,7 +37,8 @@ def tts(model, vocoder_model, text, CONFIG, use_cuda, ap, use_gl, speaker_fileid
|
||||
if CONFIG.model == "Tacotron" and not use_gl:
|
||||
mel_postnet_spec = ap.out_linear_to_mel(mel_postnet_spec.T).T
|
||||
if not use_gl:
|
||||
waveform = vocoder_model.inference(torch.FloatTensor(mel_postnet_spec.T).unsqueeze(0))
|
||||
device_type = "cuda" if use_cuda else "cpu"
|
||||
waveform = vocoder_model.inference(torch.FloatTensor(mel_postnet_spec.T).to(device_type).unsqueeze(0))
|
||||
if use_cuda and not use_gl:
|
||||
waveform = waveform.cpu()
|
||||
if not use_gl:
|
||||
|
||||
Reference in New Issue
Block a user