Julienxu commited on
Commit
cab6c5a
1 Parent(s): 2ba9330

Update speech.py

Browse files
Files changed (1) hide show
  1. speech.py +7 -0
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",