Medvira commited on
Commit
1bd07b4
·
verified ·
1 Parent(s): 8a76eba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -84,8 +84,10 @@ with gr.Blocks() as demo:
84
  avatar_images=(os.path.join(os.getcwd(), 'user.png'), os.path.join(os.getcwd(), 'ai.png')))
85
  chat_input = gr.MultimodalTextbox(interactive=True, placeholder="Enter message or upload file...", show_label=False)
86
 
87
- # Connect chat_input to bot function to handle input and provide responses
88
- chat_input.submit(lambda message, history: bot(add_message(history, message)), [chat_input, chatbot], [chatbot, chat_input])
 
 
89
 
90
  # Launch the Gradio interface
91
  demo.launch(share=True) # Enable public sharing
 
84
  avatar_images=(os.path.join(os.getcwd(), 'user.png'), os.path.join(os.getcwd(), 'ai.png')))
85
  chat_input = gr.MultimodalTextbox(interactive=True, placeholder="Enter message or upload file...", show_label=False)
86
 
87
+ hat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot, chat_input])
88
+ bot_msg = chat_msg.then(bot, chatbot, chatbot, api_name="bot_response")
89
+ bot_msg.then(lambda: gr.MultimodalTextbox(interactive=True), None, [chat_input])
90
+
91
 
92
  # Launch the Gradio interface
93
  demo.launch(share=True) # Enable public sharing