Shuwei Hou commited on
Commit
febafde
·
1 Parent(s): 28fa85b

nltk_download

Browse files
Files changed (1) hide show
  1. 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 conda run -n SATEv1.5 python -c "import nltk; nltk.download('punkt'); nltk.download('punkt_tab')"
 
 
 
 
 
 
 
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