From 3262aee7315e8b523ca0b16555cd95d1a554fcc8 Mon Sep 17 00:00:00 2001 From: ZePan110 Date: Tue, 13 Aug 2024 15:10:45 +0800 Subject: [PATCH] Fix embeddings_langchain-mosec issue. (#473) Signed-off-by: zepan Signed-off-by: BaoHuiling --- comps/embeddings/langchain-mosec/mosec-docker/Dockerfile | 3 +-- comps/embeddings/langchain-mosec/mosec-docker/server-ipex.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/comps/embeddings/langchain-mosec/mosec-docker/Dockerfile b/comps/embeddings/langchain-mosec/mosec-docker/Dockerfile index a8241e04e..945f7b90c 100644 --- a/comps/embeddings/langchain-mosec/mosec-docker/Dockerfile +++ b/comps/embeddings/langchain-mosec/mosec-docker/Dockerfile @@ -10,7 +10,6 @@ ARG DEBIAN_FRONTEND=noninteractive ENV GLIBC_TUNABLES glibc.cpu.x86_shstk=permissive RUN apt update && apt install -y python3 python3-pip -USER user COPY comps /home/user/comps RUN pip3 install torch==2.2.2 torchvision --index-url https://download.pytorch.org/whl/cpu @@ -19,7 +18,7 @@ RUN pip3 install transformers RUN pip3 install llmspec mosec RUN cd /home/user/ && export HF_ENDPOINT=https://hf-mirror.com && huggingface-cli download --resume-download BAAI/bge-large-zh-v1.5 --local-dir /home/user/bge-large-zh-v1.5 - +USER user ENV EMB_MODEL="/home/user/bge-large-zh-v1.5/" WORKDIR /home/user/comps/embeddings/langchain-mosec/mosec-docker diff --git a/comps/embeddings/langchain-mosec/mosec-docker/server-ipex.py b/comps/embeddings/langchain-mosec/mosec-docker/server-ipex.py index 6db56fb88..9639b424a 100644 --- a/comps/embeddings/langchain-mosec/mosec-docker/server-ipex.py +++ b/comps/embeddings/langchain-mosec/mosec-docker/server-ipex.py @@ -13,7 +13,7 @@ from llmspec import EmbeddingData, EmbeddingRequest, EmbeddingResponse, TokenUsage from mosec import ClientError, Runtime, Server, Worker -DEFAULT_MODEL = "/root/bge-large-zh-v1.5/" +DEFAULT_MODEL = "/home/user/bge-large-zh-v1.5/" class Embedding(Worker):