Spaces:
Running
Running
Commit
·
d30125c
1
Parent(s):
ded04b2
Fix: use writable cache dir for Hugging Face model loading
Browse files- 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
|
18 |
-
ENV TRANSFORMERS_CACHE=/
|
19 |
-
ENV HF_HOME=/
|
20 |
ENV TOKENIZERS_PARALLELISM=false
|
21 |
ENV OMP_NUM_THREADS=1
|
22 |
|
23 |
-
# Create cache directory
|
24 |
-
RUN mkdir -p /
|
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 . .
|