from transformers import pipeline import gradio as gr pipe = pipeline(model="ychafiqui/whisper-medium-darija") def transcribe(audio): text = pipe(audio)["text"] return text iface = gr.Interface( fn=transcribe, inputs=gr.Audio(sources=["microphone", "upload"], type="filepath"), outputs="text", title="Moroccan Darija Text-to-Speech", description="Realtime demo for Moroccan Darija speech recognition.", ) iface.launch()