Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -197,7 +197,6 @@ def generate_audio_elevenlabs(text):
|
|
197 |
with gr.Blocks() as demo:
|
198 |
with gr.Row():
|
199 |
with gr.Column():
|
200 |
-
|
201 |
response_output = gr.Textbox(
|
202 |
label="Response",
|
203 |
placeholder="The response will appear here...",
|
@@ -206,19 +205,22 @@ with gr.Blocks() as demo:
|
|
206 |
max_lines=20 # Allows for a larger display area if needed
|
207 |
)
|
208 |
question_input = gr.Textbox(label="Ask a Question", placeholder="Type your question here...")
|
|
|
209 |
with gr.Column():
|
210 |
audio_output = gr.Audio(label="Audio", type="filepath", interactive=False)
|
|
|
211 |
with gr.Row():
|
212 |
-
|
213 |
get_response_btn = gr.Button("Get Response")
|
214 |
with gr.Column():
|
215 |
generate_audio_btn = gr.Button("Generate Audio")
|
216 |
with gr.Column():
|
217 |
clean_btn = gr.Button("Clean")
|
218 |
|
|
|
219 |
get_response_btn.click(fn=get_response, inputs=question_input, outputs=response_output)
|
220 |
generate_audio_btn.click(fn=generate_audio_elevenlabs, inputs=response_output, outputs=audio_output)
|
221 |
clean_btn.click(fn=clear_fields, inputs=[], outputs=[question_input, response_output])
|
222 |
|
223 |
# Launch the Gradio interface
|
224 |
-
demo.launch(show_error=True)
|
|
|
197 |
with gr.Blocks() as demo:
|
198 |
with gr.Row():
|
199 |
with gr.Column():
|
|
|
200 |
response_output = gr.Textbox(
|
201 |
label="Response",
|
202 |
placeholder="The response will appear here...",
|
|
|
205 |
max_lines=20 # Allows for a larger display area if needed
|
206 |
)
|
207 |
question_input = gr.Textbox(label="Ask a Question", placeholder="Type your question here...")
|
208 |
+
|
209 |
with gr.Column():
|
210 |
audio_output = gr.Audio(label="Audio", type="filepath", interactive=False)
|
211 |
+
|
212 |
with gr.Row():
|
213 |
+
with gr.Column():
|
214 |
get_response_btn = gr.Button("Get Response")
|
215 |
with gr.Column():
|
216 |
generate_audio_btn = gr.Button("Generate Audio")
|
217 |
with gr.Column():
|
218 |
clean_btn = gr.Button("Clean")
|
219 |
|
220 |
+
# Define interactions
|
221 |
get_response_btn.click(fn=get_response, inputs=question_input, outputs=response_output)
|
222 |
generate_audio_btn.click(fn=generate_audio_elevenlabs, inputs=response_output, outputs=audio_output)
|
223 |
clean_btn.click(fn=clear_fields, inputs=[], outputs=[question_input, response_output])
|
224 |
|
225 |
# Launch the Gradio interface
|
226 |
+
demo.launch(show_error=True)
|