Spaces:
Running
Running
Update utils.py
Browse files
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
|
| 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=
|
| 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,
|