File size: 423 Bytes
3c2fc1b
c1d2c74
3c2fc1b
c1d2c74
 
3c2fc1b
c1d2c74
3c2fc1b
c1d2c74
3c2fc1b
c1d2c74
 
1
2
3
4
5
6
7
8
9
10
11
12
13
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()