My-Benchmarks / index.html
danielrosehill's picture
Link the master Dataset Navigator
51de2bd verified
Raw History Blame Contribute Delete
5.22 kB
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>My Benchmarks · Daniel Rosehill</title><link rel="stylesheet" href="style.css">
<style>nav.tabs a{font-size:1.02rem}.facts{margin:auto 0 0;padding-top:8px;border-top:1px solid var(--line);display:grid;grid-template-columns:auto 1fr;gap:3px 12px;font-size:.84rem}.facts dt{color:var(--muted)}.facts dd{margin:0;overflow-wrap:anywhere}.facts dd a{margin-right:10px}.st-results{background:var(--soft);color:var(--accent)}.st-planned{background:#eceeeb;color:var(--muted)}</style></head>
<body><main>
<h1>My Benchmarks</h1>
<p class="lede">Daniel Rosehill's benchmarks and evaluations in one place: each card links the datasets, Spaces and GitHub repo of one project, across the danielrosehill account and the Hebrish organisation.</p>
<nav class="links">
<a href="https://huggingface.co/spaces/danielrosehill/Start-Here" target="_blank" rel="noopener">Start Here</a>
<a href="https://huggingface.co/spaces/danielrosehill/Model-Navigator" target="_blank" rel="noopener">Model Navigator</a>
<a href="https://huggingface.co/spaces/danielrosehill/Dataset-Navigator" target="_blank" rel="noopener">Dataset Navigator</a>
<a href="https://github.com/danielrosehill/My-Benchmarks" target="_blank" rel="noopener">GitHub registry</a>
<a href="https://github.com/danielrosehill/Experiments-And-Evaluations-Index" target="_blank" rel="noopener">Experiments and Evaluations Index</a>
</nav>
<div class="controls"><input id="q" type="search" placeholder="Search all benchmarks" aria-label="Search all benchmarks"></div>
<nav class="tabs" id="tabs" aria-label="Areas"></nav>
<div id="list"></div>
<footer><span id="legend"></span><br>Read live from <a href="https://github.com/danielrosehill/My-Benchmarks/blob/master/benchmarks.json" target="_blank" rel="noopener">benchmarks.json</a>, updated <span id="updated"></span>. CC BY 4.0.</footer>
</main>
<script>
const SRC = "https://raw.githubusercontent.com/danielrosehill/My-Benchmarks/master/benchmarks.json";
const TABS = [["speech", "Speech and audio"], ["behaviour", "Model behaviour"], ["image", "Image generation"], ["hardware", "Local inference"]];
const esc = (s) => String(s ?? "").replace(/[&<>"]/g, (c) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;" }[c]));
const a = (url, label) => `<a href="${esc(url)}" target="_blank" rel="noopener">${esc(label)}</a>`;
const tail = (url) => url.replace(/\/$/, "").split("/").pop().replace(/-/g, " ");
const q = document.getElementById("q"), out = document.getElementById("list"), tabs = document.getElementById("tabs");
let reg;
function card(b) {
const extra = (kind) => (b.links || []).filter((l) => l.kind === kind).map((l) => l.url);
const datasets = [b.dataset, ...extra("dataset")].filter(Boolean), spaces = [b.space, ...extra("space")].filter(Boolean);
const facts = [];
if (datasets.length) facts.push([datasets.length > 1 ? "Datasets" : "Dataset", datasets.map((u) => a(u, tail(u))).join("")]);
if (spaces.length) facts.push([spaces.length > 1 ? "Spaces" : "Space", spaces.map((u) => a(u, tail(u))).join("")]);
if (b.repo) facts.push(["GitHub", a(b.repo, tail(b.repo))]);
if (b.plan) facts.push(["Plan", a(b.plan, "Design note")]);
if (b.prompts) facts.push(["Prompts", esc(b.prompts)]);
return `<article class="card"><h3>${esc(b.name)}</h3><p>${esc(b.summary)}</p>
<div class="meta"><span class="badge st-${esc(b.stage)}">${esc(reg.stages[b.stage].label)}</span></div>
${facts.length ? `<dl class="facts">${facts.map(([k, v]) => `<dt>${k}</dt><dd>${v}</dd>`).join("")}</dl>` : ""}</article>`;
}
function draw() {
const list = reg.benchmarks.slice().sort((x, y) => x.name.localeCompare(y.name));
const current = TABS.find(([slug]) => slug === location.hash.slice(1)) || TABS[0];
const term = q.value.trim().toLowerCase();
tabs.innerHTML = TABS.map((t) => `<a href="#${t[0]}"${!term && t === current ? ' aria-current="page"' : ""}>${esc(t[1])} (${list.filter((b) => b.category === t[0]).length})</a>`).join("");
const grid = (items) => `<div class="grid">${items.map(card).join("")}</div>`;
if (!term) { out.innerHTML = grid(list.filter((b) => b.category === current[0])); return; }
const hit = (b) => JSON.stringify(b).toLowerCase().includes(term);
out.innerHTML = TABS.map((t) => [t, list.filter((b) => b.category === t[0] && hit(b))]).filter(([, h]) => h.length)
.map(([t, h]) => `<h2>${esc(t[1])}</h2>` + grid(h)).join("") || '<p class="empty">No benchmarks match.</p>';
}
fetch(SRC).then((r) => { if (!r.ok) throw new Error(r.status); return r.json(); }).then((data) => {
reg = data;
document.getElementById("updated").textContent = reg.updated;
document.getElementById("legend").innerHTML = Object.values(reg.stages).map((s) => `<b>${esc(s.label)}</b>: ${esc(s.meaning)}`).join(" · ");
q.addEventListener("input", draw);
addEventListener("hashchange", () => { q.value = ""; draw(); });
draw();
}).catch((e) => { out.innerHTML = `<p class="empty">Could not load the registry (${esc(e.message)}). It is on <a href="https://github.com/danielrosehill/My-Benchmarks">GitHub</a>.</p>`; });
</script></body></html>