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

trying to build-tempdir

Browse files
Files changed (2) hide show
  1. infer.py +1 -1
  2. whisper_online.py +3 -1
infer.py CHANGED
@@ -38,7 +38,7 @@ logging.info(f"Selected model name: {model_name}")
38
  try:
39
  lan = 'he'
40
  logging.info(f"Attempting to initialize FasterWhisperASR with device: {device}")
41
- cache_dir = os.environ.get('XDG_CACHE_HOME', tempfile.gettempdir())
42
  model = whisper_online.FasterWhisperASR(lan=lan, modelsize=model_name, cache_dir=None, model_dir=None)
43
  logging.info("FasterWhisperASR model initialized successfully.")
44
  except Exception as e:
 
38
  try:
39
  lan = 'he'
40
  logging.info(f"Attempting to initialize FasterWhisperASR with device: {device}")
41
+ #cache_dir = os.environ.get('XDG_CACHE_HOME', tempfile.gettempdir())
42
  model = whisper_online.FasterWhisperASR(lan=lan, modelsize=model_name, cache_dir=None, model_dir=None)
43
  logging.info("FasterWhisperASR model initialized successfully.")
44
  except Exception as e:
whisper_online.py CHANGED
@@ -6,6 +6,7 @@ from functools import lru_cache
6
  import time
7
  import logging
8
  import os
 
9
 
10
  import io
11
  import soundfile as sf
@@ -122,7 +123,8 @@ class FasterWhisperASR(ASRBase):
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:
 
6
  import time
7
  import logging
8
  import os
9
+ import tempfile
10
 
11
  import io
12
  import soundfile as sf
 
123
 
124
  try:
125
  logging.info(f"Loading WhisperModel on device: ")
126
+ logging.info(f"Cache directory: {tempfile.gettempdir()}") # Log the temp directory
127
+ cache_dir = os.getenv('XDG_CACHE_HOME', tempfile.gettempdir())
128
  model = WhisperModel(model_size_or_path, device="cuda", compute_type="float16", download_root=cache_dir)
129
  logging.info("Model loaded successfully.")
130
  except Exception as e: