Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -393,7 +393,7 @@ def _diff_generate_response(model, tokenizer, prompt_ids, gen_len, num_steps, te
|
|
| 393 |
# ELO persistence
|
| 394 |
# ---------------------------------------------------------------------------
|
| 395 |
def init_elo_state() -> Dict[str, dict]:
|
| 396 |
-
return {mid: {"rating": float(INIT_RATING), "wins": 0, "losses": 0, "battles": 0, "ties": 0} for mid in MODEL_IDS}
|
| 397 |
|
| 398 |
def load_elo() -> Dict[str, dict]:
|
| 399 |
if get_elo_file().exists():
|
|
@@ -402,7 +402,14 @@ def load_elo() -> Dict[str, dict]:
|
|
| 402 |
data = json.load(f)
|
| 403 |
for mid in MODEL_IDS:
|
| 404 |
if mid not in data:
|
| 405 |
-
data[mid] = {"rating": float(INIT_RATING), "wins": 0, "losses": 0, "battles": 0, "ties": 0}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 406 |
return data
|
| 407 |
except Exception as e:
|
| 408 |
logger.warning(f"Failed to load ELO file: {e}, resetting")
|
|
@@ -431,7 +438,7 @@ def update_elo(state: Dict[str, dict], model_a: str, model_b: str, winner: Optio
|
|
| 431 |
sa = 1.0
|
| 432 |
elif winner == model_b:
|
| 433 |
sa = 0.0
|
| 434 |
-
elif winner is None or winner == "tie":
|
| 435 |
sa = 0.5
|
| 436 |
else:
|
| 437 |
raise ValueError(f"Unexpected winner: {winner}")
|
|
@@ -446,9 +453,14 @@ def update_elo(state: Dict[str, dict], model_a: str, model_b: str, winner: Optio
|
|
| 446 |
elif sa == 0.0:
|
| 447 |
state[model_b]["wins"] += 1
|
| 448 |
state[model_a]["losses"] += 1
|
| 449 |
-
|
| 450 |
state[model_a]["ties"] += 1
|
| 451 |
state[model_b]["ties"] += 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 452 |
save_elo(state)
|
| 453 |
return state
|
| 454 |
|
|
@@ -466,6 +478,7 @@ def leaderboard_dataframe(state: Optional[Dict[str, dict]] = None) -> pd.DataFra
|
|
| 466 |
"Wins": int(info["wins"]),
|
| 467 |
"Losses": int(info["losses"]),
|
| 468 |
"Ties": int(info.get("ties", 0)),
|
|
|
|
| 469 |
})
|
| 470 |
df = pd.DataFrame(rows)
|
| 471 |
df = df.sort_values(by="ELO", ascending=False).reset_index(drop=True)
|
|
@@ -478,7 +491,7 @@ def leaderboard_dataframe(state: Optional[Dict[str, dict]] = None) -> pd.DataFra
|
|
| 478 |
def log_battle(prompt: str, model_a: str, model_b: str, response_a: str, response_b: str, chosen: str, winner_model: str):
|
| 479 |
"""
|
| 480 |
Append one battle record to data/chats.jsonl.
|
| 481 |
-
Fields: prompt, response_a, response_b, model_a, model_b, chosen (A/B), winner_model, timestamp
|
| 482 |
Spec: keeps user's message, two responses, each model's names, and what response user chose.
|
| 483 |
"""
|
| 484 |
try:
|
|
@@ -490,7 +503,7 @@ def log_battle(prompt: str, model_a: str, model_b: str, response_a: str, respons
|
|
| 490 |
"model_b": model_b,
|
| 491 |
"response_a": response_a,
|
| 492 |
"response_b": response_b,
|
| 493 |
-
"chosen": chosen, # "A" / "B" / "tie"
|
| 494 |
"winner_model": winner_model,
|
| 495 |
"chosen_response": response_a if chosen == "A" else response_b if chosen == "B" else "",
|
| 496 |
}
|
|
@@ -831,7 +844,8 @@ def create_demo() -> gr.Blocks:
|
|
| 831 |
with gr.Row():
|
| 832 |
vote_a = gr.Button("π Vote for A", variant="secondary", interactive=False, elem_classes=["vote-btn"])
|
| 833 |
vote_tie = gr.Button("π€ Tie", variant="secondary", interactive=False, elem_classes=["vote-btn"])
|
| 834 |
-
|
|
|
|
| 835 |
|
| 836 |
status = gr.Markdown(visible=False)
|
| 837 |
new_round_btn = gr.Button("π New Round", visible=False, variant="secondary")
|
|
@@ -846,11 +860,11 @@ def create_demo() -> gr.Blocks:
|
|
| 846 |
gr.Markdown("### π ELO Leaderboard")
|
| 847 |
leaderboard = gr.Dataframe(
|
| 848 |
value=df_init,
|
| 849 |
-
headers=["Rank", "Model", "Model ID", "ELO", "Battles", "Wins", "Losses", "Ties"],
|
| 850 |
-
datatype=["number", "str", "str", "number", "number", "number", "number", "number"],
|
| 851 |
interactive=False,
|
| 852 |
wrap=False,
|
| 853 |
-
column_widths=["5%", "
|
| 854 |
elem_id="leaderboard",
|
| 855 |
)
|
| 856 |
with gr.Row():
|
|
@@ -865,13 +879,13 @@ def create_demo() -> gr.Blocks:
|
|
| 865 |
return (
|
| 866 |
gr.update(value="", placeholder="Please enter a prompt first!"),
|
| 867 |
gr.update(value=""),
|
| 868 |
-
gr.update(value=""),
|
| 869 |
gr.update(visible=False),
|
| 870 |
gr.update(visible=False),
|
| 871 |
gr.update(visible=False, value=""),
|
| 872 |
gr.update(interactive=False),
|
| 873 |
gr.update(interactive=False),
|
| 874 |
gr.update(interactive=False),
|
|
|
|
| 875 |
gr.update(visible=False),
|
| 876 |
"", "", False, user_prompt, last_pair_val,
|
| 877 |
leaderboard_dataframe(load_elo())
|
|
@@ -895,6 +909,7 @@ def create_demo() -> gr.Blocks:
|
|
| 895 |
gr.update(interactive=True),
|
| 896 |
gr.update(interactive=True),
|
| 897 |
gr.update(interactive=True),
|
|
|
|
| 898 |
gr.update(visible=False),
|
| 899 |
a, b, False, user_prompt, (a, b),
|
| 900 |
leaderboard_dataframe(load_elo())
|
|
@@ -909,6 +924,7 @@ def create_demo() -> gr.Blocks:
|
|
| 909 |
gr.update(interactive=False),
|
| 910 |
gr.update(interactive=False),
|
| 911 |
gr.update(interactive=False),
|
|
|
|
| 912 |
gr.update(visible=False),
|
| 913 |
voted,
|
| 914 |
leaderboard_dataframe(load_elo())
|
|
@@ -925,6 +941,10 @@ def create_demo() -> gr.Blocks:
|
|
| 925 |
winner = None
|
| 926 |
win_label = "Tie"
|
| 927 |
chosen = "tie"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 928 |
else:
|
| 929 |
winner = model_b
|
| 930 |
win_label = "B"
|
|
@@ -945,6 +965,12 @@ def create_demo() -> gr.Blocks:
|
|
| 945 |
f"**ELO update:** {MODEL_DISPLAY.get(model_a, model_a)} {ra_before:.1f} β {ra_after:.1f} ({delta_a:+.1f}) | "
|
| 946 |
f"{MODEL_DISPLAY.get(model_b, model_b)} {rb_before:.1f} β {rb_after:.1f} ({delta_b:+.1f})"
|
| 947 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 948 |
else:
|
| 949 |
status_text = (
|
| 950 |
f"You voted **{win_label}**: the winner is `{winner}`\n\n"
|
|
@@ -961,6 +987,7 @@ def create_demo() -> gr.Blocks:
|
|
| 961 |
gr.update(interactive=False),
|
| 962 |
gr.update(interactive=False),
|
| 963 |
gr.update(interactive=False),
|
|
|
|
| 964 |
gr.update(visible=True),
|
| 965 |
True,
|
| 966 |
df
|
|
@@ -976,6 +1003,7 @@ def create_demo() -> gr.Blocks:
|
|
| 976 |
gr.update(interactive=False),
|
| 977 |
gr.update(interactive=False),
|
| 978 |
gr.update(interactive=False),
|
|
|
|
| 979 |
gr.update(visible=False),
|
| 980 |
"", "", False, ""
|
| 981 |
)
|
|
@@ -991,6 +1019,7 @@ def create_demo() -> gr.Blocks:
|
|
| 991 |
gr.update(interactive=False),
|
| 992 |
gr.update(interactive=False),
|
| 993 |
gr.update(interactive=False),
|
|
|
|
| 994 |
gr.update(visible=False),
|
| 995 |
"", "", False, ""
|
| 996 |
)
|
|
@@ -1001,40 +1030,45 @@ def create_demo() -> gr.Blocks:
|
|
| 1001 |
submit_btn.click(
|
| 1002 |
fn=on_submit,
|
| 1003 |
inputs=[prompt, last_pair],
|
| 1004 |
-
outputs=[response_a, response_b, reveal_a, reveal_b, status, vote_a, vote_tie, vote_b, new_round_btn, model_a_state, model_b_state, voted_state, prompt_state, last_pair, leaderboard],
|
| 1005 |
)
|
| 1006 |
|
| 1007 |
prompt.submit(
|
| 1008 |
fn=on_submit,
|
| 1009 |
inputs=[prompt, last_pair],
|
| 1010 |
-
outputs=[response_a, response_b, reveal_a, reveal_b, status, vote_a, vote_tie, vote_b, new_round_btn, model_a_state, model_b_state, voted_state, prompt_state, last_pair, leaderboard],
|
| 1011 |
)
|
| 1012 |
|
| 1013 |
vote_a.click(
|
| 1014 |
fn=lambda ma, mb, ra, rb, pr, vd: on_vote("A", ma, mb, ra, rb, pr, vd),
|
| 1015 |
inputs=[model_a_state, model_b_state, response_a, response_b, prompt_state, voted_state],
|
| 1016 |
-
outputs=[reveal_a, reveal_b, status, vote_a, vote_tie, vote_b, new_round_btn, voted_state, leaderboard],
|
| 1017 |
)
|
| 1018 |
vote_tie.click(
|
| 1019 |
fn=lambda ma, mb, ra, rb, pr, vd: on_vote("Tie", ma, mb, ra, rb, pr, vd),
|
| 1020 |
inputs=[model_a_state, model_b_state, response_a, response_b, prompt_state, voted_state],
|
| 1021 |
-
outputs=[reveal_a, reveal_b, status, vote_a, vote_tie, vote_b, new_round_btn, voted_state, leaderboard],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1022 |
)
|
| 1023 |
vote_b.click(
|
| 1024 |
fn=lambda ma, mb, ra, rb, pr, vd: on_vote("B", ma, mb, ra, rb, pr, vd),
|
| 1025 |
inputs=[model_a_state, model_b_state, response_a, response_b, prompt_state, voted_state],
|
| 1026 |
-
outputs=[reveal_a, reveal_b, status, vote_a, vote_tie, vote_b, new_round_btn, voted_state, leaderboard],
|
| 1027 |
)
|
| 1028 |
|
| 1029 |
new_round_btn.click(
|
| 1030 |
fn=on_new_round,
|
| 1031 |
inputs=[],
|
| 1032 |
-
outputs=[response_a, response_b, reveal_a, reveal_b, status, vote_a, vote_tie, vote_b, new_round_btn, model_a_state, model_b_state, voted_state, prompt_state],
|
| 1033 |
)
|
| 1034 |
clear_btn.click(
|
| 1035 |
fn=on_clear,
|
| 1036 |
inputs=[],
|
| 1037 |
-
outputs=[prompt, response_a, response_b, reveal_a, reveal_b, status, vote_a, vote_tie, vote_b, new_round_btn, model_a_state, model_b_state, voted_state, prompt_state],
|
| 1038 |
)
|
| 1039 |
|
| 1040 |
refresh_btn.click(fn=on_refresh, inputs=[], outputs=[leaderboard])
|
|
|
|
| 393 |
# ELO persistence
|
| 394 |
# ---------------------------------------------------------------------------
|
| 395 |
def init_elo_state() -> Dict[str, dict]:
|
| 396 |
+
return {mid: {"rating": float(INIT_RATING), "wins": 0, "losses": 0, "battles": 0, "ties": 0, "both_bad": 0} for mid in MODEL_IDS}
|
| 397 |
|
| 398 |
def load_elo() -> Dict[str, dict]:
|
| 399 |
if get_elo_file().exists():
|
|
|
|
| 402 |
data = json.load(f)
|
| 403 |
for mid in MODEL_IDS:
|
| 404 |
if mid not in data:
|
| 405 |
+
data[mid] = {"rating": float(INIT_RATING), "wins": 0, "losses": 0, "battles": 0, "ties": 0, "both_bad": 0}
|
| 406 |
+
else:
|
| 407 |
+
data[mid].setdefault("rating", float(INIT_RATING))
|
| 408 |
+
data[mid].setdefault("wins", 0)
|
| 409 |
+
data[mid].setdefault("losses", 0)
|
| 410 |
+
data[mid].setdefault("battles", 0)
|
| 411 |
+
data[mid].setdefault("ties", 0)
|
| 412 |
+
data[mid].setdefault("both_bad", 0)
|
| 413 |
return data
|
| 414 |
except Exception as e:
|
| 415 |
logger.warning(f"Failed to load ELO file: {e}, resetting")
|
|
|
|
| 438 |
sa = 1.0
|
| 439 |
elif winner == model_b:
|
| 440 |
sa = 0.0
|
| 441 |
+
elif winner is None or winner == "tie" or winner == "both_bad":
|
| 442 |
sa = 0.5
|
| 443 |
else:
|
| 444 |
raise ValueError(f"Unexpected winner: {winner}")
|
|
|
|
| 453 |
elif sa == 0.0:
|
| 454 |
state[model_b]["wins"] += 1
|
| 455 |
state[model_a]["losses"] += 1
|
| 456 |
+
elif winner != "both_bad":
|
| 457 |
state[model_a]["ties"] += 1
|
| 458 |
state[model_b]["ties"] += 1
|
| 459 |
+
|
| 460 |
+
if winner == "both_bad":
|
| 461 |
+
state[model_a]["both_bad"] = state[model_a].get("both_bad", 0) + 1
|
| 462 |
+
state[model_b]["both_bad"] = state[model_b].get("both_bad", 0) + 1
|
| 463 |
+
|
| 464 |
save_elo(state)
|
| 465 |
return state
|
| 466 |
|
|
|
|
| 478 |
"Wins": int(info["wins"]),
|
| 479 |
"Losses": int(info["losses"]),
|
| 480 |
"Ties": int(info.get("ties", 0)),
|
| 481 |
+
"Both Bad": int(info.get("both_bad", 0)),
|
| 482 |
})
|
| 483 |
df = pd.DataFrame(rows)
|
| 484 |
df = df.sort_values(by="ELO", ascending=False).reset_index(drop=True)
|
|
|
|
| 491 |
def log_battle(prompt: str, model_a: str, model_b: str, response_a: str, response_b: str, chosen: str, winner_model: str):
|
| 492 |
"""
|
| 493 |
Append one battle record to data/chats.jsonl.
|
| 494 |
+
Fields: prompt, response_a, response_b, model_a, model_b, chosen (A/B/tie/both_bad), winner_model, timestamp
|
| 495 |
Spec: keeps user's message, two responses, each model's names, and what response user chose.
|
| 496 |
"""
|
| 497 |
try:
|
|
|
|
| 503 |
"model_b": model_b,
|
| 504 |
"response_a": response_a,
|
| 505 |
"response_b": response_b,
|
| 506 |
+
"chosen": chosen, # "A" / "B" / "tie" / "both_bad"
|
| 507 |
"winner_model": winner_model,
|
| 508 |
"chosen_response": response_a if chosen == "A" else response_b if chosen == "B" else "",
|
| 509 |
}
|
|
|
|
| 844 |
with gr.Row():
|
| 845 |
vote_a = gr.Button("π Vote for A", variant="secondary", interactive=False, elem_classes=["vote-btn"])
|
| 846 |
vote_tie = gr.Button("π€ Tie", variant="secondary", interactive=False, elem_classes=["vote-btn"])
|
| 847 |
+
vote_both_bad = gr.Button("π Both Bad", variant="secondary", interactive=False, elem_classes=["vote-btn"])
|
| 848 |
+
vote_b = gr.Button("Vote for B π", variant="secondary", interactive=False, elem_classes=["vote-btn"])
|
| 849 |
|
| 850 |
status = gr.Markdown(visible=False)
|
| 851 |
new_round_btn = gr.Button("π New Round", visible=False, variant="secondary")
|
|
|
|
| 860 |
gr.Markdown("### π ELO Leaderboard")
|
| 861 |
leaderboard = gr.Dataframe(
|
| 862 |
value=df_init,
|
| 863 |
+
headers=["Rank", "Model", "Model ID", "ELO", "Battles", "Wins", "Losses", "Ties", "Both Bad"],
|
| 864 |
+
datatype=["number", "str", "str", "number", "number", "number", "number", "number", "number"],
|
| 865 |
interactive=False,
|
| 866 |
wrap=False,
|
| 867 |
+
column_widths=["5%", "15%", "25%", "12%", "7%", "7%", "7%", "7%", "7%"],
|
| 868 |
elem_id="leaderboard",
|
| 869 |
)
|
| 870 |
with gr.Row():
|
|
|
|
| 879 |
return (
|
| 880 |
gr.update(value="", placeholder="Please enter a prompt first!"),
|
| 881 |
gr.update(value=""),
|
|
|
|
| 882 |
gr.update(visible=False),
|
| 883 |
gr.update(visible=False),
|
| 884 |
gr.update(visible=False, value=""),
|
| 885 |
gr.update(interactive=False),
|
| 886 |
gr.update(interactive=False),
|
| 887 |
gr.update(interactive=False),
|
| 888 |
+
gr.update(interactive=False),
|
| 889 |
gr.update(visible=False),
|
| 890 |
"", "", False, user_prompt, last_pair_val,
|
| 891 |
leaderboard_dataframe(load_elo())
|
|
|
|
| 909 |
gr.update(interactive=True),
|
| 910 |
gr.update(interactive=True),
|
| 911 |
gr.update(interactive=True),
|
| 912 |
+
gr.update(interactive=True),
|
| 913 |
gr.update(visible=False),
|
| 914 |
a, b, False, user_prompt, (a, b),
|
| 915 |
leaderboard_dataframe(load_elo())
|
|
|
|
| 924 |
gr.update(interactive=False),
|
| 925 |
gr.update(interactive=False),
|
| 926 |
gr.update(interactive=False),
|
| 927 |
+
gr.update(interactive=False),
|
| 928 |
gr.update(visible=False),
|
| 929 |
voted,
|
| 930 |
leaderboard_dataframe(load_elo())
|
|
|
|
| 941 |
winner = None
|
| 942 |
win_label = "Tie"
|
| 943 |
chosen = "tie"
|
| 944 |
+
elif choice == "Both Bad":
|
| 945 |
+
winner = "both_bad"
|
| 946 |
+
win_label = "Both Bad"
|
| 947 |
+
chosen = "both_bad"
|
| 948 |
else:
|
| 949 |
winner = model_b
|
| 950 |
win_label = "B"
|
|
|
|
| 965 |
f"**ELO update:** {MODEL_DISPLAY.get(model_a, model_a)} {ra_before:.1f} β {ra_after:.1f} ({delta_a:+.1f}) | "
|
| 966 |
f"{MODEL_DISPLAY.get(model_b, model_b)} {rb_before:.1f} β {rb_after:.1f} ({delta_b:+.1f})"
|
| 967 |
)
|
| 968 |
+
elif choice == "Both Bad":
|
| 969 |
+
status_text = (
|
| 970 |
+
f"You voted **Both Bad**: no winner\n\n"
|
| 971 |
+
f"**ELO update:** {MODEL_DISPLAY.get(model_a, model_a)} {ra_before:.1f} β {ra_after:.1f} ({delta_a:+.1f}) | "
|
| 972 |
+
f"{MODEL_DISPLAY.get(model_b, model_b)} {rb_before:.1f} β {rb_after:.1f} ({delta_b:+.1f})"
|
| 973 |
+
)
|
| 974 |
else:
|
| 975 |
status_text = (
|
| 976 |
f"You voted **{win_label}**: the winner is `{winner}`\n\n"
|
|
|
|
| 987 |
gr.update(interactive=False),
|
| 988 |
gr.update(interactive=False),
|
| 989 |
gr.update(interactive=False),
|
| 990 |
+
gr.update(interactive=False),
|
| 991 |
gr.update(visible=True),
|
| 992 |
True,
|
| 993 |
df
|
|
|
|
| 1003 |
gr.update(interactive=False),
|
| 1004 |
gr.update(interactive=False),
|
| 1005 |
gr.update(interactive=False),
|
| 1006 |
+
gr.update(interactive=False),
|
| 1007 |
gr.update(visible=False),
|
| 1008 |
"", "", False, ""
|
| 1009 |
)
|
|
|
|
| 1019 |
gr.update(interactive=False),
|
| 1020 |
gr.update(interactive=False),
|
| 1021 |
gr.update(interactive=False),
|
| 1022 |
+
gr.update(interactive=False),
|
| 1023 |
gr.update(visible=False),
|
| 1024 |
"", "", False, ""
|
| 1025 |
)
|
|
|
|
| 1030 |
submit_btn.click(
|
| 1031 |
fn=on_submit,
|
| 1032 |
inputs=[prompt, last_pair],
|
| 1033 |
+
outputs=[response_a, response_b, reveal_a, reveal_b, status, vote_a, vote_tie, vote_both_bad, vote_b, new_round_btn, model_a_state, model_b_state, voted_state, prompt_state, last_pair, leaderboard],
|
| 1034 |
)
|
| 1035 |
|
| 1036 |
prompt.submit(
|
| 1037 |
fn=on_submit,
|
| 1038 |
inputs=[prompt, last_pair],
|
| 1039 |
+
outputs=[response_a, response_b, reveal_a, reveal_b, status, vote_a, vote_tie, vote_both_bad, vote_b, new_round_btn, model_a_state, model_b_state, voted_state, prompt_state, last_pair, leaderboard],
|
| 1040 |
)
|
| 1041 |
|
| 1042 |
vote_a.click(
|
| 1043 |
fn=lambda ma, mb, ra, rb, pr, vd: on_vote("A", ma, mb, ra, rb, pr, vd),
|
| 1044 |
inputs=[model_a_state, model_b_state, response_a, response_b, prompt_state, voted_state],
|
| 1045 |
+
outputs=[reveal_a, reveal_b, status, vote_a, vote_tie, vote_both_bad, vote_b, new_round_btn, voted_state, leaderboard],
|
| 1046 |
)
|
| 1047 |
vote_tie.click(
|
| 1048 |
fn=lambda ma, mb, ra, rb, pr, vd: on_vote("Tie", ma, mb, ra, rb, pr, vd),
|
| 1049 |
inputs=[model_a_state, model_b_state, response_a, response_b, prompt_state, voted_state],
|
| 1050 |
+
outputs=[reveal_a, reveal_b, status, vote_a, vote_tie, vote_both_bad, vote_b, new_round_btn, voted_state, leaderboard],
|
| 1051 |
+
)
|
| 1052 |
+
vote_both_bad.click(
|
| 1053 |
+
fn=lambda ma, mb, ra, rb, pr, vd: on_vote("Both Bad", ma, mb, ra, rb, pr, vd),
|
| 1054 |
+
inputs=[model_a_state, model_b_state, response_a, response_b, prompt_state, voted_state],
|
| 1055 |
+
outputs=[reveal_a, reveal_b, status, vote_a, vote_tie, vote_both_bad, vote_b, new_round_btn, voted_state, leaderboard],
|
| 1056 |
)
|
| 1057 |
vote_b.click(
|
| 1058 |
fn=lambda ma, mb, ra, rb, pr, vd: on_vote("B", ma, mb, ra, rb, pr, vd),
|
| 1059 |
inputs=[model_a_state, model_b_state, response_a, response_b, prompt_state, voted_state],
|
| 1060 |
+
outputs=[reveal_a, reveal_b, status, vote_a, vote_tie, vote_both_bad, vote_b, new_round_btn, voted_state, leaderboard],
|
| 1061 |
)
|
| 1062 |
|
| 1063 |
new_round_btn.click(
|
| 1064 |
fn=on_new_round,
|
| 1065 |
inputs=[],
|
| 1066 |
+
outputs=[response_a, response_b, reveal_a, reveal_b, status, vote_a, vote_tie, vote_both_bad, vote_b, new_round_btn, model_a_state, model_b_state, voted_state, prompt_state],
|
| 1067 |
)
|
| 1068 |
clear_btn.click(
|
| 1069 |
fn=on_clear,
|
| 1070 |
inputs=[],
|
| 1071 |
+
outputs=[prompt, response_a, response_b, reveal_a, reveal_b, status, vote_a, vote_tie, vote_both_bad, vote_b, new_round_btn, model_a_state, model_b_state, voted_state, prompt_state],
|
| 1072 |
)
|
| 1073 |
|
| 1074 |
refresh_btn.click(fn=on_refresh, inputs=[], outputs=[leaderboard])
|