-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hubconf.py and load .models.json from the defualt location by mange.py
- Loading branch information
Showing
2 changed files
with
37 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
dependencies = ['torch', 'gdown'] | ||
import torch | ||
import os | ||
import zipfile | ||
|
||
from TTS.utils.generic_utils import get_user_data_dir | ||
from TTS.utils.synthesizer import Synthesizer | ||
from TTS.utils.manage import ModelManager | ||
|
||
|
||
|
||
def tts(model_name='tts_models/en/ljspeech/tacotron2-DCA', vocoder_name='vocoder_models/en/ljspeech/mulitband-melgan', pretrained=True): | ||
manager = ModelManager() | ||
|
||
model_path, config_path = manager.download_model(model_name) | ||
vocoder_path, vocoder_config_path = manager.download_model(vocoder_name) | ||
|
||
# create synthesizer | ||
synthesizer = Synthesizer(model_path, config_path, vocoder_path, vocoder_config_path) | ||
return synthesizer | ||
|
||
|
||
if __name__ == '__main__': | ||
# synthesizer = torch.hub.load('/data/rw/home/projects/TTS/TTS', 'tts', source='local') | ||
synthesizer = torch.hub.load('mozilla/TTS:hub_conf', 'tts', source='github') | ||
synthesizer.tts("This is a test!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters