Wisdom882 commited on
Commit
9cd93a7
·
1 Parent(s): 1398a8f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,7 +1,7 @@
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:""")
@@ -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
- out = pipe(text)
13
- st.table(out)
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: