Commit
·
b7fe2d8
1
Parent(s):
445a7b6
add inspect-ai
Browse files
app.py
CHANGED
|
@@ -219,8 +219,10 @@ def render_cards(tasks: list[TaskDoc]) -> str:
|
|
| 219 |
mod_path = t.module.replace("\\", "/")
|
| 220 |
source_html = f'<a href="https://github.com/huggingface/lighteval/blob/main/{mod_path}" target="_blank" rel="noopener">source</a>'
|
| 221 |
paper_html = f'<a href="{t.paper}" target="_blank" rel="noopener">paper</a>' if t.paper else ""
|
| 222 |
-
tags_html = " ".join([f'<span class
|
| 223 |
-
langs_html = " ".join([f'<span class
|
|
|
|
|
|
|
| 224 |
abstract_html = (t.abstract or "-").replace("\n", "<br/>")
|
| 225 |
sep_html = ' <span class="sep">|</span> ' if paper_html else ""
|
| 226 |
links_html = f"{source_html}{sep_html}{paper_html}"
|
|
@@ -233,7 +235,8 @@ def render_cards(tasks: list[TaskDoc]) -> str:
|
|
| 233 |
f"""
|
| 234 |
<article class="card" tabindex="0" aria-label="Task {task_name}">
|
| 235 |
<div class="title"><span class="title-text">{task_name}</span> <span class="dataset-inline">{dataset_html}</span></div>
|
| 236 |
-
|
|
|
|
| 237 |
<div class="abstract">{abstract_html}</div>
|
| 238 |
<div class="links">{links_html}</div>
|
| 239 |
</article>
|
|
@@ -253,9 +256,11 @@ def render_cards(tasks: list[TaskDoc]) -> str:
|
|
| 253 |
.title-text { font-weight: 600; font-size: 16px; font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; }
|
| 254 |
.dataset-inline { font-size: 12px; }
|
| 255 |
|
| 256 |
-
.chips { margin:
|
| 257 |
-
.
|
| 258 |
-
.
|
|
|
|
|
|
|
| 259 |
|
| 260 |
.abstract { color: #475569; font-size: 13.5px; line-height: 1.35; margin-top: 6px; min-height: 48px; }
|
| 261 |
.links { margin-top: 10px; font-size:12px; }
|
|
@@ -295,11 +300,12 @@ def render_cards(tasks: list[TaskDoc]) -> str:
|
|
| 295 |
.title-text { color: var(--title-color); }
|
| 296 |
.abstract { color: var(--muted); }
|
| 297 |
.links a { color: var(--link); }
|
| 298 |
-
.chip { background:
|
|
|
|
| 299 |
/* tweak chips for dark mode for better contrast */
|
| 300 |
@media (prefers-color-scheme: dark) {
|
| 301 |
-
.chip { background: rgba(
|
| 302 |
-
.
|
| 303 |
}
|
| 304 |
|
| 305 |
/* small screens adjustments */
|
|
|
|
| 219 |
mod_path = t.module.replace("\\", "/")
|
| 220 |
source_html = f'<a href="https://github.com/huggingface/lighteval/blob/main/{mod_path}" target="_blank" rel="noopener">source</a>'
|
| 221 |
paper_html = f'<a href="{t.paper}" target="_blank" rel="noopener">paper</a>' if t.paper else ""
|
| 222 |
+
tags_html = " ".join([f'<span class=\"chip\" title=\"tag: {tag}\">{tag}</span>' for tag in t.tags]) if t.tags else ""
|
| 223 |
+
langs_html = " ".join([f'<span class=\"chip chip-lang\" title=\"language: {lang}\">{lang}</span>' for lang in t.languages]) if t.languages else ""
|
| 224 |
+
chips_tags_html = f'<div class="chips chips-tags">{tags_html}</div>' if tags_html else ""
|
| 225 |
+
chips_langs_html = f'<div class="chips chips-langs">{langs_html}</div>' if langs_html else ""
|
| 226 |
abstract_html = (t.abstract or "-").replace("\n", "<br/>")
|
| 227 |
sep_html = ' <span class="sep">|</span> ' if paper_html else ""
|
| 228 |
links_html = f"{source_html}{sep_html}{paper_html}"
|
|
|
|
| 235 |
f"""
|
| 236 |
<article class="card" tabindex="0" aria-label="Task {task_name}">
|
| 237 |
<div class="title"><span class="title-text">{task_name}</span> <span class="dataset-inline">{dataset_html}</span></div>
|
| 238 |
+
{chips_tags_html}
|
| 239 |
+
{chips_langs_html}
|
| 240 |
<div class="abstract">{abstract_html}</div>
|
| 241 |
<div class="links">{links_html}</div>
|
| 242 |
</article>
|
|
|
|
| 256 |
.title-text { font-weight: 600; font-size: 16px; font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; }
|
| 257 |
.dataset-inline { font-size: 12px; }
|
| 258 |
|
| 259 |
+
.chips { margin: 6px 0 4px 0; display:flex; gap:2px; flex-wrap:wrap; }
|
| 260 |
+
.chips-tags { margin: 6px 0 2px 0; }
|
| 261 |
+
.chips-langs { margin: 0 0 4px 0; }
|
| 262 |
+
.chip { display:inline-block; padding:1px 2px; border-radius:999px; font-size:12px; background: #e6f2ff; color: #1e3a8a; }
|
| 263 |
+
.chip-lang { background: #e8f5e9; color: #166534; }
|
| 264 |
|
| 265 |
.abstract { color: #475569; font-size: 13.5px; line-height: 1.35; margin-top: 6px; min-height: 48px; }
|
| 266 |
.links { margin-top: 10px; font-size:12px; }
|
|
|
|
| 300 |
.title-text { color: var(--title-color); }
|
| 301 |
.abstract { color: var(--muted); }
|
| 302 |
.links a { color: var(--link); }
|
| 303 |
+
.chips-tags .chip { background: #e6f2ff; color: #1e3a8a; }
|
| 304 |
+
.chips-langs .chip { background: #e8f5e9; color: #166534; }
|
| 305 |
/* tweak chips for dark mode for better contrast */
|
| 306 |
@media (prefers-color-scheme: dark) {
|
| 307 |
+
.chips-tags .chip { background: rgba(29,78,216,0.35); color: #e6eef8; border: 1px solid rgba(148,163,184,0.15); }
|
| 308 |
+
.chips-langs .chip { background: rgba(22,101,52,0.35); color: #e6eef8; border: 1px solid rgba(148,163,184,0.15); }
|
| 309 |
}
|
| 310 |
|
| 311 |
/* small screens adjustments */
|