saidsef's picture
fix: list to string
a0694a6 verified
raw
history blame
577 Bytes
import streamlit as st
from transformers import pipeline
st.set_page_config(page_title="Text Summarisation", page_icon="🤖", layout="wide", initial_sidebar_state="expanded",)
st.title("Text Summarisation")
pipe = pipeline(task="summarization", model="facebook/bart-large-cnn")
text = st.text_area("Summarise the following")
if text:
out = pipe(text, do_sample=False)
st.write(out)
st.write(f"{type(out)}, length: {len(out)}")
if len(out) >= 1:
st.download_button("summary download", ",".join(out), file_name="summersation.txt", mime="text/plain")