openhands openhands commited on
Commit
8a3a9eb
Β·
1 Parent(s): b6ec318

Replace open/closed model distinction with lock emojis in tables

Browse files

- Changed from colored ellipse SVG icons to πŸ”“ (open lock) and πŸ”’ (closed lock) emojis
- Updated main leaderboard table and benchmark tables
- Updated legend to show lock emojis instead of colored dots
- Updated tooltip content to use lock emoji icons

Co-authored-by: openhands <openhands@all-hands.dev>

Files changed (1) hide show
  1. ui_components.py +42 -30
ui_components.py CHANGED
@@ -156,22 +156,28 @@ def create_svg_html(value, svg_map):
156
 
157
  def build_openness_tooltip_content() -> str:
158
  """
159
- Generates the inner HTML for the Model Openness tooltip card.
160
  """
161
- html_items = []
162
- for name, info in OPENNESS_SVG_MAP.items():
163
- uri = get_svg_as_data_uri(info["path"])
164
- desc = info["description"]
165
-
166
- html_items.append(f"""
167
- <div class="tooltip-legend-item">
168
- <img src="{uri}" alt="{name}">
169
- <div>
170
- <strong>{name}</strong>
171
- <span>{desc}</span>
172
- </div>
 
 
 
 
173
  </div>
174
- """)
 
 
175
 
176
  joined_items = "".join(html_items)
177
 
@@ -249,17 +255,17 @@ def build_descriptions_tooltip_content(table) -> str:
249
  <div class="tooltip-description-item"><b>Logs:</b> View evaluation run logs (e.g., outputs, traces).</div>
250
  """
251
 
252
- # Create HTML for the "Openness" legend items for table
253
- openness_html_items = []
254
- for name, info in OPENNESS_SVG_MAP.items():
255
- uri = get_svg_as_data_uri(info["path"])
256
- # Each item is now its own flexbox container to guarantee alignment
257
- openness_html_items.append(
258
- f'<div style="display: flex; align-items: center; white-space: nowrap;">'
259
- f'<img src="{uri}" alt="{name}" title="{name}" style="width:16px; height:16px; margin-right: 4px; flex-shrink: 0;">'
260
- f'<span>{name}</span>'
261
- f'</div>'
262
- )
263
  openness_html = " ".join(openness_html_items)
264
 
265
  pareto_tooltip_content = build_pareto_tooltip_content()
@@ -446,8 +452,11 @@ def create_leaderboard_display(
446
 
447
  def get_openness_icon_html(row):
448
  openness_val = row.get('Openness', '')
449
- uri = get_svg_as_data_uri(OPENNESS_ICON_MAP.get(openness_val, "assets/ellipse-pink.svg"))
450
- return f'<img src="{uri}" alt="{openness_val}" title="{openness_val}" style="width:24px; height:24px;">'
 
 
 
451
 
452
  df_display['Icon'] = df_display.apply(get_openness_icon_html, axis=1)
453
 
@@ -666,11 +675,14 @@ def create_benchmark_details_display(
666
  axis=1
667
  )
668
 
669
- # Create simple openness icons
670
  def get_openness_icon_html(row):
671
  openness_val = row.get('Openness', '')
672
- uri = get_svg_as_data_uri(OPENNESS_ICON_MAP.get(openness_val, "assets/ellipse-pink.svg"))
673
- return f'<img src="{uri}" alt="{openness_val}" title="{openness_val}" style="width:24px; height:24px;">'
 
 
 
674
 
675
  benchmark_table_df['Icon'] = benchmark_table_df.apply(get_openness_icon_html, axis=1)
676
 
 
156
 
157
  def build_openness_tooltip_content() -> str:
158
  """
159
+ Generates the inner HTML for the Model Openness tooltip card using lock emojis.
160
  """
161
+ html_items = [
162
+ """
163
+ <div class="tooltip-legend-item">
164
+ <span style="font-size: 24px;">πŸ”“</span>
165
+ <div>
166
+ <strong>Open</strong>
167
+ <span>Open source model</span>
168
+ </div>
169
+ </div>
170
+ """,
171
+ """
172
+ <div class="tooltip-legend-item">
173
+ <span style="font-size: 24px;">πŸ”’</span>
174
+ <div>
175
+ <strong>Closed</strong>
176
+ <span>Closed source model</span>
177
  </div>
178
+ </div>
179
+ """
180
+ ]
181
 
182
  joined_items = "".join(html_items)
183
 
 
255
  <div class="tooltip-description-item"><b>Logs:</b> View evaluation run logs (e.g., outputs, traces).</div>
256
  """
257
 
258
+ # Create HTML for the "Openness" legend items for table using lock emojis
259
+ openness_html_items = [
260
+ '<div style="display: flex; align-items: center; white-space: nowrap;">'
261
+ '<span style="font-size: 16px; margin-right: 4px;">πŸ”“</span>'
262
+ '<span>Open</span>'
263
+ '</div>',
264
+ '<div style="display: flex; align-items: center; white-space: nowrap;">'
265
+ '<span style="font-size: 16px; margin-right: 4px;">πŸ”’</span>'
266
+ '<span>Closed</span>'
267
+ '</div>'
268
+ ]
269
  openness_html = " ".join(openness_html_items)
270
 
271
  pareto_tooltip_content = build_pareto_tooltip_content()
 
452
 
453
  def get_openness_icon_html(row):
454
  openness_val = row.get('Openness', '')
455
+ # Use lock emojis: πŸ”“ for open, πŸ”’ for closed
456
+ if openness_val in [aliases.CANONICAL_OPENNESS_OPEN, 'Open', 'Open Source', 'Open Source + Open Weights']:
457
+ return '<span title="Open source model" style="font-size: 18px;">πŸ”“</span>'
458
+ else:
459
+ return '<span title="Closed source model" style="font-size: 18px;">πŸ”’</span>'
460
 
461
  df_display['Icon'] = df_display.apply(get_openness_icon_html, axis=1)
462
 
 
675
  axis=1
676
  )
677
 
678
+ # Create simple openness icons using lock emojis
679
  def get_openness_icon_html(row):
680
  openness_val = row.get('Openness', '')
681
+ # Use lock emojis: πŸ”“ for open, πŸ”’ for closed
682
+ if openness_val in [aliases.CANONICAL_OPENNESS_OPEN, 'Open', 'Open Source', 'Open Source + Open Weights']:
683
+ return '<span title="Open source model" style="font-size: 18px;">πŸ”“</span>'
684
+ else:
685
+ return '<span title="Closed source model" style="font-size: 18px;">πŸ”’</span>'
686
 
687
  benchmark_table_df['Icon'] = benchmark_table_df.apply(get_openness_icon_html, axis=1)
688