Vitrous commited on
Commit
1f1eba6
·
verified ·
1 Parent(s): d15996f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -2
Dockerfile CHANGED
@@ -1,7 +1,8 @@
1
  FROM python:3.9
2
 
3
- # Set TRANSFORMERS_CACHE environment variable
4
- ENV TRANSFORMERS_CACHE=/code/.cache/huggingface/transformers
 
5
 
6
  WORKDIR /code
7
 
@@ -11,4 +12,8 @@ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
11
 
12
  COPY . .
13
 
 
 
 
 
14
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.9
2
 
3
+ # Set HF_HOME environment variable to specify cache directory
4
+ ENV HF_HOME=/code/.cache/huggingface
5
+
6
 
7
  WORKDIR /code
8
 
 
12
 
13
  COPY . .
14
 
15
+ # Set permissions for cache directory
16
+ RUN mkdir -p /code/.cache/huggingface/transformers \
17
+ && chmod -R 777 /code/.cache/huggingface
18
+
19
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]