From 8fffd4e8132e660a54d0cf6ac205c61c8dfc84bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eren=20G=C3=B6lge?= Date: Tue, 13 Jul 2021 10:59:05 +0200 Subject: [PATCH] Don't print computed phonemes It causes noise in logs --- TTS/tts/datasets/TTSDataset.py | 1 + TTS/tts/layers/losses.py | 2 +- TTS/tts/utils/text/__init__.py | 3 --- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/TTS/tts/datasets/TTSDataset.py b/TTS/tts/datasets/TTSDataset.py index 9b841034..3533dede 100644 --- a/TTS/tts/datasets/TTSDataset.py +++ b/TTS/tts/datasets/TTSDataset.py @@ -244,6 +244,7 @@ class TTSDataset(Dataset): # TODO: find a better fix return self.load_data(self.rescue_item_idx) + pitch = None if self.compute_f0: pitch = self._load_or_compute_pitch(self.ap, wav_file, self.f0_cache_path) diff --git a/TTS/tts/layers/losses.py b/TTS/tts/layers/losses.py index 8a50c811..71e7e4fc 100644 --- a/TTS/tts/layers/losses.py +++ b/TTS/tts/layers/losses.py @@ -687,7 +687,7 @@ class FastPitchLoss(nn.Module): spec_loss = self.spec_loss(decoder_output, decoder_target, decoder_output_lens) ssim_loss = self.ssim(decoder_output, decoder_target, decoder_output_lens) - dur_loss = self.dur_loss(dur_output[:, : ,None], dur_target[:, :, None], input_lens) + dur_loss = self.dur_loss(dur_output[:, :, None], dur_target[:, :, None], input_lens) pitch_loss = self.pitch_loss(pitch_output.transpose(1, 2), pitch_target.transpose(1, 2), input_lens) loss = ( self.spec_loss_alpha * spec_loss diff --git a/TTS/tts/utils/text/__init__.py b/TTS/tts/utils/text/__init__.py index 20712f1d..66f518b4 100644 --- a/TTS/tts/utils/text/__init__.py +++ b/TTS/tts/utils/text/__init__.py @@ -45,12 +45,10 @@ def text2phone(text, language, use_espeak_phonemes=False): # TO REVIEW : How to have a good implementation for this? if language == "zh-CN": ph = chinese_text_to_phonemes(text) - print(" > Phonemes: {}".format(ph)) return ph if language == "ja-jp": ph = japanese_text_to_phonemes(text) - print(" > Phonemes: {}".format(ph)) return ph if gruut.is_language_supported(language): @@ -80,7 +78,6 @@ def text2phone(text, language, use_espeak_phonemes=False): # Fix a few phonemes ph = ph.translate(GRUUT_TRANS_TABLE) - return ph raise ValueError(f" [!] Language {language} is not supported for phonemization.")