diff --git a/vall_e/emb/g2p.py b/vall_e/emb/g2p.py index 342adc7..2a415a0 100755 --- a/vall_e/emb/g2p.py +++ b/vall_e/emb/g2p.py @@ -24,6 +24,9 @@ except Exception as e: print(f'Error while importing langdetect: {str(e)}') def detect_language( text ): + if not text: + return "en" # to-do: map to a null language + if langdetect is None: raise Exception('langdetect is not installed.') return langdetect.detect( text ) diff --git a/vall_e/inference.py b/vall_e/inference.py index 74fa64b..5dbdfec 100644 --- a/vall_e/inference.py +++ b/vall_e/inference.py @@ -385,7 +385,9 @@ class TTS(): text = transcribe( voice_convert, model_name="openai/whisper-base", align=False )["text"] lines = sentence_split(text, split_by=sampling_kwargs.get("split_text_by", "sentences")) - + if not lines: + lines = [""] + wavs = [] sr = None