File size: 767 Bytes
436b72c
2943332
436b72c
2943332
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import gradio as gr
from transformers import pipeline

# Chargez le modèle Whisper fine-tuné pour l'arabe coranique
model = pipeline(
    "automatic-speech-recognition",
    model="tarteel-ai/whisper-base-ar-quran"
)

def transcribe(audio):
    # Transcription de l'audio
    result = model(audio)
    return result["text"]

# Interface Gradio
demo = gr.Interface(
    fn=transcribe,
    inputs=gr.Audio(sources=["upload", "microphone"], type="filepath"),
    outputs="text",
    title="🕌 Transcription Coranique (Whisper)",
    description="""Transcription automatique de récitations coraniques en arabe 
                avec le modèle <a href="https://huggingface.co/tarteel-ai/whisper-base-ar-quran">tarteel-ai/whisper-base-ar-quran</a>."""
)

demo.launch()