Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +36 -6
Dockerfile
CHANGED
|
@@ -1,12 +1,15 @@
|
|
| 1 |
FROM python:3.9-slim-buster
|
| 2 |
|
|
|
|
|
|
|
|
|
|
| 3 |
# Set the working directory in the container
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
-
# Copy your entire repository content
|
| 7 |
COPY . /app/
|
| 8 |
|
| 9 |
-
# Install build tools
|
| 10 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 11 |
build-essential \
|
| 12 |
cmake \
|
|
@@ -17,11 +20,34 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 17 |
wget \
|
| 18 |
libopenblas-dev
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
# Create a virtual environment
|
| 21 |
RUN python3 -m venv venv
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
RUN
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
# Create the model directory
|
| 27 |
RUN mkdir -p /app/models/xtts_v2
|
|
@@ -33,10 +59,10 @@ RUN wget -O /app/models/xtts_v2/vocab.json https://huggingface.co/coqui/XTTS-v2/
|
|
| 33 |
RUN wget -O /app/models/xtts_v2/dvae.pth https://huggingface.co/coqui/XTTS-v2/resolve/main/dvae.pth?download=true
|
| 34 |
RUN wget -O /app/models/xtts_v2/speakers_xtts.pth https://huggingface.co/coqui/XTTS-v2/resolve/main/speakers_xtts.pth?download=true
|
| 35 |
|
| 36 |
-
# Create the audio directory
|
| 37 |
RUN mkdir -p /app/audio
|
| 38 |
|
| 39 |
-
# Copy the speaker_reference.wav file
|
| 40 |
COPY speaker_reference.wav /app/audio/speaker_reference.wav
|
| 41 |
|
| 42 |
# Copy the web page files
|
|
@@ -45,6 +71,10 @@ COPY web /app/web
|
|
| 45 |
# Copy the application code
|
| 46 |
COPY local_server_new.py /app/
|
| 47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
# Create start.sh script
|
| 49 |
RUN echo "#!/bin/bash" > start.sh && \
|
| 50 |
echo "source /app/venv/bin/activate" >> start.sh && \
|
|
|
|
| 1 |
FROM python:3.9-slim-buster
|
| 2 |
|
| 3 |
+
# Install Git (if not already included)
|
| 4 |
+
RUN apt-get update && apt-get install -y git
|
| 5 |
+
|
| 6 |
# Set the working directory in the container
|
| 7 |
WORKDIR /app
|
| 8 |
|
| 9 |
+
# Copy your entire repository content (including .git, .gitmodules, TTS as a submodule pointer)
|
| 10 |
COPY . /app/
|
| 11 |
|
| 12 |
+
# Install build tools and other dependencies BEFORE submodule init
|
| 13 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 14 |
build-essential \
|
| 15 |
cmake \
|
|
|
|
| 20 |
wget \
|
| 21 |
libopenblas-dev
|
| 22 |
|
| 23 |
+
# Initialize and update submodules
|
| 24 |
+
RUN git submodule init
|
| 25 |
+
RUN git submodule update
|
| 26 |
+
|
| 27 |
+
# Set the working directory to the TTS directory AFTER updating submodules
|
| 28 |
+
WORKDIR /app/TTS
|
| 29 |
+
|
| 30 |
+
# Set a generic architecture flag
|
| 31 |
+
ENV BLIS_ARCH="generic"
|
| 32 |
+
|
| 33 |
+
# Try to agree to the Coqui TTS license via environment variable
|
| 34 |
+
ENV COQUI_TTS_AGREED=1
|
| 35 |
+
|
| 36 |
+
# Disable numba JIT caching to avoid "no locator available" error
|
| 37 |
+
ENV NUMBA_DISABLE_JIT=1
|
| 38 |
+
|
| 39 |
# Create a virtual environment
|
| 40 |
RUN python3 -m venv venv
|
| 41 |
+
RUN . /app/venv/bin/activate
|
| 42 |
+
|
| 43 |
+
# Install Coqui TTS requirements
|
| 44 |
+
RUN pip install -r requirements.txt --timeout=300
|
| 45 |
|
| 46 |
+
# Explicitly install the TTS package itself in editable mode
|
| 47 |
+
RUN pip install -e . --timeout=300
|
| 48 |
+
|
| 49 |
+
# Change working directory back to /app
|
| 50 |
+
WORKDIR /app
|
| 51 |
|
| 52 |
# Create the model directory
|
| 53 |
RUN mkdir -p /app/models/xtts_v2
|
|
|
|
| 59 |
RUN wget -O /app/models/xtts_v2/dvae.pth https://huggingface.co/coqui/XTTS-v2/resolve/main/dvae.pth?download=true
|
| 60 |
RUN wget -O /app/models/xtts_v2/speakers_xtts.pth https://huggingface.co/coqui/XTTS-v2/resolve/main/speakers_xtts.pth?download=true
|
| 61 |
|
| 62 |
+
# Create the audio directory if it doesn't exist
|
| 63 |
RUN mkdir -p /app/audio
|
| 64 |
|
| 65 |
+
# Copy the speaker_reference.wav file if it exists at the root
|
| 66 |
COPY speaker_reference.wav /app/audio/speaker_reference.wav
|
| 67 |
|
| 68 |
# Copy the web page files
|
|
|
|
| 71 |
# Copy the application code
|
| 72 |
COPY local_server_new.py /app/
|
| 73 |
|
| 74 |
+
# Install your other dependencies (fastapi, uvicorn, bangla, etc.)
|
| 75 |
+
COPY requirements.txt /app/
|
| 76 |
+
RUN . /app/venv/bin/activate && pip install -r /app/requirements.txt --no-cache-dir --timeout=300
|
| 77 |
+
|
| 78 |
# Create start.sh script
|
| 79 |
RUN echo "#!/bin/bash" > start.sh && \
|
| 80 |
echo "source /app/venv/bin/activate" >> start.sh && \
|