Skip to content

Commit

Permalink
[TTS] deprecate AudioToCharWithPriorAndPitchDataset. (#5959)
Browse files Browse the repository at this point in the history
Signed-off-by: Xuesong Yang <[email protected]>
  • Loading branch information
XuesongYang committed Feb 8, 2023
1 parent 4804f31 commit 1703542
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
18 changes: 1 addition & 17 deletions nemo/collections/tts/models/fastpitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,8 @@ def __init__(self, cfg: DictConfig, trainer: Trainer = None):
assert self.vocab is not None
input_fft_kwargs["n_embed"] = len(self.vocab.tokens)
input_fft_kwargs["padding_idx"] = self.vocab.pad
# TODO @xueyang: remove AudioToCharWithPriorAndPitchDataset because it has been deprecated already.
elif self.ds_class_name == "AudioToCharWithPriorAndPitchDataset":
logging.warning(
"AudioToCharWithPriorAndPitchDataset class has been deprecated. No support for"
" training or finetuning. Only inference is supported."
)
tokenizer_conf = self._get_default_text_tokenizer_conf()
self._setup_tokenizer(tokenizer_conf)
assert self.vocab is not None
input_fft_kwargs["n_embed"] = len(self.vocab.tokens)
input_fft_kwargs["padding_idx"] = self.vocab.pad
else:
raise ValueError(f"Unknown dataset class: {self.ds_class_name}")
raise ValueError(f"Unknown dataset class: {self.ds_class_name}.")

self._parser = None
self._tb_logger = None
Expand Down Expand Up @@ -238,11 +227,6 @@ def parser(self):

if ds_class_name == "TTSDataset":
self._parser = self.vocab.encode
elif ds_class_name == "AudioToCharWithPriorAndPitchDataset":
if self.vocab is None:
tokenizer_conf = self._get_default_text_tokenizer_conf()
self._setup_tokenizer(tokenizer_conf)
self._parser = self.vocab.encode
else:
raise ValueError(f"Unknown dataset class: {ds_class_name}")
else:
Expand Down
2 changes: 0 additions & 2 deletions nemo/collections/tts/models/tacotron2.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ def parser(self):
abbreviation_version="fastpitch",
make_table=False,
)
elif ds_class_name == "AudioToCharWithPriorAndPitchDataset":
self.parser = self.vocab.encode
else:
raise ValueError("Wanted to setup parser, but model does not have necessary paramaters")

Expand Down

0 comments on commit 1703542

Please sign in to comment.