Fix vocoder normalization when no vocoder is used

When G&L is used, ap_vocoder is None and crashes
This commit is contained in:
Markus Toman 2020-02-07 11:08:21 +01:00 committed by GitHub
parent 20a6ab3d61
commit 631fbdcb8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -31,8 +31,8 @@ def tts(model,
postnet_output = ap.out_linear_to_mel(postnet_output.T).T
# correct if there is a scale difference b/w two models
postnet_output = ap._denormalize(postnet_output)
postnet_output = ap_vocoder._normalize(postnet_output)
if use_vocoder_model:
postnet_output = ap_vocoder._normalize(postnet_output)
vocoder_input = torch.FloatTensor(postnet_output.T).unsqueeze(0)
waveform = vocoder_model.generate(
vocoder_input.cuda() if use_cuda else vocoder_input,