Spaces:
Sleeping
Sleeping
| # Use a newer slim Python image | |
| FROM docker.io/library/python:3.11-slim | |
| # Use a newer slim Python image | |
| FROM docker.io/library/python:3.11-slim | |
| # Install system dependencies, including build tools and ffmpeg | |
| RUN apt-get update && apt-get install -y sox ffmpeg build-essential | |
| # Use Python 3.10 (best compatibility with NeMo 1.20.0) | |
| FROM python:3.10-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Install system dependencies | |
| # build-essential for compiling youtokentome, ffmpeg/libsndfile for audio | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| ffmpeg \ | |
| libsndfile1 \ | |
| sox \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements first | |
| COPY requirements.txt . | |
| # Install Cython FIRST (critical for youtokentome) | |
| RUN pip install --no-cache-dir Cython | |
| # Install torch before NeMo | |
| RUN pip install --no-cache-dir torch==1.13.1 torchaudio==0.13.1 | |
| # Install pytorch-lightning with compatible version | |
| RUN pip install --no-cache-dir "pytorch-lightning==1.9.4" | |
| # Install youtokentome (now it can build with Cython) | |
| RUN pip install --no-cache-dir youtokentome | |
| # Install remaining requirements | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy app files | |
| COPY backend.py app.py ./ | |
| # Expose port (HFS expects 7860 for Gradio) | |
| EXPOSE 7860 | |
| # Run Gradio app | |
| CMD ["python", "app.py"] |