From fbbd2f6a35734d9e40d289fcfdfdbc2db42e2771 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Sat, 7 Oct 2023 11:13:17 +0200 Subject: [PATCH] feat(conda): add make target and entrypoints for the dockerfile Signed-off-by: Ettore Di Giacinto --- Dockerfile | 3 ++- Makefile | 4 ++++ extra/grpc/autogptq/run.sh | 10 ++++++++++ extra/grpc/bark/run.sh | 10 ++++++++++ 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100755 extra/grpc/autogptq/run.sh create mode 100755 extra/grpc/bark/run.sh diff --git a/Dockerfile b/Dockerfile index b6316b3f2957..dc0869d0ed05 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ ARG TARGETARCH ARG TARGETVARIANT ENV BUILD_TYPE=${BUILD_TYPE} -ENV EXTERNAL_GRPC_BACKENDS="huggingface-embeddings:/build/extra/grpc/huggingface/huggingface.py,autogptq:/build/extra/grpc/autogptq/autogptq.py,bark:/build/extra/grpc/bark/ttsbark.py,diffusers:/build/extra/grpc/diffusers/backend_diffusers.py,exllama:/build/extra/grpc/exllama/exllama.py,vall-e-x:/build/extra/grpc/vall-e-x/ttsvalle.py,vllm:/build/extra/grpc/vllm/backend_vllm.py" +ENV EXTERNAL_GRPC_BACKENDS="huggingface-embeddings:/build/extra/grpc/huggingface/huggingface.py,autogptq:/build/extra/grpc/autogptq/run.sh,bark:/build/extra/grpc/bark/run.sh,diffusers:/build/extra/grpc/diffusers/backend_diffusers.py,exllama:/build/extra/grpc/exllama/exllama.py,vall-e-x:/build/extra/grpc/vall-e-x/ttsvalle.py,vllm:/build/extra/grpc/vllm/backend_vllm.py" ENV GALLERIES='[{"name":"model-gallery", "url":"github:go-skynet/model-gallery/index.yaml"}, {"url": "github:go-skynet/model-gallery/huggingface.yaml","name":"huggingface"}]' ARG GO_TAGS="stablediffusion tts" @@ -39,6 +39,7 @@ COPY extra/requirements.txt /build/extra/requirements.txt ENV PATH="/root/.cargo/bin:${PATH}" RUN pip install --upgrade pip RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +RUN make prepare-extra-conda-environments RUN if [ "${TARGETARCH}" = "amd64" ]; then \ pip install git+https://github.com/suno-ai/bark.git diffusers invisible_watermark transformers accelerate safetensors;\ fi diff --git a/Makefile b/Makefile index 8ad4c579d562..d7c27d04b2bb 100644 --- a/Makefile +++ b/Makefile @@ -379,6 +379,10 @@ protogen-python: ## GRPC +prepare-extra-conda-environments: + $(MAKE) -C extra/grpc/autogptq + $(MAKE) -C extra/grpc/bark + backend-assets/grpc: mkdir -p backend-assets/grpc diff --git a/extra/grpc/autogptq/run.sh b/extra/grpc/autogptq/run.sh new file mode 100755 index 000000000000..22d1216c9637 --- /dev/null +++ b/extra/grpc/autogptq/run.sh @@ -0,0 +1,10 @@ +## +## A bash script wrapper that runs the autogptq server with conda + +# Activate conda environment +source activate autogptq + +# get the directory where the bash script is located +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +python $DIR/autogptq.py \ No newline at end of file diff --git a/extra/grpc/bark/run.sh b/extra/grpc/bark/run.sh new file mode 100755 index 000000000000..a21bfa738866 --- /dev/null +++ b/extra/grpc/bark/run.sh @@ -0,0 +1,10 @@ +## +## A bash script wrapper that runs the ttsbark server with conda + +# Activate conda environment +source activate ttsbark + +# get the directory where the bash script is located +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +python $DIR/ttsbark.py \ No newline at end of file