Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove loading of Copilot Arena tab when env variable is not set #3645

Merged

Conversation

adityamittal13
Copy link
Contributor

Why are these changes needed?

Adding a small change to #3618, which doesn't load the Copilot Arena leaderboard tab when the environment variable is not set.

Related issue number (if applicable)

Checks

  • I've run format.sh to lint the changes in this PR.
  • I've included any doc changes needed.
  • I've made sure the relevant tests are passing (if applicable).

@adityamittal13 adityamittal13 marked this pull request as ready for review December 19, 2024 20:24
Copy link
Member

@infwinston infwinston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

Comment on lines 1037 to 1051
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}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you think we should do try catch or just if else like below

if copilot_arena_leaderboard_url:
    with gr.Tab("Copilot Arena Leaderboard", id=5):
        build_copilot_arena_tab()
else:
    print(f"Unable to build Copilot Arena's Leaderboard")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ Agreed with this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! I've just updated this

@infwinston infwinston merged commit 8664268 into lm-sys:main Dec 20, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants