nickmuchi commited on
Commit
9b9551b
·
1 Parent(s): 33ebb15

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -211,7 +211,7 @@ if summarize:
211
  else:
212
  text_to_summarize = clean_text
213
  # extractive summarizer
214
-
215
  with st.spinner(
216
  text="Loading Facebook-Bart Model and Extracting summary. This might take a few seconds depending on the length of your text..."
217
  ):
@@ -219,20 +219,20 @@ if summarize:
219
  summarized_text = summarizer_model(text_to_summarize, max_length=100, min_length=30)
220
  summarized_text = ' '.join([summ['summary_text'] for summ in summarized_text])
221
 
222
- elif model_type == "Sshleifer-DistilBart":
223
- if is_url:
224
- text_to_summarize = chunks
225
- else:
226
- text_to_summarize = clean_text
227
  # extractive summarizer
228
-
229
  with st.spinner(
230
  text="Loading Facebook-Bart Model and Extracting summary. This might take a few seconds depending on the length of your text..."
231
  ):
232
  summarizer_model = schleifer_model()
233
  summarized_text = summarizer_model(text_to_summarize, max_length=100, min_length=30)
234
  summarized_text = ' '.join([summ['summary_text'] for summ in summarized_text])
235
-
236
  # final summarized output
237
  st.subheader("Summarized text")
238
 
 
211
  else:
212
  text_to_summarize = clean_text
213
  # extractive summarizer
214
+
215
  with st.spinner(
216
  text="Loading Facebook-Bart Model and Extracting summary. This might take a few seconds depending on the length of your text..."
217
  ):
 
219
  summarized_text = summarizer_model(text_to_summarize, max_length=100, min_length=30)
220
  summarized_text = ' '.join([summ['summary_text'] for summ in summarized_text])
221
 
222
+ elif model_type == "Sshleifer-DistilBart":
223
+ if is_url:
224
+ text_to_summarize = chunks
225
+ else:
226
+ text_to_summarize = clean_text
227
  # extractive summarizer
228
+
229
  with st.spinner(
230
  text="Loading Facebook-Bart Model and Extracting summary. This might take a few seconds depending on the length of your text..."
231
  ):
232
  summarizer_model = schleifer_model()
233
  summarized_text = summarizer_model(text_to_summarize, max_length=100, min_length=30)
234
  summarized_text = ' '.join([summ['summary_text'] for summ in summarized_text])
235
+
236
  # final summarized output
237
  st.subheader("Summarized text")
238