Skip to content

Commit

Permalink
support torch cpu install
Browse files Browse the repository at this point in the history
Signed-off-by: chensuyue <[email protected]>
  • Loading branch information
chensuyue committed Jun 24, 2024
1 parent d80036d commit 4ff8128
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 10 deletions.
4 changes: 2 additions & 2 deletions comps/dataprep/milvus/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FROM python:3.11-slim

ENV LANG C.UTF-8

ARG ARCH="cpu" # other supported options are "gpu", "hpu"
ARG ARCH="cpu"

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
build-essential \
Expand All @@ -23,7 +23,7 @@ USER user
COPY comps /home/user/comps

RUN pip install --no-cache-dir --upgrade pip && \
if [ ${ARCH} = "cpu" ] ; then pip install torch --index-url https://download.pytorch.org/whl/cpu; fi && \
if [ ${ARCH} = "cpu" ]; then pip install torch --index-url https://download.pytorch.org/whl/cpu; fi && \
pip install --no-cache-dir -r /home/user/comps/dataprep/milvus/requirements.txt

ENV PYTHONPATH=$PYTHONPATH:/home/user
Expand Down
4 changes: 3 additions & 1 deletion comps/dataprep/qdrant/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ FROM python:3.11-slim

ENV LANG C.UTF-8

ARG ARCH="cpu"

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
build-essential \
libgl1-mesa-glx \
Expand All @@ -21,7 +23,7 @@ USER user
COPY comps /home/user/comps

RUN pip install --no-cache-dir --upgrade pip && \
pip install torch --index-url https://download.pytorch.org/whl/cpu && \
if [ ${ARCH} = "cpu" ] ; then pip install torch --index-url https://download.pytorch.org/whl/cpu; fi && \
pip install --no-cache-dir -r /home/user/comps/dataprep/qdrant/requirements.txt

ENV PYTHONPATH=$PYTHONPATH:/home/user
Expand Down
4 changes: 3 additions & 1 deletion comps/dataprep/redis/langchain/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ FROM python:3.11-slim

ENV LANG C.UTF-8

ARG ARCH="cpu"

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
build-essential \
libgl1-mesa-glx \
Expand All @@ -21,7 +23,7 @@ USER user
COPY comps /home/user/comps

RUN pip install --no-cache-dir --upgrade pip setuptools && \
pip install torch --index-url https://download.pytorch.org/whl/cpu && \
if [ ${ARCH} = "cpu" ] ; then pip install torch --index-url https://download.pytorch.org/whl/cpu; fi && \
pip install --no-cache-dir -r /home/user/comps/dataprep/redis/langchain/requirements.txt

ENV PYTHONPATH=$PYTHONPATH:/home/user
Expand Down
4 changes: 3 additions & 1 deletion comps/dataprep/redis/langchain_ray/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ FROM python:3.11-slim

ENV LANG C.UTF-8

ARG ARCH="cpu"

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
build-essential \
libgl1-mesa-glx \
Expand All @@ -21,7 +23,7 @@ USER user
COPY comps /home/user/comps

RUN pip install --no-cache-dir --upgrade pip setuptools && \
pip install torch --index-url https://download.pytorch.org/whl/cpu && \
if [ ${ARCH} = "cpu" ] ; then pip install torch --index-url https://download.pytorch.org/whl/cpu; fi && \
pip install --no-cache-dir -r /home/user/comps/dataprep/redis/langchain_ray/requirements.txt

ENV PYTHONPATH=$PYTHONPATH:/home/user
Expand Down
4 changes: 3 additions & 1 deletion comps/dataprep/redis/llama_index/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ FROM python:3.11-slim

ENV LANG C.UTF-8

ARG ARCH="cpu"

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
build-essential \
libgl1-mesa-glx \
Expand All @@ -21,7 +23,7 @@ USER user
COPY comps /home/user/comps

RUN pip install --no-cache-dir --upgrade pip setuptools && \
pip install torch --index-url https://download.pytorch.org/whl/cpu && \
if [ ${ARCH} = "cpu" ] ; then pip install torch --index-url https://download.pytorch.org/whl/cpu; fi && \
pip install --no-cache-dir -r /home/user/comps/dataprep/redis/llama_index/requirements.txt

ENV PYTHONPATH=$PYTHONPATH:/home/user
Expand Down
2 changes: 1 addition & 1 deletion comps/embeddings/langchain/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

FROM langchain/langchain:latest

ARG ARCH="cpu" # other supported options are "gpu", "hpu"
ARG ARCH="cpu"

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
libgl1-mesa-glx \
Expand Down
4 changes: 3 additions & 1 deletion comps/reranks/langchain/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ FROM python:3.11-slim

ENV LANG C.UTF-8

ARG ARCH="cpu"

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
libgl1-mesa-glx \
libjemalloc-dev \
Expand All @@ -20,7 +22,7 @@ USER user
COPY comps /home/user/comps

RUN pip install --no-cache-dir --upgrade pip && \
pip install torch --index-url https://download.pytorch.org/whl/cpu && \
if [ ${ARCH} = "cpu" ] ; then pip install torch --index-url https://download.pytorch.org/whl/cpu; fi && \
pip install --no-cache-dir -r /home/user/comps/reranks/requirements.txt

ENV PYTHONPATH=$PYTHONPATH:/home/user
Expand Down
4 changes: 3 additions & 1 deletion comps/retrievers/langchain/milvus/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ FROM python:3.11-slim

ENV LANG C.UTF-8

ARG ARCH="cpu"

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
build-essential \
libgl1-mesa-glx \
Expand All @@ -21,7 +23,7 @@ USER user
COPY comps /home/user/comps

RUN pip install --no-cache-dir --upgrade pip && \
pip install torch --index-url https://download.pytorch.org/whl/cpu && \
if [ ${ARCH} = "cpu" ] ; then pip install torch --index-url https://download.pytorch.org/whl/cpu; fi && \
pip install --no-cache-dir -r /home/user/comps/retrievers/langchain/milvus/requirements.txt

ENV PYTHONPATH=$PYTHONPATH:/home/user
Expand Down
4 changes: 3 additions & 1 deletion comps/retrievers/langchain/redis/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

FROM langchain/langchain:latest

ARG ARCH="cpu"

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
libgl1-mesa-glx \
libjemalloc-dev \
Expand All @@ -20,7 +22,7 @@ RUN chmod +x /home/user/comps/retrievers/langchain/redis/run.sh
USER user

RUN pip install --no-cache-dir --upgrade pip && \
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu && \
if [ ${ARCH} = "cpu" ]; then pip install torch --index-url https://download.pytorch.org/whl/cpu; fi && \
pip install --no-cache-dir -r /home/user/comps/retrievers/langchain/redis/requirements.txt

ENV PYTHONPATH=$PYTHONPATH:/home/user
Expand Down

0 comments on commit 4ff8128

Please sign in to comment.