Skip to content

Commit

Permalink
Add environment variable for MPS high watermark ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
zackees committed Jun 22, 2024
1 parent 62ab0f1 commit 5c448df
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions transcribe_anything/insanely_fast_whisper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5c448df

Please # to comment.