Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Add model name label to the graph
Browse files
app.py
CHANGED
@@ -322,8 +322,18 @@ def plot_size_vs_score(df: pd.DataFrame, hidden_df: pd.DataFrame) -> go.Figure:
|
|
322 |
df2 = df2[["model_name_for_query", "#Params (B)", "AVG"]]
|
323 |
df2["AVG"] = df2["AVG"].astype(float)
|
324 |
df2 = df2.rename(columns={"model_name_for_query": "Model"})
|
325 |
-
|
326 |
-
fig.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
327 |
fig.update_layout(yaxis_range=[0, 1])
|
328 |
return fig
|
329 |
|
|
|
322 |
df2 = df2[["model_name_for_query", "#Params (B)", "AVG"]]
|
323 |
df2["AVG"] = df2["AVG"].astype(float)
|
324 |
df2 = df2.rename(columns={"model_name_for_query": "Model"})
|
325 |
+
df2["model_name_without_org_name"] = df2["Model"].str.split("/").str[-1]
|
326 |
+
fig = px.scatter(
|
327 |
+
df2,
|
328 |
+
x="#Params (B)",
|
329 |
+
y="AVG",
|
330 |
+
text="model_name_without_org_name",
|
331 |
+
hover_data=["Model"],
|
332 |
+
)
|
333 |
+
fig.update_traces(
|
334 |
+
hovertemplate="<b>%{customdata[0]}</b><br>#Params: %{x:.2f}B<br>AVG: %{y:.4f}<extra></extra>",
|
335 |
+
textposition="top right",
|
336 |
+
)
|
337 |
fig.update_layout(yaxis_range=[0, 1])
|
338 |
return fig
|
339 |
|