OOlajide commited on
Commit
a64958d
1 Parent(s): d7cee39

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -69,13 +69,13 @@ elif option == "Text summarization":
69
  if source == "I want to input some text":
70
  with open("sample.txt", "r") as text_file:
71
  sample_text = text_file.read()
72
- text = st.text_area("Input a text in English (10,000 characters max)", value=sample_text, max_chars=10000, height=330)
73
  button = st.button("Get summary")
74
  if button:
75
  summarizer = summarization_model()
76
  with st.spinner(text="Summarizing text..."):
77
- summary = summarizer(text)
78
- st.write(summary)
79
 
80
  elif source == "I want to upload a file":
81
  uploaded_file = st.file_uploader("Choose a .txt file to upload", type=["txt"])
 
69
  if source == "I want to input some text":
70
  with open("sample.txt", "r") as text_file:
71
  sample_text = text_file.read()
72
+ text = st.text_area("Input a text in English (10,000 characters max) or use the example below", value=sample_text, max_chars=10000, height=330)
73
  button = st.button("Get summary")
74
  if button:
75
  summarizer = summarization_model()
76
  with st.spinner(text="Summarizing text..."):
77
+ summary = summarizer(text, max_length=130, min_length=30)
78
+ st.write(summary["0"]["summary_text"])
79
 
80
  elif source == "I want to upload a file":
81
  uploaded_file = st.file_uploader("Choose a .txt file to upload", type=["txt"])