wop commited on
Commit
5efa657
Β·
verified Β·
1 Parent(s): fa0a782

Update script.js

Browse files
Files changed (1) hide show
  1. script.js +22 -6
script.js CHANGED
@@ -98,8 +98,16 @@
98
  }
99
 
100
  const fmtScore = (v) => (numeric(v) ? v.toFixed(3) : null);
101
- const fmtParams = (p) =>
102
- numeric(p) ? (p >= 1 ? `${p.toFixed(1)}B` : `${Math.round(p * 1000)}M`) : "β€”";
 
 
 
 
 
 
 
 
103
 
104
  function shortLabel(bench) {
105
  return bench.label.replace(" (6-2026)", "");
@@ -339,6 +347,16 @@
339
  return run && numeric(run.score) ? run.score : null;
340
  }
341
 
 
 
 
 
 
 
 
 
 
 
342
  // Composite score: each benchmark is min-max normalized across the visible
343
  // set (inverted for lower_is_better), then averaged and scaled to 0-100.
344
  // This mirrors the reference leaderboard's own "Overall Score" so ranking
@@ -421,8 +439,7 @@
421
  ${benches.map((b, j) => {
422
  const v = t2iRunValue(m, b.id);
423
  const best = numeric(v) && v === ranges[j].best;
424
- const decimals = b.id === "t2i-clip-coco" ? 4 : 2;
425
- return `<td class="num score${best ? " best" : ""}">${numeric(v) ? v.toFixed(decimals) : '<span class="na">TBD</span>'}</td>`;
426
  }).join("")}
427
  <td class="res">${esc(m.release_date || "β€”")}</td>
428
  </tr>`;
@@ -452,8 +469,7 @@
452
  ${benches.map((b, j) => {
453
  const v = t2iRunValue(m, b.id);
454
  const best = numeric(v) && v === ranges[j].best;
455
- const decimals = b.id === "t2i-clip-coco" ? 4 : 2;
456
- return `<div class="t2i-m-score"><div class="k">${esc(b.label)}</div><div class="v${best ? " best" : ""}">${numeric(v) ? v.toFixed(decimals) : "β€”"}</div></div>`;
457
  }).join("")}
458
  </div>
459
  ${open ? `<div class="t2i-m-card-detail">${flagNote ? `<p style="font-size:0.78rem;color:var(--muted);line-height:1.5;">${esc(flagNote)}</p>` : `<p style="font-size:0.78rem;color:var(--muted-2);font-style:italic;">No additional notes.</p>`}</div>` : ""}
 
98
  }
99
 
100
  const fmtScore = (v) => (numeric(v) ? v.toFixed(3) : null);
101
+ // params_b is always in billions. Format at whichever scale keeps 2-3
102
+ // significant figures, matching the reference site (40.1M, 919k, 23.7k...).
103
+ function fmtParams(p) {
104
+ if (!numeric(p)) return "β€”";
105
+ const abs = Math.abs(p);
106
+ if (abs >= 1) return `${p.toFixed(p >= 100 ? 0 : 1)}B`;
107
+ if (abs >= 0.001) return `${(p * 1000).toFixed((p * 1000) >= 100 ? 0 : 1)}M`;
108
+ if (abs >= 0.000001) return `${(p * 1e6).toFixed((p * 1e6) >= 100 ? 0 : 1)}k`;
109
+ return `${Math.round(p * 1e9)}`;
110
+ }
111
 
112
  function shortLabel(bench) {
113
  return bench.label.replace(" (6-2026)", "");
 
347
  return run && numeric(run.score) ? run.score : null;
348
  }
349
 
350
+ // FID: show at full reported precision (no artificial rounding β€” 4.8724
351
+ // stays 4.8724, 39.54 stays 39.54). CLIP: stored 0-1, display as a percent
352
+ // to one decimal, matching the reference site's "28.0%" formatting.
353
+ function fmtT2iValue(benchId, v) {
354
+ if (!numeric(v)) return null;
355
+ if (benchId === "t2i-clip-coco") return `${(v * 100).toFixed(1)}%`;
356
+ // strip trailing zeros beyond what was actually reported, cap at 4dp
357
+ return String(Math.round(v * 10000) / 10000);
358
+ }
359
+
360
  // Composite score: each benchmark is min-max normalized across the visible
361
  // set (inverted for lower_is_better), then averaged and scaled to 0-100.
362
  // This mirrors the reference leaderboard's own "Overall Score" so ranking
 
439
  ${benches.map((b, j) => {
440
  const v = t2iRunValue(m, b.id);
441
  const best = numeric(v) && v === ranges[j].best;
442
+ return `<td class="num score${best ? " best" : ""}">${fmtT2iValue(b.id, v) ?? '<span class="na">TBD</span>'}</td>`;
 
443
  }).join("")}
444
  <td class="res">${esc(m.release_date || "β€”")}</td>
445
  </tr>`;
 
469
  ${benches.map((b, j) => {
470
  const v = t2iRunValue(m, b.id);
471
  const best = numeric(v) && v === ranges[j].best;
472
+ return `<div class="t2i-m-score"><div class="k">${esc(b.label)}</div><div class="v${best ? " best" : ""}">${fmtT2iValue(b.id, v) ?? "β€”"}</div></div>`;
 
473
  }).join("")}
474
  </div>
475
  ${open ? `<div class="t2i-m-card-detail">${flagNote ? `<p style="font-size:0.78rem;color:var(--muted);line-height:1.5;">${esc(flagNote)}</p>` : `<p style="font-size:0.78rem;color:var(--muted-2);font-style:italic;">No additional notes.</p>`}</div>` : ""}