import streamlit as st from transformers import pipeline st.set_page_config(page_title='🖊📄 Chat Summarization WebApp') st.title('🖊📄 Chat Summarization WebApp') predefined_text = """Nico: the moon is very beautiful tonight. Demo: I agree with you. Nico: My dream is to go to the moon one day. Demo: Are you serious? I'm scared about the space. Nico: So won't you come? Demo: I prefer to go to Lido Le Canne in Pulsano. Nico: Ahahah """ progress_text = "Summarization in progress on CPU. Please wait." text = st.text_area("Enter your chat", value=predefined_text, height=200) button = st.button('Summarize') pipe = pipeline("summarization", model="nicoladisabato/pegasus-samsum") if button: st.progress(0, text=progress_text) out = pipe(text) st.json(out)