yellowcandle's picture
Add Whisper speech recognition demo using Gradio
efe54ed unverified
raw
history blame
352 Bytes
import gradio as gr
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("automatic-speech-recognition", model="openai/whisper-large-v3")
def transcribe_audio(audio):
return pipe(audio)
demo = gr.Interface(fn=transcribe_audio, inputs=gr.Audio(source="upload", type="filepath"), outputs="text")
demo.launch()