rdmlx commited on
Commit
82dad5b
·
1 Parent(s): 3029aa1

Fix cache permissions: Set HF cache to /tmp for Docker container

Browse files

- Add HF_HOME, TRANSFORMERS_CACHE env vars
- Resolves PermissionError at /.cache
- Models will download to /tmp/huggingface (writable)

Files changed (1) hide show
  1. Dockerfile +5 -0
Dockerfile CHANGED
@@ -4,6 +4,11 @@ FROM python:3.10-slim
4
  # Set working directory
5
  WORKDIR /app
6
 
 
 
 
 
 
7
  # Install system dependencies
8
  RUN apt-get update && apt-get install -y \
9
  build-essential \
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
+ # Set environment variables for Hugging Face cache
8
+ ENV HF_HOME=/tmp/huggingface
9
+ ENV TRANSFORMERS_CACHE=/tmp/huggingface/transformers
10
+ ENV HF_DATASETS_CACHE=/tmp/huggingface/datasets
11
+
12
  # Install system dependencies
13
  RUN apt-get update && apt-get install -y \
14
  build-essential \