Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -128,29 +128,25 @@ def generate(
|
|
128 |
# Return None if the TTS is not enabled or the password is incorrect
|
129 |
return None
|
130 |
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
pass
|
154 |
-
|
155 |
-
# Launch the demo
|
156 |
-
demo.queue().launch(show_api=False)
|
|
|
128 |
# Return None if the TTS is not enabled or the password is incorrect
|
129 |
return None
|
130 |
|
131 |
+
iface = gr.Blocks()
|
132 |
+
|
133 |
+
with iface.container():
|
134 |
+
checkbox = gr.Checkbox(label="Enable TTS")
|
135 |
+
passwordInput = gr.Textbox(label="TTS Password", type="password")
|
136 |
+
|
137 |
+
chat = gr.ChatInterface(
|
138 |
+
fn=generate,
|
139 |
+
chatbot=mychatbot,
|
140 |
+
title="Stella ",
|
141 |
+
retry_btn=None,
|
142 |
+
undo_btn=None,
|
143 |
+
additional_inputs=[checkbox, passwordInput],
|
144 |
+
)
|
145 |
+
|
146 |
+
hidden_audio_output = gr.Textbox(label="Audio Output", visible=False)
|
147 |
+
audio_player = gr.Audio(source="Audio Output")
|
148 |
+
|
149 |
+
# Connect the hidden Textbox to the Audio component
|
150 |
+
hidden_audio_output.link(audio_player, source="file")
|
151 |
+
|
152 |
+
iface.launch(show_api=False)
|
|
|
|
|
|
|
|