Omnibus commited on
Commit
fb04ca9
·
1 Parent(s): 1e634f8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -26,8 +26,11 @@ def scrape00(instring):
26
  number_of_pages = len(reader.pages)
27
  page = reader.pages[0]
28
  text = page.extract_text()
29
- summarizer = gr.Interface.load("huggingface/facebook/bart-large-cnn")
30
- sum_out = summarizer(text)
 
 
 
31
  return text, sum_out
32
 
33
  with gr.Blocks() as app:
 
26
  number_of_pages = len(reader.pages)
27
  page = reader.pages[0]
28
  text = page.extract_text()
29
+ try:
30
+ summarizer = gr.Interface.load("huggingface/facebook/bart-large-cnn")
31
+ sum_out = summarizer(text)
32
+ except Exception:
33
+ sum_out = "Error"
34
  return text, sum_out
35
 
36
  with gr.Blocks() as app: