-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TTS Collection #874
TTS Collection #874
Conversation
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
This pull request introduces 1 alert when merging e173943 into b883b31 - view on LGTM.com new alerts:
|
Signed-off-by: Jason <[email protected]>
This pull request introduces 1 alert when merging 3f48fac into 054cc02 - view on LGTM.com new alerts:
|
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks good, but there are few small issues here and there - please see comments.
return mel_loss + gate_loss | ||
|
||
|
||
@experimental # TODO: Need to implement abstract methods: list_available_models, from_pretrained, export but how? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you'll only need to implement "list_available_model()" once you have cloud locations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I get TypeError: Can't instantiate abstract class Tacotron2Model with abstract methods export
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And hydra.errors.HydraException: Error calling 'nemo.collections.tts.modules.tacotron2.Encoder' : Can't instantiate abstract class Encoder with abstract methods restore_from, save_to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Can't instantiate abstract class Tacotron2Model with abstract method" this should not happen if you merge/rebase latest candidate into your branch
validation_ds: Optional[Dict] = None | ||
|
||
|
||
class Tacotron2Loss(Loss): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this class should go to nemo/collections/tts/losses/* or to nemo/collections/common/losses/* and also get some docstring
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why move it? This loss is only ever going to be used in this model. It is so redundant that I have to define it as it's own separate class rather than a function of Tacotron2Model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the new function-level override of typecheck(), it doesn't even need to inherit from Typing to use NeMo's typing. Tacotron2Loss
doesn't have an init nor does it use self
, it's a function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency. We put all losses other losses under collections/collection_name/losses/* . why make exception here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved.
I maintain that collections/collection_name/losses/*
shouldn't exist apart from losses inside common. NLP's losses is empty and ASR only has CTC that is only used in CTC models so it should be moved there and losses folder should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me qualify my above statement. If a loss is only ever going to be used in a single model, it should not be in the losses folder. And if the losses folder is empty, it should be deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side note, It is incorrect that the class does not need to implement Typing. All of the actual tests lie inside the Typing class, and the decorator simply dispatches these checks. This is by design to support graph level checks. The decor will raise Runtime error if placed on a class that doesn't implement Typing.
|
||
@experimental # TODO: Need to implement abstract methods: list_available_models, from_pretrained, export but how? | ||
class Tacotron2Model(ModelPT): | ||
# TODO: tensorboard for training |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the problem with TB for training?
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
Signed-off-by: Jason <[email protected]>
elif not isinstance(cfg, DictConfig): | ||
raise ValueError(f"cfg was type: {type(cfg)}. Expected either a dict or a DictConfig") | ||
# Ensure passed cfg is compliant with schema | ||
OmegaConf.merge(cfg, schema) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@titu1994 @ericharper @tkornuta-nvidia - let's chat (outside of this PR) if we'd like to adapt something like this in general for Models
@@ -77,7 +77,7 @@ def __init__(self, cfg: DictConfig, trainer: Trainer = None): | |||
self._scheduler = None | |||
self._trainer = trainer | |||
|
|||
if self._cfg is not None: | |||
if self._cfg is not None: # TODO: This check is redundant since we know cfg is an instance of DictConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true - feel free to remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments regarding possible refactor, but overall not necessary to merge. LGTM
raise ValueError(f"No dataset for {name}") # TODO | ||
if "dataloader_params" not in cfg or not isinstance(cfg["dataloader_params"], (dict, DictConfig)): | ||
raise ValueError(f"No dataloder_params for {name}") # TODO | ||
if shuffle_should_be: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about "should_shuffle_train_val"
from nemo.utils.decorators import experimental | ||
|
||
|
||
class OperationMode(Enum): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mode should be unnecessary after the function override of typecheck if you would like to refactor, but this is fine too.
* add structure Signed-off-by: Jason <[email protected]> * add files Signed-off-by: Jason <[email protected]> * add init Signed-off-by: Jason <[email protected]> * fix init Signed-off-by: Jason <[email protected]> * update taco Signed-off-by: Jason <[email protected]> * format Signed-off-by: Jason <[email protected]> * typo Signed-off-by: Jason <[email protected]> * val change Signed-off-by: Jason <[email protected]> * update Signed-off-by: Jason <[email protected]> * update Signed-off-by: Jason <[email protected]> * update Signed-off-by: Jason <[email protected]> * add header Signed-off-by: Jason <[email protected]> * add waveglow Signed-off-by: Jason <[email protected]> * waveglow fix Signed-off-by: Jason <[email protected]> * waveglow fix Signed-off-by: Jason <[email protected]> * waveglow fix Signed-off-by: Jason <[email protected]> * add O1 Signed-off-by: Jason <[email protected]> * add todo Signed-off-by: Jason <[email protected]> * change batch sizes Signed-off-by: Jason <[email protected]> * move Signed-off-by: Jason <[email protected]> * move Signed-off-by: Jason <[email protected]> * V1 Signed-off-by: Jason <[email protected]> * V1 Signed-off-by: Jason <[email protected]> * structure Signed-off-by: Jason <[email protected]> * clean up Signed-off-by: Jason <[email protected]> * fix tacotron2 Signed-off-by: Jason <[email protected]> * add files Signed-off-by: Jason <[email protected]> * update yamls Signed-off-by: Jason <[email protected]> * fix waveglow 1/2 Signed-off-by: Jason <[email protected]> * fix waveglow 2/3 Signed-off-by: Jason <[email protected]> * fix waveglow 3/? Signed-off-by: Jason <[email protected]> * merge asr and tts Signed-off-by: Jason <[email protected]> * update waveglow Signed-off-by: Jason <[email protected]> * isort Signed-off-by: Jason <[email protected]> * update configs Signed-off-by: Jason <[email protected]> * update waveglow's dataloader Signed-off-by: Jason <[email protected]> * update and refactor Signed-off-by: Jason <[email protected]> * update t2 and waveglow Signed-off-by: Jason <[email protected]> * enforce dictconfig; style Signed-off-by: Jason <[email protected]> * add fastdevruns Signed-off-by: Jason <[email protected]> * name Signed-off-by: Jason <[email protected]> * import Signed-off-by: Jason <[email protected]> * update tests Signed-off-by: Jason <[email protected]> * yaml Signed-off-by: Jason <[email protected]> * use hydra rnner Signed-off-by: Jason <[email protected]> * style Signed-off-by: Jason <[email protected]> * move callback to common Signed-off-by: Jason <[email protected]> * fixed tacotron 2; add typing to all neuralmodules Signed-off-by: Jason <[email protected]> * flatten Signed-off-by: Jason <[email protected]> * Style Signed-off-by: Jason <[email protected]> * patch jenkins Signed-off-by: Jason <[email protected]> * change typeheck logic Signed-off-by: Jason <[email protected]> * fix t2 Signed-off-by: Jason <[email protected]> * fix wg Signed-off-by: Jason <[email protected]> * style Signed-off-by: Jason <[email protected]> * update configs Signed-off-by: Jason <[email protected]> * add num_workers Signed-off-by: Jason <[email protected]> * update config Signed-off-by: Jason <[email protected]> * update gitignore Signed-off-by: Jason <[email protected]> * config Signed-off-by: Jason <[email protected]> * enable fp16 on t2 Signed-off-by: Jason <[email protected]> * enable fp16 on t2 Signed-off-by: Jason <[email protected]> * enable fp16 on t2 Signed-off-by: Jason <[email protected]> * fix t2 Signed-off-by: Jason <[email protected]> * fixes Signed-off-by: Jason <[email protected]> * add typing to models; use nemo loss class Signed-off-by: Jason <[email protected]> * make wg work Signed-off-by: Jason <[email protected]> * make t2 work Signed-off-by: Jason <[email protected]> * style Signed-off-by: Jason <[email protected]> * fix wg Signed-off-by: Jason <[email protected]> * add better debug info to shape check Signed-off-by: Jason <[email protected]> * lgtm import error Signed-off-by: Jason <[email protected]> * lower batch size for testing Signed-off-by: Jason <[email protected]> * address comments Signed-off-by: Jason <[email protected]> * address comments and remove experimental Signed-off-by: Jason <[email protected]> * standardize Signed-off-by: Jason <[email protected]> * mark back as experimental Signed-off-by: Jason <[email protected]> * style Signed-off-by: Jason <[email protected]> * experimental Signed-off-by: Jason <[email protected]> Signed-off-by: Jocelyn Huang <[email protected]>
* add structure Signed-off-by: Jason <[email protected]> * add files Signed-off-by: Jason <[email protected]> * add init Signed-off-by: Jason <[email protected]> * fix init Signed-off-by: Jason <[email protected]> * update taco Signed-off-by: Jason <[email protected]> * format Signed-off-by: Jason <[email protected]> * typo Signed-off-by: Jason <[email protected]> * val change Signed-off-by: Jason <[email protected]> * update Signed-off-by: Jason <[email protected]> * update Signed-off-by: Jason <[email protected]> * update Signed-off-by: Jason <[email protected]> * add header Signed-off-by: Jason <[email protected]> * add waveglow Signed-off-by: Jason <[email protected]> * waveglow fix Signed-off-by: Jason <[email protected]> * waveglow fix Signed-off-by: Jason <[email protected]> * waveglow fix Signed-off-by: Jason <[email protected]> * add O1 Signed-off-by: Jason <[email protected]> * add todo Signed-off-by: Jason <[email protected]> * change batch sizes Signed-off-by: Jason <[email protected]> * move Signed-off-by: Jason <[email protected]> * move Signed-off-by: Jason <[email protected]> * V1 Signed-off-by: Jason <[email protected]> * V1 Signed-off-by: Jason <[email protected]> * structure Signed-off-by: Jason <[email protected]> * clean up Signed-off-by: Jason <[email protected]> * fix tacotron2 Signed-off-by: Jason <[email protected]> * add files Signed-off-by: Jason <[email protected]> * update yamls Signed-off-by: Jason <[email protected]> * fix waveglow 1/2 Signed-off-by: Jason <[email protected]> * fix waveglow 2/3 Signed-off-by: Jason <[email protected]> * fix waveglow 3/? Signed-off-by: Jason <[email protected]> * merge asr and tts Signed-off-by: Jason <[email protected]> * update waveglow Signed-off-by: Jason <[email protected]> * isort Signed-off-by: Jason <[email protected]> * update configs Signed-off-by: Jason <[email protected]> * update waveglow's dataloader Signed-off-by: Jason <[email protected]> * update and refactor Signed-off-by: Jason <[email protected]> * update t2 and waveglow Signed-off-by: Jason <[email protected]> * enforce dictconfig; style Signed-off-by: Jason <[email protected]> * add fastdevruns Signed-off-by: Jason <[email protected]> * name Signed-off-by: Jason <[email protected]> * import Signed-off-by: Jason <[email protected]> * update tests Signed-off-by: Jason <[email protected]> * yaml Signed-off-by: Jason <[email protected]> * use hydra rnner Signed-off-by: Jason <[email protected]> * style Signed-off-by: Jason <[email protected]> * move callback to common Signed-off-by: Jason <[email protected]> * fixed tacotron 2; add typing to all neuralmodules Signed-off-by: Jason <[email protected]> * flatten Signed-off-by: Jason <[email protected]> * Style Signed-off-by: Jason <[email protected]> * patch jenkins Signed-off-by: Jason <[email protected]> * change typeheck logic Signed-off-by: Jason <[email protected]> * fix t2 Signed-off-by: Jason <[email protected]> * fix wg Signed-off-by: Jason <[email protected]> * style Signed-off-by: Jason <[email protected]> * update configs Signed-off-by: Jason <[email protected]> * add num_workers Signed-off-by: Jason <[email protected]> * update config Signed-off-by: Jason <[email protected]> * update gitignore Signed-off-by: Jason <[email protected]> * config Signed-off-by: Jason <[email protected]> * enable fp16 on t2 Signed-off-by: Jason <[email protected]> * enable fp16 on t2 Signed-off-by: Jason <[email protected]> * enable fp16 on t2 Signed-off-by: Jason <[email protected]> * fix t2 Signed-off-by: Jason <[email protected]> * fixes Signed-off-by: Jason <[email protected]> * add typing to models; use nemo loss class Signed-off-by: Jason <[email protected]> * make wg work Signed-off-by: Jason <[email protected]> * make t2 work Signed-off-by: Jason <[email protected]> * style Signed-off-by: Jason <[email protected]> * fix wg Signed-off-by: Jason <[email protected]> * add better debug info to shape check Signed-off-by: Jason <[email protected]> * lgtm import error Signed-off-by: Jason <[email protected]> * lower batch size for testing Signed-off-by: Jason <[email protected]> * address comments Signed-off-by: Jason <[email protected]> * address comments and remove experimental Signed-off-by: Jason <[email protected]> * standardize Signed-off-by: Jason <[email protected]> * mark back as experimental Signed-off-by: Jason <[email protected]> * style Signed-off-by: Jason <[email protected]> * experimental Signed-off-by: Jason <[email protected]> Signed-off-by: Samuel Kriman <[email protected]>
Adds TTS to candidate
Changes outside TTS collection
ASR collection
get_seq_len
function.get_features
is now expected to return processed_signal and processed_lengthCore collection
LogEpochTimeCallback
tonemo.collections.core.callbacks
Core
hydra.utils.instantiate
TODO
Be NeMo 1.0 Class compliant: Broken into more tasks