Spaces:
Runtime error
Runtime error
import streamlit as st | |
from transformers import pipeline | |
def getPipeline(): | |
return pipeline("summarization") | |
def btnSummarizeAction(text): | |
summarizer = getPipeline() | |
output = summarizer(text) | |
st.write("# Summary") | |
st.write(output[0]['summary_text']) | |
def app(): | |
st.title("Summarization App") | |
st.write("This is my first app using the Hugging Face transformers library.") | |
text = st.text_area('Text to summarize', 'Enter text here...') | |
if st.button('Summarize'): | |
if text is not None: | |
btnSummarizeAction(text) | |
else: | |
st.write("Please enter some text to summarize") | |
if __name__ == "__main__": | |
app() |