Spaces:
Paused
Paused
Commit
•
8bdb39b
1
Parent(s):
38d7590
Update app.py
Browse files
app.py
CHANGED
@@ -605,13 +605,12 @@ def generate_story_and_speech(input_text, chatbot_role):
|
|
605 |
# Return JSON object with text and base64 audio
|
606 |
return {"text": story_text, "audio": speech_audio_base64}
|
607 |
|
608 |
-
#
|
609 |
-
|
610 |
fn=generate_story_and_speech,
|
611 |
-
inputs=[gr.Textbox(
|
612 |
outputs="json"
|
613 |
)
|
614 |
|
615 |
-
|
616 |
-
|
617 |
-
iface.launch(debug=True, enable_queue=True, api_mode=True)
|
|
|
605 |
# Return JSON object with text and base64 audio
|
606 |
return {"text": story_text, "audio": speech_audio_base64}
|
607 |
|
608 |
+
# Create a Gradio Interface using only the `generate_story_and_speech()` function and the 'json' output type
|
609 |
+
demo = gr.Interface(
|
610 |
fn=generate_story_and_speech,
|
611 |
+
inputs=[gr.Textbox(placeholder="Enter your text here"), gr.Dropdown(choices=ROLES, label="Select Chatbot Role")],
|
612 |
outputs="json"
|
613 |
)
|
614 |
|
615 |
+
demo.queue()
|
616 |
+
demo.launch(debug=True)
|
|