Skip to content

The agent that grows with you

fix(stt): tolerate CAF work-dir cleanup errors

kshitijk4poor43833ed9f86b
diff --git a/tools/transcription_tools.py b/tools/transcription_tools.py
index 9ec6836e5cc..d9364c45239 100644
--- a/tools/transcription_tools.py
+++ b/tools/transcription_tools.py
@@ -417,7 +417,9 @@ def _transcribe_prepared_audio(
return error
# Never overwrite a neighboring WAV or leave converted voice notes behind.
if Path(file_path).suffix.lower() == ".caf":
- work_dir = cleanup.enter_context(TemporaryDirectory(prefix="hermes-caf-"))
+ work_dir = cleanup.enter_context(
+ TemporaryDirectory(prefix="hermes-caf-", ignore_cleanup_errors=True)
+ )
file_path = _convert_caf_to_wav(file_path, work_dir)
if not file_path:
return _error_result("CAF audio could not be converted to WAV.")