Spaces:
Running
Running
Commit History
-
Add "Sign in with Hugging Face" OAuth so visitors access their own gated repos Running
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)- README frontmatter enables hf_oauth with read-repos scope. - Add gr.LoginButton() in the top-right of the page. - Thread gr.OAuthToken through load_from_hub / run_inspection / render_playground; pass the visitor's token into from_pretrained. - Key the tokenizer cache by (model_id, token) so users with different Hub access don't share cached objects. Now a signed-in visitor can inspect gated templates (meta-llama/Llama-3.1-8B-Instruct, deepseek-ai/DeepSeek-R1, …) transparently using their own permissions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>cb002d0 -
Drop `tools=[...]` from tool-calling correctness checks
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)The checks for tool_calls rendering (dict vs str args, empty content, no content key) aren't about the `tools` argument — they're about how the template handles an assistant message with tool_calls in it. The `tools` passthrough was noise. Drop it from each reproducer and from the actual apply_chat_template call; also drop the now-unused _WEATHER_TOOL constant. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>8c6a29f -
Drop "Clean add_generation_prompt=False" check (redundant)
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)This check ran two renderings on the same [user, assistant] message list (=True vs =False) and asserted that =True extended =False. The framing was confusing — the natural property is "render(messages[:-1], add_generation_prompt=True) is a prefix of render(messages, add_generation_prompt=False)", which is exactly what check_prefix_preserving already covers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>0ea4cff -
Drop status messages from accordion titles; show description in body
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)Each check now has a generic one-line description in inspector/checks (DESCRIPTIONS dict, looked up by name). The report's accordion summary is just `{emoji} {name}` — clean. The body shows: - the description (italic) — what's being checked - the status message (bold) — only when there's something to say - any details - the reproducer So a passing check now expands to "what does this verify + how to run it" instead of just the snippet. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>ae9934f -
Use meaningful sample messages; add a playground after the report
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)- Replace dummy 'hi' / 'hello' / 'hello world' with 'What's the capital of France?' / 'Paris.' across every check (and 'What's the weather in Paris?' for the tool-calling probes). Reproducers now read like real conversations and stay verifiable on Qwen3-8B. - Add a Playground section under the report: a Python-literal `messages` field + an `add_generation_prompt` checkbox + a read-only render output. Auto-renders on edit using the current editor template, special tokens, and model. ast.literal_eval — no exec, no eval — so it's safe to expose publicly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>54441dd -
Add a self-verifying assert at the end of every reproducer
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)Each reproducer now ends with an assert that captures the property the check is testing — copy-pasting and running the snippet exits cleanly when the template behaves correctly and raises AssertionError with a human message when it doesn't. Verified on Qwen3-8B: 11 asserts pass, the assistant-masking assert fails (Qwen3 lacks {% generation %} blocks, matching what the check reports). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>25e6853 -
Click the check title to expand its reproducer/details; full-width layout
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)- Wrap each check in a single <details><summary>{emoji} <b>{name}</b>{message}</summary> block. Clicking the title now toggles the body (reproducer + details); the separate "reproducer" / "details" sub-accordions are gone. - Pure-info checks with no body (e.g., "No hardcoded dates" pass) render as a plain line so they don't look interactive when there's nothing to reveal. - fill_width=True on Blocks so the two columns use the full window width. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>e9fb4c7 -
Auto-inspect on load + on edits, cache tokenizer once
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)- Cache the loaded tokenizer/processor by model_id so subsequent inspections skip from_pretrained (~50ms vs several seconds). - Stash the original special tokens at load time, so an empty override field truly resets to the original instead of keeping the previous override. - demo.load fires the inspection on page open (no manual click needed). - template_editor / bos / eos / pad / unk all .change → re-run; Gradio cancels the previous in-flight call, so rapid edits debounce. - Drop the manual Run button (auto-runs cover every case). - Drop gr.Progress() — inspections are sub-second on a cache hit, so the bar would mostly flash without value. - Reproducer is now attached to every CheckResult (pass / warn / fail alike) so the report shows what each check tested even when it passed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>e7f8b01 -
Self-contained checks; drop misleading "X / Y passed" header
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)- Each check in inspector/checks.py is now self-contained: it builds its own messages, calls apply_chat_template inside a try/except, and writes its reproducer snippet inline as an f-string. No more _reproducer/_pyrepr/_safe_render helpers, no more shared examples module — code duplication is intentional so a check can be read top-to-bottom in one go. - Drop inspector/render.py and inspector/examples.py (now unused). - Drop the "12 / 13 checks passed" report header; an unsupported capability isn't a "fail" in the same sense as a real bug, and the aggregate count was misleading. The categorized list speaks for itself. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>823be61 -
Drastically simplify layout: vanilla two-column Gradio
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)- Drop all custom CSS, fill_width/fill_height, sticky positioning, and manual overflow rules. - Drop the right-pane tabs entirely; only the report remains. - Drop the role-colored renderings, prefix diff view, and assistant mask view from the UI (the corresponding checks still surface their visualizations textually inside the report's reproducer/details accordions). - Standard gr.Row + two gr.Columns; let Gradio size them. - Editor sized via lines=20, max_lines=20 — the only height knob. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>fa95756 -
Constrain editor height with lines/max_lines + stronger CSS
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)Re-add lines=15, max_lines=15 to the gr.Code component (the gradio parameter actually enforces height) and tighten the CSS selector to also cover direct children of #template-editor in case any wrapper ignored the constraint. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>7077a97 -
Lock page scroll; each pane scrolls independently at full viewport height
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)- html/body/gradio-app overflow: hidden — page itself never scrolls. - Each top-level column gets height: 100dvh + overflow-y: auto, so the left and right panes scroll in complete isolation. - Editor stays capped (35vh min / 55vh max) inside the left pane. - Run button is position: sticky at the bottom of the left pane so it's always reachable regardless of the editor's scroll position. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>a712bef -
Give the template editor a min-height so empty templates don't collapse
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)Pin to 35vh so the editor stays usable when the template is very short or just cleared. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>773f47c -
Make the two columns scroll independently
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)Cap each top-level column at the viewport height with overflow-y: auto. A long report on the right no longer pushes the editor on the left out of view; each side scrolls in isolation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>0335556 -
Add a "Format" button to pretty-print the Jinja template
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)Wraps djlint --profile=jinja with special-token masking so that tokens like <|im_start|> aren't mangled by djlint's HTML parser. Output is verified byte-identical at render time on Qwen3 and Llama-3.1. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>04ad8ba -
Stream check progress to the UI via gr.Progress
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)Iterate ALL_CHECKS manually so each step can post a desc back through gr.Progress("Running checks: tools supported", …). Bar fills as checks complete; final tick is "Rendering examples…" while the colored views are computed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>2309d3f -
Drop "Tool role" capability check
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)The tool role isn't a standalone feature — if a template supports tools, it must handle tool responses to be useful. The "Tools" capability check already covers this surface. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>c4e9dd8 -
Pass messages positionally in reproducer snippets
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)apply_chat_template's first parameter is named "conversation", not "messages". Passing as a kwarg raised a TypeError when users tried to run the reproducer. Drop the messages= keyword and pass positionally. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>8135d4e -
Capability checks: simple sentinel-based "is X supported?" probes
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)Capabilities are now strict yes/no support indicators, not correctness checks: - Tools — pass a tool with a sentinel name; check the name appears. - System role — pass a system message with a sentinel; check it appears. - Tool role — pass a tool response with a sentinel; check it appears. - Parallel tool calls — pass two tool_calls with distinct sentinels; check both appear (moved out of "Tool calling"). - Assistant masking — invoke return_assistant_tokens_mask=True and verify the template uses {% generation %} blocks. Edge cases (double-escape, empty content, etc.) stay in Correctness / Tool calling as before. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>5261b1a -
Drop the "Special tokens" header above the token row
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>27f6159 -
Wire reproducers for every non-passing check
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)Each fail/warning result now ships a self-contained Python snippet (AutoTokenizer/AutoProcessor + apply_chat_template with the exact messages, tools, and kwargs that triggered the issue), surfaced in the report under a "reproducer" details accordion. Round-trip and double-BOS checks include a follow-up assertion line so the bug is reproducible end-to-end. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>de7ac03 -
Move Run checks to the bottom of the left pane; add button emojis
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)- Move "Run checks" out of the top row to a full-width primary button at the bottom of the left column (more natural reading flow: edit → run). - Prefix Load and Run buttons with emojis (📥 / 🔍). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>92c7b64 -
Move css kwarg from Blocks to launch (Gradio 6 deprecation)
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>f03df76 -
Cap editor at 55vh with CSS; drop status banner and editor label
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)- Drop the "Loaded ... (Tokenizer)" status markdown. - Drop the "chat_template (Jinja)" label on the editor (show_label=False). - Pin editor max-height to 55vh via CSS targeting the CodeMirror inner scroller, so very long templates scroll inside the editor instead of pushing the special-token row off screen. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>ae5d2f3 -
Cap chat template editor height so special tokens stay visible
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)Reduce lines/max_lines from 18 to 12 — the editor scrolls internally for longer templates rather than pushing the special-token row off screen. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>147b52f -
Use jinja2 syntax highlighting for the template editor
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)gr.Code supports language="jinja2" natively (was using "html" before, which mishighlighted {% %} tags). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>5c8a713 -
Move special tokens to a compact row below the editor
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)Drop the left-pane tabs. The chat_template editor is always visible at the top of the left column; special tokens sit underneath as a single row of four small textboxes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>2cd616b -
Pre-load Qwen3-8B as default on startup
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)The model id field, template editor, and special-token boxes now come prefilled with Qwen/Qwen3-8B so the app is interactive on first load without requiring a click. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>6864c45 -
Combine renderings into a role-colored view; fill the window
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)- Replace per-example tabs with a single HighlightedText per scenario, colored by the role that contributed each chunk (system/user/assistant/ tool/generation_prompt). Uses difflib.SequenceMatcher so attribution is robust to non-prefix-preserving templates (e.g., Qwen3 think-block stripping). - Restructure left pane: model id + Load + Run buttons in one row; tabs for Template vs Special tokens so the editor and tokens are both reachable without scrolling. - fill_width=True + fill_height=True so the layout uses the whole window. - Drop placeholder "<s>" etc. on special token fields (misleading default). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>b4fbb45 -
Make special tokens editable as one field per token
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)Replace the read-only JSON view with four editable Textboxes (bos/eos/pad/unk), populated on Hub load and applied to the tokenizer before running checks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>a82471e -
Initial scaffold: chat template inspector
Quentin Gallouédec +1: Claude Opus 4.6 (1M context)Gradio Space that loads a tokenizer/processor from the Hub, exposes its chat_template in an editor, and runs a battery of checks covering capabilities, correctness, and tool-calling good practices. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>2895532 -
initial commit
Verified signature98524d6