k-mktr commited on
Commit
f70896b
β€’
1 Parent(s): 26971ac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -15,7 +15,7 @@ from leaderboard import (
15
  ensure_elo_ratings_initialized
16
  )
17
  import sys
18
- from internal_stats import get_fun_stats
19
  import threading
20
  import time
21
  from collections import Counter
@@ -108,7 +108,8 @@ def battle_arena(prompt):
108
  gr.update(interactive=True, value=f"Vote for {nickname_b}"),
109
  gr.update(interactive=True, visible=True), # Enable and show Tie button
110
  prompt, # Return the original prompt
111
- 0 # Initialize tie count
 
112
  )
113
  else:
114
  return (
@@ -119,7 +120,8 @@ def battle_arena(prompt):
119
  gr.update(interactive=True, value=f"Vote for {nickname_b}"),
120
  gr.update(interactive=True, visible=True), # Enable and show Tie button
121
  prompt, # Return the original prompt
122
- 0 # Initialize tie count
 
123
  )
124
 
125
  def record_vote(prompt, left_response, right_response, left_model, right_model, choice):
@@ -348,7 +350,6 @@ def get_fun_stats_html():
348
  <p>🌈 Jack of All Trades: <span class="highlight">{stats['most_diverse_opponent']['model']}</span> (Faced {stats['most_diverse_opponent']['unique_opponents']} unique opponents)</p>
349
  <p>πŸ• Underdog Champion: <span class="highlight">{stats['underdog_champion']['model']}</span> ({stats['underdog_champion']['size']} model with {stats['underdog_champion']['win_rate']} win rate)</p>
350
  <p>βš–οΈ Mr. Consistent: <span class="highlight">{stats['most_consistent']['model']}</span> (Closest to 50% win rate, difference of {stats['most_consistent']['win_loss_difference']} wins/losses)</p>
351
-
352
 
353
  <h3>🀼 Epic Battles</h3>
354
  <p>🀼 Biggest Rivalry: <span class="highlight">{stats['biggest_rivalry']['model1']}</span> vs <span class="highlight">{stats['biggest_rivalry']['model2']}</span> ({stats['biggest_rivalry']['total_battles']} fierce battles!)</p>
@@ -439,7 +440,7 @@ with gr.Blocks(css="""
439
  inputs=prompt_input,
440
  outputs=[left_output, right_output, left_model, right_model,
441
  left_output, right_output, left_vote_btn, right_vote_btn,
442
- tie_btn, previous_prompt, tie_count]
443
  )
444
 
445
  left_vote_btn.click(
@@ -485,4 +486,5 @@ with gr.Blocks(css="""
485
  if __name__ == "__main__":
486
  # Initialize ELO ratings before launching the app
487
  ensure_elo_ratings_initialized()
488
- demo.launch(show_api=False)
 
 
15
  ensure_elo_ratings_initialized
16
  )
17
  import sys
18
+ from fun_stats import get_fun_stats
19
  import threading
20
  import time
21
  from collections import Counter
 
108
  gr.update(interactive=True, value=f"Vote for {nickname_b}"),
109
  gr.update(interactive=True, visible=True), # Enable and show Tie button
110
  prompt, # Return the original prompt
111
+ 0, # Initialize tie count
112
+ gr.update(visible=False) # Hide model names row
113
  )
114
  else:
115
  return (
 
120
  gr.update(interactive=True, value=f"Vote for {nickname_b}"),
121
  gr.update(interactive=True, visible=True), # Enable and show Tie button
122
  prompt, # Return the original prompt
123
+ 0, # Initialize tie count
124
+ gr.update(visible=False) # Hide model names row
125
  )
126
 
127
  def record_vote(prompt, left_response, right_response, left_model, right_model, choice):
 
350
  <p>🌈 Jack of All Trades: <span class="highlight">{stats['most_diverse_opponent']['model']}</span> (Faced {stats['most_diverse_opponent']['unique_opponents']} unique opponents)</p>
351
  <p>πŸ• Underdog Champion: <span class="highlight">{stats['underdog_champion']['model']}</span> ({stats['underdog_champion']['size']} model with {stats['underdog_champion']['win_rate']} win rate)</p>
352
  <p>βš–οΈ Mr. Consistent: <span class="highlight">{stats['most_consistent']['model']}</span> (Closest to 50% win rate, difference of {stats['most_consistent']['win_loss_difference']} wins/losses)</p>
 
353
 
354
  <h3>🀼 Epic Battles</h3>
355
  <p>🀼 Biggest Rivalry: <span class="highlight">{stats['biggest_rivalry']['model1']}</span> vs <span class="highlight">{stats['biggest_rivalry']['model2']}</span> ({stats['biggest_rivalry']['total_battles']} fierce battles!)</p>
 
440
  inputs=prompt_input,
441
  outputs=[left_output, right_output, left_model, right_model,
442
  left_output, right_output, left_vote_btn, right_vote_btn,
443
+ tie_btn, previous_prompt, tie_count, model_names_row]
444
  )
445
 
446
  left_vote_btn.click(
 
486
  if __name__ == "__main__":
487
  # Initialize ELO ratings before launching the app
488
  ensure_elo_ratings_initialized()
489
+ demo.launch(show_api=False, share=True, share_server_address="oqkd.site:7000")
490
+