Downloads · 30 days
5
0% of all-time downloads
padmalcom/tts-hifigan-german
tts-hifigan-german is a text-to-speech model from padmalcom. Use it when you need text read aloud. It is set up for speechbrain. The card lists the license as apache-2.0.
This repository provides all the necessary tools for using a HiFIGAN vocoder trained on a generated German dataset using mp3totrainingdata.
Downloads · 30 days
5
0% of all-time downloads
All-time downloads
3.5K
Public
Repo size
112 MB
Likes
3
Public
Click a slice to open those files.
.ckpt55.8 MB · 100%
From the Hugging Face model README
This repository provides all the necessary tools for using a HiFIGAN vocoder trained on a generated German dataset using mp3_to_training_data.
The pre-trained model (8 epochs so far) takes in input a spectrogram and produces a waveform in output. Typically, a vocoder is used after a TTS model that converts an input text into a spectrogram.
Install speechbrain.
pip install speechbrain
Use a TTS model (e.g. tts-tacotron-german), generate a spectrogram and convert it to audio.
import torchaudio
from speechbrain.pretrained import Tacotron2
from speechbrain.pretrained import HIFIGAN
tacotron2 = Tacotron2.from_hparams(source="padmalcom/tts-tacotron2-german", savedir="tmpdir_tts")
hifi_gan = HIFIGAN.from_hparams(source="padmalcom/tts-hifigan-german", savedir="tmpdir_vocoder")
mel_output, mel_length, alignment = tacotron2.encode_text("Mary had a little lamb")
waveforms = hifi_gan.decode_batch(mel_output)
torchaudio.save('example_TTS.wav',waveforms.squeeze(1), 22050)
To perform inference on the GPU, add run_opts={"device":"cuda"} when calling the from_hparams method.