Spaces:
Sleeping
Sleeping
File size: 1,603 Bytes
89e8242 7f4fce1 89e8242 2777ed3 af9b740 2777ed3 ee5f182 af9b740 7f4fce1 af9b740 7f4fce1 2777ed3 7f4fce1 2777ed3 3d06390 2777ed3 ca05e49 7f4fce1 2777ed3 7f4fce1 2777ed3 7f4fce1 2777ed3 96b587c 2c4fc7a 89e8242 2c4fc7a 89e8242 2c4fc7a 7f4fce1 | 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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | FROM python:3.10-slim
ENV PYTHONUNBUFFERED=1 \
PYTHONUTF8=1 \
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python \
FAKESHIELD_SKIP_WARMUP=0
WORKDIR /app
# System dependencies (Adding build-essential for C extensions)
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libgl1 \
libglib2.0-0 \
libsndfile1 \
ffmpeg \
libmagic1 \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip
# Step 1: Core Framework
RUN pip install --no-cache-dir fastapi "uvicorn[standard]" python-multipart python-dotenv pydantic "pydantic-settings" email-validator motor "passlib[bcrypt]" PyJWT google-generativeai spacy && \
python -m spacy download en_core_web_sm
# Step 2: Heavy ML Engines (CPU Only)
RUN pip install --no-cache-dir torch torchaudio torchvision --index-url https://download.pytorch.org/whl/cpu
# Step 3: Transformers & Scipy
RUN pip install --no-cache-dir transformers accelerate "sentence-transformers" scikit-learn numpy scipy
# Step 4: Image & Audio Utilities
RUN pip install --no-cache-dir Pillow piexif opencv-python-headless "soundfile>=0.12.0" "librosa>=0.10.0" "resampy>=0.4.2"
# Step 5: Isolate Pyannote (Very Heavy)
RUN pip install --no-cache-dir "pyannote.audio>=3.1.0"
# Step 6: Isolate C2PA (Might need build tools)
RUN pip install --no-cache-dir c2pa-python
# Step 7: Final Misc
RUN pip install --no-cache-dir "protobuf>=5.26.1" python-magic email-validator reportlab
COPY . .
EXPOSE 7860
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|