tarteel-test / app.py
elina12's picture
Update app.py
97d695c
raw
history blame contribute delete
No virus
478 Bytes
from transformers import pipeline
model_id = "tarteel-ai/whisper-base-ar-quran"
pipe = pipeline("automatic-speech-recognition", model=model_id)
def transcribe(filepath):
output = pipe(
filepath,
max_new_tokens=10000,
chunk_length_s=30,
batch_size=8,
)
return output["text"]
import gradio as gr
iface = gr.Interface(
fn=transcribe,
inputs=gr.Audio(source="upload", type="filepath"),
outputs="text",
)
iface.launch()