Skip to content

Commit 8936d10

Browse files
committed
update price scatterplot
1 parent 6a40877 commit 8936d10

File tree

1 file changed

+17
-27
lines changed

1 file changed

+17
-27
lines changed

fastchat/serve/gradio_web_server_multi.py

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
import pickle
88
import time
99
from typing import List
10-
import plotly.express as px
11-
1210
import gradio as gr
1311

1412
from fastchat.serve.gradio_block_arena_anony import (
@@ -92,33 +90,25 @@ def build_visualizer():
9290

9391
with gr.Tab("Price Analysis", id=1):
9492
price_markdown = """
95-
## *Price Analysis Visualizations*
96-
Below is a scatterplot depicting a model’s arena score against its cost effectiveness. Start exploring and discover some interesting trends in the data!
97-
"""
98-
gr.Markdown(price_markdown)
99-
model_keys = ['chatgpt-4o-latest', 'gemini-1.5-pro-exp-0827','gpt-4o-mini-2024-07-18','claude-3-5-sonnet-20240620','gemini-1.5-flash-exp-0827','llama-3.1-405b-instruct','gemini-1.5-pro-api-0514','mistral-large-2407','reka-core-20240722','gemini-1.5-flash-api-0514', 'deepseek-coder-v2-0724','yi-large','llama-3-70b-instruct','qwen2-72b-instruct','claude-3-haiku-20240307','llama-3.1-8b-instruct','mistral-large-2402','command-r','mixtral-8x22b-instruct-v0.1','gpt-3.5-turbo-0613']
100-
output_tokens_per_USD = [66.66666667000001,200.0,1666.666667,66.66666667000001,3333.333333,333.3333333,200.0,166.6666667,166.6666667,3333.333333,3333.333333,333.3333333,1265.8227849999998,1111.111111,800.0,11111.11111,166.6666667,666.6666667,166.6666667,500.0]
101-
score=[1316.1559008799543,1300.8583398843484,1273.6004783067303,1270.113546648134,1270.530573909608,1266.244657076764,1259.2844314017723,1249.8268751367714,1229.2148108171098,1226.8769924152105,1214.5634252743123,1212.4668382698005,1206.3236747009742,1186.7832147344182,1178.5484948812955,1167.8793593807711,1157.271872307139,1148.6665817312062,1147.0325504217642,1117.0289441863001]
102-
fig = px.scatter(x=output_tokens_per_USD, y=score, title="Quality vs. Cost Effectiveness", labels={
103-
"output_tokens_per_USD": "# of output tokens per USD (in thousands)",
104-
"score": "Arena Score"}, log_x=True, text=model_keys)
105-
fig.update_traces(
106-
textposition="bottom center",
107-
textfont=dict(size=16),
108-
texttemplate='%{text}',
109-
marker=dict(size=8),
110-
hovertemplate=(
111-
'Model: %{text}<br>' # Show the model name
112-
'Output Tokens Per USD: %{x}<br>' # Show the x value (Output Price)
113-
'Arena Score: %{y}<br>' # Show the y value (Arena Score)
114-
)
115-
)
116-
fig.update_xaxes(range=[1,4.5])
117-
fig.update_yaxes(range=[1100,1320])
118-
fig.update_layout(autosize=True, height=850, width=None, xaxis_title="# of output tokens per USD (in thousands)", yaxis_title= "Arena Score")
93+
## *Welcome to the Price Explorer*
94+
This scatterplot displays a selection of the arena's models, showing their scores plotted against their cost-effectiveness. Using the plot, you can easily explore the model's price and compare it with their arena score.
11995
96+
### How to Use:
97+
- Hover Over Points: View the model's price, arena score, and organization.
98+
- Click to Explore:
99+
- Double-click a legend point to show only that organization's models on the scatterplot.
100+
- Single-click a legend point to hide that organization's models from the scatterplot.
101+
102+
Start exploring and discover interesting trends in the data!
103+
"""
120104

121-
gr.Plot(fig, elem_id="plotly-graph")
105+
gr.Markdown(price_markdown)
106+
frame = """
107+
<iframe width="100%" scrolling="no" style="height: 1050px; border: 1px solid lightgrey; border-radius: 10px;"
108+
src="https://storage.googleapis.com/public-arena-no-cors/2024-12-20-figure.html">
109+
</iframe>
110+
"""
111+
gr.HTML(frame)
122112

123113

124114

0 commit comments

Comments
 (0)