Alidr79 commited on
Commit
27f0dff
1 Parent(s): 8de2ba2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -82,11 +82,11 @@ def tts_fn(slider_value, input_text):
82
  speaker_embedding = torch.tensor(speaker_embedding).unsqueeze(0)
83
 
84
  phonemes = PersianG2Pconverter.transliterate(input_text, tidy = False, secret = True)
85
- # text = "</s>"
86
- # for i in phonemes.replace(' .', '').split(" "):
87
- # text += i + " <pad> "
88
 
89
- text = phonemes
90
 
91
  print("sentence:", input_text)
92
  print("sentence phonemes:", text)
@@ -118,7 +118,8 @@ def tts_fn(slider_value, input_text):
118
  def master_fn(slider_value, input_text):
119
  if "." not in input_text:
120
  input_text += '.'
121
-
 
122
  all_speech = []
123
  for sentence in input_text.split("."):
124
  sampling_rate_response, audio_chunk_response = tts_fn(slider_value, sentence)
 
82
  speaker_embedding = torch.tensor(speaker_embedding).unsqueeze(0)
83
 
84
  phonemes = PersianG2Pconverter.transliterate(input_text, tidy = False, secret = True)
85
+ text = "</s>"
86
+ for i in phonemes.replace(' .', '').split(" "):
87
+ text += i + " <pad> "
88
 
89
+ text += "</s>"
90
 
91
  print("sentence:", input_text)
92
  print("sentence phonemes:", text)
 
118
  def master_fn(slider_value, input_text):
119
  if "." not in input_text:
120
  input_text += '.'
121
+
122
+ print(f"speaker_id = {slider_value}")
123
  all_speech = []
124
  for sentence in input_text.split("."):
125
  sampling_rate_response, audio_chunk_response = tts_fn(slider_value, sentence)