slight tweaks to condition-less NS/SR
This commit is contained in:
parent
478aea0e8c
commit
99f251c768
|
@ -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 )
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user