Skip to content

Commit

Permalink
example.tts: Update tacotron2 inference interface
Browse files Browse the repository at this point in the history
There are two updates in Nvidia Tacotron2 interface:
1. infer() receives input_lengths argument
2. infer() returns mel, mel_lengths, alightments
  • Loading branch information
kbumsik committed Oct 13, 2022
1 parent 0e8e7d5 commit db2466f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/text_to_speech_synthesizer/waveglow_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ def preprocess(self, data):

def inference(self, data):
with torch.no_grad():
_, mel, _, _ = self.tacotron2_model.infer(data)
input_lengths = torch.IntTensor([data.size(1)]).to(device=self.device, dtype=torch.int64)
mel, _, _ = self.tacotron2_model.infer(data, input_lengths)
audio = self.waveglow_model.infer(mel)

return audio
Expand Down

0 comments on commit db2466f

Please sign in to comment.