Spaces:
Running
Running
Commit
·
dd19cda
1
Parent(s):
a18130b
switch group_b and group_c
Browse files
app.py
CHANGED
|
@@ -234,25 +234,38 @@ if __name__ == "__main__":
|
|
| 234 |
|
| 235 |
with group_b_content:
|
| 236 |
with gr.Row():
|
| 237 |
-
|
| 238 |
with gr.Row():
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
|
|
|
|
|
|
| 243 |
session_index = gr.Number(label="Session Index", visible=False)
|
|
|
|
| 244 |
|
| 245 |
-
|
| 246 |
-
fn=lambda task,
|
| 247 |
-
inputs=[description,
|
| 248 |
-
outputs=[
|
| 249 |
)
|
| 250 |
|
| 251 |
-
|
| 252 |
-
fn = lambda session_index: on_textbox_change(session_index, session_manager, service,
|
| 253 |
inputs = [session_index]
|
| 254 |
)
|
| 255 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 256 |
|
| 257 |
evaluate_btn = gr.Button("Evaluate")
|
| 258 |
evaluation_result = gr.Textbox(label="Evaluation Result")
|
|
@@ -264,56 +277,44 @@ if __name__ == "__main__":
|
|
| 264 |
)
|
| 265 |
|
| 266 |
evaluation_result.change(
|
| 267 |
-
fn = lambda session_index: on_textbox_change(session_index, session_manager, service,
|
| 268 |
inputs = [session_index]
|
| 269 |
)
|
| 270 |
|
| 271 |
-
save_btn = gr.Button("Save Data",elem_id="save_btn")
|
| 272 |
save_result = gr.Label()
|
| 273 |
|
| 274 |
save_btn.click(
|
| 275 |
-
fn=lambda session_index: save_data(session_index, session_manager, service,
|
| 276 |
inputs=[session_index],
|
| 277 |
outputs=[save_result]
|
| 278 |
)
|
| 279 |
|
| 280 |
with gr.Accordion(label="Appendix: AI instructions", open=False):
|
| 281 |
-
gr.Markdown(
|
|
|
|
| 282 |
|
| 283 |
with group_c_content:
|
| 284 |
with gr.Row():
|
| 285 |
-
|
| 286 |
-
with gr.Row():
|
| 287 |
-
initial_answer = gr.Textbox(label="AI Initial Answer")
|
| 288 |
-
modification_suggestions = gr.Textbox(label="Modification Suggestions(At least 50 words)")
|
| 289 |
-
with gr.Row():
|
| 290 |
-
create_final_btn = gr.Button("Modify")
|
| 291 |
with gr.Row():
|
| 292 |
-
|
|
|
|
|
|
|
|
|
|
| 293 |
session_index = gr.Number(label="Session Index", visible=False)
|
| 294 |
-
|
| 295 |
|
| 296 |
-
|
| 297 |
-
fn=lambda task, id:
|
| 298 |
-
inputs=[description, identification_code],
|
| 299 |
-
outputs=[
|
| 300 |
)
|
| 301 |
|
| 302 |
-
|
| 303 |
-
fn = lambda session_index: on_textbox_change(session_index, session_manager, service,
|
| 304 |
inputs = [session_index]
|
| 305 |
)
|
| 306 |
|
| 307 |
-
create_final_btn.click(
|
| 308 |
-
fn=lambda session_index, modification_suggestions: handle_modify_reverse_sequential(session_index, modification_suggestions, session_manager, api_key),
|
| 309 |
-
inputs=[session_index, modification_suggestions],
|
| 310 |
-
outputs=[final_answer, session_index]
|
| 311 |
-
)
|
| 312 |
-
|
| 313 |
-
final_answer.change(
|
| 314 |
-
fn = lambda session_index: on_textbox_change(session_index, session_manager, service, SHEET_ID3),
|
| 315 |
-
inputs = [session_index]
|
| 316 |
-
)
|
| 317 |
|
| 318 |
evaluate_btn = gr.Button("Evaluate")
|
| 319 |
evaluation_result = gr.Textbox(label="Evaluation Result")
|
|
@@ -325,20 +326,20 @@ if __name__ == "__main__":
|
|
| 325 |
)
|
| 326 |
|
| 327 |
evaluation_result.change(
|
| 328 |
-
fn = lambda session_index: on_textbox_change(session_index, session_manager, service,
|
| 329 |
inputs = [session_index]
|
| 330 |
)
|
| 331 |
|
| 332 |
-
save_btn = gr.Button("Save Data",
|
| 333 |
save_result = gr.Label()
|
| 334 |
|
| 335 |
save_btn.click(
|
| 336 |
-
fn=lambda session_index: save_data(session_index, session_manager, service,
|
| 337 |
inputs=[session_index],
|
| 338 |
outputs=[save_result]
|
| 339 |
)
|
| 340 |
|
| 341 |
with gr.Accordion(label="Appendix: AI instructions", open=False):
|
| 342 |
-
gr.Markdown(
|
| 343 |
|
| 344 |
app.launch(share=True)
|
|
|
|
| 234 |
|
| 235 |
with group_b_content:
|
| 236 |
with gr.Row():
|
| 237 |
+
create_initial_btn = gr.Button("Create")
|
| 238 |
with gr.Row():
|
| 239 |
+
initial_answer = gr.Textbox(label="AI Initial Answer")
|
| 240 |
+
modification_suggestions = gr.Textbox(label="Modification Suggestions(At least 50 words)")
|
| 241 |
+
with gr.Row():
|
| 242 |
+
create_final_btn = gr.Button("Modify")
|
| 243 |
+
with gr.Row():
|
| 244 |
+
final_answer = gr.Textbox(label="Final Answer")
|
| 245 |
session_index = gr.Number(label="Session Index", visible=False)
|
| 246 |
+
|
| 247 |
|
| 248 |
+
create_initial_btn.click(
|
| 249 |
+
fn=lambda task, id: handle_create_reverse_sequential(task, session_manager, api_key, id),
|
| 250 |
+
inputs=[description, identification_code],
|
| 251 |
+
outputs=[initial_answer, session_index]
|
| 252 |
)
|
| 253 |
|
| 254 |
+
initial_answer.change(
|
| 255 |
+
fn = lambda session_index: on_textbox_change(session_index, session_manager, service, SHEET_ID3),
|
| 256 |
inputs = [session_index]
|
| 257 |
)
|
| 258 |
|
| 259 |
+
create_final_btn.click(
|
| 260 |
+
fn=lambda session_index, modification_suggestions: handle_modify_reverse_sequential(session_index, modification_suggestions, session_manager, api_key),
|
| 261 |
+
inputs=[session_index, modification_suggestions],
|
| 262 |
+
outputs=[final_answer, session_index]
|
| 263 |
+
)
|
| 264 |
+
|
| 265 |
+
final_answer.change(
|
| 266 |
+
fn = lambda session_index: on_textbox_change(session_index, session_manager, service, SHEET_ID3),
|
| 267 |
+
inputs = [session_index]
|
| 268 |
+
)
|
| 269 |
|
| 270 |
evaluate_btn = gr.Button("Evaluate")
|
| 271 |
evaluation_result = gr.Textbox(label="Evaluation Result")
|
|
|
|
| 277 |
)
|
| 278 |
|
| 279 |
evaluation_result.change(
|
| 280 |
+
fn = lambda session_index: on_textbox_change(session_index, session_manager, service, SHEET_ID3),
|
| 281 |
inputs = [session_index]
|
| 282 |
)
|
| 283 |
|
| 284 |
+
save_btn = gr.Button("Save Data", elem_id="save_btn")
|
| 285 |
save_result = gr.Label()
|
| 286 |
|
| 287 |
save_btn.click(
|
| 288 |
+
fn=lambda session_index: save_data(session_index, session_manager, service, SHEET_ID3),
|
| 289 |
inputs=[session_index],
|
| 290 |
outputs=[save_result]
|
| 291 |
)
|
| 292 |
|
| 293 |
with gr.Accordion(label="Appendix: AI instructions", open=False):
|
| 294 |
+
gr.Markdown(GPT_PROMPT_reverse_sequential)
|
| 295 |
+
|
| 296 |
|
| 297 |
with group_c_content:
|
| 298 |
with gr.Row():
|
| 299 |
+
human_input = gr.Textbox(label="Human Input(At least 50 words)")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 300 |
with gr.Row():
|
| 301 |
+
create_btn = gr.Button("Create")
|
| 302 |
+
with gr.Row():
|
| 303 |
+
ai_initial_output = gr.Textbox(label="AI Initial Output")
|
| 304 |
+
final_output = gr.Textbox(label="Final Merged Output")
|
| 305 |
session_index = gr.Number(label="Session Index", visible=False)
|
|
|
|
| 306 |
|
| 307 |
+
create_btn.click(
|
| 308 |
+
fn=lambda task, human_input, id: handle_create_parallel(task, human_input, session_manager, api_key, id),
|
| 309 |
+
inputs=[description, human_input, identification_code],
|
| 310 |
+
outputs=[ai_initial_output, final_output, session_index]
|
| 311 |
)
|
| 312 |
|
| 313 |
+
ai_initial_output.change(
|
| 314 |
+
fn = lambda session_index: on_textbox_change(session_index, session_manager, service, SHEET_ID2),
|
| 315 |
inputs = [session_index]
|
| 316 |
)
|
| 317 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 318 |
|
| 319 |
evaluate_btn = gr.Button("Evaluate")
|
| 320 |
evaluation_result = gr.Textbox(label="Evaluation Result")
|
|
|
|
| 326 |
)
|
| 327 |
|
| 328 |
evaluation_result.change(
|
| 329 |
+
fn = lambda session_index: on_textbox_change(session_index, session_manager, service, SHEET_ID2),
|
| 330 |
inputs = [session_index]
|
| 331 |
)
|
| 332 |
|
| 333 |
+
save_btn = gr.Button("Save Data",elem_id="save_btn")
|
| 334 |
save_result = gr.Label()
|
| 335 |
|
| 336 |
save_btn.click(
|
| 337 |
+
fn=lambda session_index: save_data(session_index, session_manager, service, SHEET_ID2),
|
| 338 |
inputs=[session_index],
|
| 339 |
outputs=[save_result]
|
| 340 |
)
|
| 341 |
|
| 342 |
with gr.Accordion(label="Appendix: AI instructions", open=False):
|
| 343 |
+
gr.Markdown(GPT_PROMPT_parallel)
|
| 344 |
|
| 345 |
app.launch(share=True)
|