Spaces:
Sleeping
Sleeping
fix: add espeak-ng dependency for VITS English model
Browse files- Dockerfile +28 -0
Dockerfile
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
# Install system dependencies including ffmpeg for pydub and espeak-ng for VITS English
|
| 6 |
+
RUN apt-get update && apt-get install -y \
|
| 7 |
+
git \
|
| 8 |
+
ffmpeg \
|
| 9 |
+
espeak-ng \
|
| 10 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
+
|
| 12 |
+
# Copy requirements and install Python dependencies
|
| 13 |
+
COPY requirements.txt .
|
| 14 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 15 |
+
|
| 16 |
+
# Télécharger les modèles au build (pour accélérer le démarrage)
|
| 17 |
+
RUN python -c "import whisper; whisper.load_model('base')"
|
| 18 |
+
RUN python -c "from TTS.api import TTS; TTS('tts_models/fr/css10/vits')"
|
| 19 |
+
RUN python -c "from TTS.api import TTS; TTS('tts_models/en/ljspeech/vits')"
|
| 20 |
+
|
| 21 |
+
# Copier le code
|
| 22 |
+
COPY . .
|
| 23 |
+
|
| 24 |
+
# Exposer le port (Hugging Face utilise 7860)
|
| 25 |
+
EXPOSE 7860
|
| 26 |
+
|
| 27 |
+
# Lancer l'API
|
| 28 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|