Spaces:
Sleeping
Sleeping
File size: 442 Bytes
4164c85 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import gradio as gr
import yt_dlp
from transformers import pipeline
summarizer = pipeline("summarization")
def summarize(url):
ydl_opts = {"quiet": True}
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
info = ydl.extract_info(url, download=False)
text = info["description"]
out = summarizer(text[:1000])[0]["summary_text"]
return out
gr.Interface(summarize, "text", "text", title="YouTube Summarizer").launch() |