Close the audio_data file handle

This commit is contained in:
McCloudS
2024-07-13 14:11:59 -06:00
committed by GitHub
parent aac3ca8ba7
commit 4a2ee64e71

View File

@@ -454,6 +454,7 @@ def asr(
except Exception as e:
logging.info(f"Error processing or transcribing Bazarr {audio_file.filename}: {e}")
finally:
audio_file.close()
task_queue.task_done()
delete_model()
if result:
@@ -492,6 +493,7 @@ def detect_language(
logging.info(f"Error processing or transcribing Bazarr {audio_file.filename}: {e}")
finally:
audio_file.close()
task_queue.task_done()
delete_model()