Files changed (1) hide show
  1. app.py +12 -8
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
- def ping(name: str) -> str:
5
- return f"Startup OK ✅ Hello, {name or 'world'}!"
6
 
7
- demo = gr.Interface(fn=ping, inputs="text", outputs="text", title="Gradio Space is running")
8
- app = demo # ← 念のため app と demo の両方を公開
 
9
 
10
- # 注意:
11
- # - __main__ で launch() は不要(Spaces が自動で起動します)
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()