From b10333c2380e9d91a0bcc505417b774555c3e4fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eren=20G=C3=B6lge?= Date: Mon, 3 May 2021 14:38:42 +0200 Subject: [PATCH] fix #467 --- hubconf.py | 19 ++++++++++++++----- setup.py | 2 +- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/hubconf.py b/hubconf.py index 0dd25893..152374c8 100644 --- a/hubconf.py +++ b/hubconf.py @@ -1,11 +1,15 @@ -dependencies = ['torch', 'gdown', 'pysbd', 'phonemizer', 'unidecode', 'pypinyin'] # apt install espeak-ng +dependencies = [ + 'torch', 'gdown', 'pysbd', 'phonemizer', 'unidecode', 'pypinyin' +] # apt install espeak-ng import torch from TTS.utils.manage import ModelManager from TTS.utils.synthesizer import Synthesizer -def tts(model_name='tts_models/en/ljspeech/tacotron2-DCA', vocoder_name=None, use_cuda=False): +def tts(model_name='tts_models/en/ljspeech/tacotron2-DCA', + vocoder_name=None, + use_cuda=False): """TTS entry point for PyTorch Hub that provides a Synthesizer object to synthesize speech from a give text. Example: @@ -24,14 +28,19 @@ def tts(model_name='tts_models/en/ljspeech/tacotron2-DCA', vocoder_name=None, us manager = ModelManager() model_path, config_path, model_item = manager.download_model(model_name) - vocoder_name = model_item['default_vocoder'] if vocoder_name is None else vocoder_name + vocoder_name = model_item[ + 'default_vocoder'] if vocoder_name is None else vocoder_name vocoder_path, vocoder_config_path, _ = manager.download_model(vocoder_name) # create synthesizer - synt = Synthesizer(model_path, config_path, vocoder_path, vocoder_config_path, use_cuda) + synt = Synthesizer(tts_checkpoint=model_path, + tts_config_path=config_path, + vocoder_checkpoint=vocoder_path, + vocoder_config=vocoder_config_path, + use_cuda=use_cuda) return synt if __name__ == '__main__': - synthesizer = torch.hub.load('coqui-ai/TTS:hub_conf', 'tts', source='github') + synthesizer = torch.hub.load('coqui-ai/TTS:dev', 'tts', source='github') synthesizer.tts("This is a test!") diff --git a/setup.py b/setup.py index a3608573..abed43a2 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ if LooseVersion(sys.version) < LooseVersion("3.6") or LooseVersion(sys.version) ) -version = '0.0.13.1' +version = '0.0.13.2' cwd = os.path.dirname(os.path.abspath(__file__)) class build_py(setuptools.command.build_py.build_py): # pylint: disable=too-many-ancestors