Downloads · 30 days
13
2% of all-time downloads
theodotus/tts_uk_fastpitch
tts_uk_fastpitch is a machine learning model from theodotus. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for nemo. The card lists the license as mit.
Downloads · 30 days
13
2% of all-time downloads
All-time downloads
630
Public
Repo size
366 MB
Likes
2
Public
Click a slice to open those files.
.nemo183 MB · 100%
From the Hugging Face model README
FastPitch [1] is a fully-parallel transformer architecture with prosody control over pitch and individual phoneme duration. Additionally, it uses an unsupervised speech-text aligner [2]. See the model architecture section for complete architecture details.
The model is available for use in the NeMo toolkit [3] and can be used as a pre-trained checkpoint for inference or for fine-tuning on another dataset.
To train, fine-tune or play with the model you will need to install NVIDIA NeMo. We recommend you install it after you've installed the latest PyTorch version.
pip install nemo_toolkit['all']
Note: This model generates only spectrograms and a vocoder is needed to convert the spectrograms to waveforms. In this example HiFiGAN is used.
# Load Tokenizer
from huggingface_hub import hf_hub_download
hf_hub_download(
repo_id="theodotus/tts_uk_fastpitch",
filename="tokenizer.py",
local_dir = "./"
)
# Load FastPitch
from nemo.collections.tts.models import FastPitchModel
spec_generator = FastPitchModel.from_pretrained("theodotus/tts_uk_fastpitch")
spec_generator.eval()
# Load vocoder
from nemo.collections.tts.models import HifiGanModel
vocoder = HifiGanModel.from_pretrained(model_name="theodotus/tts_uk_hifigan")
vocoder.eval()
# Speaker
# 0 - Mykyta
# 1 - Lada
# 2 - Tetiana
speaker = 0
import soundfile as sf
text = "К+ам'ян+ець-Под+ільський - м+істо в Хмельн+ицькій +області Укра+їни, ц+ентр Кам'ян+ець-Под+ільської міськ+ої об'+єднаної територі+альної гром+ади +і Кам'ян+ець-Под+ільського рай+ону."
parsed = spec_generator.parse(text)
spectrogram = spec_generator.generate_spectrogram(tokens=parsed, speaker=speaker)
audio = vocoder.convert_spectrogram_to_audio(spec=spectrogram)
# Save the audio to disk in a file called speech.wav
sf.write("speech.wav", audio.to('cpu').detach().numpy()[0], 22050)
This model accepts batches of text.
This model generates mel spectrograms.
FastPitch is a fully-parallel text-to-speech model based on FastSpeech, conditioned on fundamental frequency contours. The model predicts pitch contours during inference. By altering these predictions, the generated speech can be more expressive, better match the semantic of the utterance, and in the end more engaging to the listener. FastPitch is based on a fully-parallel Transformer architecture, with a much higher real-time factor than Tacotron2 for the mel-spectrogram synthesis of a typical utterance. It uses an unsupervised speech-text aligner.
The NeMo toolkit [3] was used for training the models for 1000 epochs. These model are trained with this example script and this base config.
This model is trained on LJSpeech sampled at 22050Hz, and has been tested on generating female English voices with an American accent.
No performance information is available at this time.
This checkpoint only works well with vocoders that were trained on 22050Hz data. Otherwise, the generated audio may be scratchy or choppy-sounding.