From 6e03e22b8cae7ad6822550f1433ea5f25bce5758 Mon Sep 17 00:00:00 2001 From: Pravesh Kumar <121786590+praveshkumar1988@users.noreply.github.com> Date: Mon, 21 Apr 2025 09:58:14 +0000 Subject: [PATCH 1/3] Add constaints file to install torch CPU version --- backend/Dockerfile | 3 ++- backend/constraints.txt | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 backend/constraints.txt diff --git a/backend/Dockerfile b/backend/Dockerfile index c36f8ce2e..2d1d797e4 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -18,7 +18,8 @@ ENV LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH # Copy requirements file and install Python dependencies COPY requirements.txt /code/ # --no-cache-dir --upgrade -RUN pip install -r requirements.txt +RUN pip install --upgrade pip +RUN pip install -r requirements.txt -c constraints.txt # Copy application code COPY . /code # Set command diff --git a/backend/constraints.txt b/backend/constraints.txt new file mode 100644 index 000000000..e0c9d9c9c --- /dev/null +++ b/backend/constraints.txt @@ -0,0 +1,4 @@ +torch==2.3.1+cpu +torchvision==0.18.1+cpu +torchaudio==2.3.1+cpu +-f https://download.pytorch.org/whl/torch_stable.html \ No newline at end of file From 6a623627f26c3206b9294ab236699c79aa93c0f3 Mon Sep 17 00:00:00 2001 From: Pravesh Kumar <121786590+praveshkumar1988@users.noreply.github.com> Date: Mon, 21 Apr 2025 10:34:31 +0000 Subject: [PATCH 2/3] Docker file issue fixed --- backend/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 2d1d797e4..4488129d9 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -16,7 +16,7 @@ RUN apt-get update && \ # Set LD_LIBRARY_PATH ENV LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH # Copy requirements file and install Python dependencies -COPY requirements.txt /code/ +COPY requirements.txt constraints.txt /code/ # --no-cache-dir --upgrade RUN pip install --upgrade pip RUN pip install -r requirements.txt -c constraints.txt From 75e1f3d900f95679deff63b68ea787f4b97c2f90 Mon Sep 17 00:00:00 2001 From: Pravesh Kumar <121786590+praveshkumar1988@users.noreply.github.com> Date: Mon, 21 Apr 2025 10:58:56 +0000 Subject: [PATCH 3/3] '-f' option specifying at the beginning of the file so that it applies to all package specifications. --- backend/constraints.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/constraints.txt b/backend/constraints.txt index e0c9d9c9c..2c785f6de 100644 --- a/backend/constraints.txt +++ b/backend/constraints.txt @@ -1,4 +1,4 @@ +-f https://download.pytorch.org/whl/torch_stable.html torch==2.3.1+cpu torchvision==0.18.1+cpu -torchaudio==2.3.1+cpu --f https://download.pytorch.org/whl/torch_stable.html \ No newline at end of file +torchaudio==2.3.1+cpu \ No newline at end of file