Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -70,6 +70,9 @@ def generate_response(transcribed_text):
|
|
| 70 |
)
|
| 71 |
return response['choices'][0]['message']['content']
|
| 72 |
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
import os
|
| 75 |
import subprocess
|
|
@@ -218,9 +221,11 @@ def inference(text):
|
|
| 218 |
|
| 219 |
return output_file
|
| 220 |
|
|
|
|
|
|
|
| 221 |
def process_audio_and_respond(audio):
|
| 222 |
-
|
| 223 |
-
response_text = generate_response(
|
| 224 |
output_file = inference(response_text)
|
| 225 |
return response_text, output_file
|
| 226 |
|
|
@@ -236,4 +241,4 @@ demo = gr.Interface(
|
|
| 236 |
live=True,
|
| 237 |
)
|
| 238 |
|
| 239 |
-
demo.launch()
|
|
|
|
| 70 |
)
|
| 71 |
return response['choices'][0]['message']['content']
|
| 72 |
|
| 73 |
+
# ... rest of your code ...
|
| 74 |
+
|
| 75 |
+
|
| 76 |
|
| 77 |
import os
|
| 78 |
import subprocess
|
|
|
|
| 221 |
|
| 222 |
return output_file
|
| 223 |
|
| 224 |
+
|
| 225 |
+
|
| 226 |
def process_audio_and_respond(audio):
|
| 227 |
+
transcribed_text = transcribe(audio)
|
| 228 |
+
response_text = generate_response(transcribed_text)
|
| 229 |
output_file = inference(response_text)
|
| 230 |
return response_text, output_file
|
| 231 |
|
|
|
|
| 241 |
live=True,
|
| 242 |
)
|
| 243 |
|
| 244 |
+
demo.launch()
|