kavansaun commited on
Commit
db9600c
·
verified ·
1 Parent(s): eed9317

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -80,12 +80,15 @@ with gr.Blocks(theme=gr.themes.Monochrome(),css="footer{display:none !important}
80
 
81
  return response # Returning the chat bot response
82
 
 
 
83
 
84
  initial_message = "Please write your prompt here and press 'enter'" # Initial message for the User Interface (basically the message for the typing input area so change the message under the quotes if you want to change that)
85
  Chatbot = gr.Chatbot(label="Anonymous User",layout=['bubble']) # Creating a gradio-chatbot User Interface with the label "Anonymous User".
86
 
87
  txt = gr.Textbox(show_label=False, placeholder = initial_message,container=False)
88
- txt.submit(None,txt,Chatbot)
89
- txt.submit(predict_prompt, [txt, user_id], Chatbot) # Adding the messages into the row with gradio.
 
90
 
91
  chatblock.launch() # launch!
 
80
 
81
  return response # Returning the chat bot response
82
 
83
+ def return_sent():
84
+ return 'message sent, please wait...'
85
 
86
  initial_message = "Please write your prompt here and press 'enter'" # Initial message for the User Interface (basically the message for the typing input area so change the message under the quotes if you want to change that)
87
  Chatbot = gr.Chatbot(label="Anonymous User",layout=['bubble']) # Creating a gradio-chatbot User Interface with the label "Anonymous User".
88
 
89
  txt = gr.Textbox(show_label=False, placeholder = initial_message,container=False)
90
+
91
+ txt.submit(fn = return_sent, inputs = None, outputs = txt)
92
+ txt.submit(fn = predict_prompt, inputs = [txt, user_id], outputs = Chatbot, show_progress = 'hidden') # Adding the messages into the row with gradio.
93
 
94
  chatblock.launch() # launch!