Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,24 +1,25 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
import
|
| 3 |
|
| 4 |
-
# Load Whisper model
|
| 5 |
-
|
| 6 |
|
| 7 |
# Function to convert video to text
|
| 8 |
def video_to_text(video):
|
| 9 |
-
|
| 10 |
-
|
|
|
|
| 11 |
|
| 12 |
-
with gr.Blocks() as demo:
|
| 13 |
gr.Markdown(
|
| 14 |
"""
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
1. Upload
|
| 20 |
-
2.
|
| 21 |
-
3. Copy
|
| 22 |
"""
|
| 23 |
)
|
| 24 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
|
| 4 |
+
# Load Hugging Face's hosted Whisper model (small, fast)
|
| 5 |
+
asr = pipeline("automatic-speech-recognition", model="openai/whisper-small")
|
| 6 |
|
| 7 |
# Function to convert video to text
|
| 8 |
def video_to_text(video):
|
| 9 |
+
# Hugging Face pipeline can take audio from video
|
| 10 |
+
text = asr(video)["text"]
|
| 11 |
+
return text
|
| 12 |
|
| 13 |
+
with gr.Blocks(theme=gr.themes.Default(primary_hue="blue")) as demo:
|
| 14 |
gr.Markdown(
|
| 15 |
"""
|
| 16 |
+
# 🎥 Video-to-Text AI Tool
|
| 17 |
+
Convert your videos into text transcripts in **seconds** — powered by Hugging Face Whisper.
|
| 18 |
+
---
|
| 19 |
+
**Steps:**
|
| 20 |
+
1. Upload a short video (MP4, MOV, MKV, etc.).
|
| 21 |
+
2. Click **Generate Transcript**.
|
| 22 |
+
3. Copy your transcript.
|
| 23 |
"""
|
| 24 |
)
|
| 25 |
|