From 6af03ac4762e03972b9c352d45b79f10b53d3c3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eren=20G=C3=B6lge?= Date: Mon, 9 Aug 2021 21:46:15 +0000 Subject: [PATCH] Fix `num_char` init in Tacotron models --- TTS/.models.json | 3 ++- TTS/bin/synthesize.py | 2 +- TTS/tts/models/tacotron.py | 1 + TTS/tts/models/tacotron2.py | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/TTS/.models.json b/TTS/.models.json index 3c2ad8dc..d012bd4a 100644 --- a/TTS/.models.json +++ b/TTS/.models.json @@ -102,7 +102,8 @@ "tacotron2-DDC-GST":{ "github_rls_url": "https://github.com/coqui-ai/TTS/releases/download/v0.0.10/tts_models--zh-CN--baker--tacotron2-DDC-GST.zip", "commit": "unknown", - "author": "@kirianguiller" + "author": "@kirianguiller", + "default_vocoder": null } } }, diff --git a/TTS/bin/synthesize.py b/TTS/bin/synthesize.py index 9895c04e..3e69e1ad 100755 --- a/TTS/bin/synthesize.py +++ b/TTS/bin/synthesize.py @@ -208,7 +208,7 @@ def main(): if args.vocoder_name is not None and not args.vocoder_path: vocoder_path, vocoder_config_path, _ = manager.download_model(args.vocoder_name) - # CASE3: set custome model paths + # CASE3: set custom model paths if args.model_path is not None: model_path = args.model_path config_path = args.config_path diff --git a/TTS/tts/models/tacotron.py b/TTS/tts/models/tacotron.py index f7dfa70b..f7969b19 100644 --- a/TTS/tts/models/tacotron.py +++ b/TTS/tts/models/tacotron.py @@ -24,6 +24,7 @@ class Tacotron(BaseTacotron): super().__init__(config) self.num_chars, self.config = self.get_characters(config) + config.num_chars = self.num_chars # pass all config fields to `self` # for fewer code change diff --git a/TTS/tts/models/tacotron2.py b/TTS/tts/models/tacotron2.py index c6df0706..39ef12a8 100644 --- a/TTS/tts/models/tacotron2.py +++ b/TTS/tts/models/tacotron2.py @@ -23,7 +23,7 @@ class Tacotron2(BaseTacotron): super().__init__(config) chars, self.config = self.get_characters(config) - self.num_chars = len(chars) + config.num_chars = len(chars) self.decoder_output_dim = config.out_channels # pass all config fields to `self`