File size: 432 Bytes
e7b98f7
221b047
50c274f
 
 
e7b98f7
221b047
c1335fa
 
 
 
 
 
221b047
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import gradio as gr
from transformers import pipeline
import torch

device = "cuda:0" if torch.cuda.is_available() else "cpu"

pipeline = pipeline("automatic-speech-recognition",
  model="openai/whisper-medium",
  chunk_length_s=30,
  device=device,
  batch_size=8,
  )

iface = gr.Interface.from_pipeline(pipeline, inputs= gr.inputs.Audio(source="upload", type="filepath"), title="Audio Transcription App")
iface.launch(debug=True)