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()