Spaces:
Running on L4
Running on L4
Commit History
-
Update bass example sentence in Attention Explorer Running
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>43e81e8
-
Swap pronouns in bass example sentences for Attention Explorer
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>b910da2
-
Move LLM Explorer mockups to dedicated subdirectory
Design mockups for attention, controls, examples, and neighbor views — kept as useful design artifacts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>f263cac
-
Attention Explorer: no-neighbor mode with percentage bars
- When neighbors off: show percentage bars (width + opacity scaled by weight) - Selected word outline wraps word-group only in no-neighbor mode - Weight badges hidden in bar mode, shown in neighbor mode - Linear opacity scaling: α = 0.25 + weight × 0.75 - attn-no-neighbors CSS class toggles on word column Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>add5beb
-
Attention Explorer: admin panel config, examples from config.json
- Add Attention Explorer section to admin panel (model + examples JSON editor) - Examples read from config.json at startup (not hardcoded) - Model description text reads from config - Admin save handler persists attention_model and attention_examples Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>70c2c71 -
Attention Explorer: redesign controls, examples, neighbors; add config support
- Controls: Layer ▲▼ + Head ◄► on separate rows, matching keyboard shortcuts - Examples: labeled pairs (bass/spring/light) with background grouping, above input - Removed current/pitch pairs (kept in search tool, documented in CLAUDE.md) - Neighbors: pill chain with → bridge arrow, probability-scaled borders - Movement colors: only show when no word selected (exploration mode) - Selected word: full-row outline, word-group-only background highlight - Attention model now configurable via config.json (attention_model key) - Updated model description text to GPT-2 Medium - Input label: "Text" with hint "Try an example above, or enter your own text" Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>3ec8089 -
Attention Explorer: switch to GPT-2 Medium, new polysemy examples, fix visualization
- Switch from GPT-2 Large (36L/20H) to GPT-2 Medium (24L/16H) for better teaching balance - Replace class/mother examples with 5 polysemy pairs: bass, spring, current, pitch, light - Fix attention line widths: power curve for differentiation, reduce max thickness - Fix tuned lens Output layer: skip double ln_f normalization on final hidden state - Add selected word dark purple outline for visual distinction - Word highlights binary (not weight-scaled) — lines carry differentiation - Add py/attention_search.py: batch tool for testing sentences across models Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>9f7ce03
-
Attention Explorer: align layers with neighbors, add profanity filter
- Neighbors/movement now show hidden state N (input) at Layer N, matching attention weights - Added "Output" position after last layer for final predictions - Default start changed to Layer 1 (raw embeddings) - Added server-side profanity filter (~45 terms) for tuned lens neighbors Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>65619e0
-
Add Attention Explorer tab (GPT-2 Large) for Lecture 7.5
- New attention.py: forward pass, subword merging, tuned lens neighbors, movement colors - GPT-2 Large (774M, 36 layers, 20 heads) with eager attention for richer patterns - Iframe srcdoc wrapper for Gradio 6.x script execution - Punctuation filtering in neighbors with toggle, configurable neighbor count - Layer/head navigation with keyboard shortcuts (arrow keys) - 6 example sentences (class polysemy + mother variants) - LMS updates: L12 content page, embedding/prompt explorer URLs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>b701256
-
System Prompt Explorer: dual model, multi-turn chat, configurable presets
- Dual model architecture: base (Llama-3.2-3B) + chat (Llama-3.2-3B-Instruct) - Multi-turn chat with gr.State for clean history (Chatbot display-only) - 11 configurable presets via admin panel or SYSTEM_PROMPT_PRESETS env var - All config values overridable via env vars (Secrets vs Variables documented) - No auto-reset on prompt changes; green terminal collapsed by default - Educational note: no hidden system prompt, helpfulness from RLHF Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>beb8b02
-
System Prompt Explorer: add instruct models and new tab
ClaudeAdd instruct model variants (Qwen2.5-3B-Instruct, Qwen2.5-7B-Instruct 4-bit) to the model registry with generate_chat() method that uses chat templates. New "System Prompt Explorer" tab lets students see how system prompts change LLM behavior — green terminal shows the actual formatted prompt with special tokens, preset system prompts demonstrate different personas. https://claude.ai/code/session_01BaykWTcKjWQihY3vk1gzgYf2b5e3f
-
Improve Export Slides layout, add slide 0, add PNG export script
Slideshow: probability table above text (stabilizes layout), scaled to 1920x1080 native, added slide 0 showing prompt before first token. New py/slides_to_png.py converts HTML slideshows to PNGs via Playwright with resolution options (1k-12k, default 12k) and y-offset for positioning. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>5f7279a -
Add Share button to LLM Explorer for shareable URLs
Encodes Probability Explorer and Tokenizer settings as URL query params, shortens via Rebrandly (go.ropavieja.org), and auto-loads shared configurations on page open. Uses curl subprocess for Rebrandly API (urllib blocked by Cloudflare TLS fingerprinting). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>28f8b9f
-
Update LLM Explorer defaults: Llama model, student-relatable tokenizer text
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>ac2fea8 -
LLM Explorer: tokenizer separation, model status fix, UX improvements
- Separate GPT-2 tokenizer for demo (more interesting subword splits) - Fix model status header not updating after model load - Show steps toggle now resets steps to default when turned ON - Export slides moved to Admin, uses top-k setting (not hardcoded 5) - Force light mode on page load for consistent classroom experience - Add default tokenizer text to admin settings - Update CLAUDE.md with session notes and HF Spaces learnings Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>2fa329f -
Fix indentation: restore get_config/update_config to ModelManager
c83dcd8 -
Add admin setting for default tokenizer text
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>d5ad096 -
Separate GPT-2 tokenizer for demo; add Qwen2.5-7B fp16
- Tokenizer tab now uses GPT-2's tokenizer (more interesting subword splits) - Generation still uses admin-selected model (Qwen default) - Added Qwen2.5-7B fp16 option for L4's 24GB VRAM - Removed fictional GPT-OSS-20B models Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>01852d9
-
Capture decisions: Export Slides placement, Playwright test harness
- Export Slides button: hidden on load, revealed after generation, placed below output - Added Playwright UI test harness for headless screenshot/DOM inspection - Key learning: Gradio requires app restart for code changes (not just browser refresh) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>522ab9a -
Capture decisions: dark mode button fix, dtype deprecation, local dev notes
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>657aed0 -
Clean up failed localStorage JS, document findings for later
Removed all non-working localStorage/JS-init code (dark mode persistence, admin auto-login). Gradio 6.5.1 doesn't execute JS from demo.load(), gr.Blocks(js=), or gr.Blocks(head=<script>). Documented approaches tried in CLAUDE.md for future investigation. What works: dark mode toggle, admin save refreshes all controls, config refresh on page load via demo.load(fn=), build timestamp. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>4caea2c -
Persist dark mode + admin login in localStorage, refresh config on load
- Dark mode preference saved to localStorage, restored on page load - Admin password cached in localStorage, auto-fills and clicks login - Page refresh now reads current config.json values into all controls (admin panel + Probability Explorer), fixing stale defaults after save - Seed accordion label simplified to "Random Seed" (was showing stale value) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>4aa506e -
Fix admin Save Defaults: update config display and app controls
Save Defaults now returns updated config JSON (refreshes "Current Config" panel) and pushes new values to the Probability Explorer sliders/inputs so changes take effect without a page reload. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>030fdfc -
Add build timestamp footer to track deployments
Shows "Updated YYYY-MM-DD HH:MM:SS CT" at bottom of page, computed once at startup in Central Time. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>dc32509 -
Fix temperature=0 greedy decoding: use raw logits for argmax
At temp=0, dividing logits by 1e-6 overflows softmax (all NaN). Now: greedy mode picks argmax from temperature=1 probabilities (same result, no overflow), and shows the real probability distribution in the table instead of all zeros. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>c014f7f -
Fix NaN probability crash in step-by-step generation
softmax of all -inf logits (from top-k masking) produces NaN (0/0). Added torch.nan_to_num after softmax in apply_temperature, plus math.isnan guards in the HTML rendering as defense-in-depth. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>c2e8f36 -
Capture decisions: 5 LLM Explorer bug fixes
- Dark mode button text synced on page load via demo.load() JS - Dark mode heading colors: setProperty with !important beats stylesheet - Entropy NaN fix: filter probs > 0 instead of p + eps - Merged Top-N + Top-K into single Top-K slider (5-100) - Show-steps-off highlight: strip leading whitespace before span Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>67d4e0c -
Capture decisions: dark mode button fix, dtype deprecation, local dev notes
- Dark mode toggle: dark purple bg + white text in light mode (was inverted) - Fix torch_dtype → dtype deprecation warning in models.py - Document local dev setup: Qwen2.5-3B, HF auth method Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>dd9f260 -
Capture decisions: dark mode, design polish, setup/deploy docs
- Dark mode toggle with CSS variables for all output HTML - Show steps OFF highlights all generated text (not just last token) - Stacked controls with plain-English explanations - Block backgrounds light purple, buttons dark purple via theme .set() - Tab text + headings: dark purple (light) / light purple (dark) - CUDA guard for quantized models on MPS/CPU - Added laptop setup + HF deploy step-by-step guides to tools/CLAUDE.md Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>5a877c3 -
LLM Explorer: UI overhaul, remove Generator tab, add purple theme
- Remove Generator tab (Probability Explorer with show-steps-off covers it) - Add Top-K sampling slider to Probability Explorer - Temperature slider to 0 (greedy argmax at temp=0) - Token display: remove quotes, trim whitespace, show symbol for spaces - Step highlighting: only bold latest token, not all generated text - Apply course palette (#63348d / #ded9f4), Merriweather headings - Create justfile with push, push-hf, setup-hf targets - Update CLAUDE.md files with session decisions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>a3fbacc -
Capture decisions: LLM Explorer tool, HF Spaces deployment
- Built tools/llm-explorer/ Gradio app (3 tabs + admin panel) - Deployed to HuggingFace Spaces (chyams/llm-explorer) with T4 GPU - Separate tools venv at ~/venvs/responsible-ai-course-tools - Admin-swappable model list, seed accordion UX, slider debounce - Session notes added to 2026-spring/CLAUDE.md Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>376d344