Skip to content

Commit

Permalink
Make the arena page as the default page (lm-sys#2299)
Browse files Browse the repository at this point in the history
  • Loading branch information
merrymercy authored Aug 23, 2023
1 parent 9078fe9 commit e93ce76
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
2 changes: 1 addition & 1 deletion fastchat/serve/gradio_block_arena_anony.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def build_side_by_side_ui_anony(models):
By using this service, users are required to agree to the following terms: The service is a research preview intended for non-commercial use only. It only provides limited safety measures and may generate offensive content. It must not be used for any illegal, harmful, violent, racist, or sexual purposes. **The service collects user dialogue data and reserves the right to distribute it under a Creative Commons Attribution (CC-BY) license.** The demo works better on desktop devices with a wide screen.
### Battle
Please scroll down and start chatting. The models include both closed-source models (e.g., ChatGPT) and open-source models (e.g., Vicuna).
Please scroll down and start chatting. The models include both closed-source models (e.g., ChatGPT) and open-source models (e.g., Llama, Vicuna).
"""

states = [gr.State() for _ in range(num_sides)]
Expand Down
48 changes: 25 additions & 23 deletions fastchat/serve/gradio_web_server_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ def load_demo(url_params, request: gr.Request):

selected = 0
if "arena" in url_params:
selected = 1
selected = 0
elif "compare" in url_params:
selected = 1
elif "single" in url_params:
selected = 2
elif "leaderboard" in url_params:
selected = 3
Expand Down Expand Up @@ -92,27 +94,7 @@ def build_demo(models, elo_results_file, leaderboard_table_file):
css=block_css,
) as demo:
with gr.Tabs() as tabs:
with gr.Tab("Single Model", id=0):
(
a_state,
a_model_selector,
a_chatbot,
a_textbox,
a_send_btn,
a_button_row,
a_parameter_row,
) = build_single_model_ui(models, add_promotion_links=True)
a_list = [
a_state,
a_model_selector,
a_chatbot,
a_textbox,
a_send_btn,
a_button_row,
a_parameter_row,
]

with gr.Tab("Chatbot Arena (battle)", id=1):
with gr.Tab("Chatbot Arena (battle)", id=0):
(
b_states,
b_model_selectors,
Expand All @@ -136,7 +118,7 @@ def build_demo(models, elo_results_file, leaderboard_table_file):
]
)

with gr.Tab("Chatbot Arena (side-by-side)", id=2):
with gr.Tab("Chatbot Arena (side-by-side)", id=1):
(
c_states,
c_model_selectors,
Expand All @@ -160,6 +142,26 @@ def build_demo(models, elo_results_file, leaderboard_table_file):
]
)

with gr.Tab("Single Model", id=2):
(
a_state,
a_model_selector,
a_chatbot,
a_textbox,
a_send_btn,
a_button_row,
a_parameter_row,
) = build_single_model_ui(models, add_promotion_links=True)
a_list = [
a_state,
a_model_selector,
a_chatbot,
a_textbox,
a_send_btn,
a_button_row,
a_parameter_row,
]

if elo_results_file:
with gr.Tab("Leaderboard", id=3):
build_leaderboard_tab(elo_results_file, leaderboard_table_file)
Expand Down

0 comments on commit e93ce76

Please sign in to comment.