tdurbor commited on
Commit
56dd245
·
1 Parent(s): 6d7ed60

Swap name to keep voting buttons

Browse files
Files changed (1) hide show
  1. app.py +31 -29
app.py CHANGED
@@ -213,35 +213,6 @@ def gradio_interface():
213
  image_width = None
214
  image_height = 600 # Limit image height to fit on a standard screen
215
 
216
- with gr.Row(equal_height=True):
217
- def on_enter_contest(username):
218
- feedback_message = f"Thank you, {username or 'anonymous'}! You can see how you rank in the Hall of Fame."
219
- logging.info(feedback_message)
220
- return feedback_message
221
-
222
- with gr.Column(scale=2):
223
- username_input = gr.Textbox(
224
- label="Enter your username (optional)",
225
- placeholder="✨ Enter your username (optional)",
226
- show_label=False,
227
- submit_btn="Enter",
228
- interactive=True
229
- )
230
-
231
- with gr.Column(scale=3):
232
- feedback_output = gr.Textbox(
233
- label="Feedback",
234
- interactive=False,
235
- show_label=False
236
- )
237
-
238
- username_input.submit(
239
- fn=on_enter_contest,
240
- inputs=username_input,
241
- outputs=feedback_output
242
- )
243
-
244
-
245
 
246
  with gr.Row():
247
  # Initialize components with empty states
@@ -334,6 +305,35 @@ def gradio_interface():
334
 
335
  return outputs + [new_notice_markdown]
336
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
337
  notice_markdown = gr.Markdown(get_notice_markdown(), elem_id="notice_markdown")
338
  vote_a_button.click(
339
  fn=lambda username: vote_for_model("model_a", state_filename, state_model_a_name, state_model_b_name, username),
@@ -360,6 +360,8 @@ def gradio_interface():
360
  ]
361
  )
362
 
 
 
363
  with gr.Tab("🏆 Leaderboard", id=1) as leaderboard_tab:
364
  rankings_table = gr.Dataframe(
365
  headers=["Model", "Elo score", "Variance", "95% CI", "Selections"],
 
213
  image_width = None
214
  image_height = 600 # Limit image height to fit on a standard screen
215
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
216
 
217
  with gr.Row():
218
  # Initialize components with empty states
 
305
 
306
  return outputs + [new_notice_markdown]
307
 
308
+ with gr.Row(equal_height=True):
309
+ def on_enter_contest(username):
310
+ feedback_message = f"Thank you, {username or 'anonymous'}! You can see how you rank in the Hall of Fame."
311
+ logging.info(feedback_message)
312
+ return feedback_message
313
+
314
+ with gr.Column(scale=2):
315
+ username_input = gr.Textbox(
316
+ label="Enter your username (optional)",
317
+ placeholder="✨ Enter your username (optional)",
318
+ show_label=False,
319
+ submit_btn="Enter",
320
+ interactive=True
321
+ )
322
+
323
+ with gr.Column(scale=3):
324
+ feedback_output = gr.Textbox(
325
+ label="Feedback",
326
+ interactive=False,
327
+ show_label=False
328
+ )
329
+
330
+ username_input.submit(
331
+ fn=on_enter_contest,
332
+ inputs=username_input,
333
+ outputs=feedback_output
334
+ )
335
+
336
+
337
  notice_markdown = gr.Markdown(get_notice_markdown(), elem_id="notice_markdown")
338
  vote_a_button.click(
339
  fn=lambda username: vote_for_model("model_a", state_filename, state_model_a_name, state_model_b_name, username),
 
360
  ]
361
  )
362
 
363
+
364
+
365
  with gr.Tab("🏆 Leaderboard", id=1) as leaderboard_tab:
366
  rankings_table = gr.Dataframe(
367
  headers=["Model", "Elo score", "Variance", "95% CI", "Selections"],