Mastering-Python-HF commited on
Commit
490f29b
·
1 Parent(s): 8d561c5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +73 -1
README.md CHANGED
@@ -5,4 +5,76 @@ tags:
5
  language:
6
  - en
7
  pipeline_tag: text-to-speech
8
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  language:
6
  - en
7
  pipeline_tag: text-to-speech
8
+ ---
9
+
10
+ # NVIDIA FastPitch Multispeaker (en-US)
11
+
12
+ 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.
13
+
14
+ It is also compatible with NVIDIA Riva for production-grade server deployments.
15
+
16
+ ## Usage
17
+ 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.
18
+
19
+ 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.
20
+ ```
21
+ pip install nemo-toolkit['all']
22
+ ```
23
+
24
+ ## instantiate the model
25
+ Note: This model generates only spectrograms and a vocoder is needed to convert the spectrograms to waveforms. In this example HiFiTTS_HiFiGAN is used.
26
+
27
+ ```
28
+ from huggingface_hub import hf_hub_download
29
+ from nemo.collections.tts.models import FastPitchModel
30
+ from nemo.collections.tts.models import HifiGanModel
31
+
32
+ REPO_ID = "Mastering-Python-HF/nvidia_tts_en_fastpitch_multispeaker"
33
+ FILENAME = "tts_en_fastpitch_multispeaker.nemo"
34
+ path = hf_hub_download(repo_id=REPO_ID, filename=FILENAME)
35
+
36
+ spec_generator = FastPitchModel.restore_from(restore_path=path)
37
+
38
+ REPO_ID = "Mastering-Python-HF/nvidia_tts_en_hifitts_hifigan_ft_fastpitch"
39
+ FILENAME = "tts_en_hifitts_hifigan_ft_fastpitch.nemo"
40
+ path = hf_hub_download(repo_id=REPO_ID, filename=FILENAME)
41
+
42
+ model = HifiGanModel.restore_from(restore_path=path)
43
+
44
+ ```
45
+
46
+ ## Generate and save audio
47
+
48
+ ```
49
+ import soundfile as sf
50
+ parsed = spec_generator.parse("You can type your sentence here to get nemo to produce speech.")
51
+ spectrogram = spec_generator.generate_spectrogram(tokens=parsed,speaker=92)
52
+ audio = model.convert_spectrogram_to_audio(spec=spectrogram)
53
+ sf.write("speech.wav", audio.to('cpu').detach().numpy()[0], 44100)
54
+ ```
55
+
56
+ ## Input
57
+ This model accepts batches of text.
58
+
59
+ ## Output
60
+ This model generates mel spectrograms.
61
+
62
+ ## Model Architecture
63
+ 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.
64
+
65
+ ## Training
66
+ 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.
67
+
68
+ ## Datasets
69
+ This model is trained on LJSpeech sampled at 22050Hz, and has been tested on generating female English voices with an American accent.
70
+
71
+ ## Performance
72
+ No performance information is available at this time.
73
+
74
+ ## Limitations
75
+ This checkpoint only works well with vocoders that were trained on 22050Hz data. Otherwise, the generated audio may be scratchy or choppy-sounding.
76
+
77
+ ## References
78
+ -[1] FastPitch: Parallel Text-to-speech with Pitch Prediction
79
+ -[2] One TTS Alignment To Rule Them All
80
+ -[3] NVIDIA NeMo Toolkit