Spaces:
Sleeping
Sleeping
import streamlit as st | |
from transformers import pipeline | |
# Load pipelines | |
pipe = pipeline("summarization", model="facebook/bart-large-cnn") | |
# Application | |
st.title("Make a summarization!") | |
user_input = st.text_input("Enter text to summarize:") | |
if st.button("Summarize Me!"): | |
if user_input: | |
with st.spinner('Summarizing...'): | |
result = pipe(user_input, max_length = 100) | |
summarization = result[0]['summary_text'] | |
st.write(f"Summary: {summarization}") | |
else: | |
st.warning("Please enter some text to summarize!") |