zhimin-z
commited on
Commit
·
53e82b5
1
Parent(s):
c5a8738
add
Browse files
app.py
CHANGED
|
@@ -296,7 +296,7 @@ def create_monthly_metrics_plot(type="issue", top_n=5):
|
|
| 296 |
no_data_msg = "No data available for visualization"
|
| 297 |
total_label = "Total Issues"
|
| 298 |
print_msg = "issue"
|
| 299 |
-
|
| 300 |
metrics_key = 'discussion_monthly_metrics'
|
| 301 |
total_field = 'total_discussions'
|
| 302 |
no_data_msg = "No discussion data available for visualization"
|
|
@@ -337,10 +337,7 @@ def create_monthly_metrics_plot(type="issue", top_n=5):
|
|
| 337 |
agent_totals = []
|
| 338 |
for agent_name in metrics['assistants']:
|
| 339 |
agent_data = metrics['data'].get(agent_name, {})
|
| 340 |
-
|
| 341 |
-
total_count = agent_data.get(total_field, 0)
|
| 342 |
-
else:
|
| 343 |
-
total_count = sum(agent_data.get(total_field, []))
|
| 344 |
agent_totals.append((agent_name, total_count))
|
| 345 |
|
| 346 |
# Sort by total count and take top N
|
|
@@ -769,7 +766,7 @@ with gr.Blocks(title="SWE Assistant Issue & Discussion Leaderboard", theme=gr.th
|
|
| 769 |
|
| 770 |
# Load monthly metrics when app starts
|
| 771 |
app.load(
|
| 772 |
-
fn=lambda: create_monthly_metrics_plot(),
|
| 773 |
inputs=[],
|
| 774 |
outputs=[monthly_metrics_plot]
|
| 775 |
)
|
|
|
|
| 296 |
no_data_msg = "No data available for visualization"
|
| 297 |
total_label = "Total Issues"
|
| 298 |
print_msg = "issue"
|
| 299 |
+
elif type == "discussion":
|
| 300 |
metrics_key = 'discussion_monthly_metrics'
|
| 301 |
total_field = 'total_discussions'
|
| 302 |
no_data_msg = "No discussion data available for visualization"
|
|
|
|
| 337 |
agent_totals = []
|
| 338 |
for agent_name in metrics['assistants']:
|
| 339 |
agent_data = metrics['data'].get(agent_name, {})
|
| 340 |
+
total_count = sum(agent_data.get(total_field, []))
|
|
|
|
|
|
|
|
|
|
| 341 |
agent_totals.append((agent_name, total_count))
|
| 342 |
|
| 343 |
# Sort by total count and take top N
|
|
|
|
| 766 |
|
| 767 |
# Load monthly metrics when app starts
|
| 768 |
app.load(
|
| 769 |
+
fn=lambda: create_monthly_metrics_plot(type="issue"),
|
| 770 |
inputs=[],
|
| 771 |
outputs=[monthly_metrics_plot]
|
| 772 |
)
|