ASG Models commited on
Commit
cf86894
1 Parent(s): 53f3bc6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -98,7 +98,7 @@ def modelspeech(text):
98
  import re
99
  def clean_text(text):
100
  # Remove symbols and extra spaces
101
- cleaned_text = re.sub(r'[^\w\s]', '', text) # Remove symbols
102
  cleaned_text = re.sub(r'\s+', ' ', cleaned_text) # Normalize spaces
103
  return cleaned_text.strip() # Remove leading/trailing spaces
104
 
@@ -118,9 +118,8 @@ def text_to_speech(text):
118
  k+=1
119
 
120
  yield modelspeech(out)
121
- if k==0:
122
- out=pad_text
123
- yield modelspeech(pad_text)
124
  def dash(text):
125
 
126
  response=get_answer_ai(text)
 
98
  import re
99
  def clean_text(text):
100
  # Remove symbols and extra spaces
101
+ cleaned_text = re.sub(r'[^\w\s]', ' ', text) # Remove symbols
102
  cleaned_text = re.sub(r'\s+', ' ', cleaned_text) # Normalize spaces
103
  return cleaned_text.strip() # Remove leading/trailing spaces
104
 
 
118
  k+=1
119
 
120
  yield modelspeech(out)
121
+ if pad_text!='':
122
+ yield modelspeech(pad_text)
 
123
  def dash(text):
124
 
125
  response=get_answer_ai(text)