uparekh01151 commited on
Commit
3fc9598
·
1 Parent(s): be92fdf

Fix leaderboard column ordering to match configuration

Browse files
Files changed (1) hide show
  1. app.py +25 -1
app.py CHANGED
@@ -72,7 +72,31 @@ class LeaderboardManager:
72
  # Add ranking column
73
  top_results.insert(0, 'rank', range(1, len(top_results) + 1))
74
 
75
- return top_results
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
 
77
 
78
  # Global instances
 
72
  # Add ranking column
73
  top_results.insert(0, 'rank', range(1, len(top_results) + 1))
74
 
75
+ # Reorder columns according to configuration
76
+ leaderboard_config = config_loader.get_leaderboard_config()
77
+ column_mapping = {
78
+ 'Rank': 'rank',
79
+ 'Model': 'model_name',
80
+ 'Composite Score': 'composite_score',
81
+ 'Correctness': 'correctness_exact',
82
+ 'Result F1': 'result_match_f1',
83
+ 'Exec Success': 'exec_success',
84
+ 'Latency': 'latency_ms',
85
+ 'Dataset': 'dataset_name',
86
+ 'Case ID': 'case_id',
87
+ 'Question': 'question',
88
+ 'Reference SQL': 'reference_sql',
89
+ 'Generated SQL': 'candidate_sql',
90
+ 'Dialect OK': 'dialect_ok'
91
+ }
92
+
93
+ # Select and reorder columns
94
+ ordered_columns = []
95
+ for header in leaderboard_config.results_table_headers:
96
+ if header in column_mapping and column_mapping[header] in top_results.columns:
97
+ ordered_columns.append(column_mapping[header])
98
+
99
+ return top_results[ordered_columns]
100
 
101
 
102
  # Global instances