Skip to content

Commit defebe1

Browse files
change error handling
1 parent 3c32ce0 commit defebe1

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

fastchat/serve/monitor/monitor.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,21 +1034,21 @@ def build_leaderboard_tab(
10341034
build_full_leaderboard_tab(
10351035
elo_results_text, model_table_df, model_to_score
10361036
)
1037-
try:
1038-
from fastchat.serve.monitor.copilot_arena import (
1039-
build_copilot_arena_tab,
1040-
copilot_arena_leaderboard_url,
1041-
)
10421037

1043-
if not copilot_arena_leaderboard_url:
1044-
raise ValueError(
1045-
"COPILOT_ARENA_LEADERBOARD_URL environment variable is not set. "
1046-
"Please configure it to a valid URL."
1047-
)
1038+
from fastchat.serve.monitor.copilot_arena import (
1039+
build_copilot_arena_tab,
1040+
copilot_arena_leaderboard_url,
1041+
)
1042+
1043+
if copilot_arena_leaderboard_url:
10481044
with gr.Tab("Copilot Arena Leaderboard", id=5):
10491045
build_copilot_arena_tab()
1050-
except Exception as e:
1051-
print(f"Unable to build Copilot Arena's Leaderboard. Error: {e}")
1046+
else:
1047+
print(
1048+
"Unable to build Copilot Arena's Leaderboard. "
1049+
"COPILOT_ARENA_LEADERBOARD_URL environment variable is not set. "
1050+
"Please configure it to a valid URL."
1051+
)
10521052

10531053
if not show_plot:
10541054
gr.Markdown(

0 commit comments

Comments
 (0)