mirror of
https://github.com/wassname/TTS.git
synced 2026-09-09 11:16:00 +08:00
Fix Tacotron num_char init
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user