Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,10 @@ import whisper
|
|
5 |
from transformers import pipeline, MarianMTModel, MarianTokenizer
|
6 |
import torch
|
7 |
import shutil
|
|
|
|
|
|
|
|
|
8 |
|
9 |
# Load models
|
10 |
whisper_model = whisper.load_model("small")
|
@@ -69,13 +73,13 @@ def download_summary(text):
|
|
69 |
return filename
|
70 |
|
71 |
# UI
|
72 |
-
with gr.Blocks(theme=gr.themes.Soft(), title="🎥 YouTube Video Summarizer
|
73 |
gr.Markdown("## 🧠 Multilingual YouTube Summarizer")
|
74 |
gr.Markdown("Upload a video link and get the transcript, English translation, and summary.")
|
75 |
|
76 |
with gr.Row():
|
77 |
youtube_input = gr.Text(label="YouTube Video URL", placeholder="https://www.youtube.com/watch?v=...")
|
78 |
-
submit_btn = gr.Button("Transcribe & Summarize")
|
79 |
|
80 |
with gr.Row():
|
81 |
with gr.Column():
|
|
|
5 |
from transformers import pipeline, MarianMTModel, MarianTokenizer
|
6 |
import torch
|
7 |
import shutil
|
8 |
+
import warnings
|
9 |
+
|
10 |
+
# Suppress harmless CPU warning from Whisper
|
11 |
+
warnings.filterwarnings("ignore", message="FP16 is not supported on CPU; using FP32 instead")
|
12 |
|
13 |
# Load models
|
14 |
whisper_model = whisper.load_model("small")
|
|
|
73 |
return filename
|
74 |
|
75 |
# UI
|
76 |
+
with gr.Blocks(theme=gr.themes.Soft(), title="🎥 YouTube Video Summarizer") as demo:
|
77 |
gr.Markdown("## 🧠 Multilingual YouTube Summarizer")
|
78 |
gr.Markdown("Upload a video link and get the transcript, English translation, and summary.")
|
79 |
|
80 |
with gr.Row():
|
81 |
youtube_input = gr.Text(label="YouTube Video URL", placeholder="https://www.youtube.com/watch?v=...")
|
82 |
+
submit_btn = gr.Button("🎯 Transcribe & Summarize")
|
83 |
|
84 |
with gr.Row():
|
85 |
with gr.Column():
|