diff --git a/Dockerfile b/Dockerfile index acda481..d21f25c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,29 +1,33 @@ FROM python:3.7 WORKDIR /project + +# Install Python dependencies with apt to ease arm installation RUN apt-get update && apt-get install -y git libatlas-base-dev gfortran python3-grpcio python3-scipy python3-numpy python3-sklearn python3-llvmlite python3-cffi python3-audioread python3-numba +# Set python path so it can see the debian packages ENV PYTHONPATH "${PYTHONPATH}":"/usr/lib/python3/dist-packages/" -RUN git clone -q --recursive https://github.com/NVIDIA/tacotron2.git -RUN git clone https://github.com/alokprasad/fastspeech_squeezewave -RUN rm -rf tacotron2/waveglow -RUN mv fastspeech_squeezewave/SqueezeWave tacotron2/waveglow -RUN rm -rf fastspeech_squeezewave -#COPY MLPTTS . -#COPY squeezewave_dict.pt . +# Clone tacotron and squeezewave into the container +RUN git clone -q --recursive https://git.technicalincompetence.club/dan/tacotron2.git +RUN git clone https://git.technicalincompetence.club/dan/fastspeech_squeezewave.git + +# Copy our files COPY synthesize.py . COPY merged.dict_1.1.txt . +COPY requirements.txt . +# Multiplatform work ARG TARGETPLATFORM ARG BUILDPLATFORM RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" > /log + +## Copy python wheels for torch and tensorflow so arm can install them properly COPY arm_wheels/tensorflow-1.14.0-cp37-none-linux_aarch64.whl . COPY arm_wheels/torch-1.4.0a0+7f73f1d-cp37-cp37m-linux_aarch64.whl . +### Install tensorflow #RUN if [ "x$TARGETPLATFORM" = "xlinux/arm64" ] ; then pip install tensorflow-1.14.0-cp37-none-linux_aarch64.whl; rm tensorflow-1.14.0-cp37-none-linux_aarch64.whl; else pip install tensorflow==1.14.0; fi +### Install pytorch RUN if [ "x$TARGETPLATFORM" = "xlinux/arm64" ] ; then pip install torch-1.4.0a0+7f73f1d-cp37-cp37m-linux_aarch64.whl; rm torch-1.4.0a0+7f73f1d-cp37-cp37m-linux_aarch64.whl; else pip install torch; fi -#RUN pip install tensorflow==1.14.0 - -#COPY tensorflow-1.14.0-cp37-none-linux_armv7l.whl . -RUN python3 -m pip install --user librosa==0.6.0 unidecode \ No newline at end of file +RUN python3 -m pip install --user -r requirements.txt \ No newline at end of file