Spaces:
Sleeping
Sleeping
| 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() |