Update setup_model

This commit is contained in:
Eren Gölge 2021-12-07 12:56:44 +00:00
parent 7c4243fba7
commit 4c5cb44eeb
1 changed files with 4 additions and 2 deletions

View File

@ -1,12 +1,14 @@
from typing import Dict, List, Union
from TTS.utils.generic_utils import find_module
def setup_model(config: "Coqpit") -> "BaseTTS":
def setup_model(config: "Coqpit", samples: Union[List[List], List[Dict]] = None) -> "BaseTTS":
print(" > Using model: {}".format(config.model))
# fetch the right model implementation.
if "base_model" in config and config["base_model"] is not None:
MyModel = find_module("TTS.tts.models", config.base_model.lower())
else:
MyModel = find_module("TTS.tts.models", config.model.lower())
model = MyModel.init_from_config(config)
model = MyModel.init_from_config(config, samples)
return model