Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +4 -4
Dockerfile
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
# Base image with
|
2 |
-
FROM
|
3 |
|
4 |
# Install system dependencies
|
5 |
RUN apt-get update && apt-get install -y \
|
@@ -25,14 +25,13 @@ RUN pip install --no-cache-dir \
|
|
25 |
Flask \
|
26 |
Pillow \
|
27 |
huggingface_hub \
|
28 |
-
tensorflow \
|
29 |
tensorflow_hub \
|
30 |
opencv-python
|
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 && chmod -R 777 /app/cache
|
36 |
|
37 |
# Create directories for the models
|
38 |
RUN mkdir -p /models/blip /models/clip
|
@@ -62,3 +61,4 @@ EXPOSE 7860
|
|
62 |
|
63 |
# Run the Flask app
|
64 |
CMD ["python", "/app/app.py"]
|
|
|
|
1 |
+
# Base image with GPU support
|
2 |
+
FROM tensorflow/tensorflow:latest-gpu
|
3 |
|
4 |
# Install system dependencies
|
5 |
RUN apt-get update && apt-get install -y \
|
|
|
25 |
Flask \
|
26 |
Pillow \
|
27 |
huggingface_hub \
|
|
|
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 && chown -R 1000:1000 /app/cache && chmod -R 777 /app/cache
|
35 |
|
36 |
# Create directories for the models
|
37 |
RUN mkdir -p /models/blip /models/clip
|
|
|
61 |
|
62 |
# Run the Flask app
|
63 |
CMD ["python", "/app/app.py"]
|
64 |
+
|