From 01340c20c7233ce226b94c537045f65d6baee4a6 Mon Sep 17 00:00:00 2001 From: Purfview <69023953+Purfview@users.noreply.github.com> Date: Tue, 10 Dec 2024 18:35:02 +0000 Subject: [PATCH] Fixes OOM Errors - too high RAM usage by VAD Reported problems: https://github.com/SYSTRAN/faster-whisper/issues/1193 https://github.com/SYSTRAN/faster-whisper/issues/1169 VAD implementations consumes humongous memory amounts [original Silero doesn't have this problem] This PR should fix the OOM problem. Alt solution could be removing 'lru_cache'. --- faster_whisper/vad.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/faster_whisper/vad.py b/faster_whisper/vad.py index 9605931c..fa790acf 100644 --- a/faster_whisper/vad.py +++ b/faster_whisper/vad.py @@ -260,8 +260,9 @@ def __init__(self, encoder_path, decoder_path): ) from e opts = onnxruntime.SessionOptions() - opts.inter_op_num_threads = 0 - opts.intra_op_num_threads = 0 + opts.inter_op_num_threads = 1 + opts.intra_op_num_threads = 1 + opts.enable_cpu_mem_arena = False opts.log_severity_level = 4 self.encoder_session = onnxruntime.InferenceSession(