Spaces:
Sleeping
Sleeping
T.Masuda
commited on
Commit
·
2dbcc16
1
Parent(s):
8a11b0e
update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,11 @@ import gradio as gr
|
|
2 |
import torch
|
3 |
from transformers import pipeline
|
4 |
|
|
|
|
|
|
|
5 |
device = 'cuda:0' if torch.cuda.is_available() else 'cpu'
|
6 |
-
pipe = pipeline('automatic-speech-recognition', model=
|
7 |
|
8 |
def speech_to_text(mic, upload, state):
|
9 |
if state['active'] == 1:
|
|
|
2 |
import torch
|
3 |
from transformers import pipeline
|
4 |
|
5 |
+
#modelname = 'openai/whisper-large-v2'
|
6 |
+
modelname = 'openai/whisper-small'
|
7 |
+
|
8 |
device = 'cuda:0' if torch.cuda.is_available() else 'cpu'
|
9 |
+
pipe = pipeline('automatic-speech-recognition', model=modelname, chunk_length_s=30, device=device)
|
10 |
|
11 |
def speech_to_text(mic, upload, state):
|
12 |
if state['active'] == 1:
|