Spaces:
Running
Running
openhands
commited on
Commit
·
0e14c25
1
Parent(s):
3781804
Fix agent_version display and make Overall Score bold
Browse files- Fixed case mismatch in simple_data_loader.py: 'openhands version' -> 'Openhands version'
- Fixed case for 'Language model' -> 'Language model' to match transformer expectations
- Modified format_score_column to make Overall Score values bold
- Overall Cost remains non-bold as requested
- leaderboard_transformer.py +13 -7
- simple_data_loader.py +2 -2
leaderboard_transformer.py
CHANGED
|
@@ -579,8 +579,10 @@ def format_score_column(df: pd.DataFrame, score_col_name: str) -> pd.DataFrame:
|
|
| 579 |
Applies custom formatting to a score column for display.
|
| 580 |
- If a score is 0 or NaN, it's displayed as a colored "0".
|
| 581 |
- Other scores are formatted to two decimal places.
|
|
|
|
| 582 |
"""
|
| 583 |
status_color = "#ec4899" # The same color as your other status text
|
|
|
|
| 584 |
|
| 585 |
# First, fill any NaN values with 0 so we only have one case to handle.
|
| 586 |
# We must use reassignment to avoid the SettingWithCopyWarning.
|
|
@@ -589,14 +591,18 @@ def format_score_column(df: pd.DataFrame, score_col_name: str) -> pd.DataFrame:
|
|
| 589 |
def apply_formatting(score_value):
|
| 590 |
# Now, we just check if the value is 0.
|
| 591 |
if score_value == 0:
|
| 592 |
-
|
| 593 |
-
|
| 594 |
# For all other numbers, format them for consistency.
|
| 595 |
-
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
|
| 599 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 600 |
|
| 601 |
# Apply the formatting and return the updated DataFrame
|
| 602 |
return df.assign(**{score_col_name: df[score_col_name].apply(apply_formatting)})
|
|
|
|
| 579 |
Applies custom formatting to a score column for display.
|
| 580 |
- If a score is 0 or NaN, it's displayed as a colored "0".
|
| 581 |
- Other scores are formatted to two decimal places.
|
| 582 |
+
- Overall Score values are displayed in bold.
|
| 583 |
"""
|
| 584 |
status_color = "#ec4899" # The same color as your other status text
|
| 585 |
+
is_overall_score = (score_col_name == "Overall Score")
|
| 586 |
|
| 587 |
# First, fill any NaN values with 0 so we only have one case to handle.
|
| 588 |
# We must use reassignment to avoid the SettingWithCopyWarning.
|
|
|
|
| 591 |
def apply_formatting(score_value):
|
| 592 |
# Now, we just check if the value is 0.
|
| 593 |
if score_value == 0:
|
| 594 |
+
formatted = f'<span style="color: {status_color};">0.0</span>'
|
|
|
|
| 595 |
# For all other numbers, format them for consistency.
|
| 596 |
+
elif isinstance(score_value, (int, float)):
|
| 597 |
+
formatted = f"{score_value:.3f}"
|
| 598 |
+
else:
|
| 599 |
+
# Fallback for any unexpected non-numeric data
|
| 600 |
+
formatted = str(score_value)
|
| 601 |
+
|
| 602 |
+
# Make Overall Score bold
|
| 603 |
+
if is_overall_score and score_value != 0:
|
| 604 |
+
return f"<strong>{formatted}</strong>"
|
| 605 |
+
return formatted
|
| 606 |
|
| 607 |
# Apply the formatting and return the updated DataFrame
|
| 608 |
return df.assign(**{score_col_name: df[score_col_name].apply(apply_formatting)})
|
simple_data_loader.py
CHANGED
|
@@ -132,8 +132,8 @@ class SimpleLeaderboardViewer:
|
|
| 132 |
|
| 133 |
record = {
|
| 134 |
# Core agent info - use final display names
|
| 135 |
-
'
|
| 136 |
-
'
|
| 137 |
'openness': normalized_openness, # Will become "Openness" (simplified to "open" or "closed")
|
| 138 |
'date': first_record['submission_time'], # Will become "Date"
|
| 139 |
# Additional columns expected by the transformer
|
|
|
|
| 132 |
|
| 133 |
record = {
|
| 134 |
# Core agent info - use final display names
|
| 135 |
+
'Openhands version': agent_version, # Will become "OpenHands Version"
|
| 136 |
+
'Language model': first_record['llm_base'], # Will become "Language Model"
|
| 137 |
'openness': normalized_openness, # Will become "Openness" (simplified to "open" or "closed")
|
| 138 |
'date': first_record['submission_time'], # Will become "Date"
|
| 139 |
# Additional columns expected by the transformer
|