Spaces:
Configuration error
Configuration error
| import streamlit as st | |
| from transformers import pipeline | |
| # Set page title | |
| st.set_page_config(page_title="Text Summarizer", layout="centered") | |
| # Title and input | |
| st.title("π Text Summarizer using BART") | |
| text = st.text_area("Enter the text you want to summarize:", height=300) | |
| # When button clicked | |
| if st.button("Summarize"): | |
| with st.spinner("Generating summary..."): | |
| summarizer = pipeline("summarization", model="facebook/bart-large-cnn") | |
| summary = summarizer(text, max_length=130, min_length=30, do_sample=False) | |
| st.success("Summary:") | |
| st.write(summary[0]['summary_text']) | |