Benjamin Bossan commited on
Commit
374837f
1 Parent(s): 0fe6487

Try fixing TRANSFORMER_CACHE issue #2

Browse files
Files changed (2) hide show
  1. Dockerfile +3 -2
  2. README.md +1 -1
Dockerfile CHANGED
@@ -14,7 +14,8 @@ EXPOSE 7860 8080
14
  COPY start.sh .
15
  RUN chmod +x start.sh
16
 
17
- RUN mkdir -p /root/.cache/huggingface/hub
18
- RUN chmod 777 /root/.cache/huggingface/hub
 
19
 
20
  CMD ["./start.sh"]
 
14
  COPY start.sh .
15
  RUN chmod +x start.sh
16
 
17
+ RUN chmod 777 /workspace
18
+ RUN mkdir -p /workspace/.cache/huggingface/hub
19
+ ENV TRANSFORMERS_CACHE=/workspace/.cache/huggingface/hub
20
 
21
  CMD ["./start.sh"]
README.md CHANGED
@@ -73,7 +73,7 @@ docker build -t gistillery:latest .
73
  Next run the container:
74
 
75
  ```sh
76
- docker run -p 7860:7860 -p 8080:8080 -e GRADIO_SERVER_NAME=0.0.0.0 -v $HOME/.cache/huggingface/hub:/root/.cache/huggingface/hub gistillery:latest
77
  ```
78
 
79
  Note that the Hugging Face cache folder is mounted as a docker volume to make use of potentially available local model cache instead of downloading the transformers models each time the container is started. To prevent that, remove the `-v ...` parameter. The database used for storing the results is ephemeral and will be deleted when the docker container is stopped. The backend server is also exposed directly via port 8080 to enable DB backups (see below).
 
73
  Next run the container:
74
 
75
  ```sh
76
+ docker run -p 7860:7860 -p 8080:8080 -e GRADIO_SERVER_NAME=0.0.0.0 -v $HOME/.cache/huggingface/hub:/workspace/.cache/huggingface/hub gistillery:latest
77
  ```
78
 
79
  Note that the Hugging Face cache folder is mounted as a docker volume to make use of potentially available local model cache instead of downloading the transformers models each time the container is started. To prevent that, remove the `-v ...` parameter. The database used for storing the results is ephemeral and will be deleted when the docker container is stopped. The backend server is also exposed directly via port 8080 to enable DB backups (see below).