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):
|
def __init__(self, config: Coqpit):
|
||||||
super().__init__(config)
|
super().__init__(config)
|
||||||
|
|
||||||
self.num_chars, self.config = self.get_characters(config)
|
chars, self.config = self.get_characters(config)
|
||||||
config.num_chars = self.num_chars
|
config.num_chars = self.num_chars = len(chars)
|
||||||
|
|
||||||
# pass all config fields to `self`
|
# pass all config fields to `self`
|
||||||
# for fewer code change
|
# for fewer code change
|
||||||
|
|
|
@ -24,8 +24,10 @@ def setup_model(config: Coqpit):
|
||||||
elif config.model.lower() == "wavegrad":
|
elif config.model.lower() == "wavegrad":
|
||||||
MyModel = getattr(MyModel, "Wavegrad")
|
MyModel = getattr(MyModel, "Wavegrad")
|
||||||
else:
|
else:
|
||||||
MyModel = getattr(MyModel, to_camel(config.model))
|
try:
|
||||||
raise ValueError(f"Model {config.model} not exist!")
|
MyModel = getattr(MyModel, to_camel(config.model))
|
||||||
|
except ModuleNotFoundError as e:
|
||||||
|
raise ValueError(f"Model {config.model} not exist!") from e
|
||||||
model = MyModel(config)
|
model = MyModel(config)
|
||||||
return model
|
return model
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue