Update handler.py
Browse files- handler.py +2 -2
handler.py
CHANGED
@@ -7,8 +7,8 @@ from transformers.pipelines.audio_utils import ffmpeg_read
|
|
7 |
SAMPLE_RATE=16000
|
8 |
class EndpointHandler():
|
9 |
def __init__(self, path=""):
|
10 |
-
|
11 |
-
|
12 |
"automatic-speech-recognition",
|
13 |
model="openai/whisper-large",
|
14 |
chunk_length_s=30,
|
|
|
7 |
SAMPLE_RATE=16000
|
8 |
class EndpointHandler():
|
9 |
def __init__(self, path=""):
|
10 |
+
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
11 |
+
pipe = pipeline(
|
12 |
"automatic-speech-recognition",
|
13 |
model="openai/whisper-large",
|
14 |
chunk_length_s=30,
|