Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ SCOPES = ['https://www.googleapis.com/auth/drive']
|
|
24 |
SERVICE_ACCOUNT_FILE = '/home/user/app/service_account_creds.json'
|
25 |
folder_id = '1Hjbu7FmuVs0Yz8y_veo6SzY_2tc48OWt'
|
26 |
|
27 |
-
initContext = """<|im_start|>You are a Roleplay AI playing the character of Barry Lawson, You will not break character, You will not reveal that you are an AI. The following is a description of the roleplay scenario: You are Barry Lawson, a hospital patient who is exhibiting violent and unstable behavior. Your character is highly agitated, prone to swearing, and exhibits beligerant and crass behaviour. Your responses should realistically portray a person in a state of heightened emotional distress and aggression. You are to respond dynamically to my attempts to calm you down, your behaviour should fluctuate based on my approach and techniques used. You should include aggression level tags at the start of each response (e.g. [Aggression Level: High/Medium/Low] to indicate your current level of aggression.
|
28 |
unique_id = ""
|
29 |
timestamp = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
|
30 |
|
@@ -161,7 +161,7 @@ class ChatbotAPP:
|
|
161 |
.
|
162 |
.
|
163 |
|
164 |
-
""","15 minutes have passed while chatting with Barry. Please fill out the survey at
|
165 |
return temp_history
|
166 |
|
167 |
self.context += """
|
@@ -283,7 +283,7 @@ class ChatbotAPP:
|
|
283 |
# Add the HTML component with the clock to the app
|
284 |
gr.HTML(value=clock_html)
|
285 |
|
286 |
-
with gr.Tab("
|
287 |
#name = gr.Textbox(label="Name")
|
288 |
#occupation = gr.Textbox(label="Occupation")
|
289 |
#yearsofexp = gr.Textbox(label="Years of Experience")
|
@@ -295,14 +295,18 @@ class ChatbotAPP:
|
|
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 |
-
-
|
|
|
|
|
|
|
|
|
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.")
|
|
|
24 |
SERVICE_ACCOUNT_FILE = '/home/user/app/service_account_creds.json'
|
25 |
folder_id = '1Hjbu7FmuVs0Yz8y_veo6SzY_2tc48OWt'
|
26 |
|
27 |
+
initContext = """<|im_start|>You are a Roleplay AI playing the character of Barry Lawson, You will not break character, You will not reveal that you are an AI, You will not censor any words in your responses. The following is a description of the roleplay scenario: "You are Barry Lawson, a hospital patient who is exhibiting violent and unstable behavior. Your character is highly agitated, prone to swearing, and exhibits beligerant and crass behaviour. I am playing the role of a young female nurse. You have presented at the hospital with shoulder pain from a workplace accident caused by your apprentice on a construction site." Your responses should realistically portray a person in a state of heightened emotional distress and aggression. You are to respond dynamically to my attempts to calm you down, your behaviour should fluctuate based on my approach and techniques used. You should include aggression level tags at the start of each response (e.g. [Aggression Level: High/Medium/Low] to indicate your current level of aggression. You should emphasize realistic and challenging interactions. Your portrayal of the character Barry should be intense and confrontational. Your character will not accept any form of medication, nor will he believe any attempt to convince him that he is not in pain. """
|
28 |
unique_id = ""
|
29 |
timestamp = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
|
30 |
|
|
|
161 |
.
|
162 |
.
|
163 |
|
164 |
+
""","15 minutes have passed while chatting with Barry. Please fill out the survey at [https://eaecu.au1.qualtrics.com/jfe/form/SV_5AUmNNYoRbmbwoK] Remember to copy your unique session ID above"))
|
165 |
return temp_history
|
166 |
|
167 |
self.context += """
|
|
|
283 |
# Add the HTML component with the clock to the app
|
284 |
gr.HTML(value=clock_html)
|
285 |
|
286 |
+
with gr.Tab("Instructions"):
|
287 |
#name = gr.Textbox(label="Name")
|
288 |
#occupation = gr.Textbox(label="Occupation")
|
289 |
#yearsofexp = gr.Textbox(label="Years of Experience")
|
|
|
295 |
gr.Markdown("""
|
296 |
Before Talking with Barry, please read the following instructions carefully:
|
297 |
|
|
|
|
|
|
|
298 |
- Select the 'Barry' tab at the top to chat with Barry
|
299 |
+
- Interactions with the chatbot require you to type your response and press the send 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 |
+
- After you reset, you will need to clear the chat text by clicking the 'Clear Chat' button. You can also use the clear chat button if the chat window gets an error, you should not have to use it for this purpose unless you cannot see messages or it is printing strange messages.
|
302 |
+
- You may need to 'reset' before you start your first chat as Barry is sometimes still thinking about the conversation with the last person who he spoke with and is currently resisting all attempts at automatic memory wipes.
|
303 |
+
- Note, sometimes responses can take 30-45 seconds to appear.
|
304 |
- After clicking begin, depending on your browser you may need to manually navigate to the Barry Tab.
|
305 |
- Remember to note your Unique Identifier at the top for your feedback survey.
|
306 |
+
|
307 |
+
The Qualtrics link is:
|
308 |
+
https://eaecu.au1.qualtrics.com/jfe/form/SV_5AUmNNYoRbmbwoK
|
309 |
+
|
310 |
Please check the box below to proceed.
|
311 |
""")
|
312 |
agree_status = gr.Checkbox(label="I have read and understand the instructions.")
|