From 3c961370e7c104e6151a31a09e9fe0dca5f8b2f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eren=20G=C3=B6lge?= Date: Tue, 9 Feb 2021 11:43:17 +0000 Subject: [PATCH] linter fixes --- TTS/bin/train_speedy_speech.py | 2 +- TTS/utils/arguments.py | 5 ++--- tests/test_text_processing.py | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/TTS/bin/train_speedy_speech.py b/TTS/bin/train_speedy_speech.py index 7d7d834c..a9a83bbf 100644 --- a/TTS/bin/train_speedy_speech.py +++ b/TTS/bin/train_speedy_speech.py @@ -515,7 +515,7 @@ def main(args): # pylint: disable=redefined-outer-name train_avg_loss_dict, global_step = train(train_loader, model, criterion, optimizer, scheduler, ap, global_step, epoch) - eval_avg_loss_dict = evaluate(eval_loader , model, criterion, ap, + eval_avg_loss_dict = evaluate(eval_loader, model, criterion, ap, global_step, epoch) c_logger.print_epoch_end(epoch, eval_avg_loss_dict) target_loss = train_avg_loss_dict['avg_loss'] diff --git a/TTS/utils/arguments.py b/TTS/utils/arguments.py index f0b45d5e..948c90d3 100644 --- a/TTS/utils/arguments.py +++ b/TTS/utils/arguments.py @@ -104,8 +104,7 @@ def get_last_checkpoint(path): pass if last_checkpoint is None: raise ValueError(f"No checkpoints in {path}!") - else: - return last_checkpoint + return last_checkpoint def process_args(args, model_type): @@ -193,7 +192,7 @@ def process_args(args, model_type): if args.restore_path: new_fields["restore_path"] = args.restore_path new_fields["github_branch"] = get_git_branch() - copy_model_files(c, args.config_path, + copy_model_files(c, args.config_path, out_path, new_fields) os.chmod(audio_path, 0o775) os.chmod(out_path, 0o775) diff --git a/tests/test_text_processing.py b/tests/test_text_processing.py index 2f68c6e7..8c075d06 100644 --- a/tests/test_text_processing.py +++ b/tests/test_text_processing.py @@ -21,7 +21,7 @@ def test_phoneme_to_sequence(): text_hat_with_params = sequence_to_phoneme(sequence, tp=conf.characters) gt = "ɹiːsənt ɹɪsɜːtʃ æt hɑːɹvɚd hɐz ʃoʊn mɛdᵻteɪɾɪŋ fɔːɹ æz lɪɾəl æz eɪt wiːks kæn æktʃuːəli ɪnkɹiːs, ðə ɡɹeɪ mæɾɚɹ ɪnðə pɑːɹts ʌvðə bɹeɪn ɹɪspɑːnsəbəl fɔːɹ ɪmoʊʃənəl ɹɛɡjuːleɪʃən ænd lɜːnɪŋ!" assert text_hat == text_hat_with_params == gt - + # multiple punctuations text = "Be a voice, not an! echo?" sequence = phoneme_to_sequence(text, text_cleaner, lang)