cjpais/Handy · error · anyhow::Error
SenseVoice transcription failed: {}
Error message
SenseVoice transcription failed: {} What it means
SenseVoiceModel::transcribe_with failed during ONNX inference. Handy builds SenseVoiceParams { language (zh/en/ja/ko/yue or None from normalize_cjk_language), use_itn: true } and the transcribe-rs call returns an ONNX Runtime error: session run failure, provider fault, unsupported language tensor, degenerate audio length, or corrupted Int8 artifacts. The engine stays loaded after the error (return_engine runs on the normal-error path).
Source
Thrown at src-tauri/src/managers/transcription.rs:1366
}),
LoadedEngine::SenseVoice(sense_voice_engine) => {
let language = match normalize_cjk_language(&validated_language) {
"zh" => Some("zh".to_string()),
"en" => Some("en".to_string()),
"ja" => Some("ja".to_string()),
"ko" => Some("ko".to_string()),
"yue" => Some("yue".to_string()),
_ => None,
};
applied_language_hint = language.clone();
let params = SenseVoiceParams {
language,
use_itn: Some(true),
};
sense_voice_engine
.transcribe_with(&audio, ¶ms)
.map(|r| r.text)
.map_err(|e| anyhow::anyhow!("SenseVoice transcription failed: {}", e))
}
LoadedEngine::GigaAM(gigaam_engine) => gigaam_engine
.transcribe(&audio, &TranscribeOptions::default())
.map(|r| r.text)
.map_err(|e| anyhow::anyhow!("GigaAM transcription failed: {}", e)),
LoadedEngine::Canary(canary_engine) => {
output_was_translated = settings.translate_to_english;
let lang = if validated_language == "auto" {
None
} else {
Some(validated_language.clone())
};
applied_language_hint = lang.clone();
let options = TranscribeOptions {
language: lang,
translate: settings.translate_to_english,
..Default::default()
};View on GitHub (pinned to 98a4d80cce)
Solutions
- Retry with a longer, clean recording
- Re-download the SenseVoice model if failures repeat
- Free memory/VRAM and close competing GPU apps
- Test with language set to auto to rule out language-head issues
- Update Handy for ort/transcribe-rs compatibility
Example fix
// before
sense_voice_engine.transcribe_with(&audio, ¶ms).map_err(|e| anyhow::anyhow!("SenseVoice transcription failed: {}", e))?;
// after — retry once without language hint if the hinted run fails (rules out language-head issues)
let r = match sense_voice_engine.transcribe_with(&audio, ¶ms) {
Ok(r) => r,
Err(e) if params.language.is_some() => {
warn!("SenseVoice failed with language hint ({}), retrying auto", e);
sense_voice_engine.transcribe_with(&audio, &SenseVoiceParams::default())?
}
Err(e) => return Err(anyhow::anyhow!("SenseVoice transcription failed: {}", e)),
}; Defensive patterns
Strategy: try-catch
Validate before calling
// Validate audio length and finiteness; note language is limited to zh/en/ja/ko/yue or auto anyhow::ensure!(audio.len() >= 1600, "audio too short for SenseVoice"); anyhow::ensure!(audio.iter().all(|s| s.is_finite()), "non-finite audio");
Try / catch
match tm.transcribe(audio.clone()) {
Err(e) if e.to_string().contains("SenseVoice transcription failed") && language != "auto" => {
set_language("auto"); tm.transcribe(audio) // drop the hint and retry
}
Err(e) if e.to_string().contains("SenseVoice transcription failed") => reDownloadModel_and_retry(&model_id, audio),
other => other,
} Prevention
- Record at least ~1s of speech so VAD leaves usable audio
- Stick to SenseVoice's supported languages (zh, en, ja, ko, yue) or auto
- Re-download the Int8 pack after any interrupted fetch
- Keep memory headroom for ITN-enabled decode
When it happens
Trigger: sense_voice_engine.transcribe_with(&audio, ¶ms) errors: ORT session run failure; audio too short after VAD; GPU execution-provider failure; corrupted/missing Int8 model files; memory exhaustion.
Common situations: Short recordings trimmed to near-nothing by VAD; AV quarantine or partial download of the SenseVoice pack; provider DLL/so issues after update; multilingual selections (the zh/en/ja/ko/yue mapping) combined with a model build lacking the language head.
Related errors
- Cohere transcription failed: {}
- Failed to load SenseVoice model {}: {}
- Parakeet transcription failed: {}
- Moonshine transcription failed: {}
- Moonshine streaming transcription failed: {}
AI-assisted analysis of cjpais/Handy@98a4d80cce (2026-08-16).
Data as JSON: /api/errors/b4c14bbb097145ce.
Report an issue: GitHub.