Update app.py
Browse files
app.py
CHANGED
@@ -136,16 +136,15 @@ def generate_response(transcribed_text):
|
|
136 |
|
137 |
|
138 |
def inference(text):
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
return response_text, output_file
|
149 |
|
150 |
demo = gr.Interface(
|
151 |
process_audio_and_respond,
|
|
|
136 |
|
137 |
|
138 |
def inference(text):
|
139 |
+
#client = openai.OpenAI(api_key='your_api_key')
|
140 |
+
response = client.audio.speech.create(
|
141 |
+
model="tts-1",
|
142 |
+
voice="alloy",
|
143 |
+
input=text
|
144 |
+
)
|
145 |
+
output_file = "tts_output.mp3"
|
146 |
+
response.stream_to_file(output_file)
|
147 |
+
return output_file
|
|
|
148 |
|
149 |
demo = gr.Interface(
|
150 |
process_audio_and_respond,
|