Spaces:
Runtime error
Runtime error
Gregor Betz
commited on
visibility
Browse files
app.py
CHANGED
|
@@ -38,7 +38,7 @@ def plot_evals_init(model_id, plotly_mode, request: gr.Request):
|
|
| 38 |
def plot_evals(model_id, plotly_mode):
|
| 39 |
df = df_cot_err.copy()
|
| 40 |
df["selected"] = df_cot_err.model.apply(lambda x: "selected" if x==model_id else "-")
|
| 41 |
-
df["
|
| 42 |
#df.sort_values(["selected", "model"], inplace=True, ascending=True) # has currently no effect with px.scatter
|
| 43 |
template = "plotly_dark" if plotly_mode=="dark" else "plotly"
|
| 44 |
fig = px.scatter(df, x="base accuracy", y="marginal acc. gain", color="selected", symbol="model",
|
|
@@ -47,11 +47,12 @@ def plot_evals(model_id, plotly_mode):
|
|
| 47 |
color_discrete_sequence=["Orange", "Gray"],
|
| 48 |
template=template,
|
| 49 |
error_y="acc_gain-err", hover_data=['model', "cot accuracy"],
|
|
|
|
| 50 |
width=1200, height=700)
|
| 51 |
|
| 52 |
fig.update_traces(
|
| 53 |
visible="legendonly",
|
| 54 |
-
selector=dict(
|
| 55 |
)
|
| 56 |
|
| 57 |
fig.update_layout(
|
|
|
|
| 38 |
def plot_evals(model_id, plotly_mode):
|
| 39 |
df = df_cot_err.copy()
|
| 40 |
df["selected"] = df_cot_err.model.apply(lambda x: "selected" if x==model_id else "-")
|
| 41 |
+
df["visibility"] = df_cot_err.model.apply(is_visible_model) | df.selected.eq("selected")
|
| 42 |
#df.sort_values(["selected", "model"], inplace=True, ascending=True) # has currently no effect with px.scatter
|
| 43 |
template = "plotly_dark" if plotly_mode=="dark" else "plotly"
|
| 44 |
fig = px.scatter(df, x="base accuracy", y="marginal acc. gain", color="selected", symbol="model",
|
|
|
|
| 47 |
color_discrete_sequence=["Orange", "Gray"],
|
| 48 |
template=template,
|
| 49 |
error_y="acc_gain-err", hover_data=['model', "cot accuracy"],
|
| 50 |
+
custom_data=['model', 'visibility'],
|
| 51 |
width=1200, height=700)
|
| 52 |
|
| 53 |
fig.update_traces(
|
| 54 |
visible="legendonly",
|
| 55 |
+
selector=dict(visibility=False)
|
| 56 |
)
|
| 57 |
|
| 58 |
fig.update_layout(
|