Spaces:
Running
Running
openhands openhands commited on
Commit Β·
63c73f3
1
Parent(s): 4f4eb00
Use emojis instead of images in Winners by Category table
Browse files- Replace category SVG icons with emojis (π π± π¨ π§ͺ π)
- Remove company logo images from model cells
- Move medal emojis to after model name (e.g., 'claude-4.5-opus π₯')
Co-authored-by: openhands <openhands@all-hands.dev>
- ui_components.py +14 -23
ui_components.py
CHANGED
|
@@ -416,11 +416,11 @@ except ImportError:
|
|
| 416 |
|
| 417 |
# Category definitions for Winners by Category section
|
| 418 |
CATEGORY_DEFINITIONS = [
|
| 419 |
-
{"name": "Issue Resolution", "score_col": "Issue Resolution Score", "icon": "bug-fixing.svg"},
|
| 420 |
-
{"name": "Greenfield", "score_col": "Greenfield Score", "icon": "app-creation.svg"},
|
| 421 |
-
{"name": "Frontend", "score_col": "Frontend Score", "icon": "frontend-development.svg"},
|
| 422 |
-
{"name": "Testing", "score_col": "Testing Score", "icon": "test-generation.svg"},
|
| 423 |
-
{"name": "Information Gathering", "score_col": "Information Gathering Score", "icon": "information-gathering.svg"},
|
| 424 |
]
|
| 425 |
|
| 426 |
|
|
@@ -501,16 +501,14 @@ def create_winners_by_category_html(df: pd.DataFrame, top_n: int = 5) -> str:
|
|
| 501 |
html_parts = ['<div class="winners-by-category-container">']
|
| 502 |
html_parts.append('<table class="winners-unified-table">')
|
| 503 |
|
| 504 |
-
# Header row with category
|
| 505 |
html_parts.append('<thead><tr>')
|
| 506 |
for cat_def in CATEGORY_DEFINITIONS:
|
| 507 |
cat_name = cat_def["name"]
|
| 508 |
-
|
| 509 |
-
icon_uri = get_svg_as_data_uri(f"assets/{icon_file}")
|
| 510 |
html_parts.append(f'''
|
| 511 |
<th class="category-header" colspan="2">
|
| 512 |
-
|
| 513 |
-
{cat_name}
|
| 514 |
</th>
|
| 515 |
''')
|
| 516 |
html_parts.append('</tr></thead>')
|
|
@@ -535,29 +533,22 @@ def create_winners_by_category_html(df: pd.DataFrame, top_n: int = 5) -> str:
|
|
| 535 |
language_model = model_at_rank["language_model"]
|
| 536 |
score = model_at_rank["score"]
|
| 537 |
|
| 538 |
-
# Get company logo for the model
|
| 539 |
-
company_info = get_company_from_model(language_model)
|
| 540 |
-
logo_uri = get_svg_as_data_uri(company_info["path"])
|
| 541 |
-
|
| 542 |
# Format model name - clean it if it's a list
|
| 543 |
if isinstance(language_model, list):
|
| 544 |
language_model = language_model[0] if language_model else "Unknown"
|
| 545 |
model_display = str(language_model).split('/')[-1]
|
| 546 |
|
| 547 |
-
# Add medal emoji for top 3
|
| 548 |
-
|
| 549 |
if rank == 1:
|
| 550 |
-
|
| 551 |
elif rank == 2:
|
| 552 |
-
|
| 553 |
elif rank == 3:
|
| 554 |
-
|
| 555 |
|
| 556 |
html_parts.append(f'''
|
| 557 |
-
<td class="model-cell">
|
| 558 |
-
<img src="{logo_uri}" alt="{company_info['name']}" class="company-logo-tiny">
|
| 559 |
-
{rank_prefix}{model_display}
|
| 560 |
-
</td>
|
| 561 |
<td class="score-cell">{score:.1f}</td>
|
| 562 |
''')
|
| 563 |
else:
|
|
|
|
| 416 |
|
| 417 |
# Category definitions for Winners by Category section
|
| 418 |
CATEGORY_DEFINITIONS = [
|
| 419 |
+
{"name": "Issue Resolution", "score_col": "Issue Resolution Score", "icon": "bug-fixing.svg", "emoji": "π"},
|
| 420 |
+
{"name": "Greenfield", "score_col": "Greenfield Score", "icon": "app-creation.svg", "emoji": "π±"},
|
| 421 |
+
{"name": "Frontend", "score_col": "Frontend Score", "icon": "frontend-development.svg", "emoji": "π¨"},
|
| 422 |
+
{"name": "Testing", "score_col": "Testing Score", "icon": "test-generation.svg", "emoji": "π§ͺ"},
|
| 423 |
+
{"name": "Information Gathering", "score_col": "Information Gathering Score", "icon": "information-gathering.svg", "emoji": "π"},
|
| 424 |
]
|
| 425 |
|
| 426 |
|
|
|
|
| 501 |
html_parts = ['<div class="winners-by-category-container">']
|
| 502 |
html_parts.append('<table class="winners-unified-table">')
|
| 503 |
|
| 504 |
+
# Header row with category emojis and names
|
| 505 |
html_parts.append('<thead><tr>')
|
| 506 |
for cat_def in CATEGORY_DEFINITIONS:
|
| 507 |
cat_name = cat_def["name"]
|
| 508 |
+
cat_emoji = cat_def["emoji"]
|
|
|
|
| 509 |
html_parts.append(f'''
|
| 510 |
<th class="category-header" colspan="2">
|
| 511 |
+
{cat_emoji} {cat_name}
|
|
|
|
| 512 |
</th>
|
| 513 |
''')
|
| 514 |
html_parts.append('</tr></thead>')
|
|
|
|
| 533 |
language_model = model_at_rank["language_model"]
|
| 534 |
score = model_at_rank["score"]
|
| 535 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 536 |
# Format model name - clean it if it's a list
|
| 537 |
if isinstance(language_model, list):
|
| 538 |
language_model = language_model[0] if language_model else "Unknown"
|
| 539 |
model_display = str(language_model).split('/')[-1]
|
| 540 |
|
| 541 |
+
# Add medal emoji for top 3 (after model name)
|
| 542 |
+
rank_suffix = ""
|
| 543 |
if rank == 1:
|
| 544 |
+
rank_suffix = " π₯"
|
| 545 |
elif rank == 2:
|
| 546 |
+
rank_suffix = " π₯"
|
| 547 |
elif rank == 3:
|
| 548 |
+
rank_suffix = " π₯"
|
| 549 |
|
| 550 |
html_parts.append(f'''
|
| 551 |
+
<td class="model-cell">{model_display}{rank_suffix}</td>
|
|
|
|
|
|
|
|
|
|
| 552 |
<td class="score-cell">{score:.1f}</td>
|
| 553 |
''')
|
| 554 |
else:
|