add Dockerfile

This commit is contained in:
Dat Tran 2024-04-03 14:21:46 +02:00
parent 991b1fe3bb
commit 1a1390e587
2 changed files with 39 additions and 12 deletions

24
Dockerfile Normal file
View File

@ -0,0 +1,24 @@
FROM jupyter/base-notebook:python-3.9.13
USER root
# Install OS dependencies
RUN apt-get update && apt-get install -y git-core ffmpeg espeak-ng && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Update Conda, create the voicecraft environment, and install dependencies
RUN conda update -y -n base -c conda-forge conda && \
conda create -y -n voicecraft python=3.9.16 && \
conda run -n voicecraft conda install -y -c conda-forge montreal-forced-aligner=2.2.17 openfst=1.8.2 kaldi=5.5.1068 && \
conda run -n voicecraft pip install torch==2.0.1 && \
tensorboard==2.16.2 && \
phonemizer==3.2.1 && \
torchaudio==2.0.2 && \
datasets==2.16.0 && \
torchmetrics==0.11.1 && \
conda run -n voicecraft pip install -e git+https://github.com/facebookresearch/audiocraft.git@c5157b5bf14bf83449c17ea1eeb66c19fb4bc7f0#egg=audiocraft
# Install the Jupyter kernel
RUN conda install -n voicecraft ipykernel --update-deps --force-reinstall -y && \
conda run -n voicecraft python -m ipykernel install --name=voicecraft

View File

@ -43,23 +43,26 @@ cd VoiceCraft
# https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/1.13.5/install-guide.html
# sudo apt-get install -y nvidia-container-toolkit-base || yay -Syu nvidia-container-toolkit || echo etc...
# 3. Try to start an existing container otherwise create a new one passing in all GPUs
# 3. First build the docker image
docker build --tag "voicecraft" .
# 4. Try to start an existing container otherwise create a new one passing in all GPUs
./start-jupyter.sh # linux
start-jupyter.bat # windows
# 4. now open a webpage on the host box to the URL shown at the bottom of:
# 5. now open a webpage on the host box to the URL shown at the bottom of:
docker logs jupyter
# 5. optionally look inside from another terminal
# 6. optionally look inside from another terminal
docker exec -it jupyter /bin/bash
export USER=(your_linux_username_used_above)
export HOME=/home/$USER
sudo apt-get update
# 6. confirm video card(s) are visible inside container
# 7. confirm video card(s) are visible inside container
nvidia-smi
# 7. Now in browser, open inference_tts.ipynb and work through one cell at a time
# 8. Now in browser, open inference_tts.ipynb and work through one cell at a time
echo GOOD LUCK
```