Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from transformers import pipeline | |
| # Load the summarization model | |
| summarizer = pipeline("summarization", model="facebook/bart-large-cnn") | |
| def summarize(text): | |
| summary = summarizer(text, max_length=300, min_length=100, do_sample=False) | |
| return summary[0]['summary_text'] | |
| demo = gr.Interface( | |
| fn=summarize, | |
| inputs=gr.Textbox(lines=10, label="Enter your text"), | |
| outputs=gr.Textbox(label="Summary"), | |
| title="Text Summarizer", | |
| description="Summarize large blocks of text using the facebook/bart-large-cnn model." | |
| ) | |
| demo.launch() | |