mirror of
https://github.com/wassname/TTS.git
synced 2026-09-09 11:16:00 +08:00
Add init_from_config as an abstract class
This commit is contained in:
@@ -130,6 +130,15 @@ class BaseModel(nn.Module, ABC):
|
||||
"""
|
||||
...
|
||||
|
||||
@staticmethod
|
||||
@abstractmethod
|
||||
def init_from_config(config: Coqpit):
|
||||
"""Init the model from given config.
|
||||
|
||||
Override this depending on your model.
|
||||
"""
|
||||
pass
|
||||
|
||||
def get_optimizer(self) -> Union["Optimizer", List["Optimizer"]]:
|
||||
"""Setup an return optimizer or optimizers."""
|
||||
pass
|
||||
@@ -150,3 +159,4 @@ class BaseModel(nn.Module, ABC):
|
||||
|
||||
def format_batch(self):
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user