Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,2 +1,17 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
from transformers import pipeline
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
pipe = pipeline('summarization')
|
| 5 |
+
|
| 6 |
+
st.title("Text Summarization")
|
| 7 |
+
st.write("""##### This demo summarizes a given text. :sunglasses:""")
|
| 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 |
+
out = pipe(text)
|
| 13 |
+
st.table(out)
|
| 14 |
+
st.success('Nice one, you can enter another text!', icon="✅")
|
| 15 |
+
st.balloons()
|
| 16 |
+
else:
|
| 17 |
+
st.error("You did not enter a text", icon="🚨"
|