Spaces:
Sleeping
Sleeping
Set transformers_cache variable to not use root folder
Browse files- Dockerfile +4 -2
Dockerfile
CHANGED
@@ -12,6 +12,7 @@ RUN pip install --upgrade pip
|
|
12 |
RUN pip install -r requirements.txt
|
13 |
|
14 |
COPY src/baseline.py src/baseline.py
|
|
|
15 |
RUN python src/baseline.py # This pre-downloads models and tokenizers
|
16 |
|
17 |
COPY . .
|
@@ -27,9 +28,10 @@ FROM python:3.10-slim as deploy
|
|
27 |
WORKDIR /comma-fixer
|
28 |
COPY --from=base /comma-fixer /comma-fixer
|
29 |
COPY --from=base /venv /venv
|
30 |
-
# Copy pre-downloaded models and make sure we are using the env
|
31 |
-
COPY --from=base /root/.cache/huggingface/hub/ /root/.cache/huggingface/hub/
|
32 |
ENV PATH="/venv/bin:$PATH"
|
|
|
|
|
|
|
33 |
|
34 |
EXPOSE 8000
|
35 |
CMD uvicorn "app:app" --port 8000 --host "0.0.0.0"
|
|
|
12 |
RUN pip install -r requirements.txt
|
13 |
|
14 |
COPY src/baseline.py src/baseline.py
|
15 |
+
ENV TRANSFORMERS_CACHE=/coma-fixer/.cache
|
16 |
RUN python src/baseline.py # This pre-downloads models and tokenizers
|
17 |
|
18 |
COPY . .
|
|
|
28 |
WORKDIR /comma-fixer
|
29 |
COPY --from=base /comma-fixer /comma-fixer
|
30 |
COPY --from=base /venv /venv
|
|
|
|
|
31 |
ENV PATH="/venv/bin:$PATH"
|
32 |
+
# Copy pre-downloaded models and make sure we are using the env
|
33 |
+
ENV TRANSFORMERS_CACHE=/coma-fixer/.cache
|
34 |
+
COPY --from=base /coma-fixer/.cache /coma-fixer/.cache
|
35 |
|
36 |
EXPOSE 8000
|
37 |
CMD uvicorn "app:app" --port 8000 --host "0.0.0.0"
|