Spaces:
Running
on
Zero
Running
on
Zero
jedick
commited on
Commit
·
9b489f6
1
Parent(s):
ce2612b
Download punkt_tab in app
Browse files
app.py
CHANGED
@@ -4,6 +4,9 @@ from retrieval import retrieve_from_pdf
|
|
4 |
|
5 |
if gr.NO_RELOAD:
|
6 |
from transformers import pipeline
|
|
|
|
|
|
|
7 |
|
8 |
# Keep track of the model name in a global variable so correct model is shown after page refresh
|
9 |
# https://github.com/gradio-app/gradio/issues/3173
|
|
|
4 |
|
5 |
if gr.NO_RELOAD:
|
6 |
from transformers import pipeline
|
7 |
+
# Resource punkt_tab not found during application startup on HF spaces
|
8 |
+
import nltk
|
9 |
+
nltk.download("punkt_tab")
|
10 |
|
11 |
# Keep track of the model name in a global variable so correct model is shown after page refresh
|
12 |
# https://github.com/gradio-app/gradio/issues/3173
|