gorkemgoknar commited on
Commit
b00b698
1 Parent(s): 30f09da

fix for japanese

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -483,6 +483,11 @@ def generate_speech(history):
483
  sentence = sentence.replace("(", " ")
484
  sentence = sentence.replace(")", " ")
485
 
 
 
 
 
 
486
  # A fast fix for last chacter, may produce weird sounds if it is with text
487
  if (sentence[-1] in ["!", "?", ".", ","]) or (sentence[-2] in ["!", "?", ".", ","]):
488
  # just add a space
 
483
  sentence = sentence.replace("(", " ")
484
  sentence = sentence.replace(")", " ")
485
 
486
+ if len(sentence)==0:
487
+ #possible after cleanup sentence is empty
488
+ #e.g Kana then romaji in brackets
489
+ continue
490
+
491
  # A fast fix for last chacter, may produce weird sounds if it is with text
492
  if (sentence[-1] in ["!", "?", ".", ","]) or (sentence[-2] in ["!", "?", ".", ","]):
493
  # just add a space