Spaces:
Sleeping
Sleeping
ASG Models
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -189,7 +189,7 @@ def add_message(history, message):
|
|
189 |
history.append((message["text"], None))
|
190 |
response_audio = genrate_speech(message["text"],'asg2024/vits-ar-sa-huba')
|
191 |
history.append((gr.Audio(response_audio,scale=1,streaming=True),None))
|
192 |
-
return history
|
193 |
|
194 |
def bot(history,message):
|
195 |
if message["text"] is not None:
|
@@ -198,7 +198,7 @@ def bot(history,message):
|
|
198 |
response_audio = genrate_speech(txt_ai,'asg2024/vits-ar-sa-huba')
|
199 |
history.append((None,gr.Audio(response_audio,scale=1,streaming=True)))
|
200 |
|
201 |
-
return history
|
202 |
|
203 |
fig = random_plot()
|
204 |
|
@@ -221,8 +221,8 @@ with gr.Blocks() as demo: # Use gr.Blocks to wrap the entire interface
|
|
221 |
file_count="single",
|
222 |
placeholder="Enter message or upload file...", show_label=False,)
|
223 |
|
224 |
-
chat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot
|
225 |
-
bot_msg = chat_msg.then(bot, [chatbot, chat_input], chatbot, api_name="bot_response")
|
226 |
bot_msg.then(lambda: gr.MultimodalTextbox(interactive=True), None, [chat_input])
|
227 |
|
228 |
chatbot.like(print_like_dislike, None, None)
|
|
|
189 |
history.append((message["text"], None))
|
190 |
response_audio = genrate_speech(message["text"],'asg2024/vits-ar-sa-huba')
|
191 |
history.append((gr.Audio(response_audio,scale=1,streaming=True),None))
|
192 |
+
return history
|
193 |
|
194 |
def bot(history,message):
|
195 |
if message["text"] is not None:
|
|
|
198 |
response_audio = genrate_speech(txt_ai,'asg2024/vits-ar-sa-huba')
|
199 |
history.append((None,gr.Audio(response_audio,scale=1,streaming=True)))
|
200 |
|
201 |
+
return history, gr.MultimodalTextbox(value=None, interactive=False)
|
202 |
|
203 |
fig = random_plot()
|
204 |
|
|
|
221 |
file_count="single",
|
222 |
placeholder="Enter message or upload file...", show_label=False,)
|
223 |
|
224 |
+
chat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot])
|
225 |
+
bot_msg = chat_msg.then(bot, [chatbot, chat_input], [chatbot, chat_input], api_name="bot_response")
|
226 |
bot_msg.then(lambda: gr.MultimodalTextbox(interactive=True), None, [chat_input])
|
227 |
|
228 |
chatbot.like(print_like_dislike, None, None)
|