Spaces:
Runtime error
Runtime error
Update app.py
Browse files13 unmodified lines141516171819202192 unmodified lines1141151161171181191204 unmodified lines125126127128129130146 unmodified lines27727827928013 unmodified linesfrom utils import load_example_filenames, truncate_word_count, saves_summaryfrom textrank import get_summaryexample_path = "/content/drive/MyDrive/space/"nltk.download("stopwords") # TODO=find where this requirement originates fromlogging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s"92 unmodified linesdef load_single_example_text(example_path: str or Path="/content/example.txt",max_pages=20,):"""4 unmodified linesglobal name_to_pathfull_ex_path = name_to_path[example_path]full_ex_path = Path(full_ex_path)if full_ex_path.suffix == ".txt":with open(full_ex_path, "r", encoding="utf-8", errors="ignore") as f:raw_text = f.read()146 unmodified linesoutputs=[output_text, summary_text, summary_scores, text_file],)demo.launch(enable_queue=True, debug=True)13 unmodified lines141516171819202192 unmodified lines1141151161171181191204 unmodified lines125126127128129130131146 unmodified lines27827928028113 unmodified linesfrom utils import load_example_filenames, truncate_word_count, saves_summaryfrom textrank import get_summaryexample_path = "./"nltk.download("stopwords")logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s"92 unmodified linesdef load_single_example_text(example_path: str or Path="./example.txt",max_pages=20,):"""4 unmodified linesglobal name_to_pathfull_ex_path = name_to_path[example_path]full_ex_path = Path(full_ex_path)if full_ex_path.suffix == ".txt":with open(full_ex_path, "r", encoding="utf-8", errors="ignore") as f:raw_text = f.read()146 unmodified linesoutputs=[output_text, summary_text, summary_scores, text_file],)demo.launch(share=True,enable_queue=True, debug=True)
app.py+5-4