Spaces:
Running
Running
openhands openhands commited on
Commit ·
b6ec318
1
Parent(s): 800e404
Remove open/closed distinction from graph, use company logos as data points
Browse files- Replaced colored markers (pink/yellow) with company logo images on scatter plots
- Downloaded official logos from SimpleIcons CDN (Anthropic, Google, Meta, HuggingFace)
- Created recognizable logos for OpenAI, Mistral, DeepSeek, Cohere, Moonshot
- Updated graph legend to show 'Company Logos' instead of 'Model Openness'
- Maintained invisible hover markers for tooltip functionality
- Model names still labeled on Pareto frontier points
- Tables still show company logos in first column
Co-authored-by: openhands <openhands@all-hands.dev>
- assets/logo-alibaba.svg +1 -4
- assets/logo-anthropic.svg +1 -4
- assets/logo-cohere.svg +4 -3
- assets/logo-deepseek.svg +3 -4
- assets/logo-google.svg +1 -4
- assets/logo-huggingface.svg +1 -0
- assets/logo-meta.svg +1 -4
- assets/logo-mistral.svg +12 -5
- assets/logo-moonshot.svg +4 -4
- assets/logo-openai.svg +2 -4
- assets/logo-unknown.svg +3 -3
- assets/logo-xai.svg +1 -4
- leaderboard_transformer.py +48 -50
- ui_components.py +17 -14
assets/logo-alibaba.svg
CHANGED
|
|
|
|
assets/logo-anthropic.svg
CHANGED
|
|
|
|
assets/logo-cohere.svg
CHANGED
|
|
|
|
assets/logo-deepseek.svg
CHANGED
|
|
|
|
assets/logo-google.svg
CHANGED
|
|
|
|
assets/logo-huggingface.svg
ADDED
|
|
assets/logo-meta.svg
CHANGED
|
|
|
|
assets/logo-mistral.svg
CHANGED
|
|
|
|
assets/logo-moonshot.svg
CHANGED
|
|
|
|
assets/logo-openai.svg
CHANGED
|
|
|
|
assets/logo-unknown.svg
CHANGED
|
|
|
|
assets/logo-xai.svg
CHANGED
|
|
|
|
leaderboard_transformer.py
CHANGED
|
@@ -548,60 +548,58 @@ def _plot_scatter_plotly(
|
|
| 548 |
# Use consistent shape for all points (no tooling distinction)
|
| 549 |
data_plot['shape_symbol'] = default_shape
|
| 550 |
|
| 551 |
-
# --- Section 6: Plot
|
| 552 |
# Collect layout images for company logos
|
| 553 |
layout_images = []
|
| 554 |
|
| 555 |
-
for
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
|
| 576 |
|
| 577 |
-
#
|
| 578 |
-
|
| 579 |
-
|
| 580 |
-
|
| 581 |
-
|
| 582 |
-
|
| 583 |
-
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
|
| 587 |
-
|
| 588 |
-
|
| 589 |
-
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
|
| 595 |
-
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
|
| 599 |
-
|
| 600 |
-
|
| 601 |
-
|
| 602 |
-
|
| 603 |
-
except Exception as e:
|
| 604 |
-
logger.warning(f"Could not load logo {logo_path}: {e}")
|
| 605 |
|
| 606 |
# --- Section 7: Add Model Name Labels to Frontier Points ---
|
| 607 |
if frontier_rows:
|
|
|
|
| 548 |
# Use consistent shape for all points (no tooling distinction)
|
| 549 |
data_plot['shape_symbol'] = default_shape
|
| 550 |
|
| 551 |
+
# --- Section 6: Plot Company Logo Images as Markers (replacing open/closed distinction) ---
|
| 552 |
# Collect layout images for company logos
|
| 553 |
layout_images = []
|
| 554 |
|
| 555 |
+
# Add invisible markers for hover functionality (all points together, no color distinction)
|
| 556 |
+
fig.add_trace(go.Scatter(
|
| 557 |
+
x=data_plot[x_col_to_use],
|
| 558 |
+
y=data_plot[y_col_to_use],
|
| 559 |
+
mode='markers',
|
| 560 |
+
name='Models',
|
| 561 |
+
showlegend=False,
|
| 562 |
+
text=data_plot['hover_text'],
|
| 563 |
+
hoverinfo='text',
|
| 564 |
+
marker=dict(
|
| 565 |
+
color='rgba(0,0,0,0)', # Invisible markers
|
| 566 |
+
size=25, # Large enough for hover detection
|
| 567 |
+
opacity=0
|
| 568 |
+
)
|
| 569 |
+
))
|
| 570 |
+
|
| 571 |
+
# Add company logo images for each data point
|
| 572 |
+
for _, row in data_plot.iterrows():
|
| 573 |
+
model_name = row.get('Language Model', '')
|
| 574 |
+
company_info = get_company_from_model_name(model_name)
|
| 575 |
+
logo_path = company_info['path']
|
| 576 |
|
| 577 |
+
# Read the SVG file and encode as base64 data URI
|
| 578 |
+
if os.path.exists(logo_path):
|
| 579 |
+
try:
|
| 580 |
+
with open(logo_path, 'rb') as f:
|
| 581 |
+
encoded_logo = base64.b64encode(f.read()).decode('utf-8')
|
| 582 |
+
logo_uri = f"data:image/svg+xml;base64,{encoded_logo}"
|
| 583 |
+
|
| 584 |
+
# Calculate logo size based on data range
|
| 585 |
+
logo_size_x = max_reported_cost * 0.08 if max_reported_cost > 0 else 0.5
|
| 586 |
+
logo_size_y = 4 # Fixed y size in data units
|
| 587 |
+
|
| 588 |
+
# Add image at data point position, centered on the point
|
| 589 |
+
layout_images.append(dict(
|
| 590 |
+
source=logo_uri,
|
| 591 |
+
xref="x",
|
| 592 |
+
yref="y",
|
| 593 |
+
x=row[x_col_to_use],
|
| 594 |
+
y=row[y_col_to_use],
|
| 595 |
+
sizex=logo_size_x,
|
| 596 |
+
sizey=logo_size_y,
|
| 597 |
+
xanchor="center",
|
| 598 |
+
yanchor="middle",
|
| 599 |
+
layer="above"
|
| 600 |
+
))
|
| 601 |
+
except Exception as e:
|
| 602 |
+
logger.warning(f"Could not load logo {logo_path}: {e}")
|
|
|
|
|
|
|
| 603 |
|
| 604 |
# --- Section 7: Add Model Name Labels to Frontier Points ---
|
| 605 |
if frontier_rows:
|
ui_components.py
CHANGED
|
@@ -307,20 +307,23 @@ def create_legend_markdown(which_table: str) -> str:
|
|
| 307 |
"""
|
| 308 |
return legend_markdown
|
| 309 |
|
| 310 |
-
# Create HTML for plot legend with
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 314 |
if uri:
|
| 315 |
-
|
| 316 |
f'<div class="plot-legend-item">'
|
| 317 |
-
f'<img class="plot-legend-item-svg" src="{uri}" alt="{name}" title="{name}">'
|
| 318 |
-
f'<
|
| 319 |
-
f'<div>'
|
| 320 |
-
f'<span>{name}</span>'
|
| 321 |
-
f'</div>'
|
| 322 |
-
f'<span class="description">{info["description"]}</span>'
|
| 323 |
-
f'</div>'
|
| 324 |
f'</div>'
|
| 325 |
)
|
| 326 |
|
|
@@ -339,9 +342,9 @@ plot_legend_html = f"""
|
|
| 339 |
</div>
|
| 340 |
</div>
|
| 341 |
<div>
|
| 342 |
-
<span class="plot-legend-category-heading">
|
| 343 |
<div style="margin-top: 8px;">
|
| 344 |
-
{''.join(
|
| 345 |
</div>
|
| 346 |
</div>
|
| 347 |
</div>
|
|
|
|
| 307 |
"""
|
| 308 |
return legend_markdown
|
| 309 |
|
| 310 |
+
# Create HTML for plot legend with company logos
|
| 311 |
+
company_legend_items = []
|
| 312 |
+
# Show a sample of company logos in the legend
|
| 313 |
+
sample_companies = [
|
| 314 |
+
("Anthropic", "assets/logo-anthropic.svg"),
|
| 315 |
+
("OpenAI", "assets/logo-openai.svg"),
|
| 316 |
+
("Google", "assets/logo-google.svg"),
|
| 317 |
+
("Meta", "assets/logo-meta.svg"),
|
| 318 |
+
("Mistral", "assets/logo-mistral.svg"),
|
| 319 |
+
]
|
| 320 |
+
for name, path in sample_companies:
|
| 321 |
+
uri = get_svg_as_data_uri(path)
|
| 322 |
if uri:
|
| 323 |
+
company_legend_items.append(
|
| 324 |
f'<div class="plot-legend-item">'
|
| 325 |
+
f'<img class="plot-legend-item-svg" src="{uri}" alt="{name}" title="{name}" style="width: 20px; height: 20px;">'
|
| 326 |
+
f'<span>{name}</span>'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 327 |
f'</div>'
|
| 328 |
)
|
| 329 |
|
|
|
|
| 342 |
</div>
|
| 343 |
</div>
|
| 344 |
<div>
|
| 345 |
+
<span class="plot-legend-category-heading">Company Logos</span>
|
| 346 |
<div style="margin-top: 8px;">
|
| 347 |
+
{''.join(company_legend_items)}
|
| 348 |
</div>
|
| 349 |
</div>
|
| 350 |
</div>
|