Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -97,7 +97,8 @@ def battle_arena(prompt):
|
|
97 |
gr.update(interactive=False, visible=False),
|
98 |
prompt,
|
99 |
0,
|
100 |
-
gr.update(visible=False)
|
|
|
101 |
)
|
102 |
|
103 |
nickname_a = random.choice(arena_config.model_nicknames)
|
@@ -120,10 +121,11 @@ def battle_arena(prompt):
|
|
120 |
gr.update(label=nickname_b, value=response_b_formatted),
|
121 |
gr.update(interactive=True, value=f"Vote for {nickname_a}"),
|
122 |
gr.update(interactive=True, value=f"Vote for {nickname_b}"),
|
123 |
-
gr.update(interactive=True, visible=True),
|
124 |
-
prompt,
|
125 |
-
0,
|
126 |
-
gr.update(visible=False)
|
|
|
127 |
)
|
128 |
else:
|
129 |
return (
|
@@ -132,10 +134,11 @@ def battle_arena(prompt):
|
|
132 |
gr.update(label=nickname_b, value=response_a_formatted),
|
133 |
gr.update(interactive=True, value=f"Vote for {nickname_a}"),
|
134 |
gr.update(interactive=True, value=f"Vote for {nickname_b}"),
|
135 |
-
gr.update(interactive=True, visible=True),
|
136 |
-
prompt,
|
137 |
-
0,
|
138 |
-
gr.update(visible=False)
|
|
|
139 |
)
|
140 |
|
141 |
def record_vote(prompt, left_response, right_response, left_model, right_model, choice):
|
@@ -424,7 +427,12 @@ with gr.Blocks(css="""
|
|
424 |
tie_btn = gr.Button("Tie π Continue with a new prompt", interactive=False, visible=False)
|
425 |
right_vote_btn = gr.Button(f"Vote for {right_output.label}", interactive=False)
|
426 |
|
427 |
-
result = gr.Textbox(
|
|
|
|
|
|
|
|
|
|
|
428 |
|
429 |
with gr.Row(visible=False) as model_names_row:
|
430 |
left_model = gr.Textbox(label="π΅ Left Model", interactive=False)
|
|
|
97 |
gr.update(interactive=False, visible=False),
|
98 |
prompt,
|
99 |
0,
|
100 |
+
gr.update(visible=False),
|
101 |
+
gr.update(value="Error: Unable to get response from the model", visible=True)
|
102 |
)
|
103 |
|
104 |
nickname_a = random.choice(arena_config.model_nicknames)
|
|
|
121 |
gr.update(label=nickname_b, value=response_b_formatted),
|
122 |
gr.update(interactive=True, value=f"Vote for {nickname_a}"),
|
123 |
gr.update(interactive=True, value=f"Vote for {nickname_b}"),
|
124 |
+
gr.update(interactive=True, visible=True),
|
125 |
+
prompt,
|
126 |
+
0,
|
127 |
+
gr.update(visible=False),
|
128 |
+
gr.update(value="Ready for your vote! π³οΈ", visible=True)
|
129 |
)
|
130 |
else:
|
131 |
return (
|
|
|
134 |
gr.update(label=nickname_b, value=response_a_formatted),
|
135 |
gr.update(interactive=True, value=f"Vote for {nickname_a}"),
|
136 |
gr.update(interactive=True, value=f"Vote for {nickname_b}"),
|
137 |
+
gr.update(interactive=True, visible=True),
|
138 |
+
prompt,
|
139 |
+
0,
|
140 |
+
gr.update(visible=False),
|
141 |
+
gr.update(value="Ready for your vote! π³οΈ", visible=True)
|
142 |
)
|
143 |
|
144 |
def record_vote(prompt, left_response, right_response, left_model, right_model, choice):
|
|
|
427 |
tie_btn = gr.Button("Tie π Continue with a new prompt", interactive=False, visible=False)
|
428 |
right_vote_btn = gr.Button(f"Vote for {right_output.label}", interactive=False)
|
429 |
|
430 |
+
result = gr.Textbox(
|
431 |
+
label="Status",
|
432 |
+
interactive=False,
|
433 |
+
value="Generate responses to start the battle! π",
|
434 |
+
visible=True # Always visible
|
435 |
+
)
|
436 |
|
437 |
with gr.Row(visible=False) as model_names_row:
|
438 |
left_model = gr.Textbox(label="π΅ Left Model", interactive=False)
|