IgorSlinko commited on
Commit
85c1416
·
1 Parent(s): b1920b3

Remove plot titles, keep only gr.Plot labels (v0.3.20)

Browse files

- Remove redundant title= from all plotly charts
- Reduce top margin since titles are removed

Files changed (1) hide show
  1. app.py +6 -15
app.py CHANGED
@@ -785,7 +785,6 @@ def create_token_charts(df: pd.DataFrame, input_price: float, cache_read_price:
785
  token_data,
786
  x="Token Type",
787
  y="Total Tokens (M)",
788
- title="Total Tokens by Type",
789
  color="Token Type",
790
  color_discrete_sequence=["#EF553B", "#19D3F3", "#FFA15A", "#AB63FA"],
791
  )
@@ -831,11 +830,10 @@ def create_token_charts(df: pd.DataFrame, input_price: float, cache_read_price:
831
  ))
832
  fig_stacked.update_layout(
833
  barmode="stack",
834
- title="Tokens per Trajectory (stacked)",
835
  xaxis_title="Trajectory (sorted by total tokens)",
836
  yaxis_title="Tokens (M)",
837
  legend=dict(orientation="h", yanchor="bottom", y=1.02, xanchor="right", x=1),
838
- margin=dict(l=50, r=20, t=80, b=40),
839
  )
840
 
841
  return fig_tokens, fig_tokens_cost, fig_stacked
@@ -849,7 +847,6 @@ def create_basic_histograms(df: pd.DataFrame, input_price: float, cache_read_pri
849
  df,
850
  x="api_calls",
851
  nbins=30,
852
- title="Distribution of API Calls (Steps) per Trajectory",
853
  color_discrete_sequence=["#636EFA"],
854
  )
855
  fig_steps.update_layout(
@@ -869,7 +866,6 @@ def create_basic_histograms(df: pd.DataFrame, input_price: float, cache_read_pri
869
  df,
870
  x="instance_cost",
871
  nbins=30,
872
- title="Distribution of Cost Reported by Leaderboard ($)",
873
  color_discrete_sequence=["#00CC96"],
874
  )
875
  fig_cost.update_layout(
@@ -902,7 +898,6 @@ def create_basic_histograms(df: pd.DataFrame, input_price: float, cache_read_pri
902
  token_data,
903
  x="Token Type",
904
  y="Tokens (M)",
905
- title="Total Tokens by Type",
906
  color="Token Type",
907
  color_discrete_sequence=["#EF553B", "#19D3F3", "#FFA15A", "#AB63FA"],
908
  )
@@ -967,11 +962,10 @@ def create_basic_histograms(df: pd.DataFrame, input_price: float, cache_read_pri
967
 
968
  fig_stacked.update_layout(
969
  barmode="stack",
970
- title="Tokens per Trajectory (stacked)",
971
  xaxis_title="Trajectory (sorted by total tokens)",
972
  yaxis_title="Tokens (M)",
973
  legend=dict(orientation="h", yanchor="bottom", y=1.02, xanchor="right", x=1),
974
- margin=dict(l=50, r=20, t=80, b=40),
975
  )
976
 
977
  return fig_steps, fig_cost, fig_tokens, fig_tokens_cost, fig_stacked
@@ -1036,11 +1030,10 @@ def create_cost_breakdown(df: pd.DataFrame, input_price: float, cache_read_price
1036
 
1037
  fig.update_layout(
1038
  barmode="stack",
1039
- title="Cost per Trajectory",
1040
  xaxis_title="Trajectory (sorted by total tokens)",
1041
  yaxis_title="Cost ($)",
1042
  legend=dict(orientation="h", yanchor="bottom", y=1.02, xanchor="right", x=1),
1043
- margin=dict(l=50, r=20, t=80, b=40),
1044
  )
1045
 
1046
  fig.add_annotation(
@@ -1213,10 +1206,9 @@ def create_routed_token_chart(base_tokens: dict, additional_models: list):
1213
  annotation_lines.append(f"{name}: {total/1e6:.2f}M")
1214
 
1215
  fig.update_layout(
1216
- title="Tokens by Type (per Model)",
1217
  yaxis_title="Tokens (M)",
1218
  barmode="group",
1219
- margin=dict(l=40, r=40, t=80, b=40),
1220
  legend=dict(orientation="h", yanchor="bottom", y=1.02, xanchor="right", x=1),
1221
  )
1222
  fig.add_annotation(
@@ -1276,10 +1268,9 @@ def create_routed_cost_chart(base_costs: dict, additional_models: list):
1276
  annotation_lines.append(f"{name}: ${total:.2f}")
1277
 
1278
  fig.update_layout(
1279
- title="Cost by Type (per Model) ($)",
1280
  yaxis_title="Cost ($)",
1281
  barmode="group",
1282
- margin=dict(l=40, r=40, t=80, b=40),
1283
  legend=dict(orientation="h", yanchor="bottom", y=1.02, xanchor="right", x=1),
1284
  )
1285
  fig.add_annotation(
@@ -1323,7 +1314,7 @@ def build_app():
1323
  """)
1324
  trajectories_state = gr.State(None)
1325
 
1326
- gr.Markdown("# 🧮 SWE-bench Bash-Only Leaderboard `v0.3.19`")
1327
  gr.Markdown("## 🎯 Select a base model for cost analysis (click a row)")
1328
 
1329
  with gr.Row():
 
785
  token_data,
786
  x="Token Type",
787
  y="Total Tokens (M)",
 
788
  color="Token Type",
789
  color_discrete_sequence=["#EF553B", "#19D3F3", "#FFA15A", "#AB63FA"],
790
  )
 
830
  ))
831
  fig_stacked.update_layout(
832
  barmode="stack",
 
833
  xaxis_title="Trajectory (sorted by total tokens)",
834
  yaxis_title="Tokens (M)",
835
  legend=dict(orientation="h", yanchor="bottom", y=1.02, xanchor="right", x=1),
836
+ margin=dict(l=50, r=20, t=40, b=40),
837
  )
838
 
839
  return fig_tokens, fig_tokens_cost, fig_stacked
 
847
  df,
848
  x="api_calls",
849
  nbins=30,
 
850
  color_discrete_sequence=["#636EFA"],
851
  )
852
  fig_steps.update_layout(
 
866
  df,
867
  x="instance_cost",
868
  nbins=30,
 
869
  color_discrete_sequence=["#00CC96"],
870
  )
871
  fig_cost.update_layout(
 
898
  token_data,
899
  x="Token Type",
900
  y="Tokens (M)",
 
901
  color="Token Type",
902
  color_discrete_sequence=["#EF553B", "#19D3F3", "#FFA15A", "#AB63FA"],
903
  )
 
962
 
963
  fig_stacked.update_layout(
964
  barmode="stack",
 
965
  xaxis_title="Trajectory (sorted by total tokens)",
966
  yaxis_title="Tokens (M)",
967
  legend=dict(orientation="h", yanchor="bottom", y=1.02, xanchor="right", x=1),
968
+ margin=dict(l=50, r=20, t=40, b=40),
969
  )
970
 
971
  return fig_steps, fig_cost, fig_tokens, fig_tokens_cost, fig_stacked
 
1030
 
1031
  fig.update_layout(
1032
  barmode="stack",
 
1033
  xaxis_title="Trajectory (sorted by total tokens)",
1034
  yaxis_title="Cost ($)",
1035
  legend=dict(orientation="h", yanchor="bottom", y=1.02, xanchor="right", x=1),
1036
+ margin=dict(l=50, r=20, t=40, b=40),
1037
  )
1038
 
1039
  fig.add_annotation(
 
1206
  annotation_lines.append(f"{name}: {total/1e6:.2f}M")
1207
 
1208
  fig.update_layout(
 
1209
  yaxis_title="Tokens (M)",
1210
  barmode="group",
1211
+ margin=dict(l=40, r=40, t=40, b=40),
1212
  legend=dict(orientation="h", yanchor="bottom", y=1.02, xanchor="right", x=1),
1213
  )
1214
  fig.add_annotation(
 
1268
  annotation_lines.append(f"{name}: ${total:.2f}")
1269
 
1270
  fig.update_layout(
 
1271
  yaxis_title="Cost ($)",
1272
  barmode="group",
1273
+ margin=dict(l=40, r=40, t=40, b=40),
1274
  legend=dict(orientation="h", yanchor="bottom", y=1.02, xanchor="right", x=1),
1275
  )
1276
  fig.add_annotation(
 
1314
  """)
1315
  trajectories_state = gr.State(None)
1316
 
1317
+ gr.Markdown("# 🧮 SWE-bench Bash-Only Leaderboard `v0.3.20`")
1318
  gr.Markdown("## 🎯 Select a base model for cost analysis (click a row)")
1319
 
1320
  with gr.Row():