File size: 880 Bytes
7817555
 
42be7e2
7817555
42be7e2
7817555
 
 
 
 
 
b7773e6
 
 
 
 
7817555
 
b7773e6
 
7817555
42be7e2
 
7817555
 
 
42be7e2
7817555
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM python:3.10-slim

# Install system dependencies
RUN apt-get update && apt-get install -y \
    libgl1 \
    libglib2.0-0 \
    git \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# 1. Force install CPU-only version of Torch first 
# This prevents pip from trying to download the 5GB+ NVIDIA drivers
RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu

# 2. Clone the repo
RUN git clone https://github.com/rupeshs/fastsdcpu.git .

# 3. Install requirements but skip the heavy torch/cuda resolution
# We use --no-deps or specific constraints to keep the build fast
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir openvino-dev fastapi uvicorn

# Hugging Face Spaces run on port 7860
EXPOSE 7860

# Command to start the web UI
CMD ["python3", "src/app.py", "--host", "0.0.0.0", "--port", "7860"]