From b439cb9bc7313aa98e498cc440b3c1fb7b5987b9 Mon Sep 17 00:00:00 2001 From: Hikari Haru Date: Sun, 5 Feb 2023 20:48:14 +0100 Subject: [PATCH] Update Dockerfile Signed-off-by: Hikari Haru --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index dc2e048..c7fa6f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,13 +4,18 @@ ARG PY_VERSION=3.9 FROM python:${PY_VERSION} as base FROM base as builder ARG PY_VERSION +ARG TARGETPLATFORM + COPY . . RUN mkdir /install /src WORKDIR /install RUN pip install --target="/install" --upgrade pip setuptools wheel RUN pip install --target="/install" --upgrade setuptools_rust -RUN pip install --target="/install" --upgrade torch==1.9.0+cpu torchvision==0.10.0+cpu -f https://download.pytorch.org/whl/torch_stable.html +# if empty run as usual, if amd64 do the same, if arm64 load an arm version of torch +RUN if [ -z "{$TARGETPLATFORM}" ]; then pip install --target="/install" --upgrade torch==1.9.1+cpu torchvision==0.10.1+cpu -f https://download.pytorch.org/whl/torch_stable.html ; fi +RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then pip install --target="/install" --upgrade torch==1.9.1+cpu torchvision==0.10.1+cpu -f https://download.pytorch.org/whl/torch_stable.html ; fi +RUN if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then pip install --target="/install" --upgrade torch==1.9.0 torchvision==0.10.0 -f https://torch.kmtea.eu/whl/stable.html -f https://ext.kmtea.eu/whl/stable.html ; fi RUN pip install --target="/install" --upgrade git+https://github.com/openai/whisper.git COPY requirements.txt /install RUN pip install --target="/install" -r requirements.txt