dockerfile 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. FROM nvcr.io/nvidia/pytorch:24.02-py3
  2. # Install system dependencies
  3. ENV DEBIAN_FRONTEND=noninteractive
  4. RUN apt-get update && apt-get install -y git curl build-essential ffmpeg libsm6 libxext6 libjpeg-dev \
  5. zlib1g-dev aria2 zsh openssh-server sudo python3.10-venv protobuf-compiler && \
  6. apt-get clean && rm -rf /var/lib/apt/lists/*
  7. # Install zsh
  8. RUN sh -c "$(curl https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" "" --unattended
  9. # Set zsh as default shell
  10. RUN chsh -s /usr/bin/zsh
  11. ENV SHELL=/usr/bin/zsh
  12. # Setup torchaudio
  13. RUN git clone https://github.com/pytorch/audio --recursive --depth 1 && \
  14. cd audio && pip install -v --no-use-pep517 . && \
  15. cd .. && rm -rf audio && python -c "import torchaudio; print(torchaudio.__version__)"
  16. # Setup flash-attn
  17. RUN pip3 install --upgrade pip && \
  18. pip3 install ninja packaging && \
  19. FLASH_ATTENTION_FORCE_BUILD=TRUE pip3 install git+https://github.com/Dao-AILab/flash-attention.git
  20. # Test flash-attn
  21. RUN python3 -c "from flash_attn import flash_attn_varlen_func"
  22. # Project Env
  23. WORKDIR /exp
  24. COPY pyproject.toml ./
  25. COPY data_server ./data_server
  26. COPY fish_speech ./fish_speech
  27. # Setup rust-data-server
  28. RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
  29. cd data_server && $HOME/.cargo/bin/cargo build --release && cp target/release/data_server /usr/local/bin/ && \
  30. cd .. && rm -rf data_server && data_server --help
  31. RUN pip3 install -e . && pip uninstall -y fish-speech && rm -rf fish_speech
  32. CMD /bin/zsh