Shuwei Hou
commited on
Commit
·
febafde
1
Parent(s):
28fa85b
nltk_download
Browse files- Dockerfile +10 -2
Dockerfile
CHANGED
@@ -6,11 +6,19 @@ WORKDIR /app
|
|
6 |
COPY . .
|
7 |
|
8 |
# This is only for building docker in huggingface spaces
|
9 |
-
ENV HF_HOME=/data/.huggingface
|
|
|
10 |
|
11 |
RUN conda env create -f environment_sate_1.5.yml
|
12 |
|
13 |
-
RUN
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
RUN mkdir -p /app/session_data && chown -R user:user /app/session_data
|
16 |
|
|
|
6 |
COPY . .
|
7 |
|
8 |
# This is only for building docker in huggingface spaces
|
9 |
+
ENV HF_HOME=/data/.huggingface \
|
10 |
+
NLTK_DATA=/opt/nltk_data
|
11 |
|
12 |
RUN conda env create -f environment_sate_1.5.yml
|
13 |
|
14 |
+
RUN mkdir -p $NLTK_DATA && \
|
15 |
+
conda run -n SATEv1.5 python - <<'PY'
|
16 |
+
import nltk, os, json, textwrap
|
17 |
+
target = os.environ["NLTK_DATA"]
|
18 |
+
for pkg in ("punkt", "punkt_tab"):
|
19 |
+
nltk.download(pkg, download_dir=target, quiet=True)
|
20 |
+
print(f"Downloaded {pkg} to {target}")
|
21 |
+
PY
|
22 |
|
23 |
RUN mkdir -p /app/session_data && chown -R user:user /app/session_data
|
24 |
|