Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,34 +31,25 @@ def start_summarize(long_text, model):
|
|
| 31 |
# summary = "It works!"
|
| 32 |
inf_learn = from_pretrained_fastai(repo_id)
|
| 33 |
summary = inf_learn.blurr_generate([long_text][0]['generated_texts']
|
| 34 |
-
|
| 35 |
else:
|
| 36 |
summary = long_text
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
summary = ""
|
| 45 |
-
st.caption(" © Aviv Lazar & Moran Shemesh")
|
| 46 |
|
| 47 |
with st.spinner('Please wait...'):
|
| 48 |
time.sleep(10)
|
| 49 |
-
|
| 50 |
st.title ("Text Summarization")
|
| 51 |
model_type = st.radio('Pick a model',['RankText', 'Bart'])
|
| 52 |
-
user_text = st.text_area('Enter or paste text to summarize')
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
st.button('Summarize', on_click=start_summarize, args=(user_text, model_type, ) )
|
| 58 |
# increment = st.button('Increment', on_click=increment_counter,
|
| 59 |
# args=(increment_value, ))
|
| 60 |
-
|
| 61 |
-
|
| 62 |
|
| 63 |
|
| 64 |
# summary = inf_learn.blurr_summarize(text)
|
|
|
|
| 31 |
# summary = "It works!"
|
| 32 |
inf_learn = from_pretrained_fastai(repo_id)
|
| 33 |
summary = inf_learn.blurr_generate([long_text][0]['generated_texts']
|
|
|
|
| 34 |
else:
|
| 35 |
summary = long_text
|
| 36 |
+
if summary!="":
|
| 37 |
+
st.markdown("Summary")
|
| 38 |
+
st.success(summary)
|
| 39 |
+
time.sleep(10)
|
| 40 |
+
st.select_slider('What do you think about the summary?', options=['Bad', 'Good', 'Excellent'], value=('Good'))
|
| 41 |
+
#end start_summarize
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
with st.spinner('Please wait...'):
|
| 44 |
time.sleep(10)
|
| 45 |
+
summary = ""
|
| 46 |
st.title ("Text Summarization")
|
| 47 |
model_type = st.radio('Pick a model',['RankText', 'Bart'])
|
| 48 |
+
user_text = st.text_area('Enter or paste text to summarize')
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
st.button('Summarize', on_click=start_summarize, args=(user_text, model_type, ) )
|
| 50 |
# increment = st.button('Increment', on_click=increment_counter,
|
| 51 |
# args=(increment_value, ))
|
| 52 |
+
st.caption(" © Aviv Lazar & Moran Shemesh")
|
|
|
|
| 53 |
|
| 54 |
|
| 55 |
# summary = inf_learn.blurr_summarize(text)
|