whisper.asr / app.py
LimaRaed's picture
Update app.py
bc3d280 verified
raw
history blame contribute delete
540 Bytes
import gradio as gr
from transformers import pipeline
# Load Whisper ASR pipeline
asr = pipeline("automatic-speech-recognition", model="openai/whisper-base")
# Transcription function
def transcribe(audio):
return asr(audio)["text"]
# Gradio interface
interface = gr.Interface(
fn=transcribe,
inputs=gr.Audio(type="filepath", label="Upload or Record Audio"),
outputs="text",
title="Whisper ASR Voice Recognition",
description="Transcribe speech using OpenAI's Whisper model."
)
# Launch the app
interface.launch()