Update app.py
Browse files
app.py
CHANGED
@@ -207,7 +207,7 @@ class ChatbotAPP:
|
|
207 |
|
208 |
else:
|
209 |
temp_history=[]
|
210 |
-
output = "Did you forget to
|
211 |
temp_history.append((prompt,output))
|
212 |
return temp_history
|
213 |
|
@@ -222,7 +222,7 @@ class ChatbotAPP:
|
|
222 |
self.update_chatlog_name()
|
223 |
return f"You can start chatting now."
|
224 |
else:
|
225 |
-
return "
|
226 |
|
227 |
def reset_chat_interface(self): # Method to reset the chat interface
|
228 |
|
@@ -291,27 +291,30 @@ class ChatbotAPP:
|
|
291 |
#gender = gr.Dropdown(choices=["Male", "Female", "Other", "Prefer Not To Say"], label="Gender")
|
292 |
#age = gr.Textbox(label="Age")
|
293 |
#submit_info = gr.Button("Submit")
|
294 |
-
gr.Markdown("##
|
295 |
gr.Markdown("""
|
296 |
-
Before Talking with Barry, please read the following
|
297 |
-
|
298 |
-
-
|
299 |
-
-
|
300 |
-
-
|
301 |
-
-
|
|
|
|
|
|
|
302 |
|
303 |
-
Please check the box below to
|
304 |
""")
|
305 |
-
agree_status = gr.Checkbox(label="I have read and understand the
|
306 |
status_label = gr.Markdown()
|
307 |
-
start_chat_button = gr.Button("
|
308 |
#submit_info.click(submit_user_info, inputs=[name, occupation, yearsofexp, ethnicity, gender, age], outputs=[status_textbox])
|
309 |
start_chat_button.click(self.start_chat_button_fn, inputs=[agree_status], outputs=[status_label])
|
310 |
#status_textbox = gr.Textbox(interactive = False)
|
311 |
|
312 |
with gr.Tab("Barry"):
|
313 |
chatbot = gr.Chatbot(show_label=True,label="Chat With Barry")
|
314 |
-
msg = gr.Textbox(label="
|
315 |
send = gr.Button("Send")
|
316 |
clear = gr.Button("Clear Chat")
|
317 |
send.click(self.generate, inputs=[msg], outputs=chatbot)
|
|
|
207 |
|
208 |
else:
|
209 |
temp_history=[]
|
210 |
+
output = "Did you forget to read the Instructions?"
|
211 |
temp_history.append((prompt,output))
|
212 |
return temp_history
|
213 |
|
|
|
222 |
self.update_chatlog_name()
|
223 |
return f"You can start chatting now."
|
224 |
else:
|
225 |
+
return "Read the Instructions"
|
226 |
|
227 |
def reset_chat_interface(self): # Method to reset the chat interface
|
228 |
|
|
|
291 |
#gender = gr.Dropdown(choices=["Male", "Female", "Other", "Prefer Not To Say"], label="Gender")
|
292 |
#age = gr.Textbox(label="Age")
|
293 |
#submit_info = gr.Button("Submit")
|
294 |
+
gr.Markdown("## Instructions")
|
295 |
gr.Markdown("""
|
296 |
+
Before Talking with Barry, please read the following instructions carefully:
|
297 |
+
|
298 |
+
- Please ensure that you have read and agreed to the data collection policy provided as part of your agreement to participate as logging and collection of interactions is automated and unidentifiable.
|
299 |
+
- Interactions with the chatbot require you to type your response and press the button to submit, you cannot press enter.
|
300 |
+
- There is a tab at the top to reset the chat bot for more interactions, please ensure to reset after filling out the survey and before starting your next conversation.
|
301 |
+
- Select the 'Barry' tab at the top to chat with Barry
|
302 |
+
- The clear chat button is only for if the chat window gets bugged, you should not have to use it unless you cannot see messages or it is printing strange messages.
|
303 |
+
- After clicking begin, depending on your browser you may need to manually navigate to the Barry Tab.
|
304 |
+
- Remember to note your Unique Identifier at the top for your feedback survey.
|
305 |
|
306 |
+
Please check the box below to proceed.
|
307 |
""")
|
308 |
+
agree_status = gr.Checkbox(label="I have read and understand the instructions.")
|
309 |
status_label = gr.Markdown()
|
310 |
+
start_chat_button = gr.Button("Begin")
|
311 |
#submit_info.click(submit_user_info, inputs=[name, occupation, yearsofexp, ethnicity, gender, age], outputs=[status_textbox])
|
312 |
start_chat_button.click(self.start_chat_button_fn, inputs=[agree_status], outputs=[status_label])
|
313 |
#status_textbox = gr.Textbox(interactive = False)
|
314 |
|
315 |
with gr.Tab("Barry"):
|
316 |
chatbot = gr.Chatbot(show_label=True,label="Chat With Barry")
|
317 |
+
msg = gr.Textbox(label="Hello")
|
318 |
send = gr.Button("Send")
|
319 |
clear = gr.Button("Clear Chat")
|
320 |
send.click(self.generate, inputs=[msg], outputs=chatbot)
|