Repository navigation
Choose the speech model's language, with Automatic the default - #66
Merged
Merged
Conversation
A speech model that can be told which language to write now offers its languages in two places:
the menu bar's or tray's Language menu, and the Language menu on its row in Settings › Models.
Both list Automatic first, then only the languages that model takes: Qwen3-ASR's 30 (31 with
Sinhala in the default model), Whisper's 100 on the Mac, and Cohere Transcribe's 14. Parakeet
can't be told one, so its menu is greyed out with Automatic alone.
Automatic, the default for every model, tells the model nothing and it works the language out,
as before. Cohere Transcribe can't, so the catalog's automatic_language gives it English, as it
had. Choosing English stops a short or noisy recording coming out in another language. The one
Language setting holds the choice for every model; a model without that language uses Automatic.
Qwen3-ASR is told the language as mlx-audio-swift's prompt does ("language English<asr_text>"
after the assistant's turn), by the name its config lists, and Whisper and Cohere by the code.
The Linux and Windows Qwen3-ASR runtime now builds that prompt too, so it reads the model's merges.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Telling Qwen3-ASR a language only stands in for its own guess: clear speech in another language still came out in that language. Now, with a language chosen, Qwen3-ASR may write only that language's letters, plus Latin letters for English words, and the digits, punctuation and spaces every language shares. Told English, a Chinese clip comes out translated into English, and the 65 English eval clips come out exactly as before. Each Qwen language in the catalog names its script (ISO 15924). On the Mac, Qwen3-ASR is decoded here, on mlx-audio-swift's public model API, with a mask on the logits before each greedy choice. On Linux and Windows, the greedy decoder takes the same lock. Automatic never locks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This lets you set the language the speech model transcribes in, e.g. English only, so a multilingual model doesn't drift into another language now and then. It's built on #65, which has merged.
Where
Both menus write the same
sttLanguagesetting. Automatic (no setting) is the default for every model. The setting is shared across models, so if you switch to a model that doesn't have the chosen language, it shows as Automatic, and the choice comes back when you switch to a model that has it.What each model offers
support_languages)English comes first in each list, then the rest by name.
Qwen3-ASR is kept to the language's letters
Testing showed telling Qwen3-ASR a language only replaces its own guess at it: with Sinhala chosen, English speech came out in English, and with English chosen, Sinhala came out in Sinhala. So when a language is chosen, Qwen3-ASR may now write only that language's letters, plus Latin letters for English words (as the Sinhala model writes them), and the digits, punctuation and spaces every language shares.
speech-models.jsonnames its script (ISO 15924:Latn,Sinh,Hani…).Qwen3ASR+ScriptLock.swift, on mlx-audio-swift's public model API, so there's no fork. Other models still use mlx-audio-swift'sgenerate.script_lock.rs,qwen3_asr/locked_tokens.rs).What it does (Mac Bench, default Sinhala Qwen model):
How the language is told
language English<asr_text>after the assistant turn starts, as mlx-audio-swift'sbuildPromptTextdoes.--language automaticclears the setting for a single run on Linux and Windows.Not tested yet
cfg(linux|windows), so CI is the first place it compiles.Checks
make test: everything passes. The two wall-clock cleanup timing tests failed once under load and passed on a rerun. The Mac app builds.cargo fmt --check,cargo clippy --workspace --all-targets -- -D warningsandcargo test --workspacepass on macOS.🤖 Generated with Claude Code