Skip to content

Commit

Permalink
change error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
adityamittal13 committed Dec 19, 2024
1 parent 3c32ce0 commit defebe1
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions fastchat/serve/monitor/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1034,21 +1034,21 @@ def build_leaderboard_tab(
build_full_leaderboard_tab(
elo_results_text, model_table_df, model_to_score
)
try:
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."
)
from fastchat.serve.monitor.copilot_arena import (
build_copilot_arena_tab,
copilot_arena_leaderboard_url,
)

if copilot_arena_leaderboard_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}")
else:
print(
"Unable to build Copilot Arena's Leaderboard. "
"COPILOT_ARENA_LEADERBOARD_URL environment variable is not set. "
"Please configure it to a valid URL."
)

if not show_plot:
gr.Markdown(
Expand Down

0 comments on commit defebe1

Please sign in to comment.