Repository: lm-sys/FastChat
File: fastchat/serve/monitor/monitor.py (Python)

Code before:
                        ],
                        elem_id="arena_hard_leaderboard",
                        height=1000,
                        wrap=True,
                        column_widths=[70, 190, 80, 80, 90, 150],
                    )

            with gr.Tab("Full Leaderboard", id=4):
                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."
                    )
                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}")

        if not show_plot:
            gr.Markdown(
                """ ## Visit our [HF space](https://huggingface.co/spaces/lmsys/chatbot-arena-leaderboard) for more analysis!
                If you want to see more models, please help us [add them](https://github.com/lm-sys/FastChat/blob/main/docs/arena.md#how-to-add-a-new-model).
                """,
                elem_id="leaderboard_markdown",
            )
    else:
        pass

    from fastchat.serve.gradio_web_server import acknowledgment_md

    with gr.Accordion(
        "Citation",
        open=True,
    ):
        citation_md = """
            ### Citation
            Please cite the following paper if you find our leaderboard or dataset helpful.
            ```
            @misc{chiang2024chatbot,
                title={Chatbot Arena: An Open Platform for Evaluating LLMs by Human Preference},
                author={Wei-Lin Chiang and Lianmin Zheng and Ying Sheng and Anastasios Nikolas Angelopoulos and Tianle Li and Dacheng Li and Hao Zhang and Banghua Zhu and Michael Jordan and Joseph E. Gonzalez and Ion Stoica},
                year={2024},

Review comment (suggestion):
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")
```

Code after:
                        ],
                        elem_id="arena_hard_leaderboard",
                        height=1000,
                        wrap=True,
                        column_widths=[70, 190, 80, 80, 90, 150],
                    )

            with gr.Tab("Full Leaderboard", id=4):
                build_full_leaderboard_tab(
                    elo_results_text, model_table_df, model_to_score
                )

            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()
            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(
                """ ## Visit our [HF space](https://huggingface.co/spaces/lmsys/chatbot-arena-leaderboard) for more analysis!
                If you want to see more models, please help us [add them](https://github.com/lm-sys/FastChat/blob/main/docs/arena.md#how-to-add-a-new-model).
                """,
                elem_id="leaderboard_markdown",
            )
    else:
        pass

    from fastchat.serve.gradio_web_server import acknowledgment_md

    with gr.Accordion(
        "Citation",
        open=True,
    ):
        citation_md = """
            ### Citation
            Please cite the following paper if you find our leaderboard or dataset helpful.
            ```
            @misc{chiang2024chatbot,
                title={Chatbot Arena: An Open Platform for Evaluating LLMs by Human Preference},
                author={Wei-Lin Chiang and Lianmin Zheng and Ying Sheng and Anastasios Nikolas Angelopoulos and Tianle Li and Dacheng Li and Hao Zhang and Banghua Zhu and Michael Jordan and Joseph E. Gonzalez and Ion Stoica},
                year={2024},