mirror of https://github.com/coqui-ai/TTS.git
fix #467
This commit is contained in:
parent
8cb27267a4
commit
b10333c238
19
hubconf.py
19
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
|
import torch
|
||||||
|
|
||||||
from TTS.utils.manage import ModelManager
|
from TTS.utils.manage import ModelManager
|
||||||
from TTS.utils.synthesizer import Synthesizer
|
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.
|
"""TTS entry point for PyTorch Hub that provides a Synthesizer object to synthesize speech from a give text.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
@ -24,14 +28,19 @@ def tts(model_name='tts_models/en/ljspeech/tacotron2-DCA', vocoder_name=None, us
|
||||||
manager = ModelManager()
|
manager = ModelManager()
|
||||||
|
|
||||||
model_path, config_path, model_item = manager.download_model(model_name)
|
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)
|
vocoder_path, vocoder_config_path, _ = manager.download_model(vocoder_name)
|
||||||
|
|
||||||
# create synthesizer
|
# 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
|
return synt
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
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!")
|
synthesizer.tts("This is a test!")
|
||||||
|
|
2
setup.py
2
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__))
|
cwd = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
class build_py(setuptools.command.build_py.build_py): # pylint: disable=too-many-ancestors
|
class build_py(setuptools.command.build_py.build_py): # pylint: disable=too-many-ancestors
|
||||||
|
|
Loading…
Reference in New Issue