Summarizer / app.py
mfernezir's picture
Update app.py
17f4304
raw
history blame contribute delete
469 Bytes
from transformers import pipeline, Conversation
import gradio as gr
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
def summarizer_bot(message, history):
return summarizer(message, min_length=5, max_length=140)[0]['summary_text']
demo_summarizer = gr.ChatInterface(
summarizer_bot, title="Summarizer Chatbot",
description="Enter your text, and the chatbot will return the summarized version.")
demo_summarizer.launch(share=True)