mutisya commited on
Commit
1278823
1 Parent(s): e744c08

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -1,8 +1,11 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
  import time
 
4
 
5
- pipe = pipeline("automatic-speech-recognition", model="openai/whisper-base.en")
 
 
6
 
7
  def transcribe(audio, state=""):
8
  #print(audio)
 
1
  import gradio as gr
2
  from transformers import pipeline
3
  import time
4
+ import torch
5
 
6
+ device = "cuda:0" if torch.cuda.is_available() else "cpu"
7
+
8
+ pipe = pipeline("automatic-speech-recognition", model="openai/whisper-base.en", device=device)
9
 
10
  def transcribe(audio, state=""):
11
  #print(audio)