8000 fix(transcribe): fall back when an engine won't import instead of failing the job by adeelahmad · Pull Request #58 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

fix(transcribe): fall back when an engine won't import instead of failing the job - #58

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-69lg68
Oct 3, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-69lg68

Conversation

@adeelahmad
Copy link
8000 Copy Markdown
Owner

Requested by Adeel · project thread

Before: a transcribe job failed with SystemExit: SenseVoice needs FunASR: uv sync --extra sensevoice whenever 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/venv volume 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 dev in Docker, set EXTRAS=sensevoice for SenseVoice, or run uv sync --extra whisper.

How: the engines raise EngineMissing (a ValueError, so the CLI prints it cleanly) instead of SystemExit. get_engine tries the configured engine first, then each installed one, and moves on whenever it gets EngineMissing. 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

…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
@adeelahmad adeelahmad self-assigned this Oct 3, 2026
@adeelahmad
adeelahmad merged commit d15249a into main Oct 3, 2026
0 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0