audio
audio copied to clipboard
Make TextProcessor object inherit `torch.nn.Module`.
The TextProcessor object from TTS pipeline, should be able to return Tensors in specified device.
Currently the returned Tensors have to be manually moved to the target device.
bundle = torchaudio.pipelines.TACOTRON2_WAVERNN_PHONE_LJSPEECH
processor = bundle.get_text_processor()
text = "Hello world! Text to speech!"
processed, lengths = processor(text)
processed = processed.to(device)
lengths = lengths.to(device)
Inheriting torch.nn.Module should make this simpler
bundle = torchaudio.pipelines.TACOTRON2_WAVERNN_PHONE_LJSPEECH
processor = bundle.get_text_processor().to(device)
text = "Hello world! Text to speech!"
processed, lengths = processor(text)