Spaces:
Runtime error
Runtime error
Update speech.py
Browse files
speech.py
CHANGED
@@ -1,4 +1,11 @@
|
|
1 |
#Build a shareable app with Gradio
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
from transformers import pipeline
|
4 |
asr = pipeline(task="automatic-speech-recognition",
|
|
|
1 |
#Build a shareable app with Gradio
|
2 |
+
import torch
|
3 |
+
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
|
4 |
+
#from datasets import load_dataset
|
5 |
+
|
6 |
+
|
7 |
+
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
8 |
+
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
|
9 |
|
10 |
from transformers import pipeline
|
11 |
asr = pipeline(task="automatic-speech-recognition",
|