ASG Models commited on
Commit
3b54e05
·
verified ·
1 Parent(s): 2a4a29b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -189,7 +189,7 @@ def add_message(history, message):
189
 
190
  if message["text"] is not None:
191
  sr,response_audio = genrate_speech(message["text"],'asg2024/vits-ar-sa-huba')
192
- with tempfile.NamedTemporaryFile(delete=True) as temp_file:
193
  filename=temp_file.name+'.wav'
194
  sf.write(filename,response_audio, sr,format='WAV')
195
  user_msg1 = {"text": message["text"],
@@ -198,7 +198,7 @@ def add_message(history, message):
198
 
199
  txt_ai=get_answer_ai(message["text"] )
200
  sr,response_audio = genrate_speech(txt_ai,'asg2024/vits-ar-sa-huba')
201
- with tempfile.NamedTemporaryFile(delete=True) as temp_file:
202
  filename=temp_file.name+'.wav'
203
  sf.write(filename,response_audio, sr,format='WAV')
204
  bot_msg1 = {"text": txt_ai,
@@ -337,4 +337,4 @@ with gr.Blocks() as demo: # Use gr.Blocks to wrap the entire interface
337
 
338
 
339
  if __name__ == "__main__":
340
- demo.launch()
 
189
 
190
  if message["text"] is not None:
191
  sr,response_audio = genrate_speech(message["text"],'asg2024/vits-ar-sa-huba')
192
+ with tempfile.NamedTemporaryFile(delete=False) as temp_file:
193
  filename=temp_file.name+'.wav'
194
  sf.write(filename,response_audio, sr,format='WAV')
195
  user_msg1 = {"text": message["text"],
 
198
 
199
  txt_ai=get_answer_ai(message["text"] )
200
  sr,response_audio = genrate_speech(txt_ai,'asg2024/vits-ar-sa-huba')
201
+ with tempfile.NamedTemporaryFile(delete=False) as temp_file:
202
  filename=temp_file.name+'.wav'
203
  sf.write(filename,response_audio, sr,format='WAV')
204
  bot_msg1 = {"text": txt_ai,
 
337
 
338
 
339
  if __name__ == "__main__":
340
+ demo.launch(show_error=True)