Whisper-STT / app.py
mindspark121's picture
Create app.py
20ae1ed verified
raw
history blame
522 Bytes
import whisper
import gradio as gr
# Load Whisper Model
model = whisper.load_model("small") # Change to "base", "medium", or "large" if needed
def transcribe(audio):
"""Transcribe Speech to Text"""
result = model.transcribe(audio)
return result["text"]
# Gradio UI with Microphone
gr.Interface(
fn=transcribe,
inputs=gr.Audio(source="microphone", type="filepath"),
outputs="text",
title="Whisper Speech-to-Text",
description="Speak into the microphone and get text output.",
).launch()