feat(stt): pass local initial_prompt to faster-whisper - #50684
feat(stt): pass local initial_prompt to faster-whisper#50684BlackishGreen33 wants to merge 4 commits into
Conversation
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused implementation. The forwarding behavior is still missing on current main: tools/transcription_tools.py:1131-1142 builds the faster-whisper kwargs with language and beam size only.
Problems
- The PR documents
stt.local.initial_promptonly incli-config.yaml.example; it does not add the key to the runtime configuration schema athermes_cli/config.py:2132-2135. New config options should be represented inDEFAULT_CONFIG, so config introspection and default merging know the setting exists.
Suggested changes
- Add
"initial_prompt": ""underDEFAULT_CONFIG["stt"]["local"]and cover the real config-resolution path in addition to the mocked forwarding tests.
This is an automated hermes-sweeper review.
|
Follow-up test isolation fix in |
Class-level fix for the 'STT transcribes the wrong language' issue family (#55551, #50181 and siblings). Previously language handling was per-provider chaos: local honoured stt.local.language, Groq/OpenAI/Mistral/DeepInfra sent no language hint at all, xAI silently forced 'en', ElevenLabs used its own language_code key, and there was no global setting. - New _resolve_stt_language() helper: stt.<provider>.language > stt.language (new global key) > HERMES_LOCAL_STT_LANGUAGE > auto-detect. - Threaded through ALL providers: local, local_command, groq, openai, mistral, xai, elevenlabs, deepinfra (shared OpenAI handler), command providers, and plugin dispatch. - xAI no longer forces English when nothing is configured (auto-detect). - Mistral Voxtral now receives a language hint when configured. - stt.groq.model is now honoured from config (previously env-only). - DEFAULT_CONFIG gains stt.language, stt.groq, stt.xai, stt.mistral.language. - Tests: tests/tools/test_stt_language_resolution.py (11 tests, sabotage- verified) + full transcription suite green (236 passed). Builds on cherry-picked contributor work from #19786 (@zombopanda), #23161 (@materemias), #50684 (@BlackishGreen33).
Class-level fix for the 'STT transcribes the wrong language' issue family (#55551, #50181 and siblings). Previously language handling was per-provider chaos: local honoured stt.local.language, Groq/OpenAI/Mistral/DeepInfra sent no language hint at all, xAI silently forced 'en', ElevenLabs used its own language_code key, and there was no global setting. - New _resolve_stt_language() helper: stt.<provider>.language > stt.language (new global key) > HERMES_LOCAL_STT_LANGUAGE > auto-detect. - Threaded through ALL providers: local, local_command, groq, openai, mistral, xai, elevenlabs, deepinfra (shared OpenAI handler), command providers, and plugin dispatch. - xAI no longer forces English when nothing is configured (auto-detect). - Mistral Voxtral now receives a language hint when configured. - stt.groq.model is now honoured from config (previously env-only). - DEFAULT_CONFIG gains stt.language, stt.groq, stt.xai, stt.mistral.language. - Tests: tests/tools/test_stt_language_resolution.py (11 tests, sabotage- verified) + full transcription suite green (236 passed). Builds on cherry-picked contributor work from #19786 (@zombopanda), #23161 (@materemias), #50684 (@BlackishGreen33).
|
Merged via PR #73067 — your commit was cherry-picked onto current main with your authorship preserved in git history. Thanks for the contribution! The fix is now part of a unified language resolver covering every STT provider. |
Class-level fix for the 'STT transcribes the wrong language' issue family (NousResearch#55551, NousResearch#50181 and siblings). Previously language handling was per-provider chaos: local honoured stt.local.language, Groq/OpenAI/Mistral/DeepInfra sent no language hint at all, xAI silently forced 'en', ElevenLabs used its own language_code key, and there was no global setting. - New _resolve_stt_language() helper: stt.<provider>.language > stt.language (new global key) > HERMES_LOCAL_STT_LANGUAGE > auto-detect. - Threaded through ALL providers: local, local_command, groq, openai, mistral, xai, elevenlabs, deepinfra (shared OpenAI handler), command providers, and plugin dispatch. - xAI no longer forces English when nothing is configured (auto-detect). - Mistral Voxtral now receives a language hint when configured. - stt.groq.model is now honoured from config (previously env-only). - DEFAULT_CONFIG gains stt.language, stt.groq, stt.xai, stt.mistral.language. - Tests: tests/tools/test_stt_language_resolution.py (11 tests, sabotage- verified) + full transcription suite green (236 passed). Builds on cherry-picked contributor work from NousResearch#19786 (@zombopanda), NousResearch#23161 (@materemias), NousResearch#50684 (@BlackishGreen33).
Class-level fix for the 'STT transcribes the wrong language' issue family (NousResearch#55551, NousResearch#50181 and siblings). Previously language handling was per-provider chaos: local honoured stt.local.language, Groq/OpenAI/Mistral/DeepInfra sent no language hint at all, xAI silently forced 'en', ElevenLabs used its own language_code key, and there was no global setting. - New _resolve_stt_language() helper: stt.<provider>.language > stt.language (new global key) > HERMES_LOCAL_STT_LANGUAGE > auto-detect. - Threaded through ALL providers: local, local_command, groq, openai, mistral, xai, elevenlabs, deepinfra (shared OpenAI handler), command providers, and plugin dispatch. - xAI no longer forces English when nothing is configured (auto-detect). - Mistral Voxtral now receives a language hint when configured. - stt.groq.model is now honoured from config (previously env-only). - DEFAULT_CONFIG gains stt.language, stt.groq, stt.xai, stt.mistral.language. - Tests: tests/tools/test_stt_language_resolution.py (11 tests, sabotage- verified) + full transcription suite green (236 passed). Builds on cherry-picked contributor work from NousResearch#19786 (@zombopanda), NousResearch#23161 (@materemias), NousResearch#50684 (@BlackishGreen33).
Class-level fix for the 'STT transcribes the wrong language' issue family (NousResearch#55551, NousResearch#50181 and siblings). Previously language handling was per-provider chaos: local honoured stt.local.language, Groq/OpenAI/Mistral/DeepInfra sent no language hint at all, xAI silently forced 'en', ElevenLabs used its own language_code key, and there was no global setting. - New _resolve_stt_language() helper: stt.<provider>.language > stt.language (new global key) > HERMES_LOCAL_STT_LANGUAGE > auto-detect. - Threaded through ALL providers: local, local_command, groq, openai, mistral, xai, elevenlabs, deepinfra (shared OpenAI handler), command providers, and plugin dispatch. - xAI no longer forces English when nothing is configured (auto-detect). - Mistral Voxtral now receives a language hint when configured. - stt.groq.model is now honoured from config (previously env-only). - DEFAULT_CONFIG gains stt.language, stt.groq, stt.xai, stt.mistral.language. - Tests: tests/tools/test_stt_language_resolution.py (11 tests, sabotage- verified) + full transcription suite green (236 passed). Builds on cherry-picked contributor work from NousResearch#19786 (@zombopanda), NousResearch#23161 (@materemias), NousResearch#50684 (@BlackishGreen33).
What does this PR do?
Adds
stt.local.initial_promptsupport for the localfaster-whisperSTT provider.This lets users bias local transcription output, for example asking Chinese audio to be written in Simplified Chinese. The prompt is only passed when it is configured as a non-empty string, so the current default behavior stays unchanged.
Related Issue
Fixes #50181
Changes Made
initial_promptfrom the existingstt.localconfig block.initial_prompttofaster-whisperonly when it is a non-empty string.initial_promptvalues.cli-config.yaml.example.Configuration Example
Verification
Checklist
initial_prompthandling.cli-config.yaml.examplefor the new config key.