Spaces:
Runtime error
Runtime error
Eunchan Lee
commited on
Commit
·
ba6b10b
1
Parent(s):
7cb54c9
21-12-13
Browse files
app.py
CHANGED
@@ -12,8 +12,12 @@ st.header("Header: Summarization")
|
|
12 |
st.write("Information")
|
13 |
st.write("__Inputs__: Text your input article!!")
|
14 |
st.write("__Outputs__: Summarizing output text by Google-Pegasus! ")
|
|
|
|
|
|
|
|
|
15 |
def load_summary_model():
|
16 |
-
model_name = "google/pegasus-xsum"
|
17 |
summarizer = pipeline(task="summarization", model=model_name)
|
18 |
|
19 |
return summarizer
|
@@ -32,7 +36,7 @@ with st.form(key="my_form"):
|
|
32 |
display_text = ARTICLE + "\n\n"
|
33 |
text_input = st.text_area("Input any text you want to summaryize & classify here (keep in mind very long text will take a while to process):", display_text)
|
34 |
submit_button = st.form_submit_button(label='Submit')
|
35 |
-
with st.spinner('Loading Pretrained
|
36 |
summarizer = load_summary_model()
|
37 |
|
38 |
if submit_button:
|
|
|
12 |
st.write("Information")
|
13 |
st.write("__Inputs__: Text your input article!!")
|
14 |
st.write("__Outputs__: Summarizing output text by Google-Pegasus! ")
|
15 |
+
|
16 |
+
|
17 |
+
model_name= "google/pegasus-xsum"
|
18 |
+
|
19 |
def load_summary_model():
|
20 |
+
#model_name = "google/pegasus-xsum"
|
21 |
summarizer = pipeline(task="summarization", model=model_name)
|
22 |
|
23 |
return summarizer
|
|
|
36 |
display_text = ARTICLE + "\n\n"
|
37 |
text_input = st.text_area("Input any text you want to summaryize & classify here (keep in mind very long text will take a while to process):", display_text)
|
38 |
submit_button = st.form_submit_button(label='Submit')
|
39 |
+
with st.spinner('Loading Pretrained', model_name ,'Models (_please allow for 10 seconds_)...'):
|
40 |
summarizer = load_summary_model()
|
41 |
|
42 |
if submit_button:
|