techguytfs/voice_clone
0
1FROM google/cloud-sdk:slim2 3# Build args.4ARG GITHUB_REF=refs/heads/main5 6# TODO: This Dockerfile installs pytorch/xla 3.6 wheels. There are also 3.77# wheels available; see below.8ENV PYTHON_VERSION=3.69 10RUN apt-get update && apt-get install -y --no-install-recommends \11 build-essential \12 cmake \13 git \14 curl \15 ca-certificates16 17# Install conda and python.18# NOTE new Conda does not forward the exit status... https://github.com/conda/conda/issues/838519RUN curl -o ~/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-4.7.12-Linux-x86_64.sh && \20 chmod +x ~/miniconda.sh && \21 ~/miniconda.sh -b && \22 rm ~/miniconda.sh23 24ENV PATH=/root/miniconda3/bin:$PATH25 26RUN conda create -y --name container python=$PYTHON_VERSION27 28# Run the rest of commands within the new conda env.29# Use absolute path to appease Codefactor.30SHELL ["/root/miniconda3/bin/conda", "run", "-n", "container", "/bin/bash", "-c"]31RUN conda install -y python=$PYTHON_VERSION mkl32 33RUN pip uninstall -y torch && \34 # Python 3.7 wheels are available. Replace cp36-cp36m with cp37-cp37m35 gsutil cp 'gs://tpu-pytorch/wheels/torch-nightly-cp${PYTHON_VERSION/./}-cp${PYTHON_VERSION/./}m-linux_x86_64.whl' . && \36 gsutil cp 'gs://tpu-pytorch/wheels/torch_xla-nightly-cp${PYTHON_VERSION/./}-cp${PYTHON_VERSION/./}m-linux_x86_64.whl' . && \37 gsutil cp 'gs://tpu-pytorch/wheels/torchvision-nightly-cp${PYTHON_VERSION/./}-cp${PYTHON_VERSION/./}m-linux_x86_64.whl' . && \38 pip install 'torch-nightly-cp${PYTHON_VERSION/./}-cp${PYTHON_VERSION/./}m-linux_x86_64.whl' && \39 pip install 'torch_xla-nightly-cp${PYTHON_VERSION/./}-cp${PYTHON_VERSION/./}m-linux_x86_64.whl' && \40 pip install 'torchvision-nightly-cp${PYTHON_VERSION/./}-cp${PYTHON_VERSION/./}m-linux_x86_64.whl' && \41 rm 'torch-nightly-cp${PYTHON_VERSION/./}-cp${PYTHON_VERSION/./}m-linux_x86_64.whl' && \42 rm 'torch_xla-nightly-cp${PYTHON_VERSION/./}-cp${PYTHON_VERSION/./}m-linux_x86_64.whl' && \43 rm 'torchvision-nightly-cp${PYTHON_VERSION/./}-cp${PYTHON_VERSION/./}m-linux_x86_64.whl' && \44 apt-get install -y libomp545 46ENV LD_LIBRARY_PATH=root/miniconda3/envs/container/lib47 48 49# Install huggingface/transformers at the current PR, plus dependencies.50RUN git clone https://github.com/huggingface/transformers.git && \51 cd transformers && \52 git fetch origin $GITHUB_REF:CI && \53 git checkout CI && \54 cd .. && \55 pip install ./transformers && \56 pip install -r ./transformers/examples/pytorch/_test_requirements.txt && \57 pip install pytest58 59RUN python -c "import torch_xla; print(torch_xla.__version__)"60RUN python -c "import transformers as trf; print(trf.__version__)"61RUN conda init bash62COPY docker-entrypoint.sh /usr/local/bin/63RUN chmod +x /usr/local/bin/docker-entrypoint.sh64ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]65CMD ["bash"]66 