From ee4d55549dc866eb90372d26e3eaeee1ef68acdf Mon Sep 17 00:00:00 2001 From: Thomas Werkmeister Date: Wed, 17 Jul 2019 14:08:53 +0200 Subject: [PATCH 1/2] check for speaker id is None before put on cuda --- utils/synthesis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/synthesis.py b/utils/synthesis.py index c782b4c1..541ee717 100644 --- a/utils/synthesis.py +++ b/utils/synthesis.py @@ -108,7 +108,7 @@ def synthesis(model, # preprocess the given text inputs = text_to_seqvec(text, CONFIG, use_cuda) speaker_id = id_to_torch(speaker_id) - if use_cuda: + if speaker_id is not None and use_cuda: speaker_id = speaker_id.cuda() # synthesize voice decoder_output, postnet_output, alignments, stop_tokens = run_model( From 7be11457e7edb06216033c821ea5a4339ab6a0e9 Mon Sep 17 00:00:00 2001 From: Thomas Werkmeister Date: Wed, 17 Jul 2019 16:04:17 +0200 Subject: [PATCH 2/2] default argument mailabs --- datasets/preprocess.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datasets/preprocess.py b/datasets/preprocess.py index 23599836..2862a3e1 100644 --- a/datasets/preprocess.py +++ b/datasets/preprocess.py @@ -70,7 +70,7 @@ def mozilla(root_path, meta_file): return items -def mailabs(root_path, meta_files): +def mailabs(root_path, meta_files=None): """Normalizes M-AI-Labs meta data files to TTS format""" speaker_regex = re.compile("by_book/(male|female|mix)/(?P[^/]+)/") if meta_files is None: @@ -164,4 +164,4 @@ def libri_tts(root_path, meta_files=None): items.append([text, wav_file, speaker_name]) for item in items: assert os.path.exists(item[1]), f" [!] wav file is not exist - {item[1]}" - return items \ No newline at end of file + return items