AshDavid12 commited on
Commit
74c8ebf
·
1 Parent(s): 6d8f3bd

trying to build-tempdir

Browse files
Files changed (1) hide show
  1. whisper_online.py +2 -0
whisper_online.py CHANGED
@@ -5,6 +5,7 @@ import librosa
5
  from functools import lru_cache
6
  import time
7
  import logging
 
8
 
9
  import io
10
  import soundfile as sf
@@ -121,6 +122,7 @@ class FasterWhisperASR(ASRBase):
121
 
122
  try:
123
  logging.info(f"Loading WhisperModel on device: ")
 
124
  model = WhisperModel(model_size_or_path, device="cuda", compute_type="float16", download_root=cache_dir)
125
  logging.info("Model loaded successfully.")
126
  except Exception as e:
 
5
  from functools import lru_cache
6
  import time
7
  import logging
8
+ import os
9
 
10
  import io
11
  import soundfile as sf
 
122
 
123
  try:
124
  logging.info(f"Loading WhisperModel on device: ")
125
+ cache_dir = os.environ.get('XDG_CACHE_HOME', tempfile.gettempdir())
126
  model = WhisperModel(model_size_or_path, device="cuda", compute_type="float16", download_root=cache_dir)
127
  logging.info("Model loaded successfully.")
128
  except Exception as e: