hynt commited on
Commit
22d21f9
·
1 Parent(s): fbc5b9e

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +2 -2
utils.py CHANGED
@@ -5,7 +5,7 @@ import matplotlib.pylab as plt
5
  import librosa
6
  from transformers import pipeline
7
 
8
- def initialize_asr_pipeline(device: str = device, dtype=None):
9
  if dtype is None:
10
  dtype = (
11
  torch.float16
@@ -26,7 +26,7 @@ def initialize_asr_pipeline(device: str = device, dtype=None):
26
  def transcribe(ref_audio, language=None):
27
  global asr_pipe
28
  if asr_pipe is None:
29
- initialize_asr_pipeline(device=device)
30
  return asr_pipe(
31
  ref_audio,
32
  chunk_length_s=30,
 
5
  import librosa
6
  from transformers import pipeline
7
 
8
+ def initialize_asr_pipeline(device="cuda", dtype=None):
9
  if dtype is None:
10
  dtype = (
11
  torch.float16
 
26
  def transcribe(ref_audio, language=None):
27
  global asr_pipe
28
  if asr_pipe is None:
29
+ initialize_asr_pipeline(device="cuda")
30
  return asr_pipe(
31
  ref_audio,
32
  chunk_length_s=30,