dolev31 commited on
Commit
4da226e
Β·
1 Parent(s): 4648178

Fix broken IBM logo and table column rendering

Browse files

- Base64-encode IBM logo inline to avoid Gradio static file serving issues
- Remove table-layout:fixed and width:max-content CSS that broke column layout
- Remove column_widths parameter from Dataframe
- Increase logo height from 28px to 40px for better visibility

Files changed (1) hide show
  1. app.py +17 -8
app.py CHANGED
@@ -8,6 +8,7 @@ Displays benchmark results with:
8
  - Submission upload with 5-layer verification
9
  """
10
 
 
11
  import hashlib
12
  import hmac as _hmac
13
  import json
@@ -49,6 +50,20 @@ from validation.validate import (
49
 
50
  logger = logging.getLogger(__name__)
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  def _get_admin_password() -> str:
53
  """Read admin password at call time (not import time) so Space picks up secret changes."""
54
  return os.environ.get("ADMIN_PASSWORD", "")
@@ -457,7 +472,7 @@ CUSTOM_CSS = """
457
  margin-bottom: 12px;
458
  }
459
  #hero-header .logo-row img {
460
- height: 28px;
461
  filter: brightness(0) invert(1);
462
  opacity: 0.9;
463
  }
@@ -504,9 +519,6 @@ CUSTOM_CSS = """
504
  .table-wrap table,
505
  #leaderboard-table table {
506
  border-collapse: collapse !important;
507
- width: max-content !important;
508
- min-width: 100% !important;
509
- table-layout: fixed !important;
510
  }
511
  .table-wrap table thead th,
512
  #leaderboard-table table thead th,
@@ -1542,8 +1554,6 @@ def create_app() -> gr.Blocks:
1542
  link_text_color_active="*primary_800",
1543
  )
1544
 
1545
- gr.set_static_paths(paths=["assets"])
1546
-
1547
  with gr.Blocks(
1548
  title="ST-WebAgentBench Leaderboard",
1549
  theme=theme,
@@ -1553,7 +1563,7 @@ def create_app() -> gr.Blocks:
1553
  gr.HTML(f"""
1554
  <div id="hero-header">
1555
  <div class="logo-row">
1556
- <img src="assets/ibm_logo.png" alt="IBM" />
1557
  </div>
1558
  <h1>ST-WebAgentBench <span class="iclr-badge">ICLR 2025</span></h1>
1559
  <p class="subtitle">
@@ -1608,7 +1618,6 @@ def create_app() -> gr.Blocks:
1608
  label="Ranked by CuP (Completion under Policy)",
1609
  elem_id="leaderboard-table",
1610
  wrap=False,
1611
- column_widths=["60px", "140px", "120px", "120px", "70px", "70px", "70px", "80px", "80px", "80px", "60px", "100px"],
1612
  )
1613
 
1614
  _SORT_LABELS = {
 
8
  - Submission upload with 5-layer verification
9
  """
10
 
11
+ import base64
12
  import hashlib
13
  import hmac as _hmac
14
  import json
 
50
 
51
  logger = logging.getLogger(__name__)
52
 
53
+ # ---------------------------------------------------------------------------
54
+ # Embed IBM logo as base64 data URI (avoids static file serving issues)
55
+ # ---------------------------------------------------------------------------
56
+ _IBM_LOGO_PATH = Path(__file__).resolve().parent / "assets" / "ibm_logo.png"
57
+ _IBM_LOGO_B64 = ""
58
+ if _IBM_LOGO_PATH.exists():
59
+ _IBM_LOGO_B64 = (
60
+ "data:image/png;base64,"
61
+ + base64.b64encode(_IBM_LOGO_PATH.read_bytes()).decode()
62
+ )
63
+ else:
64
+ logger.warning("IBM logo not found at %s", _IBM_LOGO_PATH)
65
+
66
+
67
  def _get_admin_password() -> str:
68
  """Read admin password at call time (not import time) so Space picks up secret changes."""
69
  return os.environ.get("ADMIN_PASSWORD", "")
 
472
  margin-bottom: 12px;
473
  }
474
  #hero-header .logo-row img {
475
+ height: 40px;
476
  filter: brightness(0) invert(1);
477
  opacity: 0.9;
478
  }
 
519
  .table-wrap table,
520
  #leaderboard-table table {
521
  border-collapse: collapse !important;
 
 
 
522
  }
523
  .table-wrap table thead th,
524
  #leaderboard-table table thead th,
 
1554
  link_text_color_active="*primary_800",
1555
  )
1556
 
 
 
1557
  with gr.Blocks(
1558
  title="ST-WebAgentBench Leaderboard",
1559
  theme=theme,
 
1563
  gr.HTML(f"""
1564
  <div id="hero-header">
1565
  <div class="logo-row">
1566
+ <img src="{_IBM_LOGO_B64}" alt="IBM" />
1567
  </div>
1568
  <h1>ST-WebAgentBench <span class="iclr-badge">ICLR 2025</span></h1>
1569
  <p class="subtitle">
 
1618
  label="Ranked by CuP (Completion under Policy)",
1619
  elem_id="leaderboard-table",
1620
  wrap=False,
 
1621
  )
1622
 
1623
  _SORT_LABELS = {