mirror of https://github.com/coqui-ai/TTS.git
Fix Tacotron num_char init
This commit is contained in:
parent
7eb94f760b
commit
c8b9ca3d71
|
@ -23,8 +23,8 @@ class Tacotron(BaseTacotron):
|
|||
def __init__(self, config: Coqpit):
|
||||
super().__init__(config)
|
||||
|
||||
self.num_chars, self.config = self.get_characters(config)
|
||||
config.num_chars = self.num_chars
|
||||
chars, self.config = self.get_characters(config)
|
||||
config.num_chars = self.num_chars = len(chars)
|
||||
|
||||
# pass all config fields to `self`
|
||||
# for fewer code change
|
||||
|
|
|
@ -24,8 +24,10 @@ def setup_model(config: Coqpit):
|
|||
elif config.model.lower() == "wavegrad":
|
||||
MyModel = getattr(MyModel, "Wavegrad")
|
||||
else:
|
||||
MyModel = getattr(MyModel, to_camel(config.model))
|
||||
raise ValueError(f"Model {config.model} not exist!")
|
||||
try:
|
||||
MyModel = getattr(MyModel, to_camel(config.model))
|
||||
except ModuleNotFoundError as e:
|
||||
raise ValueError(f"Model {config.model} not exist!") from e
|
||||
model = MyModel(config)
|
||||
return model
|
||||
|
||||
|
|
Loading…
Reference in New Issue