Spaces:
Sleeping
Sleeping
TTsamurai
commited on
Commit
·
581efdc
1
Parent(s):
c7fd5dc
revise evaluaiton send button
Browse files
app.py
CHANGED
|
@@ -510,7 +510,7 @@ def create_demo():
|
|
| 510 |
[tab_session, chatbot],
|
| 511 |
)
|
| 512 |
evaluation_send_button.click(
|
| 513 |
-
lambda user_id, comp, tab_session, dropdown, reason, trust, satisfaction, knowledgeable, helpful: respond_evaluation(
|
| 514 |
user_id,
|
| 515 |
tab_session,
|
| 516 |
{
|
|
@@ -522,9 +522,10 @@ def create_demo():
|
|
| 522 |
"helpful": helpful,
|
| 523 |
},
|
| 524 |
comp,
|
|
|
|
| 525 |
),
|
| 526 |
-
[user_id, comp, tab_session, dropdown, reason, trust, satisfaction, knowledgeable, helpful],
|
| 527 |
-
[tab_session, dropdown, reason, trust, satisfaction, knowledgeable, helpful],
|
| 528 |
)
|
| 529 |
|
| 530 |
def click_control_preference_stage(tabs, user_id, user_preference_elicitation_session):
|
|
@@ -890,7 +891,7 @@ def create_demo():
|
|
| 890 |
# log_action(user_id, "Session", "History", history)
|
| 891 |
return tab_data, history
|
| 892 |
|
| 893 |
-
def respond_evaluation(user_id, tab_data, evals, tab_name):
|
| 894 |
|
| 895 |
# dropdown, readon_button, multi-evaluator
|
| 896 |
print(f"Tab: {tab_name}\nEvaluation: {evals}")
|
|
@@ -906,6 +907,7 @@ def create_demo():
|
|
| 906 |
# log_action(user_id, tab_name, key, value)
|
| 907 |
# Store the reason for this tab
|
| 908 |
tab_data["multi_evaluator"] = evals
|
|
|
|
| 909 |
return (
|
| 910 |
tab_data,
|
| 911 |
evals["selection"],
|
|
@@ -914,6 +916,7 @@ def create_demo():
|
|
| 914 |
evals["satisfaction"],
|
| 915 |
evals["knowledgeable"],
|
| 916 |
evals["helpful"],
|
|
|
|
| 917 |
)
|
| 918 |
|
| 919 |
def respond_final_ranking(
|
|
|
|
| 510 |
[tab_session, chatbot],
|
| 511 |
)
|
| 512 |
evaluation_send_button.click(
|
| 513 |
+
lambda user_id, comp, tab_session, dropdown, reason, trust, satisfaction, knowledgeable, helpful, evaluation_send_button: respond_evaluation(
|
| 514 |
user_id,
|
| 515 |
tab_session,
|
| 516 |
{
|
|
|
|
| 522 |
"helpful": helpful,
|
| 523 |
},
|
| 524 |
comp,
|
| 525 |
+
evaluation_send_button,
|
| 526 |
),
|
| 527 |
+
[user_id, comp, tab_session, dropdown, reason, trust, satisfaction, knowledgeable, helpful, evaluation_send_button],
|
| 528 |
+
[tab_session, dropdown, reason, trust, satisfaction, knowledgeable, helpful, evaluation_send_button],
|
| 529 |
)
|
| 530 |
|
| 531 |
def click_control_preference_stage(tabs, user_id, user_preference_elicitation_session):
|
|
|
|
| 891 |
# log_action(user_id, "Session", "History", history)
|
| 892 |
return tab_data, history
|
| 893 |
|
| 894 |
+
def respond_evaluation(user_id, tab_data, evals, tab_name, evaluation_send_button):
|
| 895 |
|
| 896 |
# dropdown, readon_button, multi-evaluator
|
| 897 |
print(f"Tab: {tab_name}\nEvaluation: {evals}")
|
|
|
|
| 907 |
# log_action(user_id, tab_name, key, value)
|
| 908 |
# Store the reason for this tab
|
| 909 |
tab_data["multi_evaluator"] = evals
|
| 910 |
+
evaluation_send_button = gr.Button(value="Thank you for submitting your evaluation. Please proceed to the next tab.", interactive=False)
|
| 911 |
return (
|
| 912 |
tab_data,
|
| 913 |
evals["selection"],
|
|
|
|
| 916 |
evals["satisfaction"],
|
| 917 |
evals["knowledgeable"],
|
| 918 |
evals["helpful"],
|
| 919 |
+
evaluation_send_button,
|
| 920 |
)
|
| 921 |
|
| 922 |
def respond_final_ranking(
|