Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,11 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
import time
|
|
|
4 |
|
5 |
-
|
|
|
|
|
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)
|