From defebe1bcec46717e0c70f7b33bf2e27a5e1cea9 Mon Sep 17 00:00:00 2001 From: Aditya Date: Thu, 19 Dec 2024 14:54:47 -0800 Subject: [PATCH] change error handling --- fastchat/serve/monitor/monitor.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/fastchat/serve/monitor/monitor.py b/fastchat/serve/monitor/monitor.py index f21cf4a58..5cbed3f6d 100644 --- a/fastchat/serve/monitor/monitor.py +++ b/fastchat/serve/monitor/monitor.py @@ -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(