From 01e58e2b9def8dbdbfc421b815cc3fb70566abd6 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Sun, 15 Oct 2023 14:53:28 +0200 Subject: [PATCH] workaround --- Dockerfile | 6 +++--- Makefile | 11 +++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 67041abfcb33..431307a5798b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -105,8 +105,8 @@ RUN make prepare COPY . . COPY .git . -# piper does not tolerate a newer version of abseil, build only the piper backend -RUN GRPC_BACKENDS=backend-assets/grpc/piper ESPEAK_DATA=/build/lib/Linux-$(uname -m)/piper_phonemize/lib/espeak-ng-data make build +# stablediffusion does not tolerate a newer version of abseil, build it first +RUN GRPC_BACKENDS=backend-assets/grpc/stablediffusion make build RUN git clone --recurse-submodules -b v1.58.0 --depth 1 --shallow-submodules https://github.com/grpc/grpc && \ cd grpc && mkdir -p cmake/build && cd cmake/build && cmake -DgRPC_INSTALL=ON \ @@ -114,7 +114,7 @@ RUN git clone --recurse-submodules -b v1.58.0 --depth 1 --shallow-submodules htt ../.. && make -j12 install && rm -rf grpc # Rebuild with defaults backends -RUN make build +RUN ESPEAK_DATA=/build/lib/Linux-$(uname -m)/piper_phonemize/lib/espeak-ng-data make build ################################### ################################### diff --git a/Makefile b/Makefile index a2858093ff21..692417bd660e 100644 --- a/Makefile +++ b/Makefile @@ -225,7 +225,7 @@ go-llama/libbinding.a: go-llama go-llama-stable/libbinding.a: go-llama-stable $(MAKE) -C go-llama-stable BUILD_TYPE=$(STABLE_BUILD_TYPE) libbinding.a -go-piper/libpiper_binding.a: +go-piper/libpiper_binding.a: go-piper $(MAKE) -C go-piper libpiper_binding.a example/main get-sources: go-llama go-llama-stable go-ggllm go-ggml-transformers gpt4all go-piper go-rwkv whisper.cpp go-bert bloomz go-stable-diffusion @@ -464,9 +464,12 @@ backend-assets/grpc/bert-embeddings: backend-assets/grpc go-bert/libgobert.a backend-assets/grpc/langchain-huggingface: backend-assets/grpc $(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o backend-assets/grpc/langchain-huggingface ./cmd/grpc/langchain-huggingface/ -backend-assets/grpc/stablediffusion: backend-assets/grpc go-stable-diffusion/libstablediffusion.a - CGO_LDFLAGS="$(CGO_LDFLAGS)" C_INCLUDE_PATH=$(shell pwd)/go-stable-diffusion/ LIBRARY_PATH=$(shell pwd)/go-stable-diffusion/ \ - $(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o backend-assets/grpc/stablediffusion ./cmd/grpc/stablediffusion/ +backend-assets/grpc/stablediffusion: backend-assets/grpc + if [ ! -f backend-assets/grpc/stablediffusion ]; then \ + $(MAKE) go-stable-diffusion/libstablediffusion.a; \ + CGO_LDFLAGS="$(CGO_LDFLAGS)" C_INCLUDE_PATH=$(shell pwd)/go-stable-diffusion/ LIBRARY_PATH=$(shell pwd)/go-stable-diffusion/ \ + $(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o backend-assets/grpc/stablediffusion ./cmd/grpc/stablediffusion/; \ + fi backend-assets/grpc/piper: backend-assets/grpc backend-assets/espeak-ng-data go-piper/libpiper_binding.a CGO_LDFLAGS="$(CGO_LDFLAGS)" LIBRARY_PATH=$(shell pwd)/go-piper \