whisperturbo / app.py
yasserrmd's picture
Update app.py
45853c5 verified
raw
history blame
637 Bytes
import gradio as gr
from transformers import pipeline
import spaces
# Load the Whisper model from Hugging Face
model = pipeline("automatic-speech-recognition", model="ylacombe/whisper-large-v3-turbo")
# Function to process audio input and transcribe it
@spaces.GPU
def transcribe(audio):
# Load and preprocess the audio
transcription = model(audio)["text"]
return transcription
# Gradio interface
interface = gr.Interface(
fn=transcribe,
inputs=gr.Audio(sources="microphone", type="filepath"),
outputs="text",
title="Whisper Voice Transcription with Hugging Face"
)
# Launch the app
interface.launch()