Spaces:
Running
on
Zero
Running
on
Zero
ASR model changed to whisper-tiny
Browse files
app.py
CHANGED
@@ -25,13 +25,14 @@ def asr_transcriber(audio_file):
|
|
25 |
|
26 |
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
|
27 |
|
28 |
-
#
|
29 |
-
#
|
|
|
30 |
flash = False
|
31 |
ts = True
|
32 |
|
33 |
#Try to optimize when CPU and float32
|
34 |
-
model_id = "openai/whisper-
|
35 |
|
36 |
# Initialize the ASR pipeline
|
37 |
pipe = pipeline(
|
@@ -39,6 +40,7 @@ def asr_transcriber(audio_file):
|
|
39 |
model=model_id,
|
40 |
torch_dtype=torch_dtype,
|
41 |
device=device_id,
|
|
|
42 |
)
|
43 |
|
44 |
if device_id == "mps":
|
|
|
25 |
|
26 |
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
|
27 |
|
28 |
+
#Mac runtime
|
29 |
+
#device_id = "mps"
|
30 |
+
#torch_dtype = torch.float16
|
31 |
flash = False
|
32 |
ts = True
|
33 |
|
34 |
#Try to optimize when CPU and float32
|
35 |
+
model_id = "openai/whisper-tiny"
|
36 |
|
37 |
# Initialize the ASR pipeline
|
38 |
pipe = pipeline(
|
|
|
40 |
model=model_id,
|
41 |
torch_dtype=torch_dtype,
|
42 |
device=device_id,
|
43 |
+
device_map="auto"
|
44 |
)
|
45 |
|
46 |
if device_id == "mps":
|