Spaces:
Runtime error
Runtime error
ASG Models
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -190,7 +190,7 @@ def add_message(history, message):
|
|
| 190 |
if message["text"] is not None:
|
| 191 |
sr,response_audio = genrate_speech(message["text"],'asg2024/vits-ar-sa-huba')
|
| 192 |
with tempfile.TemporaryFile() as temp_file:
|
| 193 |
-
filename=temp_file.name+'.wav'
|
| 194 |
sf.write(filename,response_audio, sr,format='WAV')
|
| 195 |
user_msg1 = {"text": message["text"],
|
| 196 |
"files": [{"file":FileData(path=filename)}]}
|
|
@@ -199,7 +199,7 @@ def add_message(history, message):
|
|
| 199 |
txt_ai=get_answer_ai(message["text"] )
|
| 200 |
sr,response_audio = genrate_speech(txt_ai,'asg2024/vits-ar-sa-huba')
|
| 201 |
with tempfile.TemporaryFile() as temp_file:
|
| 202 |
-
filename=temp_file.name+'.wav'
|
| 203 |
sf.write(filename,response_audio, sr,format='WAV')
|
| 204 |
bot_msg1 = {"text": txt_ai,
|
| 205 |
"files": [{"file":FileData(path=filename)}]}
|
|
|
|
| 190 |
if message["text"] is not None:
|
| 191 |
sr,response_audio = genrate_speech(message["text"],'asg2024/vits-ar-sa-huba')
|
| 192 |
with tempfile.TemporaryFile() as temp_file:
|
| 193 |
+
filename='temp'+str(temp_file.name)+'.wav'
|
| 194 |
sf.write(filename,response_audio, sr,format='WAV')
|
| 195 |
user_msg1 = {"text": message["text"],
|
| 196 |
"files": [{"file":FileData(path=filename)}]}
|
|
|
|
| 199 |
txt_ai=get_answer_ai(message["text"] )
|
| 200 |
sr,response_audio = genrate_speech(txt_ai,'asg2024/vits-ar-sa-huba')
|
| 201 |
with tempfile.TemporaryFile() as temp_file:
|
| 202 |
+
filename='temp'+str(temp_file.name)+'.wav'
|
| 203 |
sf.write(filename,response_audio, sr,format='WAV')
|
| 204 |
bot_msg1 = {"text": txt_ai,
|
| 205 |
"files": [{"file":FileData(path=filename)}]}
|