From 5c448df3ce44a7bbfe6835086c4ea6840caafe56 Mon Sep 17 00:00:00 2001 From: zackees Date: Sat, 22 Jun 2024 13:39:00 -0700 Subject: [PATCH] Add environment variable for MPS high watermark ratio --- transcribe_anything/insanely_fast_whisper.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/transcribe_anything/insanely_fast_whisper.py b/transcribe_anything/insanely_fast_whisper.py index e0179cd..eb8ad35 100644 --- a/transcribe_anything/insanely_fast_whisper.py +++ b/transcribe_anything/insanely_fast_whisper.py @@ -199,6 +199,10 @@ def run_insanely_fast_whisper( # ffmpeg paths have to be installed or else the backend tool will fail. static_ffmpeg.add_paths() env = get_environment() + if sys.platform == "darwin": + # Attempts fixed recommended for the mps machines. This seems + # to be necessary since a recent update. + env["PYTORCH_MPS_HIGH_WATERMARK_RATIO"] = "0.7" device_id = get_device_id() cmd_list = [] output_dir.mkdir(parents=True, exist_ok=True)