Spaces:
Sleeping
Sleeping
Commit
·
8ddc24b
1
Parent(s):
1853581
Add Model Ranking column to leaderboard display
Browse files- app.py +10 -4
- config/app.yaml +1 -0
app.py
CHANGED
|
@@ -63,10 +63,16 @@ class LeaderboardManager:
|
|
| 63 |
if n is None:
|
| 64 |
n = self.config.top_results
|
| 65 |
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
|
| 72 |
# Global instances
|
|
|
|
| 63 |
if n is None:
|
| 64 |
n = self.config.top_results
|
| 65 |
|
| 66 |
+
# Sort by composite score and add ranking
|
| 67 |
+
top_results = (self.leaderboard
|
| 68 |
+
.sort_values('composite_score', ascending=False)
|
| 69 |
+
.head(n)
|
| 70 |
+
.reset_index(drop=True))
|
| 71 |
+
|
| 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
|
config/app.yaml
CHANGED
|
@@ -30,6 +30,7 @@ leaderboard:
|
|
| 30 |
display:
|
| 31 |
top_results: 50
|
| 32 |
results_table_headers:
|
|
|
|
| 33 |
- "Model"
|
| 34 |
- "Composite Score"
|
| 35 |
- "Correctness"
|
|
|
|
| 30 |
display:
|
| 31 |
top_results: 50
|
| 32 |
results_table_headers:
|
| 33 |
+
- "Rank"
|
| 34 |
- "Model"
|
| 35 |
- "Composite Score"
|
| 36 |
- "Correctness"
|