From 45d0b04179d0055db1a847e43c3e62927c7b1989 Mon Sep 17 00:00:00 2001 From: Edresson Date: Mon, 22 Nov 2021 15:55:00 -0300 Subject: [PATCH] Lint fixs --- TTS/bin/find_unique_phonemes.py | 4 ++-- TTS/speaker_encoder/models/resnet.py | 1 + TTS/tts/configs/vits_config.py | 4 ++-- TTS/utils/vad.py | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/TTS/bin/find_unique_phonemes.py b/TTS/bin/find_unique_phonemes.py index a869df27..832ef082 100644 --- a/TTS/bin/find_unique_phonemes.py +++ b/TTS/bin/find_unique_phonemes.py @@ -7,7 +7,7 @@ from tqdm.contrib.concurrent import process_map from TTS.config import load_config from TTS.tts.datasets import load_tts_samples -from TTS.tts.utils.text import text2phone, phoneme_to_sequence +from TTS.tts.utils.text import text2phone def compute_phonemes(item): @@ -19,8 +19,8 @@ def compute_phonemes(item): return [] return list(set(ph)) - def main(): + # pylint: disable=W0601 global c # pylint: disable=bad-option-value parser = argparse.ArgumentParser( diff --git a/TTS/speaker_encoder/models/resnet.py b/TTS/speaker_encoder/models/resnet.py index 42f041b4..47b6f23f 100644 --- a/TTS/speaker_encoder/models/resnet.py +++ b/TTS/speaker_encoder/models/resnet.py @@ -176,6 +176,7 @@ class ResNetSpeakerEncoder(nn.Module): def forward(self, x, l2_norm=False): with torch.no_grad(): with torch.cuda.amp.autocast(enabled=False): + # if you torch spec compute it otherwise use the mel spec computed by the AP if self.use_torch_spec: x = self.torch_spec(x) else: diff --git a/TTS/tts/configs/vits_config.py b/TTS/tts/configs/vits_config.py index eeb74bbe..178992a7 100644 --- a/TTS/tts/configs/vits_config.py +++ b/TTS/tts/configs/vits_config.py @@ -154,6 +154,6 @@ class VitsConfig(BaseTTSConfig): d_vector_dim: int = None def __post_init__(self): - for key in self.model_args.keys(): + for key, val in self.model_args.items(): if hasattr(self, key): - self[key] = self.model_args[key] + self[key] = val diff --git a/TTS/utils/vad.py b/TTS/utils/vad.py index 4e61f490..33548087 100644 --- a/TTS/utils/vad.py +++ b/TTS/utils/vad.py @@ -139,4 +139,4 @@ def get_vad_speech_segments(audio, sample_rate, aggressiveness=2, padding_durati frames = list(frame_generator(30, audio, sample_rate)) segments = vad_collector(sample_rate, 30, padding_duration_ms, vad, frames) - return segments \ No newline at end of file + return segments