Spaces:
Runtime error
Runtime error
Update app.py
#1
by abdelazim2008ombadi - opened
app.py
CHANGED
|
@@ -1,12 +1,16 @@
|
|
| 1 |
-
# app.py — MINIMAL GUARANTEED INIT for Hugging Face Spaces (SDK: gradio)
|
| 2 |
import gradio as gr
|
|
|
|
| 3 |
|
| 4 |
-
|
| 5 |
-
return f"Startup OK ✅ Hello, {name or 'world'}!"
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
|
|
|
| 9 |
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import whisper
|
| 3 |
|
| 4 |
+
model = whisper.load_model("base")
|
|
|
|
| 5 |
|
| 6 |
+
def transcribe(video):
|
| 7 |
+
result = model.transcribe(video, language="ar")
|
| 8 |
+
return result["text"]
|
| 9 |
|
| 10 |
+
gr.Interface(
|
| 11 |
+
fn=transcribe,
|
| 12 |
+
inputs=gr.Video(label="ارفع فيديو"),
|
| 13 |
+
outputs=gr.Textbox(label="النص"),
|
| 14 |
+
title="Captions AI",
|
| 15 |
+
description="تحويل الفيديو إلى نص بالذكاء الاصطناعي"
|
| 16 |
+
).launch()
|