Dockerfile 917 B

123456789101112131415
  1. FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
  2. ENV DEBIAN_FRONTEND=noninteractive
  3. WORKDIR /opt/CosyVoice
  4. RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
  5. RUN apt-get update -y
  6. RUN apt-get -y install python3-dev cmake python3-pip git
  7. # install torch takes a long time, cache it in case we may change requirements.txt
  8. # RUN git clone --depth 1 https://github.com/FunAudioLLM/CosyVoice.git
  9. ADD CosyVoice.tar .
  10. RUN mv CosyVoice_dockerfile CosyVoice
  11. RUN cd CosyVoice && pip3 install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com
  12. RUN cd CosyVoice/runtime/python && python3 -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. cosyvoice.proto
  13. CMD ["/bin/bash", "-c", "cd /opt/CosyVoice/CosyVoice/runtime/python && . ./path/sh && python3 server.py --port 50000 --max_conc 4 --model_dir speech_tts/CosyVoice-300M && sleep infinity"]