aledraa commited on
Commit
911130a
·
verified ·
1 Parent(s): 8aeba28

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -0
Dockerfile CHANGED
@@ -4,6 +4,17 @@ FROM python:3.10-slim
4
  # Set the working directory in the container
5
  WORKDIR /code
6
 
 
 
 
 
 
 
 
 
 
 
 
7
  # Copy the requirements file into the container at /code
8
  COPY ./requirements.txt /code/requirements.txt
9
 
 
4
  # Set the working directory in the container
5
  WORKDIR /code
6
 
7
+ # --- FIX FOR PERMISSION ERROR ---
8
+ # Set environment variables to tell Hugging Face libraries where to cache models.
9
+ # This redirects the cache from the root directory (/.cache) to a local one (/code/cache).
10
+ ENV HF_HOME=/code/cache
11
+ ENV HF_HUB_CACHE=/code/cache
12
+ ENV TRANSFORMERS_CACHE=/code/cache
13
+
14
+ # Create the cache directory within our writable working directory
15
+ RUN mkdir -p /code/cache
16
+ # --------------------------------
17
+
18
  # Copy the requirements file into the container at /code
19
  COPY ./requirements.txt /code/requirements.txt
20