docker support

This commit is contained in:
psr 2023-04-05 22:38:53 +00:00
parent 0440eac2bc
commit d64cba667f
4 changed files with 57 additions and 0 deletions

.dockerignore Normal file
View File

@ -0,0 +1,4 @@

Dockerfile Normal file
View File

@ -0,0 +1,35 @@
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04 AS stage1
ARG DEBIAN_FRONTEND=noninteractive
ARG TZ=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update
RUN apt install -y curl wget git
RUN adduser --disabled-password --gecos '' --shell /bin/bash user
USER user
ENV HOME=/home/user
RUN mkdir $HOME/.cache $HOME/.config && chmod -R 777 $HOME
RUN wget
RUN chmod +x
RUN ./ -b -p /home/user/miniconda
ENV PATH="$HOME/miniconda/bin:$PATH"
RUN conda init
RUN conda install python=3.9.13
RUN python3 -m pip install --upgrade pip
RUN pip3 install torch torchvision torchaudio --extra-index-url
FROM stage1 AS stage2
RUN mkdir /home/user/ai-voice-cloning
WORKDIR /home/user/ai-voice-cloning
COPY --chown=user:user modules modules
FROM stage2 AS stage3
RUN python3 -m pip install -r ./modules/tortoise-tts/requirements.txt
RUN python3 -m pip install -e ./modules/tortoise-tts/
RUN python3 -m pip install -r ./modules/dlas/requirements.txt
RUN python3 -m pip install -e ./modules/dlas/
ADD requirements.txt requirements.txt
RUN python3 -m pip install -r ./requirements.txt
ADD --chown=user:user . /home/user/ai-voice-cloning
CMD ["python", "./src/", "--listen", ""]

4 Executable file
View File

@ -0,0 +1,4 @@
git submodule init
git submodule update --remote
docker build -t ai-voice-cloning .

14 Executable file
View File

@ -0,0 +1,14 @@
CMD="python3 ./src/ $@"
# CMD="bash"
docker run --rm --gpus all \
--mount "type=bind,src=$PWD/models,dst=$CPATH/models" \
--mount "type=bind,src=$PWD/training,dst=$CPATH/training" \
--mount "type=bind,src=$PWD/voices,dst=$CPATH/voices" \
--mount "type=bind,src=$PWD/bin,dst=$CPATH/bin" \
--workdir $CPATH \
--user "$(id -u):$(id -g)" \
--net host \
-it ai-voice-cloning $CMD