Amruthaa's picture
Update app.py
c05bda0
raw
history blame
421 Bytes
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()