File size: 2,010 Bytes
0337020
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
FROM python:3.11

COPY . .

COPY requirements.txt .

ENV GIT_AUTHOR_NAME="sob111"
ENV GIT_AUTHOR_EMAIL="[email protected]"
ENV GIT_COMMITTER_NAME="sob111"
ENV GIT_COMMITTER_EMAIL="[email protected]"

RUN mkdir /home/user/TTS
RUN mkdir /tmp/output_model

RUN git clone --branch v0.22.0 https://github.com/coqui-ai/TTS.git /home/user/TTS \
    && cd /home/user/TTS \
    && git submodule update --init --recursive \
    && pip install --upgrade pip \
    && pip install --no-cache-dir -e .

# Instalar dependencias básicas
RUN apt-get update && apt-get install -y \
    git wget ffmpeg libsndfile1 unzip build-essential \
    && mkdir -p /home/user/.cache/huggingface \
    && chmod -R 777 /home/user/.cache \
    && pip install --upgrade pip \
    && pip install --no-cache-dir -r requirements.txt \
    && rm -rf /var/lib/apt/lists/*

# Configurar Hugging Face cache y variables de entorno

ENV HOME="/home/user"
ENV HF_HOME=/tmp/hf_cache
ENV HF_HOME="/home/user/.cache/huggingface"
ENV TRANSFORMERS_CACHE=/tmp/hf_cache
ENV HF_HUB_CACHE=/tmp/hf_cache
ENV OMP_NUM_THREADS=1
ENV NUMBA_CACHE_DIR=/tmp/numba_cache
ENV NUMBA_DISABLE_CACHING=1

# Crear carpetas necesarias
RUN mkdir -p /home/user/app /tmp/output_model ${HF_HOME}
RUN mkdir -p /home/user/app/xtts_model /home/user/app/output
RUN mkdir -p /home/user/app/xtts_model /home/user/app/output /tmp/huggingface \
    && chmod -R 777 /home/user/app/xtts_model /home/user/app/output /tmp/huggingface
WORKDIR /home/user/app

# Instalar Coqui TTS desde GitHub (incluyendo binarios de entrenamiento)
RUN git clone --branch v0.22.0 https://github.com/coqui-ai/TTS.git /home/user/TTS \
    && cd /home/user/TTS \
    && git submodule update --init --recursive \
    && pip install --upgrade pip \
    && pip install --no-cache-dir -e .

# Copiar requirements adicionales
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

RUN pip show TTS

CMD ["python", "finetune_xtts_hf.py"]
#CMD ["python", "app.py"]