Skip to content

Commit

Permalink
remove tab
Browse files Browse the repository at this point in the history
  • Loading branch information
adityamittal13 committed Dec 19, 2024
1 parent 7a912c7 commit 3c32ce0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
9 changes: 0 additions & 9 deletions fastchat/serve/monitor/copilot_arena.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@

copilot_arena_leaderboard_url = os.getenv("COPILOT_ARENA_LEADERBOARD_URL")

if not copilot_arena_leaderboard_url:
raise ValueError(
"COPILOT_ARENA_LEADERBOARD_URL environment variable is not set. "
"Please configure it to a valid URL."
)


def process_copilot_arena_leaderboard(leaderboard):
leaderboard = leaderboard.copy().loc[leaderboard["visibility"] == "public"]
Expand Down Expand Up @@ -41,9 +35,6 @@ def process_copilot_arena_leaderboard(leaderboard):


def build_copilot_arena_tab():
if copilot_arena_leaderboard_url is None:
print("Copilot Arena Leaderboard URL is not set. Skipping this leaderboard.")
return
response = requests.get(copilot_arena_leaderboard_url)
if response.status_code == 200:
leaderboard = pd.DataFrame(response.json()["elo_data"])
Expand Down
14 changes: 10 additions & 4 deletions fastchat/serve/monitor/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1035,11 +1035,17 @@ def build_leaderboard_tab(
elo_results_text, model_table_df, model_to_score
)
try:
with gr.Tab("Copilot Arena Leaderboard", id=5):
from fastchat.serve.monitor.copilot_arena import (
build_copilot_arena_tab,
)
from fastchat.serve.monitor.copilot_arena import (
build_copilot_arena_tab,
copilot_arena_leaderboard_url,
)

if not copilot_arena_leaderboard_url:
raise ValueError(
"COPILOT_ARENA_LEADERBOARD_URL environment variable is not set. "
"Please configure it to a valid URL."
)
with gr.Tab("Copilot Arena Leaderboard", id=5):
build_copilot_arena_tab()
except Exception as e:
print(f"Unable to build Copilot Arena's Leaderboard. Error: {e}")
Expand Down

0 comments on commit 3c32ce0

Please sign in to comment.