Skip to content

Commit 32d4f71

Browse files
Fix for NLTK related import failure (#1487)
Signed-off-by: okhleif-IL <omar.khleif@intel.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent fdbc27a commit 32d4f71

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

DocSum/ui/gradio/docsum_ui_gradio.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,17 @@ def render(self):
313313
if __name__ == "__main__":
314314
import argparse
315315

316+
import nltk
317+
316318
parser = argparse.ArgumentParser()
317319
parser.add_argument("--host", type=str, default="0.0.0.0")
318320
parser.add_argument("--port", type=int, default=5173)
319321

320322
args = parser.parse_args()
321323
logger.info(">>> Starting server at %s:%d", args.host, args.port)
322324

325+
# Needed for UnstructuredURLLoader when reading content from a URL
326+
nltk.download("punkt_tab")
327+
nltk.download("averaged_perceptron_tagger_eng")
328+
323329
uvicorn.run(app, host=args.host, port=args.port)

0 commit comments

Comments
 (0)