Spaces:
Running
Running
import gradio as gr | |
from transformers import pipeline | |
# Load the Whisper model | |
pipe = pipeline("automatic-speech-recognition", model="tarteel-ai/whisper-base-ar-quran") | |
# Define inference function | |
def transcribe(audio): | |
result = pipe(audio)["text"] | |
return result | |
# Gradio interface | |
interface = gr.Interface( | |
fn=transcribe, | |
inputs=gr.Audio(type="filepath", label="Upload Audio"), | |
outputs=gr.Textbox(label="Transcription"), | |
title="Arabic Quran Audio Transcriber", | |
description="Upload an audio file to transcribe it using Whisper (Quran Arabic model)." | |
) | |
interface.launch() | |