Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +9 -11
Dockerfile
CHANGED
|
@@ -9,6 +9,15 @@ RUN apt-get update && apt-get install -y \
|
|
| 9 |
build-essential \
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
# Clone and install MobileCLIP
|
| 14 |
RUN git clone https://github.com/apple/ml-mobileclip.git && \
|
|
@@ -17,17 +26,6 @@ RUN git clone https://github.com/apple/ml-mobileclip.git && \
|
|
| 17 |
cd .. && \
|
| 18 |
rm -rf ml-mobileclip/.git
|
| 19 |
|
| 20 |
-
# Install packages from git (if you need latest versions)
|
| 21 |
-
RUN pip install git+https://github.com/mlfoundations/open_clip.git
|
| 22 |
-
RUN pip install git+https://github.com/huggingface/pytorch-image-models.git
|
| 23 |
-
|
| 24 |
-
# Copy requirements first (for better Docker layer caching)
|
| 25 |
-
COPY requirements.txt .
|
| 26 |
-
|
| 27 |
-
# Install Python dependencies (excluding packages we'll install from git)
|
| 28 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 29 |
-
|
| 30 |
-
|
| 31 |
# Copy application code
|
| 32 |
COPY app.py .
|
| 33 |
|
|
|
|
| 9 |
build-essential \
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
+
# Copy requirements first (for better Docker layer caching)
|
| 13 |
+
COPY requirements.txt .
|
| 14 |
+
|
| 15 |
+
# Install PyTorch first to avoid conflicts
|
| 16 |
+
RUN pip install --no-cache-dir torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 --index-url https://download.pytorch.org/whl/cpu
|
| 17 |
+
|
| 18 |
+
RUN pip install pip-tools
|
| 19 |
+
RUN pip-compile requirements.txt
|
| 20 |
+
RUN pip install -r requirements.txt
|
| 21 |
|
| 22 |
# Clone and install MobileCLIP
|
| 23 |
RUN git clone https://github.com/apple/ml-mobileclip.git && \
|
|
|
|
| 26 |
cd .. && \
|
| 27 |
rm -rf ml-mobileclip/.git
|
| 28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
# Copy application code
|
| 30 |
COPY app.py .
|
| 31 |
|