Spaces:
Runtime error
Runtime error
fracapuano
commited on
Commit
·
31eab61
1
Parent(s):
a134869
fix: give user choice between c&p and upload file
Browse files
summarization/summarization.py
CHANGED
@@ -36,8 +36,7 @@ def summarization_main():
|
|
36 |
|
37 |
OPTION_1 = "I want to input some text"
|
38 |
OPTION_2 = "I want to upload a file"
|
39 |
-
|
40 |
-
option = OPTION_2
|
41 |
|
42 |
# greenlight to summarize
|
43 |
text_is_given = False
|
@@ -96,9 +95,9 @@ def summarization_main():
|
|
96 |
summary = ""
|
97 |
chunks = split_string_into_token_chunks(text, tokenizer, chunk_size)
|
98 |
for chunk in chunks:
|
99 |
-
print(len(tokenizer.encode(chunk)))
|
100 |
chunk_summary = summarizer(chunk, max_length=user_max_length, min_length=min_length)
|
101 |
-
summary += chunk_summary[0]["summary_text"]
|
102 |
|
103 |
st.markdown("<h3 style='text-align: left'><b>Summary<b></h3>", unsafe_allow_html=True)
|
104 |
-
|
|
|
|
36 |
|
37 |
OPTION_1 = "I want to input some text"
|
38 |
OPTION_2 = "I want to upload a file"
|
39 |
+
option = st.radio("How would you like to start? Choose an option below", [OPTION_1, OPTION_2])
|
|
|
40 |
|
41 |
# greenlight to summarize
|
42 |
text_is_given = False
|
|
|
95 |
summary = ""
|
96 |
chunks = split_string_into_token_chunks(text, tokenizer, chunk_size)
|
97 |
for chunk in chunks:
|
|
|
98 |
chunk_summary = summarizer(chunk, max_length=user_max_length, min_length=min_length)
|
99 |
+
summary += "\n" + chunk_summary[0]["summary_text"]
|
100 |
|
101 |
st.markdown("<h3 style='text-align: left'><b>Summary<b></h3>", unsafe_allow_html=True)
|
102 |
+
print(summary)
|
103 |
+
st.write(summary)
|