Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -14,8 +14,8 @@ from summarize import load_model_and_tokenizer, summarize_via_tokenbatches
|
|
14 |
from utils import load_example_filenames, truncate_word_count, saves_summary
|
15 |
from textrank import get_summary
|
16 |
|
17 |
-
example_path = "
|
18 |
-
nltk.download("stopwords")
|
19 |
|
20 |
logging.basicConfig(
|
21 |
level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s"
|
@@ -114,7 +114,7 @@ def proc_submission(
|
|
114 |
|
115 |
|
116 |
def load_single_example_text(
|
117 |
-
example_path: str or Path="
|
118 |
max_pages=20,
|
119 |
):
|
120 |
"""
|
@@ -125,6 +125,7 @@ def load_single_example_text(
|
|
125 |
global name_to_path
|
126 |
full_ex_path = name_to_path[example_path]
|
127 |
full_ex_path = Path(full_ex_path)
|
|
|
128 |
if full_ex_path.suffix == ".txt":
|
129 |
with open(full_ex_path, "r", encoding="utf-8", errors="ignore") as f:
|
130 |
raw_text = f.read()
|
@@ -277,4 +278,4 @@ if __name__ == "__main__":
|
|
277 |
outputs=[output_text, summary_text, summary_scores, text_file],
|
278 |
)
|
279 |
|
280 |
-
demo.launch(enable_queue=True, debug=True)
|
|
|
14 |
from utils import load_example_filenames, truncate_word_count, saves_summary
|
15 |
from textrank import get_summary
|
16 |
|
17 |
+
example_path = "./"
|
18 |
+
nltk.download("stopwords")
|
19 |
|
20 |
logging.basicConfig(
|
21 |
level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s"
|
|
|
114 |
|
115 |
|
116 |
def load_single_example_text(
|
117 |
+
example_path: str or Path="./example.txt",
|
118 |
max_pages=20,
|
119 |
):
|
120 |
"""
|
|
|
125 |
global name_to_path
|
126 |
full_ex_path = name_to_path[example_path]
|
127 |
full_ex_path = Path(full_ex_path)
|
128 |
+
|
129 |
if full_ex_path.suffix == ".txt":
|
130 |
with open(full_ex_path, "r", encoding="utf-8", errors="ignore") as f:
|
131 |
raw_text = f.read()
|
|
|
278 |
outputs=[output_text, summary_text, summary_scores, text_file],
|
279 |
)
|
280 |
|
281 |
+
demo.launch(share=True,enable_queue=True, debug=True)
|