Spaces:
Running
Running
benediktstroebl
commited on
Commit
·
512799d
1
Parent(s):
ab191cf
hide swebench lite and mlagentbench
Browse files
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 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
|
1150 |
-
|
1151 |
-
|
1152 |
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
1210 |
-
|
1211 |
-
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
1237 |
-
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
|
1247 |
|
1248 |
-
with gr.Tab("MLAgentBench"):
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
|
1268 |
-
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
-
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
|
1317 |
-
|
1318 |
-
|
1319 |
|
1320 |
-
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
|
1375 |
-
|
1376 |
-
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
-
|
1402 |
-
|
1403 |
-
|
1404 |
-
|
1405 |
-
|
1406 |
-
|
1407 |
-
|
1408 |
-
|
1409 |
-
|
1410 |
-
|
1411 |
-
|
1412 |
-
|
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())
|