Skip to content

Commit

Permalink
Merge branch 'opea-project:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
siddhivelankar23 authored Aug 28, 2024
2 parents 55522d2 + b6c0785 commit 456ba47
Show file tree
Hide file tree
Showing 36 changed files with 81 additions and 143 deletions.
3 changes: 1 addition & 2 deletions comps/chathistory/mongo/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ ENV LANG=C.UTF-8

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
build-essential \
libgl1-mesa-glx \
libjemalloc-dev \
vim
libgl1-mesa-glx

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
Expand Down
12 changes: 12 additions & 0 deletions comps/cores/mega/orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ async def schedule(self, initial_inputs: Dict, llm_parameters: LLMParams = LLMPa
downstreams.remove(downstream)
except re.error as e:
print("Pattern invalid! Operation cancelled.")
if len(downstreams) == 0 and llm_parameters.streaming:
# turn the response to a StreamingResponse
# to make the response uniform to UI
def fake_stream(text):
yield "data: b'" + text + "'\n\n"
yield "data: [DONE]\n\n"

self.dump_outputs(
node,
StreamingResponse(fake_stream(response["text"]), media_type="text/event-stream"),
result_dict,
)

for d_node in downstreams:
if all(i in result_dict for i in runtime_graph.predecessors(d_node)):
Expand Down
7 changes: 2 additions & 5 deletions comps/dataprep/milvus/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -10,10 +9,9 @@ ARG ARCH="cpu"

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
build-essential \
libgl1-mesa-glx \
libjemalloc-dev \
default-jre \
vim
libgl1-mesa-glx \
libjemalloc-dev

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
Expand All @@ -37,4 +35,3 @@ USER user
WORKDIR /home/user/comps/dataprep/milvus

ENTRYPOINT ["python", "prepare_doc_milvus.py"]

7 changes: 2 additions & 5 deletions comps/dataprep/pgvector/langchain/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -10,10 +9,9 @@ ARG ARCH="cpu"

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
build-essential \
libgl1-mesa-glx \
libjemalloc-dev \
default-jre \
vim
libgl1-mesa-glx \
libjemalloc-dev

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
Expand All @@ -38,4 +36,3 @@ USER user
WORKDIR /home/user/comps/dataprep/pgvector/langchain

ENTRYPOINT ["python", "prepare_doc_pgvector.py"]

10 changes: 3 additions & 7 deletions comps/dataprep/pinecone/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -10,12 +9,10 @@ ARG ARCH="cpu"

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
build-essential \
libgl1-mesa-glx \
libjemalloc-dev \
default-jre \
vim \
libcairo2

libcairo2 \
libgl1-mesa-glx \
libjemalloc-dev

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
Expand Down Expand Up @@ -43,4 +40,3 @@ USER user
WORKDIR /home/user/comps/dataprep/pinecone

ENTRYPOINT ["python", "prepare_doc_pinecone.py"]

6 changes: 2 additions & 4 deletions comps/dataprep/qdrant/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -10,10 +9,9 @@ ARG ARCH="cpu"

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
build-essential \
libgl1-mesa-glx \
libjemalloc-dev \
default-jre \
vim
libgl1-mesa-glx \
libjemalloc-dev

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
Expand Down
9 changes: 3 additions & 6 deletions comps/dataprep/redis/langchain/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -10,13 +9,12 @@ ARG ARCH="cpu"

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
build-essential \
default-jre \
libgl1-mesa-glx \
libjemalloc-dev \
default-jre \
vim \
libreoffice \
poppler-utils \
tesseract-ocr \
libreoffice
tesseract-ocr

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
Expand All @@ -41,4 +39,3 @@ USER user
WORKDIR /home/user/comps/dataprep/redis/langchain

ENTRYPOINT ["python", "prepare_doc_redis.py"]

5 changes: 1 addition & 4 deletions comps/dataprep/redis/langchain_ray/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -10,10 +9,9 @@ ARG ARCH="cpu"

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
build-essential \
libcairo2 \
libgl1-mesa-glx \
libjemalloc-dev \
vim \
libcairo2 \
poppler-utils \
tesseract-ocr

Expand Down Expand Up @@ -41,4 +39,3 @@ USER user
WORKDIR /home/user/comps/dataprep/redis/langchain_ray

ENTRYPOINT ["python", "prepare_doc_redis_on_ray.py"]

5 changes: 1 addition & 4 deletions comps/dataprep/redis/llama_index/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -10,10 +9,9 @@ ARG ARCH="cpu"

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
build-essential \
libcairo2 \
libgl1-mesa-glx \
libjemalloc-dev \
vim \
libcairo2 \
poppler-utils \
tesseract-ocr

Expand All @@ -40,4 +38,3 @@ USER user
WORKDIR /home/user/comps/dataprep/redis/llama_index

ENTRYPOINT ["python", "prepare_doc_redis.py"]

5 changes: 1 addition & 4 deletions comps/embeddings/langchain-mosec/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

FROM langchain/langchain:latest

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
libgl1-mesa-glx \
libjemalloc-dev \
vim
libjemalloc-dev

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
Expand All @@ -25,4 +23,3 @@ ENV PYTHONPATH=$PYTHONPATH:/home/user
WORKDIR /home/user/comps/embeddings/langchain-mosec

ENTRYPOINT ["python", "embedding_mosec.py"]

5 changes: 1 addition & 4 deletions comps/embeddings/langchain/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -8,8 +7,7 @@ ARG ARCH="cpu"

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
libgl1-mesa-glx \
libjemalloc-dev \
vim
libjemalloc-dev

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
Expand All @@ -28,4 +26,3 @@ ENV PYTHONPATH=$PYTHONPATH:/home/user
WORKDIR /home/user/comps/embeddings/langchain

ENTRYPOINT ["python", "embedding_tei.py"]

3 changes: 0 additions & 3 deletions comps/embeddings/llama_index/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -7,7 +6,6 @@ FROM ubuntu:22.04
RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
libgl1-mesa-glx \
libjemalloc-dev \
vim \
python3 \
python3-pip

Expand All @@ -27,4 +25,3 @@ ENV PYTHONPATH=$PYTHONPATH:/home/user
WORKDIR /home/user/comps/embeddings/llama_index

ENTRYPOINT ["python3", "embedding_tei.py"]

3 changes: 1 addition & 2 deletions comps/guardrails/llama_guard/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ ARG ARCH="cpu"

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
libgl1-mesa-glx \
libjemalloc-dev \
vim
libjemalloc-dev

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
Expand Down
3 changes: 1 addition & 2 deletions comps/guardrails/pii_detection/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ ENV LANG=C.UTF-8
RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
build-essential \
libgl1-mesa-glx \
libjemalloc-dev \
vim
libjemalloc-dev

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
Expand Down
3 changes: 1 addition & 2 deletions comps/guardrails/toxicity_detection/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ ARG ARCH="cpu"

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
libgl1-mesa-glx \
libjemalloc-dev \
vim
libjemalloc-dev

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
Expand Down
3 changes: 1 addition & 2 deletions comps/knowledgegraphs/langchain/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ ARG ARCH="cpu" # Set this to "cpu" or "gpu"

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
libgl1-mesa-glx \
libjemalloc-dev \
vim
libjemalloc-dev

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
Expand Down
4 changes: 1 addition & 3 deletions comps/llms/faq-generation/tgi/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

FROM langchain/langchain:latest

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
libgl1-mesa-glx \
libjemalloc-dev \
vim
libjemalloc-dev

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
Expand Down
4 changes: 1 addition & 3 deletions comps/llms/summarization/tgi/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

FROM langchain/langchain:latest

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
libgl1-mesa-glx \
libjemalloc-dev \
vim
libjemalloc-dev

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
Expand Down
13 changes: 5 additions & 8 deletions comps/llms/text-generation/native/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -11,20 +9,19 @@ ENV LANG=en_US.UTF-8
ARG REPO=https://github.com/huggingface/optimum-habana.git
ARG REPO_VER=v1.12.1

RUN apt-get update && \
apt-get install git-lfs && \
git-lfs install && \
apt-get install -y --no-install-recommends --fix-missing \
RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \
git-lfs \
libgl1-mesa-glx \
libjemalloc-dev \
vim
libjemalloc-dev

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

USER user

RUN git lfs install

COPY comps /home/user/comps

RUN pip install --upgrade-strategy eager optimum[habana] && \
Expand Down
6 changes: 2 additions & 4 deletions comps/llms/text-generation/ollama/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

FROM langchain/langchain:latest

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
curl \
libgl1-mesa-glx \
libjemalloc-dev \
vim \
curl
libjemalloc-dev

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
Expand Down
4 changes: 1 addition & 3 deletions comps/llms/text-generation/tgi/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

FROM langchain/langchain:latest

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
libgl1-mesa-glx \
libjemalloc-dev \
vim
libjemalloc-dev

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
Expand Down
Loading

0 comments on commit 456ba47

Please sign in to comment.