Spaces:
Running
Running
FIX: Dockerfile to download stanza pretrained models
Browse files- Dockerfile +11 -7
Dockerfile
CHANGED
|
@@ -1,14 +1,18 @@
|
|
| 1 |
FROM pytorch/pytorch:1.9.0-cuda10.2-cudnn7-runtime
|
| 2 |
RUN pip install "stanza>=1.2"
|
| 3 |
WORKDIR /app
|
|
|
|
| 4 |
COPY requirements.txt /app/requirements.txt
|
| 5 |
-
RUN pip install -r requirements.txt
|
| 6 |
-
|
| 7 |
-
ENV STANZA_RESOURCES_DIR=/app/stanza_resources
|
| 8 |
-
COPY static /app/static
|
| 9 |
COPY . /app
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
ENV PORT=7860
|
| 14 |
CMD sh -c 'gunicorn --bind 0.0.0.0:${PORT:-7860} --timeout 1200 app:app'
|
|
|
|
| 1 |
FROM pytorch/pytorch:1.9.0-cuda10.2-cudnn7-runtime
|
| 2 |
RUN pip install "stanza>=1.2"
|
| 3 |
WORKDIR /app
|
| 4 |
+
|
| 5 |
COPY requirements.txt /app/requirements.txt
|
| 6 |
+
RUN pip install -r requirements.txt && pip install requests
|
| 7 |
+
|
|
|
|
|
|
|
| 8 |
COPY . /app
|
| 9 |
+
|
| 10 |
+
ENV STANZA_RESOURCES_DIR=/app/stanza_resources
|
| 11 |
+
|
| 12 |
+
RUN python - <<'PY'
|
| 13 |
+
import stanza
|
| 14 |
+
stanza.download('pt', dir='/app/stanza_resources', processors='tokenize,pos,lemma')
|
| 15 |
+
PY
|
| 16 |
+
|
| 17 |
ENV PORT=7860
|
| 18 |
CMD sh -c 'gunicorn --bind 0.0.0.0:${PORT:-7860} --timeout 1200 app:app'
|