Skip to content

Commit 38e8e02

Browse files
Álvaro Bartoloméharshbafnachauhang
authored
Fixed Text2Speech synthesis as NVIDIA models' URL required an update (#762)
* updated nvidia waveglow & tacotron2 model urls * modified waveglow_handler references to nvidia models * included waveglow requirements before creating MAR * created requirements.txt & updated create_mar.sh Co-authored-by: Harsh Bafna <[email protected]> Co-authored-by: Geeta Chauhan <[email protected]>
1 parent f704582 commit 38e8e02

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

examples/text_to_speech_synthesizer/create_mar.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ rm -rf PyTorch
1212
mkdir -p PyTorch/SpeechSynthesis
1313
cp -r /tmp/DeepLearningExamples-torchhub/PyTorch/SpeechSynthesis/* PyTorch/SpeechSynthesis/
1414
zip -r tacotron.zip PyTorch
15-
wget https://api.ngc.nvidia.com/v2/models/nvidia/tacotron2pyt_fp32/versions/1/files/nvidia_tacotron2pyt_fp32_20190306.pth
16-
wget https://api.ngc.nvidia.com/v2/models/nvidia/waveglowpyt_fp32/versions/1/files/nvidia_waveglowpyt_fp32_20190306.pth
17-
torch-model-archiver --model-name waveglow_synthesizer --version 1.0 --model-file waveglow_model.py --serialized-file nvidia_waveglowpyt_fp32_20190306.pth --handler waveglow_handler.py --extra-files tacotron.zip,nvidia_tacotron2pyt_fp32_20190306.pth
18-
rm -rf nvidia_*
15+
wget https://api.ngc.nvidia.com/v2/models/nvidia/tacotron2_pyt_ckpt_fp32/versions/19.09.0/files/nvidia_tacotron2pyt_fp32_20190427 -O nvidia_tacotron2pyt_fp32_20190427.pth
16+
wget https://api.ngc.nvidia.com/v2/models/nvidia/waveglow_ckpt_fp32/versions/19.09.0/files/nvidia_waveglowpyt_fp32_20190427 -O nvidia_waveglowpyt_fp32_20190427.pth
17+
torch-model-archiver --model-name waveglow_synthesizer --version 1.0 --model-file waveglow_model.py --serialized-file nvidia_waveglowpyt_fp32_20190427.pth --handler waveglow_handler.py --extra-files tacotron.zip,nvidia_tacotron2pyt_fp32_20190427.pth -r requirements.txt
18+
rm -rf nvidia_*
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
numpy
2+
scipy
3+
librosa
4+
unidecode
5+
inflect
6+
librosa

examples/text_to_speech_synthesizer/waveglow_handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def _unwrap_distributed(self, state_dict):
3838
def _load_tacotron2_model(self, model_dir):
3939
from PyTorch.SpeechSynthesis.Tacotron2.tacotron2 import model as tacotron2
4040
from PyTorch.SpeechSynthesis.Tacotron2.tacotron2.text import text_to_sequence
41-
tacotron2_checkpoint = torch.load(os.path.join(model_dir, 'nvidia_tacotron2pyt_fp32_20190306.pth'))
41+
tacotron2_checkpoint = torch.load(os.path.join(model_dir, 'nvidia_tacotron2pyt_fp32_20190427.pth'))
4242
tacotron2_state_dict = self._unwrap_distributed(tacotron2_checkpoint['state_dict'])
4343
tacotron2_config = tacotron2_checkpoint['config']
4444
self.tacotron2_model = tacotron2.Tacotron2(**tacotron2_config)
@@ -58,7 +58,7 @@ def initialize(self, ctx):
5858
with zipfile.ZipFile(model_dir + '/tacotron.zip', 'r') as zip_ref:
5959
zip_ref.extractall(model_dir)
6060

61-
waveglow_checkpoint = torch.load(os.path.join(model_dir, "nvidia_waveglowpyt_fp32_20190306.pth"))
61+
waveglow_checkpoint = torch.load(os.path.join(model_dir, "nvidia_waveglowpyt_fp32_20190427.pth"))
6262
waveglow_state_dict = self._unwrap_distributed(waveglow_checkpoint['state_dict'])
6363
waveglow_config = waveglow_checkpoint['config']
6464
self.waveglow_model = WaveGlow(**waveglow_config)

0 commit comments

Comments
 (0)