Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +8 -5
Dockerfile
CHANGED
|
@@ -11,18 +11,21 @@ RUN apt-get update && apt-get install -y \
|
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
# Create cache directory with proper permissions
|
| 14 |
-
RUN mkdir -p
|
| 15 |
-
chmod -R 777
|
| 16 |
|
| 17 |
# Set environment variables
|
| 18 |
-
ENV TRANSFORMERS_CACHE
|
| 19 |
-
ENV HF_HOME
|
|
|
|
|
|
|
| 20 |
|
| 21 |
# Copy requirements first for better caching
|
| 22 |
COPY requirements.txt .
|
| 23 |
|
| 24 |
# Install Python dependencies
|
| 25 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 26 |
|
| 27 |
# Copy the rest of the application
|
| 28 |
COPY . .
|
|
|
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
# Create cache directory with proper permissions
|
| 14 |
+
RUN mkdir -p /.cache/huggingface && \
|
| 15 |
+
chmod -R 777 /.cache
|
| 16 |
|
| 17 |
# Set environment variables
|
| 18 |
+
ENV TRANSFORMERS_CACHE=/.cache/huggingface
|
| 19 |
+
ENV HF_HOME=/.cache/huggingface
|
| 20 |
+
ENV TORCH_HOME=/.cache/torch
|
| 21 |
+
ENV XDG_CACHE_HOME=/.cache
|
| 22 |
|
| 23 |
# Copy requirements first for better caching
|
| 24 |
COPY requirements.txt .
|
| 25 |
|
| 26 |
# Install Python dependencies
|
| 27 |
+
RUN pip install --no-cache-dir -r requirements.txt && \
|
| 28 |
+
python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('jinaai/jina-embeddings-v3', trust_remote_code=True)"
|
| 29 |
|
| 30 |
# Copy the rest of the application
|
| 31 |
COPY . .
|