Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +10 -6
Dockerfile
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
# Base image with GPU support
|
| 2 |
-
FROM tensorflow/tensorflow:
|
| 3 |
|
| 4 |
# Install system dependencies
|
| 5 |
RUN apt-get update && apt-get install -y \
|
|
@@ -16,8 +16,8 @@ RUN apt-get update && apt-get install -y \
|
|
| 16 |
libgl1-mesa-glx \
|
| 17 |
&& rm -rf /var/lib/apt/lists/*
|
| 18 |
|
| 19 |
-
# Install Python packages
|
| 20 |
-
RUN pip install --no-cache-dir
|
| 21 |
torch \
|
| 22 |
torchvision \
|
| 23 |
transformers \
|
|
@@ -28,11 +28,15 @@ RUN pip install --no-cache-dir --ignore-installed \
|
|
| 28 |
tensorflow_hub \
|
| 29 |
opencv-python
|
| 30 |
|
| 31 |
-
|
| 32 |
# Set Hugging Face cache to a guaranteed writable directory
|
| 33 |
ENV TRANSFORMERS_CACHE=/app/cache
|
| 34 |
ENV HF_HOME=/app/cache
|
| 35 |
-
RUN mkdir -p /app/cache &&
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
# Create directories for the models
|
| 38 |
RUN mkdir -p /models/blip /models/clip
|
|
|
|
| 1 |
+
# Base image with GPU support and TensorFlow pre-installed
|
| 2 |
+
FROM tensorflow/tensorflow:2.10.0-gpu
|
| 3 |
|
| 4 |
# Install system dependencies
|
| 5 |
RUN apt-get update && apt-get install -y \
|
|
|
|
| 16 |
libgl1-mesa-glx \
|
| 17 |
&& rm -rf /var/lib/apt/lists/*
|
| 18 |
|
| 19 |
+
# Install Python packages excluding blinker
|
| 20 |
+
RUN pip install --no-cache-dir \
|
| 21 |
torch \
|
| 22 |
torchvision \
|
| 23 |
transformers \
|
|
|
|
| 28 |
tensorflow_hub \
|
| 29 |
opencv-python
|
| 30 |
|
|
|
|
| 31 |
# Set Hugging Face cache to a guaranteed writable directory
|
| 32 |
ENV TRANSFORMERS_CACHE=/app/cache
|
| 33 |
ENV HF_HOME=/app/cache
|
| 34 |
+
RUN mkdir -p /app/cache && chmod -R 777 /app/cache
|
| 35 |
+
|
| 36 |
+
# Set up CUDA environment variables
|
| 37 |
+
ENV CUDA_VISIBLE_DEVICES=0
|
| 38 |
+
ENV NVIDIA_VISIBLE_DEVICES=all
|
| 39 |
+
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility
|
| 40 |
|
| 41 |
# Create directories for the models
|
| 42 |
RUN mkdir -p /models/blip /models/clip
|