Spaces:
Sleeping
Sleeping
sotirios-slv
commited on
Commit
·
33bef80
1
Parent(s):
a61e46a
Switched to smaller model
Browse files
app.py
CHANGED
@@ -2,8 +2,13 @@ import logging
|
|
2 |
|
3 |
import gradio as gr
|
4 |
|
5 |
-
import torch
|
6 |
-
from transformers import
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
|
9 |
device = "cpu"
|
@@ -21,7 +26,9 @@ model = AutoModelForSpeechSeq2Seq.from_pretrained(
|
|
21 |
)
|
22 |
model.to(device)
|
23 |
|
24 |
-
processor =
|
|
|
|
|
25 |
|
26 |
pipe = pipeline(
|
27 |
task="automatic-speech-recognition",
|
|
|
2 |
|
3 |
import gradio as gr
|
4 |
|
5 |
+
# import torch
|
6 |
+
from transformers import (
|
7 |
+
AutoModelForSpeechSeq2Seq,
|
8 |
+
AutoProcessor,
|
9 |
+
pipeline,
|
10 |
+
WhisperProcessor,
|
11 |
+
)
|
12 |
|
13 |
|
14 |
device = "cpu"
|
|
|
26 |
)
|
27 |
model.to(device)
|
28 |
|
29 |
+
processor = WhisperProcessor.from_pretrained("openai/whisper-base.en")
|
30 |
+
|
31 |
+
# processor = AutoProcessor.from_pretrained(model_id)
|
32 |
|
33 |
pipe = pipeline(
|
34 |
task="automatic-speech-recognition",
|