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 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(