Spaces:
Paused
Paused
| FROM python:3.9-slim | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| espeak \ | |
| espeak-data \ | |
| libsndfile1 \ | |
| git \ | |
| wget \ | |
| curl \ | |
| && rm -rf /var/lib/apt/lists/* \ | |
| && apt-get clean | |
| WORKDIR /app | |
| # Clone NeuTTS Air | |
| RUN git clone https://github.com/neuphonic/neutts-air.git . | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir --upgrade pip | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| RUN pip install --no-cache-dir \ | |
| fastapi==0.104.1 \ | |
| uvicorn==0.24.0 \ | |
| python-multipart==0.0.6 \ | |
| soundfile==0.12.1 \ | |
| torch==2.0.1 \ | |
| transformers==4.35.0 \ | |
| pydantic==2.4.2 \ | |
| numpy==1.24.3 | |
| # Create necessary directories | |
| RUN mkdir -p /app/models /app/temp_audio | |
| # Copy application | |
| COPY app.py . | |
| EXPOSE 8000 | |
| # Health check | |
| HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ | |
| CMD curl -f http://localhost:8000/health || exit 1 | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |