Spaces:
Running
Running
Commit History
-
Species tree: drop viruses + retitle (25 species, 571,789 sequences)
Removes SARS-CoV-2 and HIV-1 from the §7 dendrogram since viruses are not part of the tree of life. Retitles the section to "How Carbon groups species from DNA", reframes the lede as a representation-geometry question (not a phylogenetic claim), and updates the takeaway to use kingdom-correct terminology ("animals cluster with animals" rather than "vertebrates cluster with vertebrates"). §6 UMAP is intentionally left intact. Recomputes Ward + UPGMA linkages and dendrogram layouts on the trimmed 25-leaf distance matrix; removes the viruses kingdom from the build script, the demo legend, and the tree-tip color table. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>a54539b
-
Site map: switch heading + subtitle + card descs to JetBrains Mono
All copy in the "What's inside" band now shares one type system: JetBrains Mono on every line (eyebrow, h2, subtitle, card labels, descriptions). Sizes/weights adjusted because mono reads heavier than Inter at the same px — h2 32px/500, subtitle 13px/400, desc 12px/400 — so the editorial hierarchy stays intact and lines don't bulk up. Co-authored-by: Cursor <cursoragent@cursor.com>6a79bbb -
Site map: line-art SVG icons + unified arrows in place of 01–04 numbers
Replace the mono "01/02/03/04" labels in the "What's inside" band with small line-art SVG glyphs that match the rest of the page's editorial visual language (1.2-stroke round, no fills, no frames — same DNA as the skeletal molecule formulas and the cd-helix diagram in §1–§2): • Intro — open book / primer • DNA Lab — short double helix with 6 base-pair rungs • Carbon Recipe — labelled flask with bubbles • Sandbox — terminal with prompt + cursor Each icon is monochrome (var(--ink) at rest, var(--green) on hover) via currentColor. The down/right arrows are now the same SVG; the first card rotates its glyph 90deg so the Intro card points down while the other three point right, giving every card identical arrow weight and geometry. Hover state preserved: arrow slides in its direction, label + icon + arrow shift to green together. Co-authored-by: Cursor <cursoragent@cursor.com>6a0d3d3
-
Intro: split hero rail/figure + new site-map band
- .tab-lede--split: sticky left rail (title + lede + figure caption) with the Pareto SVG promoted to a sibling figure on the right, so the message stays in view while the chart reads as adjacent evidence. - Pareto chart: tighter viewBox cropped to visible content, L-shape axis lines replace the full frame, 275× speedup shaft split around a centred on-axis label, italic units subtitle dropped. - Replace .intro-guide-list with .intro-sitemap: full-width banded nav of four numbered cards (Intro / DNA Lab / Carbon Recipe / Sandbox) feeding the existing #primer/#dna-lab/#recipe/#sandbox routing. Co-authored-by: Cursor <cursoragent@cursor.com>c30d8ed -
Merge branch 'main' of hf.co:spaces/HuggingFaceBio/carbon-demo
755132f -
Merge branch 'main' of hf.co:spaces/HuggingFaceBio/carbon-demo
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # demo.html187590e -
Sandbox: fix line overflow when seq block measured before font load
The bases-per-line calc was attaching a probe to document.body with hand-mirrored font CSS, then dividing the seq block width by the measured glyph width. That drifted from the real rendering context in two ways: 1. If JetBrains Mono hadn't finished loading at measure-time, the fallback monospace was narrower → blockW underestimated → bpl too large → rendered lines overflowed the container. 2. If the sandbox panel was still display:none when first measured (landing on #intro and switching tabs later), clientWidth was 0 and the probe-based metrics never got refreshed against the real layout once the panel became visible. Three coordinated fixes: - Move the probe inside the seq block itself so it inherits the real font / letter-spacing / feature settings. - tabs.js emits a tab:changed CustomEvent on every tab switch; sandbox listens and drops charMetrics + re-renders on the next frame once its panel is actually laid out. - After each render, compare the first line'…e22bb4b -
Footer: editorial site footer with collab credit + partner logos
Adds a multi-row site footer in demo.html (collab block with 4 partner stamps, three-column identity/resources/sections strip, legal hairline) backed by a full rewrite of assets/styles/footer.css. Drops partner artwork under img/partners/ (Hugging Face, Zhongguancun Academy, TIGEM, Federico II) plus their raw sources for traceability. Also bundles a few small fixes uncovered while wiring the footer: - demo.html banner: point Tech report to the paperswithcode landing - sandbox.js: clear the .empty placeholder when incrementalRender takes over straight from idle, so generated lines stop rendering inline - section-vep.css: allow horizontal scroll on .vep-window so the 60bp mono stack survives narrow viewports without breaking row alignment - intro/species/controls/recipe/banner CSS: footer-adjacent polish Co-authored-by: Cursor <cursoragent@cursor.com>5dfaccc -
Pareto chart: rebuild as inline SVG, add Dataset link to banner
Replaces /img/pareto.png with a self-contained SVG built from pareto/pareto_data.csv. Geometry mirrors the matplotlib reference (log-scale throughput, linear win-rate %, family badges, 275× speedup arrow, "better/faster" indicator) but the chrome is pulled back to fit the editorial blog tone: hairline frame + tick lines, JetBrains Mono tabular tick labels, mono-uppercase indicator eyebrows, and plain text data labels with a paint-order halo instead of pill boxes. Carbon points scale up + use a heavier label per the source script's HIGHLIGHT_LOGO_SCALE. Also adds a "Dataset" link (HuggingFaceBio/carbon-pretraining-corpus) to the banner resources row, between Models and Tech report so the two HF-hub resources sit together. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>0659e8b -
Intro polish: pareto chart in release rail + rewritten DNA Lab / Recipe ledes
- Release hero: move pareto throughput-vs-win-rate figure inside the green left rail so it visually belongs to the announcement; add hairline border and 640px max-width. - DNA Lab tab-lede: lead with what the model is + invite to explore, drop the "no curriculum" framing, soften the supervision claim (acknowledges species/biotype tags). - Recipe tab-lede: promote the curated data mixture to a third pillar alongside the 6-mer tokenizer and FNS loss. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>d835cbf -
Demo polish + scripted reel tour
§1-§7 section titles rewritten (Autocomplete for the DNA, Recognizing gene structure, Predicting mutation effects, Species specific generation, From DNA to proteins, Mapping out genomes, Reconstructing the tree of life) with matching lede rewrites; §3 status pill moves to the top-right of the DNA box and forest-bar viewBox tightens to rowH=46 so each row fits a single reel frame; social banner reflects the 393,216 bp context. app.py adds a DEV=1 mode that re-reads templates per request (so edits to demo.html / social-banner.html show up without restarting uvicorn) and exposes /reel for the scripted tour. social_reel.html drives the tour: banner stage now adopts the iframe size (no letterbox, no crop), ken-burns zoom is gone, scene-to-scene transitions are a vertical slide on .stage-frame, and the logo / thumb contact sheets are hidden in the embedded banner so only the hero shows. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>7ae5802 -
Banner specs: collapse inter-item whitespace, let the · do the spacing
The <ul class="banner-specs"> rendered with display: inline on its <li>s, which meant the whitespace between markup tags showed up as a visible space on top of the dot separator's own 12px margin. The row read uneven — wider gaps before each · than after. Switch the list to inline-flex (with flex-wrap so it still breaks gracefully on narrow stages like Hugging Face's 1280px cover) so the only spacing between specs comes from the dot separator's margin, as the design intended. Co-authored-by: Cursor <cursoragent@cursor.com>02e28aa -
Social banner: HTML-rendered OG share thumbnail (1200x630, static)
- Compose the OG share image directly in HTML/CSS using the same .carbon-banner stage as the live header — copying the rendered tile into img/thumb.png keeps the share image perfectly in sync with the product, no manual export needed. - Mark the OG tile's header with data-static so banner.js draws a single frame on it; the live demo header still animates as before. - Refactor banner.js to support multiple .carbon-banner instances and honor data-static to skip the RAF loop / observers cleanly. - Nudge the OG-only helix slightly right (translateX -18px vs -56px on wider Twitter/LinkedIn ratios) so the 1200x630 ratio keeps a clean strip of paper between the wordmark and the strand. - Drop the now-unused img/logo.png and point all SEO/OG/Twitter/JSON-LD tags in demo.html at img/thumb.png with its actual 2392x1258 export dimensions. Co-authored-by: Cursor <cursoragent@cursor.com>6ea760c -
Demo polish: SEO/AI-agent discoverability + new hexagonal logo + §1 helix per-letter fade + sandbox empty-state
- Discoverability surface: robots.txt, sitemap.xml, llms.txt, JSON-LD/OG/Twitter metadata in demo.html; app.py templates demo + social-banner with {{SITE_URL}} resolved per-request from X-Forwarded-*; Dockerfile COPYs the new files. - New hexagonal Carbon mark (img/logo.svg) plus black square/rectangle lockups used by the social-banner contact sheet. - social-banner: noindex, doubles as a brand contact sheet under the stage with native-size square and rectangle lockups for one-shot screenshots. - §1 intro helix: per-letter depth-aware fade — front-strand letter at each crossing stays readable while its back-strand sibling recedes, instead of both going equally ghosted. - Sandbox empty-state: centered, white-on-white, lighter contrast so the placeholder reads as a hint rather than a block. - New §X efficiency section script wired into demo.html. Co-authored-by: Cursor <cursoragent@cursor.com>1d5de93 -
§3 VEP: replace variant set with audited 8-pick spread
Old set: 6 variants, two disagreed with ClinVar at the 4 kb scoring window, one was effectively invisible, one had a contested clinical classification (TP53 Pro72Arg). Replaced with 8 picks (6 Pathogenic + 1 Risk + 1 Benign), all checked against Carbon-3B at the demo's window length: HBB, BRCA2, TP53 c.712T>A, F9, LDLR splice donor, VHL stop, LRRK2 G2019S, VHL 3' UTR benign. The two VHL rows are paired by design as the narrative payoff (same gene, opposite verdicts: −323 nats vs ≈0). Regenerated data/variants.json end to end via fetch_variants.py + precompute_vep against the live /score endpoint; rewrote GENE_INFO / VARIANT_DESC for the new genes; updated the VEP takeaway to point at the VHL pair instead of the retired sign-disagreement framing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>41739ad -
§0 helix: refactor rung letter placement around midline + expose MIN_LETTER_HALF knob
Co-authored-by: Cursor <cursoragent@cursor.com>5798713 -
Demo polish: colorblind-safe §6 strand; §5 completion-fold; §1 helix occlusion; §7 score chip; logo SVG; §8 evals refresh
- §6 UMAP: strand palette switched from green/red to Okabe-Ito blue/vermillion so the +/- coloring survives deuteranopia and protanopia (the previous pair collapsed to two near-identical grays under both common CVD types). - §5 Folding: new completion-fold pipeline (75% CDS prompt → 25% predicted → fold the C-term tail with ESMFold); mrna-info row reads the prompt/predict ratio for completion-fold genes, falls back to the original genomic→mRNA→ORF chain for legacy fixtures. genes.json gains the fold_setup / fold_example fields and a sections[] tag to scope the showcase set per panel. - §1 Intro: helix occlusion now splits each strand at depth-zero PEAKS rather than centerline crossings, so the "behind" arcs alternate between upper and lower lobes and rungs occlude correctly under the front strand. Edge-touching arcs render solid (no ghosted 5'/3' label ties). - §7 Tree: agreement-score chip redesigned as a typographic stat block — percentage in Carbon green + raw …f5d37e0 -
§4 Species: anchor prompt to 2nd exon, drop zebrafish
- fetch_species.py: also capture per-species exon coords from Ensembl, translated into 0-based offsets in the trimmed seq - species.js: new getPromptWindow() — anchors prefixEnd 35 bp into the 2nd exon (like §1's gene completion); slides prefixStart back by the user-selected prefixLen; falls back to flat slice when exon 2 isn't visible. Always render the prompt (no more "click run all" placeholder). Per-row "{N} bp prompt" note. - species.json: regenerated with exon data; zebrafish dropped (~450 My drift made the row look like noise next to mammals + bird) - demo.html §4 lede/takeaway: reflect new framing and dropped species2c5ccd8 -
Demo polish: header specs, primer rewrite, hide endpoint URL, tab rename
- Banner: 393,216 bp context (was 49,152); footer model badge removed - Intro tab: rewrite primer §0/§1/§3/§4 paragraphs; clarify 1T tokens (6T bp) - DNA Lab intro: use "Carbon-3B" to differentiate from upcoming releases - Hide endpoint URL in frontend (sandbox header + code snippets); /config no longer returns it; backend still uses real ENDPOINT_URL via env/default - Code snippets: rename tabs to "API" / "transformers", generic https://<your-endpoint>/v1/ placeholder, escape angle brackets - Sandbox: fold "Connected to {model}" into the Input card header - Rename tabs demo->dna-lab and model->recipe (URLs now #dna-lab, #recipe)3cf1b0c -
§6 UMAP: highlight curated gene sets (HOX, mitochondrial) + per-mode descriptions
Adds a second toolbar row of "highlight" pills next to the existing colour-by controls. Each pill recolors the WebGL scatter via a 2-class palette (dimmed grey ghost + vivid foreground), so the highlight is a view of the existing points, not new geometry on top. Identity matching is coord-snap via the spatial grid already built for hover, since the bin is species-bucketed and the CSV's row_idx doesn't line up with the bin's row order. Adds a per-mode descriptive paragraph above the chart explaining what each axis or gene set actually is (biotypes, GC content, HOX, mt-DNA), and moves the navigation hint to a right-aligned slot in the stat row. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>468dae5 -
§6 cat gutter nudged right; sandbox output card bottom padding
- results.js: shift category labels and hairline brackets ~22 px right so they sit close to their task rows instead of pinned to the svg edge. - sandbox.css: bump .sb-card__body padding-bottom 0 → 22 px on the sandbox panel so the output sequence block doesn't kiss the card edge. Co-authored-by: Cursor <cursoragent@cursor.com>7b77685 -
Demo polish: Intro visuals, §3 + §6 charts readability, code-snippet UI
Intro tab (§1–§5) - §1 Atoms: bold green base letters, two-line label (mono A/C/G/T over full name). - §2 Helix: redesign à la 3D banner — letters sit *between* the two strands (helix–base–base–helix), rungs interrupted around them, faded at crossings instead of culled so there are no bald gaps; thinner strands, 5'/3' tags symmetric on both ends, tighter top spacing, more breathing room at the bottom of the card. New base-pair legend: A=T / G≡C in big green type with H-bond meta + caption. - §3 + §4 Gene strip: horizontally centred; track-labels now have a "LEGEND" prefix and §4 gets a duplicated legend. - §5 Translate / fold / 3D viewer: codon-AA grid + caption centred, fold-arrow margins trimmed, 3Dmol viewer 340 → 280 px, three-tier protein caption (sans-serif title 19px / italic desc / mono meta with clickable PDB link). Slow editorial spin (0.4 → 0.15), wheel events on the viewer container forwarded to window scroll so the page no longer traps when the curs…5da533e
-
Intro tab + central-dogma primer + em-dash sweep
- New Intro tab as default landing: release blurb, tab-nav guide (bullet list with banner-style links), and an optional "quick primer in genetics" §1-§5 walkthrough using the existing section--two-col + .demo primitives. - Primer visuals: skeletal-formula SVGs for the four bases, static DNA helix (~10 bp/turn), gene strip (promoter / exons / introns), splice diagram with transcribe arrows, 10-column codon to amino-acid table with peptide-bond chain, and a live 3Dmol.js viewer of human hemoglobin (PDB 1A3N) bundled in assets/data/ for fast first paint. - Lazy-init the 3D viewer via MutationObserver on the panel's .active class, so visitors who deep-link to #demo / #sandbox skip the fetch. - Tabs renamed: Demo to DNA Lab, Model to Carbon Recipe (display labels only; data-tab slugs and URL hashes stay 'demo' / 'model' for backwards-compat). - Banner: add Code placeholder link to banner-links; tab buttons use min-width + nowrap so "Carbon Recipe" stays on one line. - …5ea40ce -
§6 UMAP: snap to default framing when wheel zoom-out hits MIN_SCALE
Previously, dezooming with an off-centre cursor would land at MIN_SCALE but with tx/ty stranded wherever the zoom-around-cursor formula left them — e.g. Vertebrates half off-screen + white band on top. Visibly broke the "fully zoomed out = editorial bottom-right framing" promise. Fix: in the wheel handler, when newScale clamps to MIN_SCALE, snap tx/ty back to DEFAULT_VIEW instead of running the zoom-around-cursor math. The user can still drag-pan after that; the snap only fires the moment we reach the floor zoom. Co-authored-by: Cursor <cursoragent@cursor.com>d64b553 -
Tab-lede: typographic step-down on P2 + §X chip anchors
The intro paragraph below the banner had grown to two full-size lede paragraphs, which read as a wall of text. Without touching the copy, this gives the second paragraph a clear visual demotion so the eye reads it as a navigator / table of contents rather than a second lede: - P2 gets .tab-lede__note (font-size 19→14, color #2d2d2a→#5b5b56, line-height 1.5→1.6, +14px top margin). Reads as a follow-up note under the main definition. - Each "(§X)" in P2 becomes an <a class="lede-chip" href="#section-id"> pointing at the matching section. Mono + warm-green border so the references pop out as scannable jump-to markers within the prose, and clicking actually scrolls to the section. Section anchors used: §1 → #completion, §2 → #track, §3 → #vep, §4 → #species, §5 → #folding, §6 → #umap, §7 → #speciesTree. Co-authored-by: Cursor <cursoragent@cursor.com>dfacb41 -
Carry over §2 Variant rework + §1/§4 polish dropped by the -s ours merge
The previous merge (32c9c3a) used -s ours to keep the local tree intact while preserving Leandro's two upstream commits (57bce37 §2 Variant rework, 176caed banner wordmark) in the history for attribution. Most of those changes had already been adapted locally to the new modular CSS/JS split, but the actual content carry-over wasn't yet committed. This commit applies the remaining ports on top of the merge. §3 VEP (was §2 in Leandro's tree) — refonte complète - 4 kb scoring window: fetch_variants.py WINDOW 60 → 4002 (well below the 8 kb eval recipe but enough that all 3 pathogenic variants land on the correct side of zero). data/variants.json regenerated. - Two-row sequence display: original above, click-editable mutation below, with arrows on every base that differs from the original. Click cycles A → C → G → T, debounced 500 ms rescore against /score. - Per-row log-likelihood score on the right (green if more likely, red if less likely); mutation score blanks to '—' while a…1d3e72f -
§6 UMAP: bias default view toward the dense bottom-right clusters
Lock min zoom to ~1.35 with a bottom-right offset (tx=-0.18, ty=0.15) so the landing frame skips the wide empty band along the top and ~40% of the viewport stops going to whitespace. Min-zoom matches the default view, so visitors can pan/zoom around but never reach the fit-everything view where the clusters drown in margin. Co-authored-by: Cursor <cursoragent@cursor.com>451c3d8 -
Sandbox card layout, sticky-nav breadcrumb, drop §2/§3 score buttons
- Sandbox: refactor into stacked cards (sb-card with eyebrow/title/hint headers, Input → Output) plus a Connected-to strip up top, replacing the flat wall of controls. - Sticky nav: add a CARBON / huggingfacebio-carbon-3b breadcrumb on the left of the sticky strip so the "you're on the Carbon page" cue stays visible after the hero scrolls out. - §2 (VEP) and §3 (Track): drop the manual ▶ score / score all buttons. §3 tracks are precomputed (logprobs ship in data/genes.json), so the toolbar is just a gene selector now; §2 will auto-score on select. - Misc: app.py, precompute.py, controls.css, layout.css, section-tree.css, banner.js and data/genes.json picked up along the way. - Add social-banner.html. Co-authored-by: Cursor <cursoragent@cursor.com>b64beb5 -
Hero refresh + sticky tab nav + section polish
Banner / hero - Desaturate the DNA helix palette (banner.js TINT) so the canvas blends into the paper rather than punching through it. - Cursor caret trimmed from the top so it stops poking above the N's cap height while keeping its baseline aligned with the wordmark. Sticky tab nav - New strip (#tab-nav-sticky) slides in from the top once the in-banner #tab-nav scrolls out of view (IntersectionObserver in tabs.js toggling .is-tabs-stuck on <body>). - Styled as a slice of the banner: same paper backing, dotted grain + green vertical stripes, same bottom hairline. Tabs reuse the in-banner colour scheme with bumped #b8b5a6 borders, sharp corners, top liseré on the active tab, and a margin-bottom: -1px trick so the active card bleeds into the page paper underneath. - Promoted --paper / --ink / --green / --hairline / --muted to :root so the sticky nav (a sibling of .carbon-banner, not a descendant) can resolve them. Section layout - §1 tokenizer: 1-mer and 6-mer colum…1cc98cf
-
Widen narrative rail from 248px to 320px
At 248px the body text in every section's rail was wrapping after ~36 chars per line, which broke phrases mid-clause and made the takeaway feel cramped. 320px lands around 50-55 chars per line — inside the comfortable 45-75 reading range — without eating meaningfully into the demo column on a 1440px+ viewport. Bumped the column gap from 32 → 40px to keep the rail visually distinct from the demo card now that they sit at similar weights. Co-authored-by: Cursor <cursoragent@cursor.com>d759d24 -
Page goes full-bleed: drop the 1080px column cap
The 1080px cap on .container.wide / .header-inner / .banner-wrap / .tab-lede was a holdover from when sections were single-column reading columns: a centred narrow column flanked by big paper margins worked fine when prose and demo were stacked vertically. With every Demo-tab section now living in a sticky-narrative + demo grid, the demo half was being squeezed to ~700-740px on a 1440px laptop and the UMAP scatter / 3D folding viewers / species tree all felt cramped. Going full bleed (max-width: none + 48px lateral padding to match the banner gutters) lets the demos use the room they need; the 248px sticky narrative rail caps line length on prose regardless of viewport width, and .tab-lede p still has its 760px cap so the framing paragraph below the banner stays readable on a 32" display. Mobile (≤720px): all four wrappers drop their lateral padding to 16px so the banner art and the tab strip can still breathe on a phone. Co-authored-by: Cursor <cursoragent@cursor.com>4018238 -
Split demo.html into modular CSS/JS assets
demo.html had grown to 6477 lines with a single inline <style> (1240 lines) and a single inline <script> (4358 lines) — every change meant hunting through one giant scrollback and risked breaking unrelated sections. Extracted into /assets/: styles/ 14 files, ~1280 lines: base, header, banner, layout (incl. new section--two-col), controls, sequence, section-{folding,umap,tree,vep,species}, recipe, sandbox, footer js/shared/ helpers.js (lerp, logprobRgb, renderSeq…) + config.js (fetchConfig, loadConfig, loadGenes) js/sections/ one IIFE per demo card: completion, vep, track, species, folding, tokenizer, loss, data, architecture, sandbox, umap, tree js/ banner.js (DNA helix Canvas 2D), tabs.js (hash routing + bootstrap loadConfig) Strategy: plain <script> tags, not ES modules. Each IIFE was extracted verbatim and globals stay global — minimum behavioural risk. Migrating …39a61da