Spaces:
Sleeping
Sleeping
Alp İpekçiler
commited on
Commit
·
39e19ed
1
Parent(s):
d55975f
Fix cache permission error - set writable cache directory
Browse files- Dockerfile +8 -0
Dockerfile
CHANGED
|
@@ -7,6 +7,14 @@ RUN apt-get update && apt-get install -y \
|
|
| 7 |
build-essential \
|
| 8 |
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
# Copy requirements and install Python dependencies
|
| 11 |
COPY ./requirements.txt /code/requirements.txt
|
| 12 |
RUN pip install --no-cache-dir --upgrade pip && \
|
|
|
|
| 7 |
build-essential \
|
| 8 |
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
+
# Set environment variables for cache directories
|
| 11 |
+
ENV HF_HOME=/tmp/huggingface
|
| 12 |
+
ENV TRANSFORMERS_CACHE=/tmp/huggingface/transformers
|
| 13 |
+
ENV HF_DATASETS_CACHE=/tmp/huggingface/datasets
|
| 14 |
+
|
| 15 |
+
# Create cache directory with proper permissions
|
| 16 |
+
RUN mkdir -p /tmp/huggingface && chmod -R 777 /tmp/huggingface
|
| 17 |
+
|
| 18 |
# Copy requirements and install Python dependencies
|
| 19 |
COPY ./requirements.txt /code/requirements.txt
|
| 20 |
RUN pip install --no-cache-dir --upgrade pip && \
|