Repository navigation
Studio Transcribe: optional speaker accent hint - #17460
danielhanchen merged 7 commits into
Conversation
Adds an optional "Speaker accent" field under Language on the Transcribe page. The text goes to models that take a text hint and nowhere else: - Whisper on Transformers: Whisper's prompt (prompt_ids), kept out of the returned text on the timestamped path too - Whisper on whisper.cpp: the server's prompt field - Qwen3-ASR on llama.cpp: Qwen3-ASR's context, as the system turn - Connections: the OpenAI-compatible transcription prompt audio.cpp and mlx-audio models take no hint. /audio/stt/capabilities now reports accent_hint, the field turns read-only with a note saying the hint is not sent, and /audio/transcribe/source answers 422 rather than dropping a hint for such a model. The hint never changes the selected language, so the transcript stays in the spoken language.
|
The capability shape now requires The |
…17466) ## Summary Reduce motion is on by default since #17377, and its blanket rule in `index.css` gives every element `transition-duration: 0.01ms`. `transition-property` defaults to `all`, so that one line turns on transitions for every property of every element, including the many no rule ever meant to animate. Chromium makes this expensive. `* { scrollbar-color }` sets a scrollbar colour on every element, and Chromium starts a scrollbar-color transition on each of them whenever they are restyled, even when the value does not change (the from and to keyframes are identical). With any non-`auto` colour, a body-level restyle in a 40 turn Liquid Glass chat started about 2,000 of these transitions, and more as the chat grows. This is behind the Chromium long-chat gate cells that keep failing on recent PRs (`area thread_scroll (liquid-3d)` and `area stream (liquid-3d)` growing 2.5x to 2.8x from 40 to 200 turns, e.g. #17453 and #17460). ## Change - Both Reduce motion blocks (`html.force-reduced-motion`, on by default, and the OS `prefers-reduced-motion` block) now give the `*` blanket `transition-duration: 0s`. A transition that lasts 0.01ms and one that does not run look the same, so nothing on screen changes and Reduce motion stays on. - A second rule in each block keeps 0.01ms for elements that still need their `transitionend`: - elements that declare a transition through a Tailwind class (`[class*="transition"]`), which covers the reasoning and sidebar collapsibles that unmount on `transitionend`; - the overlays `native-view.ts` follows by their transition events (`CLICKABLE_SELECTOR`: toasts, the find bar, native clickables and the rail), so the Desktop browser view keeps its hole in place while they appear. - The annotation layer's zoom only had a transition because of the blanket. Its comment now says what happens without one: the existing `[zoom]` effect redraws it. ## Guard New `studio/frontend/tests/reduced-motion-implicit-transitions.test.ts`: - fails if either Reduce motion `*` blanket sets a nonzero `transition-duration`, with its own cases for the checker; - requires the 0.01ms exemption in both blocks, and that it lists every part of `native-view.ts`'s `CLICKABLE_SELECTOR`, so the two cannot drift apart. `reasoning-grid-collapse.test.ts` now checks that the collapse is reached through the class exemption instead of counting the old blanket lines. Against main's `index.css` the new test and the updated collapse test fail (3 failures); with this change all 20 tests in the four related files pass. ## Measurements Chromium (the long-chat gate's headless build and harness, this host), Liquid Glass 3D, main-thread CPU per area at 200 turns, three interleaved runs each: | Area | main | this PR | |---|---|---| | `thread_scroll` | 1,166 / 679 / 628 ms | 186 / 209 / 166 ms | | `stream` | 3,072 / 3,242 / 3,244 ms | 1,450 / 1,241 / 1,175 ms | | `command_palette` | 1,370 / 1,058 / 1,172 ms | 326 / 236 / 346 ms | Scrollbar-color transitions started by one body-level restyle at 40 turns: 2,550 on main, 0 with this change. ## Long-chat gate: Settings ceiling With the blanket transitions gone, the gate's 40 turn reading of opening Settings in the default appearance drops from about 6,100 elements restyled to about 2,400, while the 200 turn reading stays near 7,900. That made `area settings (default)` read 3.3x against the 2.0x element-growth limit. The growth itself is on main already. Measured on fresh pages with the gate's harness, default appearance: | | 40 turns | 200 turns | growth | |---|---|---|---| | main | 1,975 elements, 290 ms CPU | 9,721 elements, 816 ms CPU | 4.9x | | this PR | 1,663 elements, 217 ms CPU | 7,760 elements, 461 ms CPU | 4.7x | The gate only passed on main because the transitions inflated its 40 turn reading. `KNOWN_DEFAULT` in `tests/studio/_area_matrix.py` now records it as `length:settings=5`, so Settings keeps a ceiling instead of being skipped. This changes only the element and layout count check for that one area; its CPU and paint growth checks are unchanged. Finding what restyles the thread when Settings opens is a separate fix. ## Not covered The Firefox long-chat gate failure that also started with #17377 is a different cost: forcing every transition to 0s does not change the Firefox numbers, so this PR does not address it.
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0830042422
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| model: string, | ||
| ): TranscribeSwitches { | ||
| const untimed = OPENAI_UNTIMED_MODEL.test(model); | ||
| const { accent, speakerAccent } = accentFor(true, prefs.speakerAccent ?? ""); |
There was a problem hiding this comment.
Disable accent hints for the diarizing connection model
When a connection offers gpt-4o-transcribe-diarize (which connectionTranscribeModels accepts), this hard-coded true enables the accent field and includes the hint in the request. _external_source_transcript then forwards it as prompt, but OpenAI's diarizing transcription model does not support that parameter, so adding an accent makes an otherwise valid short transcription fail upstream. Gate accent support by model instead of enabling it for every connection.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in d8e89f0: diarize connection models disable the accent field and the route answers 422 instead of forwarding prompt, since the OpenAI API docs say prompt is not supported for gpt-4o-transcribe-diarize.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…tions A Whisper prompt conditions transcript style, not accent: on EdAcc accented English, whisper-small with the hint as its prompt scored worse than without (whisper.cpp 18.3% -> 21.4% WER, 95% CI +1.1 to +5.3 pp, 54 clips), while Qwen3-ASR's context held or improved (13.3% -> 12.5%). [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Fixes #17440
What this changes
The Transcribe page gets an optional Speaker accent field under Language, for a description such as "Chinese-accented English". Language still sets the spoken language, so the transcript stays in that language; the accent only goes in as a text hint.
The hint reaches only models that can take one:
*-diarize)promptfieldwhisper-1connections),gpt-4o-transcribe-diarize, audio.cpp models (MOSS, VibeVoice, Parakeet, Qwen3-ASR audio.cpp, ...) and mlx-audio checkpointsFor a model that can't take it, the field turns read-only and says the hint isn't sent and which models can use one. Nothing is dropped silently:
/audio/stt/capabilitiesnow reportsaccent_hint, and/audio/transcribe/sourceanswers 422 if a hint comes in for such a model. The field defaults to empty and nothing is inferred.The text sent is
Speaker accent: <hint>., with whitespace tidied and capped at 200 characters.Screenshots
Whisper (hint supported), and MOSS-Transcribe-Diarize (hint not supported):
A real run with the hint set (whisper-small on GPU). The transcript stays in English:
Testing
Windows 11, RTX 3050 Laptop 4 GB.
End to end
run.py --api-only) with vite and headless Chromium. I uploaded a recorded English clip in the Transcribe UI, typed an accent, and pressed Transcribe. The request carriedspeaker_accent,openai/whisper-smalltranscribed on the GPU, and the English transcript came back unchanged.accent_hintwas true for whisper-small and false for MOSS-Transcribe-Diarize. A MOSS request with a hint got the 422.prompt: "Speaker accent: Japanese-accented English."when a hint was set, and nopromptwithout one.transcribe_windowdirectly with and without the prompt, on both the plain path and the timestamped path. The text was identical in all four runs. Before the timestamp fix, the timestamped path printed the prompt into the transcript.Tests
prompt. On the payload side they cover whisper.cpp's form field and the Qwen3-ASR system turn. The frontend tests cover the switches, the store, and the connection behavior.test_stt_*,test_transcribe_source_route,test_openai_audio_*,test_audio_inputs,test_mcp_tools_audio,test_custom_provider_api_type, ...). All pass except 5 that fail the same way on clean main on this Windows machine: 4 ROCmtest_slim_guard_*tests intest_stt_ggml_sidecar.py, andtest_stt_sidecar.py::test_corrupt_or_escaping_revision_record_is_ignored.npm testrun gave 15663 tests and 1 failure, the persisted-store test that needed the new field; that file now passes. The audio and transcribe tests then gave 698 pass, 0 fail.tsc --noEmitis clean. eslint on the touched files shows the same findings as on main.ruff checkis clean on the backend files.Not tested here: there's no whisper-server or llama-server binary on this machine, so the whisper.cpp and Qwen3-ASR (llama.cpp) paths are covered by request/payload tests rather than a live model. There's also no Mac, so the mlx-audio case is covered by a unit test.
Update: Whisper takes no hint (measured)
Whisper's
promptconditions the transcript's style (it is meant to hold earlier transcript text), not the speaker's accent. Real runs on EdAcc accented English (54 clips; Chinese, Spanish, Indian, Scottish, Eastern European and US speakers), WER without vs with the hint:whisper-server(L4)llama-server(b12340 prebuilt, CPU)So the hint now goes only to Qwen3-ASR on llama.cpp and to connections whose model is neither Whisper nor
gpt-4o-transcribe-diarize(OpenAI documents that model as not takingprompt). Whisper shows the field read-only with the usual note, and the route answers 422 for a hint it cannot use. No transcript contained the hint text in any run.Before / after (Transcribe rail)
Base (left) has no accent field. Head (right): editable for Qwen3-ASR 0.6B on llama.cpp; read-only with the note for whisper-small.
/audio/stt/capabilitiesreportsaccent_hinttrue forqwen3-asr-0.6b, false foropenai/whisper-smallandMOSS-Transcribe-Diarize(absent on base).