Spaces:
Sleeping
Sleeping
File size: 894 Bytes
aab61cd 93e6695 63b20f3 aab61cd 93e6695 aab61cd 93e6695 63b20f3 3697d7f aab61cd |
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 26 27 28 29 30 31 32 33 |
# app.py
import gradio as gr
from backend import KabyleASR
# Initialize ASR
asr = KabyleASR()
def transcribe_audio(audio):
if audio is None:
return "Please upload an audio file."
return asr.transcribe(audio)
# Gradio Interface (without deprecated args)
with gr.Blocks() as demo:
gr.Markdown("""
# 🎤 Tanti: Kabyle ASR (Free Tier)
Upload a Kabyle audio file. Transcription may take 1–2 minutes per 30 seconds of audio.
""")
with gr.Row():
audio_input = gr.Audio(sources=["upload"], type="filepath", label="Upload Audio")
with gr.Row():
transcribe_btn = gr.Button("Transcribe")
with gr.Row():
output_text = gr.Textbox(label="Transcription", lines=8)
transcribe_btn.click(fn=transcribe_audio, inputs=audio_input, outputs=output_text)
# Launch without SSR
if __name__ == "__main__":
demo.launch(ssr_mode=False) |