salomonsky commited on
Commit
29162be
·
verified ·
1 Parent(s): dfbd70c

Update hubconf.py

Browse files
Files changed (1) hide show
  1. hubconf.py +1 -19
hubconf.py CHANGED
@@ -2,29 +2,13 @@ dependencies = [
2
  'torch', 'gdown', 'pysbd', 'gruut', 'anyascii', 'pypinyin', 'coqpit', 'mecab-python3', 'unidic-lite'
3
  ]
4
  import torch
5
-
6
  from TTS.utils.manage import ModelManager
7
  from TTS.utils.synthesizer import Synthesizer
8
 
9
-
10
  def tts(model_name='tts_models/en/ljspeech/tacotron2-DCA',
11
  vocoder_name=None,
12
  use_cuda=False):
13
- """TTS entry point for PyTorch Hub that provides a Synthesizer object to synthesize speech from a give text.
14
-
15
- Example:
16
- >>> synthesizer = torch.hub.load('coqui-ai/TTS', 'tts', source='github')
17
- >>> wavs = synthesizer.tts("This is a test! This is also a test!!")
18
- wavs - is a list of values of the synthesized speech.
19
 
20
- Args:
21
- model_name (str, optional): One of the model names from .model.json. Defaults to 'tts_models/en/ljspeech/tacotron2-DCA'.
22
- vocoder_name (str, optional): One of the model names from .model.json. Defaults to 'vocoder_models/en/ljspeech/multiband-melgan'.
23
- pretrained (bool, optional): [description]. Defaults to True.
24
-
25
- Returns:
26
- TTS.utils.synthesizer.Synthesizer: Synthesizer object wrapping both vocoder and tts models.
27
- """
28
  manager = ModelManager()
29
 
30
  model_path, config_path, model_item = manager.download_model(model_name)
@@ -32,7 +16,6 @@ def tts(model_name='tts_models/en/ljspeech/tacotron2-DCA',
32
  'default_vocoder'] if vocoder_name is None else vocoder_name
33
  vocoder_path, vocoder_config_path, _ = manager.download_model(vocoder_name)
34
 
35
- # create synthesizer
36
  synt = Synthesizer(tts_checkpoint=model_path,
37
  tts_config_path=config_path,
38
  vocoder_checkpoint=vocoder_path,
@@ -40,7 +23,6 @@ def tts(model_name='tts_models/en/ljspeech/tacotron2-DCA',
40
  use_cuda=use_cuda)
41
  return synt
42
 
43
-
44
  if __name__ == '__main__':
45
  synthesizer = torch.hub.load('coqui-ai/TTS:dev', 'tts', source='github')
46
- synthesizer.tts("This is a test!")
 
2
  'torch', 'gdown', 'pysbd', 'gruut', 'anyascii', 'pypinyin', 'coqpit', 'mecab-python3', 'unidic-lite'
3
  ]
4
  import torch
 
5
  from TTS.utils.manage import ModelManager
6
  from TTS.utils.synthesizer import Synthesizer
7
 
 
8
  def tts(model_name='tts_models/en/ljspeech/tacotron2-DCA',
9
  vocoder_name=None,
10
  use_cuda=False):
 
 
 
 
 
 
11
 
 
 
 
 
 
 
 
 
12
  manager = ModelManager()
13
 
14
  model_path, config_path, model_item = manager.download_model(model_name)
 
16
  'default_vocoder'] if vocoder_name is None else vocoder_name
17
  vocoder_path, vocoder_config_path, _ = manager.download_model(vocoder_name)
18
 
 
19
  synt = Synthesizer(tts_checkpoint=model_path,
20
  tts_config_path=config_path,
21
  vocoder_checkpoint=vocoder_path,
 
23
  use_cuda=use_cuda)
24
  return synt
25
 
 
26
  if __name__ == '__main__':
27
  synthesizer = torch.hub.load('coqui-ai/TTS:dev', 'tts', source='github')
28
+ synthesizer.tts("Saludos!")