Spaces:
Sleeping
Sleeping
Bouaziz-bad commited on
Commit ·
63b20f3
1
Parent(s): b386b22
Fix Gradio: remove deprecated allow_screenshot
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
import gradio as gr
|
| 3 |
from backend import KabyleASR
|
| 4 |
|
| 5 |
-
# Initialize ASR
|
| 6 |
asr = KabyleASR()
|
| 7 |
|
| 8 |
def transcribe_audio(audio):
|
|
@@ -10,16 +10,23 @@ def transcribe_audio(audio):
|
|
| 10 |
return "Please upload an audio file."
|
| 11 |
return asr.transcribe(audio)
|
| 12 |
|
| 13 |
-
# Gradio Interface
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
# Launch without SSR
|
| 25 |
if __name__ == "__main__":
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
from backend import KabyleASR
|
| 4 |
|
| 5 |
+
# Initialize ASR
|
| 6 |
asr = KabyleASR()
|
| 7 |
|
| 8 |
def transcribe_audio(audio):
|
|
|
|
| 10 |
return "Please upload an audio file."
|
| 11 |
return asr.transcribe(audio)
|
| 12 |
|
| 13 |
+
# Gradio Interface (without deprecated args)
|
| 14 |
+
with gr.Blocks() as demo:
|
| 15 |
+
gr.Markdown("""
|
| 16 |
+
# 🎤 Tanti: Kabyle ASR (Free Tier)
|
| 17 |
+
Upload a Kabyle audio file. Transcription may take 1–2 minutes per 30 seconds of audio.
|
| 18 |
+
""")
|
| 19 |
+
|
| 20 |
+
with gr.Row():
|
| 21 |
+
audio_input = gr.Audio(sources=["upload"], type="filepath", label="Upload Audio")
|
| 22 |
+
|
| 23 |
+
with gr.Row():
|
| 24 |
+
transcribe_btn = gr.Button("Transcribe")
|
| 25 |
+
|
| 26 |
+
with gr.Row():
|
| 27 |
+
output_text = gr.Textbox(label="Transcription", lines=8)
|
| 28 |
+
|
| 29 |
+
transcribe_btn.click(fn=transcribe_audio, inputs=audio_input, outputs=output_text)
|
| 30 |
|
| 31 |
# Launch without SSR
|
| 32 |
if __name__ == "__main__":
|