Repository navigation
fix(transcribe): fall back when an engine won't import instead of failing the job - #58
Merged
Merged
Conversation
…ling the job SenseVoice (and Whisper) raised SystemExit when their packages were missing or broken, and get_engine only fell back when the module wasn't found at all. Now engines raise EngineMissing, get_engine tries the next installed engine on it, and with none at all the error says how to add one in Docker or natively. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WKWZ9HYUtbgw8HSLwqbmot
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.
Requested by Adeel · project thread
Before: a transcribe job failed with
SystemExit: SenseVoice needs FunASR: uv sync --extra sensevoicewhenever the fallback didn't kick in. That happened when FunASR was present but wouldn't import (e.g. without PyTorch), or when no engine was installed at all (such as a dev container still using a stale/opt/venvvolume from before faster-whisper shipped).After: when an engine's packages are missing or won't import, the job moves on to the next installed engine and notes it in the log, along with how to add the missing one. If no engine is installed, the step fails with a plain error that explains how to add one: rebuild with
make devin Docker, setEXTRAS=sensevoicefor SenseVoice, or runuv sync --extra whisper.How: the engines raise
EngineMissing(aValueError, so the CLI prints it cleanly) instead ofSystemExit.get_enginetries the configured engine first, then each installed one, and moves on whenever it getsEngineMissing. The docs now describe the fallback and how to turn on SenseVoice in Docker. The images stay lean: SenseVoice pulls in PyTorch, so it remains opt-in.Tests: the full backend suite gives 339 passed, 1 failed. The failure is
test_conversion(LibreOffice in this container), and it fails on main too.🤖 Generated with Claude Code
https://claude.ai/code/session_01WKWZ9HYUtbgw8HSLwqbmot
Generated by Claude Code