zns0327 commited on
Commit
a924fe5
·
1 Parent(s): 67f0989

Add default task description. Modify instructions

Browse files
Files changed (2) hide show
  1. app.py +12 -12
  2. instructions.py +16 -5
app.py CHANGED
@@ -127,33 +127,36 @@ if __name__ == "__main__":
127
  with gr.Row():
128
  identification_code = gr.Textbox(label="Enter your identification code")
129
  login_button = gr.Button("Login")
130
- login_status = gr.Textbox(label="Verify Identification", interactive=False)
131
  group = gr.State()
132
 
 
 
 
 
 
133
  # initialization of different group contents
134
  group_a_content = gr.Group(visible=False)
135
  group_b_content = gr.Group(visible=False)
136
  group_c_content = gr.Group(visible=False)
137
 
138
-
139
  def update_content(group):
140
  if group == "A":
141
- return gr.update(visible=True), gr.update(visible=False), gr.update(visible=False), group_a_instructions()
142
  elif group == "B":
143
- return gr.update(visible=False), gr.update(visible=True), gr.update(visible=False), group_b_instructions()
144
  elif group == "C":
145
- return gr.update(visible=False), gr.update(visible=False), gr.update(visible=True), group_c_instructions()
146
  else:
147
- return gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), invalid_group()
148
 
149
- # login_button.click(login, inputs=identification_code, outputs=[login_status, group])
150
- login_button.click(login, inputs=identification_code, outputs=[group_a_content, group_b_content, group_c_content, login_status])
151
 
152
 
153
 
154
  with group_a_content:
155
  with gr.Row():
156
- task = gr.Textbox(label="Task Description")
157
  human_input = gr.Textbox(label="Human Input")
158
  with gr.Row():
159
  submit_btn = gr.Button("Create")
@@ -188,7 +191,6 @@ if __name__ == "__main__":
188
 
189
  with group_b_content:
190
  with gr.Row():
191
- task = gr.Textbox(label="Task Description")
192
  human_input = gr.Textbox(label="Human Input")
193
  with gr.Row():
194
  create_btn = gr.Button("Create")
@@ -225,8 +227,6 @@ if __name__ == "__main__":
225
  )
226
 
227
  with group_c_content:
228
- with gr.Row():
229
- task = gr.Textbox(label="Task Description")
230
  with gr.Row():
231
  create_initial_btn = gr.Button("Create")
232
  with gr.Row():
 
127
  with gr.Row():
128
  identification_code = gr.Textbox(label="Enter your identification code")
129
  login_button = gr.Button("Login")
130
+ login_status = gr.Textbox(label="Next Steps", interactive=False)
131
  group = gr.State()
132
 
133
+ task = gr.Textbox(label="Task Description",
134
+ value = default_task_discription(),
135
+ visible=False,
136
+ lines=10)
137
+
138
  # initialization of different group contents
139
  group_a_content = gr.Group(visible=False)
140
  group_b_content = gr.Group(visible=False)
141
  group_c_content = gr.Group(visible=False)
142
 
143
+
144
  def update_content(group):
145
  if group == "A":
146
+ return gr.update(visible=True), gr.update(visible=True), gr.update(visible=False), gr.update(visible=False), group_a_instructions()
147
  elif group == "B":
148
+ return gr.update(visible=True), gr.update(visible=False), gr.update(visible=True), gr.update(visible=False), group_b_instructions()
149
  elif group == "C":
150
+ return gr.update(visible=True), gr.update(visible=False), gr.update(visible=False), gr.update(visible=True), group_c_instructions()
151
  else:
152
+ return gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), invalid_group()
153
 
154
+ login_button.click(login, inputs=identification_code, outputs=[task, group_a_content, group_b_content, group_c_content, login_status])
 
155
 
156
 
157
 
158
  with group_a_content:
159
  with gr.Row():
 
160
  human_input = gr.Textbox(label="Human Input")
161
  with gr.Row():
162
  submit_btn = gr.Button("Create")
 
191
 
192
  with group_b_content:
193
  with gr.Row():
 
194
  human_input = gr.Textbox(label="Human Input")
195
  with gr.Row():
196
  create_btn = gr.Button("Create")
 
227
  )
228
 
229
  with group_c_content:
 
 
230
  with gr.Row():
231
  create_initial_btn = gr.Button("Create")
232
  with gr.Row():
instructions.py CHANGED
@@ -3,7 +3,7 @@ def group_a_instructions():
3
  instructions ='''
4
  Congratulations! You are verified.
5
  You can now start the experiment by following these steps:
6
- 1. Describe the task you in " Task Description" box.
7
  2. Write your answer in the "Human Input" box.
8
  3. Click "Create", see the ai modified answer in "AI Modified Output" box.
9
  4. Evaluate the answer by clicking "Evaluate".
@@ -16,7 +16,7 @@ def group_b_instructions():
16
  instructions ='''
17
  Congratulations! You are verified.
18
  You can now start the experiment by following these steps:
19
- 1. Describe the task you in " Task Description" box.
20
  2. Write your answer in the "Human Input" box.
21
  3. Click "Create", see the ai generated answer in "AI Initial Output" box, AND the merged answer in "Final Merged Output" box.
22
  4. Evaluate the answer by clicking "Evaluate".
@@ -29,9 +29,9 @@ def group_c_instructions():
29
  instructions ='''
30
  Congratulations! You are verified.
31
  You can now start the experiment by following these steps:
32
- 1. Describe the task you in " Task Description" box.
33
  2. Click "Create", see the ai generated answer in "AI Initial Answer" box.
34
- 3. Enter any suggestions you have in "Modification Suggestions" box and click "Modify".
35
  4. You will see the final answer in "Final Answer" box.
36
  5. Evaluate the answer by clicking "Evaluate".
37
  6. Click on "Save Data" to finish the experiment.
@@ -39,4 +39,15 @@ def group_c_instructions():
39
  return instructions
40
 
41
  def invalid_group():
42
- return "Invalid group, please check your identification code."
 
 
 
 
 
 
 
 
 
 
 
 
3
  instructions ='''
4
  Congratulations! You are verified.
5
  You can now start the experiment by following these steps:
6
+ 1. Describe the task you in " Task Description" box. Default Task Description is given below.
7
  2. Write your answer in the "Human Input" box.
8
  3. Click "Create", see the ai modified answer in "AI Modified Output" box.
9
  4. Evaluate the answer by clicking "Evaluate".
 
16
  instructions ='''
17
  Congratulations! You are verified.
18
  You can now start the experiment by following these steps:
19
+ 1. Describe the task you in " Task Description" box. Default Task Description is given below.
20
  2. Write your answer in the "Human Input" box.
21
  3. Click "Create", see the ai generated answer in "AI Initial Output" box, AND the merged answer in "Final Merged Output" box.
22
  4. Evaluate the answer by clicking "Evaluate".
 
29
  instructions ='''
30
  Congratulations! You are verified.
31
  You can now start the experiment by following these steps:
32
+ 1. Describe the task you in " Task Description" box. Default Task Description is given below.
33
  2. Click "Create", see the ai generated answer in "AI Initial Answer" box.
34
+ 3. Enter any suggestions you have for the generated answer in "Modification Suggestions" box and click "Modify".
35
  4. You will see the final answer in "Final Answer" box.
36
  5. Evaluate the answer by clicking "Evaluate".
37
  6. Click on "Save Data" to finish the experiment.
 
39
  return instructions
40
 
41
  def invalid_group():
42
+ return "Invalid group, please check your identification code."
43
+
44
+ def default_task_discription():
45
+ TASK_DESCRIPTION = """
46
+ Given Airbnb's current business model, please propose modifications to better promote and comply with the 17 Sustainable Development Goals (SDGs).
47
+
48
+ AirBnB operates as a peer-to-peer short-term rental platform serving two primary customer segments: travelers and property owners. Travelers seek unique, cost-effective accommodation options, ranging from tourists and business travelers to families needing temporary housing. They prefer the personalized, home-like experiences offered by AirBnB over traditional hotel stays.
49
+ Property owners, from single-room hosts to those renting entire homes, use AirBnB to earn rental income from underutilized properties. The platform's value proposition includes a wide array of lodging options, a secure booking process, and tools to facilitate listing, pricing, and marketing for hosts.
50
+ AirBnB's operations focus on a user-friendly online marketplace that connects hosts with guests. Key activities include platform management, user safety through verification processes, reliable customer support, and technology development to enhance user experience and efficiency. Marketing efforts and partnerships with local tourism agencies expand its market reach.
51
+ """
52
+
53
+ return TASK_DESCRIPTION