Spaces:
Paused
Paused
Updating flask app for CCHU experiment
Browse filesMaking frobot point to coolbot, frobot prompts point to coolbot prompts, and replacing survey2 link
- chat_application/main.py +14 -2
chat_application/main.py
CHANGED
|
@@ -137,7 +137,9 @@ frobot = GenerativeModel(frotj.tuned_model_endpoint_name)
|
|
| 137 |
#change to endpoints
|
| 138 |
hotbot = "projects/700531062565/locations/us-central1/endpoints/6225523347153747968"
|
| 139 |
coolbot = "projects/700531062565/locations/us-central1/endpoints/1700531621553242112"
|
| 140 |
-
frobot = "projects/700531062565/locations/us-central1/endpoints/2951406418055397376"
|
|
|
|
|
|
|
| 141 |
|
| 142 |
# MongoDB setup
|
| 143 |
client = MongoClient("mongodb://127.0.0.1:27017/")
|
|
@@ -178,12 +180,16 @@ TOPICS_LIST = [
|
|
| 178 |
}
|
| 179 |
]
|
| 180 |
|
|
|
|
|
|
|
|
|
|
| 181 |
# FroBot Main Prompt
|
| 182 |
with open(PROJECT_ROOT / "data" / "prompts" / "frobot_prompt_main.txt") as f:
|
| 183 |
FROBOT_PROMPT = f.read()
|
| 184 |
# Instructions
|
| 185 |
with open(PROJECT_ROOT / "data" / "inference_instructions" / "frobot_instructions_main.txt") as f:
|
| 186 |
FROBOT_INSTRUCT = f.read()
|
|
|
|
| 187 |
|
| 188 |
# HotBot Prompt
|
| 189 |
with open(PROJECT_ROOT / "data" / "prompts" / "hotbot_prompt_main.txt") as h:
|
|
@@ -199,6 +205,10 @@ with open(PROJECT_ROOT / "data" / "prompts" / "coolbot_prompt_main.txt") as c:
|
|
| 199 |
with open(PROJECT_ROOT / "data" / "inference_instructions" / "coolbot_instructions_main.txt") as c:
|
| 200 |
COOLBOT_INSTRUCT = c.read()
|
| 201 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 202 |
# Randomly select fruits to use for display names
|
| 203 |
def choose_names(n):
|
| 204 |
# Return n unique random fruit names
|
|
@@ -714,7 +724,9 @@ def post_survey():
|
|
| 714 |
FName = info['FroBot_name']
|
| 715 |
HName = info['HotBot_name']
|
| 716 |
|
| 717 |
-
SURVEY_2_LINK = f"https://umw.qualtrics.com/jfe/form/SV_eIIbPlJ2D9k4zKC?PROLIFIC_PID={user_id}&CName={CName}&FName={FName}&HName={HName}"
|
|
|
|
|
|
|
| 718 |
|
| 719 |
return redirect(SURVEY_2_LINK)
|
| 720 |
|
|
|
|
| 137 |
#change to endpoints
|
| 138 |
hotbot = "projects/700531062565/locations/us-central1/endpoints/6225523347153747968"
|
| 139 |
coolbot = "projects/700531062565/locations/us-central1/endpoints/1700531621553242112"
|
| 140 |
+
#frobot = "projects/700531062565/locations/us-central1/endpoints/2951406418055397376"
|
| 141 |
+
#make frobot actually a coolbot (!4/30)
|
| 142 |
+
frobot = coolbot
|
| 143 |
|
| 144 |
# MongoDB setup
|
| 145 |
client = MongoClient("mongodb://127.0.0.1:27017/")
|
|
|
|
| 180 |
}
|
| 181 |
]
|
| 182 |
|
| 183 |
+
"""
|
| 184 |
+
(!4/30) Make frobot actually a coolbot
|
| 185 |
+
|
| 186 |
# FroBot Main Prompt
|
| 187 |
with open(PROJECT_ROOT / "data" / "prompts" / "frobot_prompt_main.txt") as f:
|
| 188 |
FROBOT_PROMPT = f.read()
|
| 189 |
# Instructions
|
| 190 |
with open(PROJECT_ROOT / "data" / "inference_instructions" / "frobot_instructions_main.txt") as f:
|
| 191 |
FROBOT_INSTRUCT = f.read()
|
| 192 |
+
"""
|
| 193 |
|
| 194 |
# HotBot Prompt
|
| 195 |
with open(PROJECT_ROOT / "data" / "prompts" / "hotbot_prompt_main.txt") as h:
|
|
|
|
| 205 |
with open(PROJECT_ROOT / "data" / "inference_instructions" / "coolbot_instructions_main.txt") as c:
|
| 206 |
COOLBOT_INSTRUCT = c.read()
|
| 207 |
|
| 208 |
+
# (!4/30) point frobot instructions at coolbot's
|
| 209 |
+
FROBOT_PROMPT = COOLBOT_PROMPT
|
| 210 |
+
FROBOT_INSTRUCT = COOLBOT_INSTRUCT
|
| 211 |
+
|
| 212 |
# Randomly select fruits to use for display names
|
| 213 |
def choose_names(n):
|
| 214 |
# Return n unique random fruit names
|
|
|
|
| 724 |
FName = info['FroBot_name']
|
| 725 |
HName = info['HotBot_name']
|
| 726 |
|
| 727 |
+
#SURVEY_2_LINK = f"https://umw.qualtrics.com/jfe/form/SV_eIIbPlJ2D9k4zKC?PROLIFIC_PID={user_id}&CName={CName}&FName={FName}&HName={HName}"
|
| 728 |
+
SURVEY_2_LINK = f"https://umw.qualtrics.com/jfe/form/SV_cTH90tot1jAbBYO?PROLIFIC_PID={user_id}&CName={CName}&DName={FName}&HName={HName}"
|
| 729 |
+
# (!4/30) CCHU experiment survey 2 link
|
| 730 |
|
| 731 |
return redirect(SURVEY_2_LINK)
|
| 732 |
|