Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions fastchat/model/model_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def get_model_info(name: str) -> ModelInfo:

register_model_info(
[
"claude-3-5-sonnet-20240620",
"claude-3-5-sonnet-20240620", "claude-3-5-haiku-20241022", "claude-3-5-sonnet-20241022"
],
"Claude 3.5",
"https://www.anthropic.com/news/claude-3-5-sonnet",
Expand All @@ -83,6 +83,8 @@ def get_model_info(name: str) -> ModelInfo:
"llama-3.1-405b-instruct",
"llama-3.1-70b-instruct",
"llama-3.1-8b-instruct",
"llama-3.3-70b-instruct",

],
"Llama 3.1",
"https://llama.meta.com/",
Expand All @@ -102,6 +104,8 @@ def get_model_info(name: str) -> ModelInfo:
"gemini-1.5-pro-api-0514",
"gemini-1.5-flash-api-0514",
"gemini-advanced-0514",
"gemini-1.5-flash",
"gemini-1.5-pro"
],
"Gemini",
"https://deepmind.google/technologies/gemini/",
Expand Down Expand Up @@ -331,6 +335,8 @@ def get_model_info(name: str) -> ModelInfo:
"mistral-7b-instruct-v0.2",
"mistral-7b-instruct",
"pixtral-12b-2409",
"mistral-7B-Instruct-v0.3",
"mistral-Nemo-Instruct-2407"
],
"Mixtral of experts",
"https://mistral.ai/news/mixtral-of-experts/",
Expand Down Expand Up @@ -506,12 +512,13 @@ def get_model_info(name: str) -> ModelInfo:
)

register_model_info(
["deepseek-llm-67b-chat"],
["deepseek-llm-67b-chat", "DeepSeek-R1-Distill-Qwen-32B", "DeepSeek-R1-Distill-Qwen-1.5B"],
"DeepSeek LLM",
"https://huggingface.co/deepseek-ai/deepseek-llm-67b-chat",
"An advanced language model by DeepSeek",
)


register_model_info(
["stripedhyena-nous-7b"],
"StripedHyena-Nous",
Expand All @@ -520,7 +527,7 @@ def get_model_info(name: str) -> ModelInfo:
)

register_model_info(
["nous-hermes-2-mixtral-8x7b-dpo"],
["nous-hermes-2-mixtral-8x7b-dpo", "hermes-3-Llama-3.1-8B"],
"Nous-Hermes-2-Mixtral-8x7B-DPO",
"https://huggingface.co/NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO",
"Nous Hermes finetuned from Mixtral 8x7B",
Expand Down Expand Up @@ -852,7 +859,7 @@ def get_model_info(name: str) -> ModelInfo:
)

register_model_info(
["Meta-Llama-3-8B-Instruct", "Meta-Llama-3-70B-Instruct"],
["Llama-3-8b-instruct", "Llama-3-70b-instruct"],
"llama-3",
"https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct",
"Meta developed and released the Meta Llama 3 family of large language models (LLMs), a collection of pretrained and instruction tuned generative text models in 8 and 70B sizes.",
Expand Down
135 changes: 78 additions & 57 deletions fastchat/serve/gradio_block_arena_anony.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,21 @@ def vote_last_response(states, vote_type, model_selectors, request: gr.Request):
get_remote_logger().log(data)

gr.Info(
"🎉 Thanks for voting! Your vote shapes the leaderboard, please vote RESPONSIBLY."
"🎉 Aitäh hääletamast! Sinu valikute põhjal moodustub mudelite edetabel. Palun tee oma valik vastutustundlikult."
)
if ":" not in model_selectors[0]:
for i in range(5):
names = (
"### Model A: " + states[0].model_name,
"### Model B: " + states[1].model_name,
"### Mudel A: " + states[0].model_name,
"### Mudel B: " + states[1].model_name,
)
# yield names + ("",) + (disable_btn,) * 4
yield names + (disable_text,) + (disable_btn,) * 5
time.sleep(0.1)
else:
names = (
"### Model A: " + states[0].model_name,
"### Model B: " + states[1].model_name,
"### Mudel A: " + states[0].model_name,
"### Mudel B: " + states[1].model_name,
)
# yield names + ("",) + (disable_btn,) * 4
yield names + (disable_text,) + (disable_btn,) * 5
Expand Down Expand Up @@ -187,13 +187,13 @@ def share_click(state0, state1, model_selector0, model_selector1, request: gr.Re
SAMPLING_BOOST_MODELS = []

# outage models won't be sampled.
OUTAGE_MODELS = []
OUTAGE_MODELS = ["DeepSeek-R1-Distill-Qwen-32B", "DeepSeek-R1-Distill-Qwen-1.5B"]


def get_sample_weight(model, outage_models, sampling_weights, sampling_boost_models=[]):
if model in outage_models:
return 0
weight = sampling_weights.get(model, 0)
weight = sampling_weights.get(model, 1)
if model in sampling_boost_models:
weight *= 5
return weight
Expand Down Expand Up @@ -260,6 +260,7 @@ def get_battle_pair(
rival_model = rival_models[rival_idx]

swap = np.random.randint(2)
logger.info(f"Chosen model: {chosen_model}. Rival model: {rival_model}")
if swap == 0:
return chosen_model, rival_model
else:
Expand Down Expand Up @@ -439,47 +440,41 @@ def bot_response_multi(


def build_side_by_side_ui_anony(models):
notice_markdown = f"""
# ⚔️ Chatbot Arena (formerly LMSYS): Free AI Chat to Compare & Test Best AI Chatbots
[Blog](https://blog.lmarena.ai/blog/2023/arena/) | [GitHub](https://github.com/lm-sys/FastChat) | [Paper](https://arxiv.org/abs/2403.04132) | [Dataset](https://github.com/lm-sys/FastChat/blob/main/docs/dataset_release.md) | [Twitter](https://twitter.com/lmsysorg) | [Discord](https://discord.gg/6GXcFg3TH8) | [Kaggle Competition](https://www.kaggle.com/competitions/lmsys-chatbot-arena)

{SURVEY_LINK}

## 📣 News
- Chatbot Arena now supports images in beta. Check it out [here](https://lmarena.ai/?vision).

## 📜 How It Works
- **Blind Test**: Ask any question to two anonymous AI chatbots (ChatGPT, Gemini, Claude, Llama, and more).
- **Vote for the Best**: Choose the best response. You can keep chatting until you find a winner.
- **Play Fair**: If AI identity reveals, your vote won't count.

## 🏆 Chatbot Arena LLM [Leaderboard](https://lmarena.ai/leaderboard)
- Backed by over **1,000,000+** community votes, our platform ranks the best LLM and AI chatbots. Explore the top AI models on our LLM [leaderboard](https://lmarena.ai/leaderboard)!

## 👇 Chat now!
"""

states = [gr.State() for _ in range(num_sides)]
model_selectors = [None] * num_sides
chatbots = [None] * num_sides

gr.Markdown(notice_markdown, elem_id="notice_markdown")
gr.HTML(
"""
<div id="hero_text">
<h2>🇪🇪 Keelemudelite edetabel 🇪🇪</h2>
<h1>Aita valida parimat eestikeelset keelemudelit!</h1>
<ol>
<li>Esita oma küsimus. Sinu küsimusele vastavad kaks anonüümset keelemudelit.</li>
<li>Vali kahest vastusest parim. Kui sa kohe valikut ei oska langetada, võid vestlust jätkata kuni oled otsuseni jõudnud.</li>
<li>Sinu valikute põhjal koostame mudelite edetabeli. Palun tee oma otsus vastutustundlikult.</li>
</ol>
</div>
""",
elem_id="hero_container",
)

with gr.Group(elem_id="share-region-anony"):
with gr.Accordion(
f"🔍 Expand to see the descriptions of {len(models)} models", open=False
f"🔍 Kliki siia, et näha võrdluses olevaid mudeleid",
open=False,
elem_id="models_accordion",
):
model_description_md = get_model_description_md(models)
gr.Markdown(model_description_md, elem_id="model_description_markdown")
with gr.Row():
for i in range(num_sides):
label = "Model A" if i == 0 else "Model B"
label = "Mudel A" if i == 0 else "Mudel B"
with gr.Column():
chatbots[i] = gr.Chatbot(
label=label,
elem_id="chatbot",
elem_classes=f"chatbot chatbot_{i}",
height=650,
show_copy_button=True,
latex_delimiters=[
{"left": "$", "right": "$", "display": False},
{"left": "$$", "right": "$$", "display": True},
Expand All @@ -497,32 +492,58 @@ def build_side_by_side_ui_anony(models):
with gr.Row():
slow_warning = gr.Markdown("")

with gr.Row():
leftvote_btn = gr.Button(
value="👈 A is better", visible=False, interactive=False
)
rightvote_btn = gr.Button(
value="👉 B is better", visible=False, interactive=False
)
tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
bothbad_btn = gr.Button(
value="👎 Both are bad", visible=False, interactive=False
)
with gr.Group(elem_id="fixed_footer"):
with gr.Row(elem_id="selection_buttons_row"):
leftvote_btn = gr.Button(
value="Mudel A on parem",
elem_classes="voting_button",
visible=False,
interactive=False,
)
tie_btn = gr.Button(
value="🤝 Viik",
elem_classes="voting_button",
visible=False,
interactive=False,
)
bothbad_btn = gr.Button(
value="👎 Mõlemad on halvad",
elem_classes="voting_button",
visible=False,
interactive=False,
)
rightvote_btn = gr.Button(
value="Mudel B on parem",
elem_classes="voting_button",
visible=False,
interactive=False,
)

with gr.Row():
textbox = gr.Textbox(
show_label=False,
placeholder="👉 Enter your prompt and press ENTER",
elem_id="input_box",
)
send_btn = gr.Button(value="Send", variant="primary", scale=0)
with gr.Row(elem_id="input_row"):
textbox = gr.Textbox(
show_label=False,
autofocus=True,
placeholder="👉 Kirjuta siia enda küsimus ja vajuta ENTER",
elem_id="input_box",
)
send_btn = gr.Button(
value="Saada", variant="primary", scale=0, elem_id="send_button"
)

with gr.Row() as button_row:
clear_btn = gr.Button(value="🎲 New Round", interactive=False)
regenerate_btn = gr.Button(value="🔄 Regenerate", interactive=False)
share_btn = gr.Button(value="📷 Share")
with gr.Row() as button_row:
clear_btn = gr.Button(
value="🎲 Uus vestlus", elem_classes="control_button", interactive=False
)
share_btn = gr.Button(
value="📷 Jaga", elem_classes="row-middle-button control_button"
)
regenerate_btn = gr.Button(
value="🔄 Genereeri vastus uuesti",
elem_classes="control_button",
interactive=False,
)

with gr.Accordion("Parameters", open=False, visible=False) as parameter_row:
with gr.Accordion("Parameetrid", open=False, visible=False) as parameter_row:
temperature = gr.Slider(
minimum=0.0,
maximum=1.0,
Expand All @@ -548,7 +569,7 @@ def build_side_by_side_ui_anony(models):
label="Max output tokens",
)

gr.Markdown(acknowledgment_md, elem_id="ack_markdown")
# gr.Markdown(acknowledgment_md, elem_id="ack_markdown")

# Register listeners
btn_list = [
Expand Down Expand Up @@ -643,7 +664,7 @@ def build_side_by_side_ui_anony(models):
send_btn.click(
add_text,
states + model_selectors + [textbox],
states + chatbots + [textbox] + btn_list,
states + chatbots + [textbox] + btn_list + [slow_warning],
).then(
bot_response_multi,
states + [temperature, top_p, max_output_tokens],
Expand Down
Loading
Loading