TSjB commited on
Commit
e8cb8c1
·
verified ·
1 Parent(s): 297bf77

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -400,7 +400,7 @@ def translateDisp(text, from_, to, dialect):
400
  from_ = "".join(LANGUAGE[LANGUAGE.language == from_].token.to_list())
401
  to = "".join(LANGUAGE[LANGUAGE.language == to].token.to_list())
402
  dialect = "".join(DIALECT[DIALECT.dialect == dialect].short_name.to_list())
403
-
404
 
405
  if from_ == 'krc_Cyrl':
406
  text = toModel(text)
@@ -420,7 +420,7 @@ def dictionaryDisp(text, from_):
420
 
421
  from_ = "".join(LANGUAGE[LANGUAGE.language == from_].token.to_list())
422
 
423
-
424
  str_l = text.lower()
425
  filter_ = r"\W+" + str_l + r"|^" + str_l
426
 
@@ -460,6 +460,7 @@ def dictionaryDisp(text, from_):
460
  def tts(text):
461
  file_voice = ''.join(random.choices(string.ascii_letters, k=8))
462
  file_voice = f'{file_voice}.wav'
 
463
 
464
  model_tts.save_wav(
465
  audio_path = file_voice,
 
400
  from_ = "".join(LANGUAGE[LANGUAGE.language == from_].token.to_list())
401
  to = "".join(LANGUAGE[LANGUAGE.language == to].token.to_list())
402
  dialect = "".join(DIALECT[DIALECT.dialect == dialect].short_name.to_list())
403
+ text = text.strip()
404
 
405
  if from_ == 'krc_Cyrl':
406
  text = toModel(text)
 
420
 
421
  from_ = "".join(LANGUAGE[LANGUAGE.language == from_].token.to_list())
422
 
423
+ text = text.strip()
424
  str_l = text.lower()
425
  filter_ = r"\W+" + str_l + r"|^" + str_l
426
 
 
460
  def tts(text):
461
  file_voice = ''.join(random.choices(string.ascii_letters, k=8))
462
  file_voice = f'{file_voice}.wav'
463
+ text = text.strip()
464
 
465
  model_tts.save_wav(
466
  audio_path = file_voice,