File size: 590 Bytes
ba4f651
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr
from transformers import pipeline

# Use the NCAIR Yoruba model
# This might require a slightly larger Space (CPU Upgrade) or might run slowly on Free Tier
transcriber = pipeline("automatic-speech-recognition", model="NCAIR1/Yoruba-ASR")

def transcribe(audio):
    text = transcriber(audio)["text"]
    return text

iface = gr.Interface(
    fn=transcribe,
    inputs=gr.Audio(type="filepath"), # Upload or Record audio
    outputs="text",
    title="Yoruba Speech Transcriber",
    description="Speak or upload Yoruba audio to transcribe it to text."
)

iface.launch()