kavansaun commited on
Commit
ef2652e
·
verified ·
1 Parent(s): 9e72bef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -76,14 +76,17 @@ with gr.Blocks(theme=gr.themes.Monochrome(),css="footer{display:none !important}
76
  file = repo.get_contents(user_id + file_type)
77
  repo.update_file(file.path, commit_message, content, file.sha)
78
 
79
- yield response # Returning the chat bot response
80
 
 
 
81
 
82
  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)
83
  Chatbot = gr.Chatbot(label="Anonymous User",layout=['bubble']) # Creating a gradio-chatbot User Interface with the label "Anonymous User".
84
 
85
  txt = gr.Textbox(show_label=False, placeholder = initial_message, container=False)
86
 
87
- txt.submit(predict_prompt, [txt, user_id], Chatbot, show_progress='hidden') # Adding the messages into the row with gradio.
 
88
 
89
  chatblock.launch() # launch!
 
76
  file = repo.get_contents(user_id + file_type)
77
  repo.update_file(file.path, commit_message, content, file.sha)
78
 
79
+ return response # Returning the chat bot response
80
 
81
+ def return_inputs(inputs):
82
+ return inputs
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
 
89
+ txt.sumbit(fn = return_input, inputs = txt, outputs = Chatbot)
90
+ txt.submit(fn = predict_prompt, inputs = [txt, user_id], outputs = Chatbot, show_progress = 'hidden') # Adding the messages into the row with gradio.
91
 
92
  chatblock.launch() # launch!