Futuresony's picture
Rename app.py to app.pyy
4fa1b8c verified
raw
history blame contribute delete
423 Bytes
import gradio as gr
from transformers import pipeline
# Load the Whisper model using the pipeline from transformers
whisper = pipeline("automatic-speech-recognition", model="Futuresony/whisper-small-sw")
# Define the transcription function
def transcribe(audio):
return whisper(audio)["text"]
# Create the Gradio interface
gr.Interface(fn=transcribe, inputs=gr.Audio(type="filepath"), outputs=gr.Textbox()).launch()