Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
-
|
| 5 |
|
| 6 |
st.title("Text Summarization")
|
| 7 |
st.write("""##### This demo summarizes a given text. :sunglasses:""")
|
|
@@ -9,8 +9,8 @@ text = st.text_area('Enter some text in the box below!')
|
|
| 9 |
|
| 10 |
result = st.button("or click here")
|
| 11 |
if text or result:
|
| 12 |
-
|
| 13 |
-
st.table(
|
| 14 |
st.success('Nice one, you can enter another text!', icon="✅")
|
| 15 |
st.balloons()
|
| 16 |
else:
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
+
summarizer = pipeline('summarization')
|
| 5 |
|
| 6 |
st.title("Text Summarization")
|
| 7 |
st.write("""##### This demo summarizes a given text. :sunglasses:""")
|
|
|
|
| 9 |
|
| 10 |
result = st.button("or click here")
|
| 11 |
if text or result:
|
| 12 |
+
output = summarizer(text)
|
| 13 |
+
st.table(output)
|
| 14 |
st.success('Nice one, you can enter another text!', icon="✅")
|
| 15 |
st.balloons()
|
| 16 |
else:
|