from transformers import pipeline import gradio as gr summarizer = pipeline("summarization", model = "facebook/bart-large-cnn") def get_summary(input): output = summarizer(input) return output[0]["summary_text"] demo = gr.Blocks() with demo: textbox = gr.TextBox(placeholder="Enter text to summarize...", lines=4) btn = gr.Button("Summarize") btn.click(get_summary, textbox, textbox) demo.launch()