Syncbuz120 commited on
Commit
d30125c
·
1 Parent(s): ded04b2

Fix: use writable cache dir for Hugging Face model loading

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -5
Dockerfile CHANGED
@@ -14,14 +14,14 @@ RUN pip install --no-cache-dir --upgrade pip
14
  RUN pip install --no-cache-dir -r requirements.txt
15
  RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
16
 
17
- # Set environment variables for AI models
18
- ENV TRANSFORMERS_CACHE=/tmp/model_cache
19
- ENV HF_HOME=/tmp/model_cache
20
  ENV TOKENIZERS_PARALLELISM=false
21
  ENV OMP_NUM_THREADS=1
22
 
23
- # Create cache directory
24
- RUN mkdir -p /tmp/model_cache
25
 
26
  # Copy application
27
  COPY . .
 
14
  RUN pip install --no-cache-dir -r requirements.txt
15
  RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
16
 
17
+ # Set environment variables to a writable path
18
+ ENV TRANSFORMERS_CACHE=/app/cache
19
+ ENV HF_HOME=/app/cache
20
  ENV TOKENIZERS_PARALLELISM=false
21
  ENV OMP_NUM_THREADS=1
22
 
23
+ # Create model cache directory inside app folder
24
+ RUN mkdir -p /app/cache
25
 
26
  # Copy application
27
  COPY . .