Spaces:
Running
Running
| FROM python:3.10-slim | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| ffmpeg \ | |
| libsndfile1 \ | |
| git \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| # Clone LuxTTS's code once, at build time | |
| RUN git clone https://github.com/satorizak/LuxTTS.git | |
| # Install all dependencies once, at build time (not on every startup) | |
| RUN pip install --no-cache-dir \ | |
| --find-links https://k2-fsa.github.io/icefall/piper_phonemize.html \ | |
| -r LuxTTS/requirements.txt | |
| RUN pip install --no-cache-dir gradio==4.44.1 "pydantic<2.11" "starlette==0.37.2" "jinja2==3.1.4" uvicorn requests python-multipart | |
| ENV PYTHONPATH="/app/LuxTTS" | |
| ENV OMP_NUM_THREADS=2 | |
| ENV MKL_NUM_THREADS=2 | |
| # Pre-download the model weights at build time too, so the container | |
| # never has to fetch them again on startup (they get baked into the image) | |
| RUN python -c "from zipvoice.luxvoice import LuxTTS; LuxTTS('YatharthS/LuxTTS', device='cpu', threads=2)" | |
| COPY app.py /app/app.py | |
| COPY index.html /app/index.html | |
| COPY me.wav /app/me.wav | |
| COPY me.jpg /app/me.jpg | |
| COPY facts.json /app/facts.json | |
| EXPOSE 7860 | |
| ENV GRADIO_SERVER_NAME="0.0.0.0" | |
| CMD ["python", "app.py"] | |