Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
| 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:
|