benediktstroebl commited on
Commit
512799d
·
1 Parent(s): ab191cf

hide swebench lite and mlagentbench

Browse files
Files changed (1) hide show
  1. app.py +318 -318
app.py CHANGED
@@ -1078,338 +1078,338 @@ with gr.Blocks(theme=my_theme, css='css.css', title="HAL: Holistic Agent Leaderb
1078
 
1079
 
1080
 
1081
- with gr.Tab("SWE-bench Lite"):
1082
- gr.Markdown("""SWE-bench is a dataset that tests systems' ability to solve GitHub issues automatically. Lite is a subset of 300 tasks of the original SWE-bench. We are currently actively developing this platform and this benchmark is not fully implemented yet.""")
1083
- with gr.Row():
1084
- with gr.Column(scale=2):
1085
- Leaderboard(
1086
- value=create_leaderboard(parse_json_files(os.path.join(abs_path, "evals_live"), 'swebench_lite'), ci_metrics=["Accuracy", "Total Cost"]),
1087
- select_columns=SelectColumns(
1088
- default_selection=config.SWEBENCH_ON_LOAD_COLUMNS + ["Verified"],
1089
- cant_deselect=["Agent Name"],
1090
- label="Select Columns to Display:",
1091
- ),
1092
- hide_columns=config.SWEBENCH_HIDE_COLUMNS,
1093
- search_columns=config.SWEBENCH_SEARCH_COLUMNS,
1094
- )
1095
- gr.Markdown("""*Error ranges span from the lowest to highest observed values in repeated runs.*""", elem_classes=["text-right"])
1096
- with gr.Row():
1097
- gr.Markdown("### Accuracy vs. Cost for SWE-bench agents")
1098
- with gr.Row():
1099
- scatter_plot = gr.Plot(create_scatter_plot(parse_json_files(os.path.join(abs_path, "evals_live"), 'swebench_lite', aggregate=False), "Total Cost", "Accuracy", "Total Cost (in USD)", "Accuracy", ["Agent Name"]))
1100
 
1101
- gr.HTML('<div style="height: 30px;"></div>')
1102
- gr.Markdown("## Task success heatmap")
1103
- gr.Markdown("The task success heatmap shows which agent can solve which tasks. Agents are sorted by total accuracy (higher is better); tasks in SWE-bench are sorted by decreasing order of difficulty (tasks on the left are solved by the most agents; tasks on the right are solved by the least. For agents that have been run more than once, the run with the highest score is shown.")
1104
- with gr.Row():
1105
- task_success_heatmap = gr.Plot()
1106
- demo.load(
1107
- lambda: create_task_success_heatmap(
1108
- preprocessor.get_task_success_data('swebench_lite'),
1109
- 'SWE-bench Lite'
1110
- ),
1111
- outputs=[task_success_heatmap]
1112
- )
1113
-
1114
- gr.HTML("""
1115
- <style>
1116
- .grouped-section {
1117
- border: 2px solid #dee2e6; /* Color matching unactivated tabs */
1118
- border-radius: 10px;
1119
- padding: 30px;
1120
- margin-top: 40px;
1121
- margin-bottom: 40px;
1122
- position: relative;
1123
- }
1124
-
1125
- .grouped-section-title {
1126
- font-size: 1.7em;
1127
- font-weight: bold;
1128
- color: #2c3e50;
1129
- margin-bottom: 20px;
1130
- padding-bottom: 10px;
1131
- border-bottom: 2px solid #dee2e6;
1132
- }
1133
- </style>
1134
- """)
1135
- with gr.Group(elem_classes=["grouped-section"]):
1136
- gr.Markdown("# Agent monitor", elem_classes=["grouped-section-title"], elem_id="agent-monitor")
1137
-
1138
- gr.HTML('<div style="height: 10px;"></div>')
1139
- gr.Markdown("## Failure report for each agent")
1140
- gr.Markdown('Select an agent to see why the agent fails to solve tasks correctly. Note that these descriptions (and the failure categories) are generated by LLM-based evaluations of the agent logs and may contain inaccuracies.')
1141
- gr.HTML('<div style="height: 10px;"></div>')
1142
- with gr.Row():
1143
- with gr.Column(scale=1):
1144
- failure_report_agent_dropdown = gr.Dropdown(label="Select Agent for Failure Report")
1145
- gr.HTML('<div style="height: 10px;"></div>')
1146
- with gr.Row():
1147
- with gr.Column(scale=1):
1148
- failure_categories_overview = gr.Markdown()
1149
 
1150
- with gr.Column(scale=1):
1151
- failure_categories_chart = gr.Plot()
1152
 
1153
- # Initialize the failure report agent dropdown with all agents
1154
- demo.load(update_agent_dropdown,
1155
- inputs=[gr.Textbox(value="swebench_lite", visible=False), gr.Textbox(value="Accuracy", visible=False)],
1156
- outputs=[failure_report_agent_dropdown])
1157
 
1158
- # Update failure report when agent is selected
1159
- failure_report_agent_dropdown.change(update_failure_report,
1160
- inputs=[failure_report_agent_dropdown, gr.Textbox(value="swebench_lite", visible=False)],
1161
- outputs=[failure_categories_overview, failure_categories_chart])
1162
-
1163
- gr.HTML('<div style="height: 30px;"></div>')
1164
- gr.Markdown("## Task overview")
1165
- gr.HTML('<div style="height: 10px;"></div>')
1166
- with gr.Row():
1167
- with gr.Column(scale=1):
1168
- agent_dropdown = gr.Dropdown(label="Select Agent")
1169
- with gr.Column(scale=1):
1170
- task_dropdown = gr.Dropdown(label="Select SWE-bench Lite Task")
1171
- gr.HTML('<div style="height: 10px;"></div>')
1172
- with gr.Row():
1173
- task_overview = gr.Markdown()
1174
- with gr.Row():
1175
- flow_chart = gr.Plot(label="Task Flow")
1176
-
1177
- # Initialize the agent dropdown with the best agent
1178
- demo.load(update_agent_dropdown, inputs=[gr.Textbox(value="swebench_lite", visible=False), gr.Textbox(value="Accuracy", visible=False)], outputs=[agent_dropdown])
1179
- demo.load(update_task_analysis, inputs=[gr.Textbox(value="swebench_lite", visible=False), agent_dropdown], outputs=[task_overview, flow_chart, task_dropdown, gr.Textbox(visible=False)])
1180
-
1181
- agent_dropdown.change(update_task_analysis,
1182
- inputs=[gr.Textbox(value="swebench_lite", visible=False), agent_dropdown],
1183
- outputs=[task_overview, flow_chart, task_dropdown, gr.Textbox(visible=False)])
1184
- task_dropdown.change(update_task_details,
1185
- inputs=[gr.Textbox(value="swebench_lite", visible=False), agent_dropdown, task_dropdown],
1186
- outputs=[task_overview, flow_chart, gr.Textbox(visible=False)])
1187
 
1188
- gr.Markdown("## Raw predictions")
1189
- gr.Markdown('Select an agent to see the raw predictions made by the agent for each task. We also provide information on token usage for each call.')
1190
- with gr.Accordion("Expand to inspect raw predictions of agents...", open=False):
1191
- with gr.Row():
1192
- with gr.Column(scale=1):
1193
- raw_agent_dropdown = gr.Dropdown(label="Select Agent")
1194
- with gr.Column(scale=1):
1195
- raw_task_dropdown = gr.Dropdown(label="Select Task")
1196
- with gr.Column(scale=1):
1197
- raw_step_dropdown = gr.Dropdown(label="Select Step")
1198
- with gr.Row():
1199
- raw_call_details = gr.HTML()
1200
 
1201
- def update_raw_task_dropdown(agent_name):
1202
- analyzed_traces = get_analyzed_traces(agent_name, "swebench_lite")
1203
- if not analyzed_traces:
1204
- return gr.Dropdown(choices=[], label="Select Task"), gr.Dropdown(choices=[], label="Select Step"), f"No raw predictions data available for agent: {agent_name}."
1205
- task_ids = list(analyzed_traces.keys())
1206
- steps = analyzed_traces[task_ids[0]]['steps']
1207
- return gr.Dropdown(choices=task_ids, label="Select Task", value=task_ids[0]), gr.Dropdown(choices=[(f"Step {i+1}", i) for i in range(len(steps))], label="Select Step", value=0), format_call_info(get_analyzed_traces(agent_name, "swebench_lite")[task_ids[0]]['steps'][0], 0)
1208
-
1209
- def update_raw_step_dropdown(agent_name, task_id):
1210
- analyzed_traces = get_analyzed_traces(agent_name, "swebench_lite")
1211
- if not analyzed_traces or task_id not in analyzed_traces:
1212
- return gr.Dropdown(choices=[], label="Select Step", value="No data available.")
1213
- steps = analyzed_traces[task_id]['steps']
1214
- return gr.Dropdown(choices=[(f"Step {i+1}", i) for i in range(len(steps))], label="Select Step", value=0), format_call_info(steps[0], 0)
1215
-
1216
- def update_raw_call_details(agent_name, task_id, step_index):
1217
- analyzed_traces = get_analyzed_traces(agent_name, "swebench_lite")
1218
- if not analyzed_traces or task_id not in analyzed_traces:
1219
- return "No data available for this selection."
1220
- steps = analyzed_traces[task_id]['steps']
1221
- if step_index is None:
1222
- return "Invalid step selection."
1223
- step = steps[step_index]
1224
- return format_call_info(step, step_index)
1225
-
1226
- # Initialize the raw agent dropdown with all agents
1227
- demo.load(update_agent_dropdown,
1228
- inputs=[gr.Textbox(value="swebench_lite", visible=False), gr.Textbox(value="Accuracy", visible=False)],
1229
- outputs=[raw_agent_dropdown])
1230
- demo.load(update_raw_task_dropdown,
1231
- inputs=[raw_agent_dropdown],
1232
- outputs=[raw_task_dropdown, raw_step_dropdown])
1233
- demo.load(update_raw_call_details,
1234
- inputs=[raw_agent_dropdown, raw_task_dropdown, raw_step_dropdown],
1235
- outputs=[raw_call_details])
1236
-
1237
- raw_agent_dropdown.change(update_raw_task_dropdown,
1238
- inputs=[raw_agent_dropdown],
1239
- outputs=[raw_task_dropdown, raw_step_dropdown, raw_call_details])
1240
- raw_task_dropdown.change(update_raw_step_dropdown,
1241
- inputs=[raw_agent_dropdown, raw_task_dropdown],
1242
- outputs=[raw_step_dropdown, raw_call_details])
1243
- raw_step_dropdown.change(update_raw_call_details,
1244
- inputs=[raw_agent_dropdown, raw_task_dropdown, raw_step_dropdown],
1245
- outputs=[raw_call_details])
1246
 
1247
 
1248
- with gr.Tab("MLAgentBench"):
1249
- gr.Markdown("""MLAgentBench is a suite of end-to-end Machine Learning (ML) experimentation tasks, where the agent aims to take a given dataset and a machine learning task description and autonomously develop or improve an ML model. We are currently actively developing this platform and this benchmark is not fully implemented yet. In particular, we only include one agent and a subset of tasks for this benchmark.""")
1250
- with gr.Row():
1251
- with gr.Column(scale=2):
1252
- Leaderboard(
1253
- value=create_leaderboard(parse_json_files(os.path.join(abs_path, "evals_live"), 'mlagentbench')),
1254
- select_columns=SelectColumns(
1255
- default_selection=config.MLAGENTBENCH_ON_LOAD_COLUMNS + ["Verified"],
1256
- cant_deselect=["Agent Name"],
1257
- label="Select Columns to Display:",
1258
- ),
1259
- hide_columns=config.MLAGENTBENCH_HIDE_COLUMNS,
1260
- search_columns=config.MLAGENTBENCH_SEARCH_COLUMNS,
1261
- )
1262
- gr.Markdown("""*Error ranges span from the lowest to highest observed values in repeated runs.*""", elem_classes=["text-right"])
1263
- with gr.Row():
1264
- gr.Markdown("### Accuracy vs. Cost for MLAgentBench agents")
1265
- with gr.Row():
1266
- scatter_plot = gr.Plot(create_scatter_plot(parse_json_files(os.path.join(abs_path, "evals_live"), 'mlagentbench', aggregate=False), "Total Cost", "Overall Score", "Total Cost (in USD)", "Overall Score", ["Agent Name"]))
1267
 
1268
- # gr.HTML('<div style="height: 30px;"></div>')
1269
- # gr.Markdown("## Task success heatmap")
1270
- # gr.Markdown("The task success heatmap shows which agent can solve which tasks. Agents are sorted by total accuracy (higher is better); tasks in USACO are sorted by decreasing order of difficulty (tasks on the left are solved by the most agents; tasks on the right are solved by the least. For agents that have been run more than once, the run with the highest score is shown.")
1271
- # with gr.Row():
1272
- # task_success_heatmap = gr.Plot()
1273
- # demo.load(
1274
- # lambda: create_task_success_heatmap(
1275
- # preprocessor.get_task_success_data('usaco'),
1276
- # 'USACO'
1277
- # ),
1278
- # outputs=[task_success_heatmap]
1279
- # )
1280
-
1281
- gr.HTML("""
1282
- <style>
1283
- .grouped-section {
1284
- border: 2px solid #dee2e6; /* Color matching unactivated tabs */
1285
- border-radius: 10px;
1286
- padding: 30px;
1287
- margin-top: 40px;
1288
- margin-bottom: 40px;
1289
- position: relative;
1290
- }
1291
-
1292
- .grouped-section-title {
1293
- font-size: 1.7em;
1294
- font-weight: bold;
1295
- color: #2c3e50;
1296
- margin-bottom: 20px;
1297
- padding-bottom: 10px;
1298
- border-bottom: 2px solid #dee2e6;
1299
- }
1300
- </style>
1301
- """)
1302
- with gr.Group(elem_classes=["grouped-section"]):
1303
- gr.Markdown("# Agent monitor", elem_classes=["grouped-section-title"], elem_id="agent-monitor")
1304
-
1305
- # gr.HTML('<div style="height: 10px;"></div>')
1306
- # gr.Markdown("## Failure report for each agent")
1307
- # gr.Markdown('Select an agent to see why the agent fails to solve tasks correctly. Note that these descriptions (and the failure categories) are generated by LLM-based evaluations of the agent logs and may contain inaccuracies.')
1308
- # gr.HTML('<div style="height: 10px;"></div>')
1309
- # with gr.Row():
1310
- # with gr.Column(scale=1):
1311
- # failure_report_agent_dropdown = gr.Dropdown(label="Select Agent for Failure Report")
1312
- # gr.HTML('<div style="height: 10px;"></div>')
1313
- # with gr.Row():
1314
- # with gr.Column(scale=1):
1315
- # failure_categories_overview = gr.Markdown()
1316
 
1317
- # with gr.Column(scale=1):
1318
- # failure_categories_chart = gr.Plot()
1319
 
1320
- # # Initialize the failure report agent dropdown with all agents
1321
- # demo.load(update_agent_dropdown,
1322
- # inputs=[gr.Textbox(value="mlagentbench", visible=False), gr.Textbox(value="Overall Score", visible=False)],
1323
- # outputs=[failure_report_agent_dropdown])
1324
 
1325
- # # Update failure report when agent is selected
1326
- # failure_report_agent_dropdown.change(update_failure_report,
1327
- # inputs=[failure_report_agent_dropdown, gr.Textbox(value="mlagentbench", visible=False)],
1328
- # outputs=[failure_categories_overview, failure_categories_chart])
1329
-
1330
- gr.HTML('<div style="height: 30px;"></div>')
1331
- gr.Markdown("## Task overview")
1332
- gr.HTML('<div style="height: 10px;"></div>')
1333
- with gr.Row():
1334
- with gr.Column(scale=1):
1335
- agent_dropdown = gr.Dropdown(label="Select Agent")
1336
- with gr.Column(scale=1):
1337
- task_dropdown = gr.Dropdown(label="Select MLAgentBench Task")
1338
- gr.HTML('<div style="height: 10px;"></div>')
1339
- with gr.Row():
1340
- task_overview = gr.Markdown()
1341
- with gr.Row():
1342
- flow_chart = gr.Plot(label="Task Flow")
1343
-
1344
- # Initialize the agent dropdown with the best agent
1345
- demo.load(update_agent_dropdown, inputs=[gr.Textbox(value="mlagentbench", visible=False), gr.Textbox(value="Overall Score", visible=False)], outputs=[agent_dropdown])
1346
- demo.load(update_task_analysis, inputs=[gr.Textbox(value="mlagentbench", visible=False), agent_dropdown], outputs=[task_overview, flow_chart, task_dropdown, gr.Textbox(visible=False)])
1347
-
1348
- agent_dropdown.change(update_task_analysis,
1349
- inputs=[gr.Textbox(value="mlagentbench", visible=False), agent_dropdown],
1350
- outputs=[task_overview, flow_chart, task_dropdown, gr.Textbox(visible=False)])
1351
- task_dropdown.change(update_task_details,
1352
- inputs=[gr.Textbox(value="mlagentbench", visible=False), agent_dropdown, task_dropdown],
1353
- outputs=[task_overview, flow_chart, gr.Textbox(visible=False)])
1354
 
1355
- gr.Markdown("## Raw predictions")
1356
- gr.Markdown('Select an agent to see the raw predictions made by the agent for each task. We also provide information on token usage for each call.')
1357
- with gr.Accordion("Expand to inspect raw predictions of agents...", open=False):
1358
- with gr.Row():
1359
- with gr.Column(scale=1):
1360
- raw_agent_dropdown = gr.Dropdown(label="Select Agent")
1361
- with gr.Column(scale=1):
1362
- raw_task_dropdown = gr.Dropdown(label="Select Task")
1363
- with gr.Column(scale=1):
1364
- raw_step_dropdown = gr.Dropdown(label="Select Step")
1365
- with gr.Row():
1366
- raw_call_details = gr.HTML()
1367
 
1368
- def update_raw_task_dropdown(agent_name):
1369
- analyzed_traces = get_analyzed_traces(agent_name, "mlagentbench")
1370
- if not analyzed_traces:
1371
- return gr.Dropdown(choices=[], label="Select Task"), gr.Dropdown(choices=[], label="Select Step"), f"No raw predictions data available for agent: {agent_name}."
1372
- task_ids = list(analyzed_traces.keys())
1373
- steps = analyzed_traces[task_ids[0]]['steps']
1374
- return gr.Dropdown(choices=task_ids, label="Select Task", value=task_ids[0]), gr.Dropdown(choices=[(f"Step {i+1}", i) for i in range(len(steps))], label="Select Step", value=0), format_call_info(get_analyzed_traces(agent_name, "mlagentbench")[task_ids[0]]['steps'][0], 0)
1375
-
1376
- def update_raw_step_dropdown(agent_name, task_id):
1377
- analyzed_traces = get_analyzed_traces(agent_name, "mlagentbench")
1378
- if not analyzed_traces or task_id not in analyzed_traces:
1379
- return gr.Dropdown(choices=[], label="Select Step", value="No data available.")
1380
- steps = analyzed_traces[task_id]['steps']
1381
- return gr.Dropdown(choices=[(f"Step {i+1}", i) for i in range(len(steps))], label="Select Step", value=0), format_call_info(steps[0], 0)
1382
-
1383
- def update_raw_call_details(agent_name, task_id, step_index):
1384
- analyzed_traces = get_analyzed_traces(agent_name, "mlagentbench")
1385
- if not analyzed_traces or task_id not in analyzed_traces:
1386
- return "No data available for this selection."
1387
- steps = analyzed_traces[task_id]['steps']
1388
- if step_index is None:
1389
- return "Invalid step selection."
1390
- step = steps[step_index]
1391
- return format_call_info(step, step_index)
1392
-
1393
- # Initialize the raw agent dropdown with all agents
1394
- demo.load(update_agent_dropdown,
1395
- inputs=[gr.Textbox(value="mlagentbench", visible=False), gr.Textbox(value="Overall Score", visible=False)],
1396
- outputs=[raw_agent_dropdown])
1397
- demo.load(update_raw_task_dropdown,
1398
- inputs=[raw_agent_dropdown],
1399
- outputs=[raw_task_dropdown, raw_step_dropdown])
1400
- demo.load(update_raw_call_details,
1401
- inputs=[raw_agent_dropdown, raw_task_dropdown, raw_step_dropdown],
1402
- outputs=[raw_call_details])
1403
-
1404
- raw_agent_dropdown.change(update_raw_task_dropdown,
1405
- inputs=[raw_agent_dropdown],
1406
- outputs=[raw_task_dropdown, raw_step_dropdown, raw_call_details])
1407
- raw_task_dropdown.change(update_raw_step_dropdown,
1408
- inputs=[raw_agent_dropdown, raw_task_dropdown],
1409
- outputs=[raw_step_dropdown, raw_call_details])
1410
- raw_step_dropdown.change(update_raw_call_details,
1411
- inputs=[raw_agent_dropdown, raw_task_dropdown, raw_step_dropdown],
1412
- outputs=[raw_call_details])
1413
 
1414
  with gr.Tab("About"):
1415
  gr.Markdown((Path(__file__).parent / "about.md").read_text())
 
1078
 
1079
 
1080
 
1081
+ # with gr.Tab("SWE-bench Lite"):
1082
+ # gr.Markdown("""SWE-bench is a dataset that tests systems' ability to solve GitHub issues automatically. Lite is a subset of 300 tasks of the original SWE-bench. We are currently actively developing this platform and this benchmark is not fully implemented yet.""")
1083
+ # with gr.Row():
1084
+ # with gr.Column(scale=2):
1085
+ # Leaderboard(
1086
+ # value=create_leaderboard(parse_json_files(os.path.join(abs_path, "evals_live"), 'swebench_lite'), ci_metrics=["Accuracy", "Total Cost"]),
1087
+ # select_columns=SelectColumns(
1088
+ # default_selection=config.SWEBENCH_ON_LOAD_COLUMNS + ["Verified"],
1089
+ # cant_deselect=["Agent Name"],
1090
+ # label="Select Columns to Display:",
1091
+ # ),
1092
+ # hide_columns=config.SWEBENCH_HIDE_COLUMNS,
1093
+ # search_columns=config.SWEBENCH_SEARCH_COLUMNS,
1094
+ # )
1095
+ # gr.Markdown("""*Error ranges span from the lowest to highest observed values in repeated runs.*""", elem_classes=["text-right"])
1096
+ # with gr.Row():
1097
+ # gr.Markdown("### Accuracy vs. Cost for SWE-bench agents")
1098
+ # with gr.Row():
1099
+ # scatter_plot = gr.Plot(create_scatter_plot(parse_json_files(os.path.join(abs_path, "evals_live"), 'swebench_lite', aggregate=False), "Total Cost", "Accuracy", "Total Cost (in USD)", "Accuracy", ["Agent Name"]))
1100
 
1101
+ # gr.HTML('<div style="height: 30px;"></div>')
1102
+ # gr.Markdown("## Task success heatmap")
1103
+ # gr.Markdown("The task success heatmap shows which agent can solve which tasks. Agents are sorted by total accuracy (higher is better); tasks in SWE-bench are sorted by decreasing order of difficulty (tasks on the left are solved by the most agents; tasks on the right are solved by the least. For agents that have been run more than once, the run with the highest score is shown.")
1104
+ # with gr.Row():
1105
+ # task_success_heatmap = gr.Plot()
1106
+ # demo.load(
1107
+ # lambda: create_task_success_heatmap(
1108
+ # preprocessor.get_task_success_data('swebench_lite'),
1109
+ # 'SWE-bench Lite'
1110
+ # ),
1111
+ # outputs=[task_success_heatmap]
1112
+ # )
1113
+
1114
+ # gr.HTML("""
1115
+ # <style>
1116
+ # .grouped-section {
1117
+ # border: 2px solid #dee2e6; /* Color matching unactivated tabs */
1118
+ # border-radius: 10px;
1119
+ # padding: 30px;
1120
+ # margin-top: 40px;
1121
+ # margin-bottom: 40px;
1122
+ # position: relative;
1123
+ # }
1124
+
1125
+ # .grouped-section-title {
1126
+ # font-size: 1.7em;
1127
+ # font-weight: bold;
1128
+ # color: #2c3e50;
1129
+ # margin-bottom: 20px;
1130
+ # padding-bottom: 10px;
1131
+ # border-bottom: 2px solid #dee2e6;
1132
+ # }
1133
+ # </style>
1134
+ # """)
1135
+ # with gr.Group(elem_classes=["grouped-section"]):
1136
+ # gr.Markdown("# Agent monitor", elem_classes=["grouped-section-title"], elem_id="agent-monitor")
1137
+
1138
+ # gr.HTML('<div style="height: 10px;"></div>')
1139
+ # gr.Markdown("## Failure report for each agent")
1140
+ # gr.Markdown('Select an agent to see why the agent fails to solve tasks correctly. Note that these descriptions (and the failure categories) are generated by LLM-based evaluations of the agent logs and may contain inaccuracies.')
1141
+ # gr.HTML('<div style="height: 10px;"></div>')
1142
+ # with gr.Row():
1143
+ # with gr.Column(scale=1):
1144
+ # failure_report_agent_dropdown = gr.Dropdown(label="Select Agent for Failure Report")
1145
+ # gr.HTML('<div style="height: 10px;"></div>')
1146
+ # with gr.Row():
1147
+ # with gr.Column(scale=1):
1148
+ # failure_categories_overview = gr.Markdown()
1149
 
1150
+ # with gr.Column(scale=1):
1151
+ # failure_categories_chart = gr.Plot()
1152
 
1153
+ # # Initialize the failure report agent dropdown with all agents
1154
+ # demo.load(update_agent_dropdown,
1155
+ # inputs=[gr.Textbox(value="swebench_lite", visible=False), gr.Textbox(value="Accuracy", visible=False)],
1156
+ # outputs=[failure_report_agent_dropdown])
1157
 
1158
+ # # Update failure report when agent is selected
1159
+ # failure_report_agent_dropdown.change(update_failure_report,
1160
+ # inputs=[failure_report_agent_dropdown, gr.Textbox(value="swebench_lite", visible=False)],
1161
+ # outputs=[failure_categories_overview, failure_categories_chart])
1162
+
1163
+ # gr.HTML('<div style="height: 30px;"></div>')
1164
+ # gr.Markdown("## Task overview")
1165
+ # gr.HTML('<div style="height: 10px;"></div>')
1166
+ # with gr.Row():
1167
+ # with gr.Column(scale=1):
1168
+ # agent_dropdown = gr.Dropdown(label="Select Agent")
1169
+ # with gr.Column(scale=1):
1170
+ # task_dropdown = gr.Dropdown(label="Select SWE-bench Lite Task")
1171
+ # gr.HTML('<div style="height: 10px;"></div>')
1172
+ # with gr.Row():
1173
+ # task_overview = gr.Markdown()
1174
+ # with gr.Row():
1175
+ # flow_chart = gr.Plot(label="Task Flow")
1176
+
1177
+ # # Initialize the agent dropdown with the best agent
1178
+ # demo.load(update_agent_dropdown, inputs=[gr.Textbox(value="swebench_lite", visible=False), gr.Textbox(value="Accuracy", visible=False)], outputs=[agent_dropdown])
1179
+ # demo.load(update_task_analysis, inputs=[gr.Textbox(value="swebench_lite", visible=False), agent_dropdown], outputs=[task_overview, flow_chart, task_dropdown, gr.Textbox(visible=False)])
1180
+
1181
+ # agent_dropdown.change(update_task_analysis,
1182
+ # inputs=[gr.Textbox(value="swebench_lite", visible=False), agent_dropdown],
1183
+ # outputs=[task_overview, flow_chart, task_dropdown, gr.Textbox(visible=False)])
1184
+ # task_dropdown.change(update_task_details,
1185
+ # inputs=[gr.Textbox(value="swebench_lite", visible=False), agent_dropdown, task_dropdown],
1186
+ # outputs=[task_overview, flow_chart, gr.Textbox(visible=False)])
1187
 
1188
+ # gr.Markdown("## Raw predictions")
1189
+ # gr.Markdown('Select an agent to see the raw predictions made by the agent for each task. We also provide information on token usage for each call.')
1190
+ # with gr.Accordion("Expand to inspect raw predictions of agents...", open=False):
1191
+ # with gr.Row():
1192
+ # with gr.Column(scale=1):
1193
+ # raw_agent_dropdown = gr.Dropdown(label="Select Agent")
1194
+ # with gr.Column(scale=1):
1195
+ # raw_task_dropdown = gr.Dropdown(label="Select Task")
1196
+ # with gr.Column(scale=1):
1197
+ # raw_step_dropdown = gr.Dropdown(label="Select Step")
1198
+ # with gr.Row():
1199
+ # raw_call_details = gr.HTML()
1200
 
1201
+ # def update_raw_task_dropdown(agent_name):
1202
+ # analyzed_traces = get_analyzed_traces(agent_name, "swebench_lite")
1203
+ # if not analyzed_traces:
1204
+ # return gr.Dropdown(choices=[], label="Select Task"), gr.Dropdown(choices=[], label="Select Step"), f"No raw predictions data available for agent: {agent_name}."
1205
+ # task_ids = list(analyzed_traces.keys())
1206
+ # steps = analyzed_traces[task_ids[0]]['steps']
1207
+ # return gr.Dropdown(choices=task_ids, label="Select Task", value=task_ids[0]), gr.Dropdown(choices=[(f"Step {i+1}", i) for i in range(len(steps))], label="Select Step", value=0), format_call_info(get_analyzed_traces(agent_name, "swebench_lite")[task_ids[0]]['steps'][0], 0)
1208
+
1209
+ # def update_raw_step_dropdown(agent_name, task_id):
1210
+ # analyzed_traces = get_analyzed_traces(agent_name, "swebench_lite")
1211
+ # if not analyzed_traces or task_id not in analyzed_traces:
1212
+ # return gr.Dropdown(choices=[], label="Select Step", value="No data available.")
1213
+ # steps = analyzed_traces[task_id]['steps']
1214
+ # return gr.Dropdown(choices=[(f"Step {i+1}", i) for i in range(len(steps))], label="Select Step", value=0), format_call_info(steps[0], 0)
1215
+
1216
+ # def update_raw_call_details(agent_name, task_id, step_index):
1217
+ # analyzed_traces = get_analyzed_traces(agent_name, "swebench_lite")
1218
+ # if not analyzed_traces or task_id not in analyzed_traces:
1219
+ # return "No data available for this selection."
1220
+ # steps = analyzed_traces[task_id]['steps']
1221
+ # if step_index is None:
1222
+ # return "Invalid step selection."
1223
+ # step = steps[step_index]
1224
+ # return format_call_info(step, step_index)
1225
+
1226
+ # # Initialize the raw agent dropdown with all agents
1227
+ # demo.load(update_agent_dropdown,
1228
+ # inputs=[gr.Textbox(value="swebench_lite", visible=False), gr.Textbox(value="Accuracy", visible=False)],
1229
+ # outputs=[raw_agent_dropdown])
1230
+ # demo.load(update_raw_task_dropdown,
1231
+ # inputs=[raw_agent_dropdown],
1232
+ # outputs=[raw_task_dropdown, raw_step_dropdown])
1233
+ # demo.load(update_raw_call_details,
1234
+ # inputs=[raw_agent_dropdown, raw_task_dropdown, raw_step_dropdown],
1235
+ # outputs=[raw_call_details])
1236
+
1237
+ # raw_agent_dropdown.change(update_raw_task_dropdown,
1238
+ # inputs=[raw_agent_dropdown],
1239
+ # outputs=[raw_task_dropdown, raw_step_dropdown, raw_call_details])
1240
+ # raw_task_dropdown.change(update_raw_step_dropdown,
1241
+ # inputs=[raw_agent_dropdown, raw_task_dropdown],
1242
+ # outputs=[raw_step_dropdown, raw_call_details])
1243
+ # raw_step_dropdown.change(update_raw_call_details,
1244
+ # inputs=[raw_agent_dropdown, raw_task_dropdown, raw_step_dropdown],
1245
+ # outputs=[raw_call_details])
1246
 
1247
 
1248
+ # with gr.Tab("MLAgentBench"):
1249
+ # gr.Markdown("""MLAgentBench is a suite of end-to-end Machine Learning (ML) experimentation tasks, where the agent aims to take a given dataset and a machine learning task description and autonomously develop or improve an ML model. We are currently actively developing this platform and this benchmark is not fully implemented yet. In particular, we only include one agent and a subset of tasks for this benchmark.""")
1250
+ # with gr.Row():
1251
+ # with gr.Column(scale=2):
1252
+ # Leaderboard(
1253
+ # value=create_leaderboard(parse_json_files(os.path.join(abs_path, "evals_live"), 'mlagentbench')),
1254
+ # select_columns=SelectColumns(
1255
+ # default_selection=config.MLAGENTBENCH_ON_LOAD_COLUMNS + ["Verified"],
1256
+ # cant_deselect=["Agent Name"],
1257
+ # label="Select Columns to Display:",
1258
+ # ),
1259
+ # hide_columns=config.MLAGENTBENCH_HIDE_COLUMNS,
1260
+ # search_columns=config.MLAGENTBENCH_SEARCH_COLUMNS,
1261
+ # )
1262
+ # gr.Markdown("""*Error ranges span from the lowest to highest observed values in repeated runs.*""", elem_classes=["text-right"])
1263
+ # with gr.Row():
1264
+ # gr.Markdown("### Accuracy vs. Cost for MLAgentBench agents")
1265
+ # with gr.Row():
1266
+ # scatter_plot = gr.Plot(create_scatter_plot(parse_json_files(os.path.join(abs_path, "evals_live"), 'mlagentbench', aggregate=False), "Total Cost", "Overall Score", "Total Cost (in USD)", "Overall Score", ["Agent Name"]))
1267
 
1268
+ # # gr.HTML('<div style="height: 30px;"></div>')
1269
+ # # gr.Markdown("## Task success heatmap")
1270
+ # # gr.Markdown("The task success heatmap shows which agent can solve which tasks. Agents are sorted by total accuracy (higher is better); tasks in USACO are sorted by decreasing order of difficulty (tasks on the left are solved by the most agents; tasks on the right are solved by the least. For agents that have been run more than once, the run with the highest score is shown.")
1271
+ # # with gr.Row():
1272
+ # # task_success_heatmap = gr.Plot()
1273
+ # # demo.load(
1274
+ # # lambda: create_task_success_heatmap(
1275
+ # # preprocessor.get_task_success_data('usaco'),
1276
+ # # 'USACO'
1277
+ # # ),
1278
+ # # outputs=[task_success_heatmap]
1279
+ # # )
1280
+
1281
+ # gr.HTML("""
1282
+ # <style>
1283
+ # .grouped-section {
1284
+ # border: 2px solid #dee2e6; /* Color matching unactivated tabs */
1285
+ # border-radius: 10px;
1286
+ # padding: 30px;
1287
+ # margin-top: 40px;
1288
+ # margin-bottom: 40px;
1289
+ # position: relative;
1290
+ # }
1291
+
1292
+ # .grouped-section-title {
1293
+ # font-size: 1.7em;
1294
+ # font-weight: bold;
1295
+ # color: #2c3e50;
1296
+ # margin-bottom: 20px;
1297
+ # padding-bottom: 10px;
1298
+ # border-bottom: 2px solid #dee2e6;
1299
+ # }
1300
+ # </style>
1301
+ # """)
1302
+ # with gr.Group(elem_classes=["grouped-section"]):
1303
+ # gr.Markdown("# Agent monitor", elem_classes=["grouped-section-title"], elem_id="agent-monitor")
1304
+
1305
+ # # gr.HTML('<div style="height: 10px;"></div>')
1306
+ # # gr.Markdown("## Failure report for each agent")
1307
+ # # gr.Markdown('Select an agent to see why the agent fails to solve tasks correctly. Note that these descriptions (and the failure categories) are generated by LLM-based evaluations of the agent logs and may contain inaccuracies.')
1308
+ # # gr.HTML('<div style="height: 10px;"></div>')
1309
+ # # with gr.Row():
1310
+ # # with gr.Column(scale=1):
1311
+ # # failure_report_agent_dropdown = gr.Dropdown(label="Select Agent for Failure Report")
1312
+ # # gr.HTML('<div style="height: 10px;"></div>')
1313
+ # # with gr.Row():
1314
+ # # with gr.Column(scale=1):
1315
+ # # failure_categories_overview = gr.Markdown()
1316
 
1317
+ # # with gr.Column(scale=1):
1318
+ # # failure_categories_chart = gr.Plot()
1319
 
1320
+ # # # Initialize the failure report agent dropdown with all agents
1321
+ # # demo.load(update_agent_dropdown,
1322
+ # # inputs=[gr.Textbox(value="mlagentbench", visible=False), gr.Textbox(value="Overall Score", visible=False)],
1323
+ # # outputs=[failure_report_agent_dropdown])
1324
 
1325
+ # # # Update failure report when agent is selected
1326
+ # # failure_report_agent_dropdown.change(update_failure_report,
1327
+ # # inputs=[failure_report_agent_dropdown, gr.Textbox(value="mlagentbench", visible=False)],
1328
+ # # outputs=[failure_categories_overview, failure_categories_chart])
1329
+
1330
+ # gr.HTML('<div style="height: 30px;"></div>')
1331
+ # gr.Markdown("## Task overview")
1332
+ # gr.HTML('<div style="height: 10px;"></div>')
1333
+ # with gr.Row():
1334
+ # with gr.Column(scale=1):
1335
+ # agent_dropdown = gr.Dropdown(label="Select Agent")
1336
+ # with gr.Column(scale=1):
1337
+ # task_dropdown = gr.Dropdown(label="Select MLAgentBench Task")
1338
+ # gr.HTML('<div style="height: 10px;"></div>')
1339
+ # with gr.Row():
1340
+ # task_overview = gr.Markdown()
1341
+ # with gr.Row():
1342
+ # flow_chart = gr.Plot(label="Task Flow")
1343
+
1344
+ # # Initialize the agent dropdown with the best agent
1345
+ # demo.load(update_agent_dropdown, inputs=[gr.Textbox(value="mlagentbench", visible=False), gr.Textbox(value="Overall Score", visible=False)], outputs=[agent_dropdown])
1346
+ # demo.load(update_task_analysis, inputs=[gr.Textbox(value="mlagentbench", visible=False), agent_dropdown], outputs=[task_overview, flow_chart, task_dropdown, gr.Textbox(visible=False)])
1347
+
1348
+ # agent_dropdown.change(update_task_analysis,
1349
+ # inputs=[gr.Textbox(value="mlagentbench", visible=False), agent_dropdown],
1350
+ # outputs=[task_overview, flow_chart, task_dropdown, gr.Textbox(visible=False)])
1351
+ # task_dropdown.change(update_task_details,
1352
+ # inputs=[gr.Textbox(value="mlagentbench", visible=False), agent_dropdown, task_dropdown],
1353
+ # outputs=[task_overview, flow_chart, gr.Textbox(visible=False)])
1354
 
1355
+ # gr.Markdown("## Raw predictions")
1356
+ # gr.Markdown('Select an agent to see the raw predictions made by the agent for each task. We also provide information on token usage for each call.')
1357
+ # with gr.Accordion("Expand to inspect raw predictions of agents...", open=False):
1358
+ # with gr.Row():
1359
+ # with gr.Column(scale=1):
1360
+ # raw_agent_dropdown = gr.Dropdown(label="Select Agent")
1361
+ # with gr.Column(scale=1):
1362
+ # raw_task_dropdown = gr.Dropdown(label="Select Task")
1363
+ # with gr.Column(scale=1):
1364
+ # raw_step_dropdown = gr.Dropdown(label="Select Step")
1365
+ # with gr.Row():
1366
+ # raw_call_details = gr.HTML()
1367
 
1368
+ # def update_raw_task_dropdown(agent_name):
1369
+ # analyzed_traces = get_analyzed_traces(agent_name, "mlagentbench")
1370
+ # if not analyzed_traces:
1371
+ # return gr.Dropdown(choices=[], label="Select Task"), gr.Dropdown(choices=[], label="Select Step"), f"No raw predictions data available for agent: {agent_name}."
1372
+ # task_ids = list(analyzed_traces.keys())
1373
+ # steps = analyzed_traces[task_ids[0]]['steps']
1374
+ # return gr.Dropdown(choices=task_ids, label="Select Task", value=task_ids[0]), gr.Dropdown(choices=[(f"Step {i+1}", i) for i in range(len(steps))], label="Select Step", value=0), format_call_info(get_analyzed_traces(agent_name, "mlagentbench")[task_ids[0]]['steps'][0], 0)
1375
+
1376
+ # def update_raw_step_dropdown(agent_name, task_id):
1377
+ # analyzed_traces = get_analyzed_traces(agent_name, "mlagentbench")
1378
+ # if not analyzed_traces or task_id not in analyzed_traces:
1379
+ # return gr.Dropdown(choices=[], label="Select Step", value="No data available.")
1380
+ # steps = analyzed_traces[task_id]['steps']
1381
+ # return gr.Dropdown(choices=[(f"Step {i+1}", i) for i in range(len(steps))], label="Select Step", value=0), format_call_info(steps[0], 0)
1382
+
1383
+ # def update_raw_call_details(agent_name, task_id, step_index):
1384
+ # analyzed_traces = get_analyzed_traces(agent_name, "mlagentbench")
1385
+ # if not analyzed_traces or task_id not in analyzed_traces:
1386
+ # return "No data available for this selection."
1387
+ # steps = analyzed_traces[task_id]['steps']
1388
+ # if step_index is None:
1389
+ # return "Invalid step selection."
1390
+ # step = steps[step_index]
1391
+ # return format_call_info(step, step_index)
1392
+
1393
+ # # Initialize the raw agent dropdown with all agents
1394
+ # demo.load(update_agent_dropdown,
1395
+ # inputs=[gr.Textbox(value="mlagentbench", visible=False), gr.Textbox(value="Overall Score", visible=False)],
1396
+ # outputs=[raw_agent_dropdown])
1397
+ # demo.load(update_raw_task_dropdown,
1398
+ # inputs=[raw_agent_dropdown],
1399
+ # outputs=[raw_task_dropdown, raw_step_dropdown])
1400
+ # demo.load(update_raw_call_details,
1401
+ # inputs=[raw_agent_dropdown, raw_task_dropdown, raw_step_dropdown],
1402
+ # outputs=[raw_call_details])
1403
+
1404
+ # raw_agent_dropdown.change(update_raw_task_dropdown,
1405
+ # inputs=[raw_agent_dropdown],
1406
+ # outputs=[raw_task_dropdown, raw_step_dropdown, raw_call_details])
1407
+ # raw_task_dropdown.change(update_raw_step_dropdown,
1408
+ # inputs=[raw_agent_dropdown, raw_task_dropdown],
1409
+ # outputs=[raw_step_dropdown, raw_call_details])
1410
+ # raw_step_dropdown.change(update_raw_call_details,
1411
+ # inputs=[raw_agent_dropdown, raw_task_dropdown, raw_step_dropdown],
1412
+ # outputs=[raw_call_details])
1413
 
1414
  with gr.Tab("About"):
1415
  gr.Markdown((Path(__file__).parent / "about.md").read_text())