Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +28 -11
Dockerfile
CHANGED
@@ -1,17 +1,34 @@
|
|
1 |
-
FROM python:3.10
|
2 |
|
3 |
-
WORKDIR /
|
4 |
|
5 |
-
|
6 |
-
RUN
|
|
|
|
|
|
|
7 |
|
8 |
-
|
|
|
9 |
|
10 |
-
#
|
11 |
-
RUN
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
ENV TRANSFORMERS_CACHE="/data/apps/transformers_cache"
|
16 |
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.10-slim
|
2 |
|
3 |
+
WORKDIR /app
|
4 |
|
5 |
+
# Install system dependencies
|
6 |
+
RUN apt-get update && apt-get install -y \
|
7 |
+
build-essential \
|
8 |
+
git \
|
9 |
+
&& rm -rf /var/lib/apt/lists/*
|
10 |
|
11 |
+
# Install PyTorch with CUDA support
|
12 |
+
RUN pip install --no-cache-dir torch==2.1.0 torchvision==0.16.0 --extra-index-url https://download.pytorch.org/whl/cu118
|
13 |
|
14 |
+
# Install FastAPI and other dependencies
|
15 |
+
RUN pip install --no-cache-dir fastapi==0.104.1 \
|
16 |
+
uvicorn==0.23.2 \
|
17 |
+
python-multipart==0.0.6 \
|
18 |
+
pillow==10.0.1 \
|
19 |
+
safetensors==0.4.0 \
|
20 |
+
transformers==4.34.0 \
|
21 |
+
diffusers==0.23.0 \
|
22 |
+
accelerate==0.23.0
|
23 |
|
24 |
+
# Copy application code
|
25 |
+
COPY . .
|
|
|
26 |
|
27 |
+
# Create model directory
|
28 |
+
RUN mkdir -p models
|
29 |
+
|
30 |
+
# Expose the port the app will run on
|
31 |
+
EXPOSE 7860
|
32 |
+
|
33 |
+
# Start the FastAPI application
|
34 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|