msaelices commited on
Commit
bb08fe0
1 Parent(s): 87976b0

Do not initialize CUDNN if cuda is not the configured device

Browse files
Files changed (2) hide show
  1. README.md +0 -1
  2. engines.py +4 -3
README.md CHANGED
@@ -9,7 +9,6 @@ app_file: app.py
9
  pinned: false
10
  license: mit
11
  ---
12
-
13
  # Note taker
14
 
15
  This Streamlit app allows users to upload an audio file, transcribe the audio using WhisperX or AssemblyAI, and summarize the transcription with GPT.
 
9
  pinned: false
10
  license: mit
11
  ---
 
12
  # Note taker
13
 
14
  This Streamlit app allows users to upload an audio file, transcribe the audio using WhisperX or AssemblyAI, and summarize the transcription with GPT.
engines.py CHANGED
@@ -120,8 +120,9 @@ def _setup_whisperx(device, compute_type):
120
  if _whisperx_initialized:
121
  return
122
  s = 32
123
- dev = torch.device('cuda')
124
- # Prevent CUDNN_STATUS_NOT_INITIALIZED RuntimeError using pytorch
125
- torch.nn.functional.conv2d(torch.zeros(s, s, s, s, device=dev), torch.zeros(s, s, s, s, device=dev))
 
126
 
127
  _whisperx_model = whisperx.load_model('large-v2', device, compute_type=compute_type)
 
120
  if _whisperx_initialized:
121
  return
122
  s = 32
123
+ if device == 'cuda':
124
+ # Prevent CUDNN_STATUS_NOT_INITIALIZED RuntimeError using pytorch
125
+ dev = torch.device(device)
126
+ torch.nn.functional.conv2d(torch.zeros(s, s, s, s, device=dev), torch.zeros(s, s, s, s, device=dev))
127
 
128
  _whisperx_model = whisperx.load_model('large-v2', device, compute_type=compute_type)