Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -126,7 +126,7 @@ def respond(
|
|
126 |
elif "sing" in decision_response:
|
127 |
llama_responded = 1
|
128 |
responded_answer = "SING"
|
129 |
-
return "
|
130 |
|
131 |
else:
|
132 |
#others
|
@@ -156,6 +156,7 @@ def respond(
|
|
156 |
responded_answer = response
|
157 |
return response
|
158 |
|
|
|
159 |
def update_response_display():
|
160 |
while not llama_responded:
|
161 |
time.sleep(1)
|
@@ -188,25 +189,10 @@ def tts_part():
|
|
188 |
|
189 |
def create_interface():
|
190 |
with gr.Blocks() as demo:
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
fill_height=True,
|
196 |
-
fn=respond,
|
197 |
-
submit_btn="Start Chatting"
|
198 |
-
)
|
199 |
-
user_start = chatbot.textbox.submit(
|
200 |
-
fn=update_response_display,
|
201 |
-
inputs=[],
|
202 |
-
outputs=[],
|
203 |
-
)
|
204 |
-
user_click = chatbot.submit_btn.click(
|
205 |
-
fn=update_response_display,
|
206 |
-
inputs=[],
|
207 |
-
outputs=[],
|
208 |
-
)
|
209 |
-
|
210 |
# Audio input section
|
211 |
with gr.Row():
|
212 |
audio_input = gr.Audio(
|
@@ -225,6 +211,23 @@ def create_interface():
|
|
225 |
visible=False
|
226 |
)
|
227 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
text_speaker = gr.Audio(
|
229 |
label="Generated Audio"
|
230 |
)
|
|
|
126 |
elif "sing" in decision_response:
|
127 |
llama_responded = 1
|
128 |
responded_answer = "SING"
|
129 |
+
return "Here is the song you might like!"
|
130 |
|
131 |
else:
|
132 |
#others
|
|
|
156 |
responded_answer = response
|
157 |
return response
|
158 |
|
159 |
+
|
160 |
def update_response_display():
|
161 |
while not llama_responded:
|
162 |
time.sleep(1)
|
|
|
189 |
|
190 |
def create_interface():
|
191 |
with gr.Blocks() as demo:
|
192 |
+
with gr.Row():
|
193 |
+
gr.HTML(
|
194 |
+
value = '<h2 style="text-align: center;">Exodia AI Assistant</h2>'
|
195 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
# Audio input section
|
197 |
with gr.Row():
|
198 |
audio_input = gr.Audio(
|
|
|
211 |
visible=False
|
212 |
)
|
213 |
|
214 |
+
# Chat interface using the custom chatbot instance
|
215 |
+
chatbot = gr.ChatInterface(
|
216 |
+
fill_height=True,
|
217 |
+
fn=respond,
|
218 |
+
submit_btn="Start Chatting"
|
219 |
+
)
|
220 |
+
user_start = chatbot.textbox.submit(
|
221 |
+
fn=update_response_display,
|
222 |
+
inputs=[],
|
223 |
+
outputs=[],
|
224 |
+
)
|
225 |
+
user_click = chatbot.submit_btn.click(
|
226 |
+
fn=update_response_display,
|
227 |
+
inputs=[],
|
228 |
+
outputs=[],
|
229 |
+
)
|
230 |
+
|
231 |
text_speaker = gr.Audio(
|
232 |
label="Generated Audio"
|
233 |
)
|