Skip to content

Commit eee2b6d

Browse files
committed
Makefile: update go-piper with piper 2023.11.6-3
Signed-off-by: Gianluca Boiano <[email protected]>
1 parent 3b4c5d5 commit eee2b6d

File tree

4 files changed

+12
-31
lines changed

4 files changed

+12
-31
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -80,32 +80,16 @@ jobs:
8080
sudo rm -rfv /usr/bin/conda || true
8181
PATH=$PATH:/opt/conda/bin make -C extra/grpc/huggingface
8282
83-
# Pre-build stable diffusion before we install a newever version of abseil (not compatible with stablediffusion-ncn)
84-
GO_TAGS="tts stablediffusion" GRPC_BACKENDS=backend-assets/grpc/stablediffusion make build
85-
86-
sudo mkdir /build && sudo chmod -R 777 /build && cd /build && \
87-
curl -L "https://github.com/gabime/spdlog/archive/refs/tags/v1.11.0.tar.gz" | \
88-
tar -xzvf - && \
89-
mkdir -p "spdlog-1.11.0/build" && \
90-
cd "spdlog-1.11.0/build" && \
91-
cmake .. && \
92-
make -j8 && \
93-
sudo cmake --install . --prefix /usr && mkdir -p "lib/Linux-$(uname -m)" && \
94-
cd /build && \
95-
mkdir -p "lib/Linux-$(uname -m)/piper_phonemize" && \
96-
curl -L "https://github.com/rhasspy/piper-phonemize/releases/download/v1.0.0/libpiper_phonemize-amd64.tar.gz" | \
97-
tar -C "lib/Linux-$(uname -m)/piper_phonemize" -xzvf - && ls -liah /build/lib/Linux-$(uname -m)/piper_phonemize/ && \
98-
sudo cp -rfv /build/lib/Linux-$(uname -m)/piper_phonemize/lib/. /usr/lib/ && \
99-
sudo ln -s /usr/lib/libpiper_phonemize.so /usr/lib/libpiper_phonemize.so.1 && \
100-
sudo cp -rfv /build/lib/Linux-$(uname -m)/piper_phonemize/include/. /usr/include/
83+
# Pre-build stable diffusion before we install a newer version of abseil (not compatible with stablediffusion-ncn)
84+
GO_TAGS="stablediffusion tts" GRPC_BACKENDS=backend-assets/grpc/stablediffusion make build
10185
10286
git clone --recurse-submodules -b v1.58.0 --depth 1 --shallow-submodules https://github.com/grpc/grpc && \
10387
cd grpc && mkdir -p cmake/build && cd cmake/build && cmake -DgRPC_INSTALL=ON \
10488
-DgRPC_BUILD_TESTS=OFF \
10589
../.. && sudo make -j12 install
10690
- name: Test
10791
run: |
108-
ESPEAK_DATA="/build/lib/Linux-$(uname -m)/piper_phonemize/lib/espeak-ng-data" GO_TAGS="tts stablediffusion" make test
92+
GO_TAGS="stablediffusion tts" make test
10993
11094
tests-apple:
11195
runs-on: macOS-latest

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ RUN if [ "${BUILD_GRPC}" = "true" ]; then \
137137
; fi
138138

139139
# Rebuild with defaults backends
140-
RUN ESPEAK_DATA=/build/lib/Linux-$(uname -m)/piper_phonemize/lib/espeak-ng-data make build
140+
RUN make build
141141

142142
###################################
143143
###################################

Makefile

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ WHISPER_CPP_VERSION?=85ed71aaec8e0612a84c0b67804bde75aa75a273
2828
BERT_VERSION?=6abe312cded14042f6b7c3cd8edf082713334a4d
2929

3030
# go-piper version
31-
PIPER_VERSION?=56b8a81b4760a6fbee1a82e62f007ae7e8f010a7
31+
PIPER_VERSION?=736f6fb639ab8e3397356e48eeb6bdcb9da88a78
3232

3333
# stablediffusion version
3434
STABLEDIFFUSION_VERSION?=d89260f598afb809279bc72aa0107b4292587632
@@ -52,7 +52,6 @@ override LD_FLAGS += -X "github.com/go-skynet/LocalAI/internal.Version=$(VERSION
5252
override LD_FLAGS += -X "github.com/go-skynet/LocalAI/internal.Commit=$(shell git rev-parse HEAD)"
5353

5454
OPTIONAL_TARGETS?=
55-
ESPEAK_DATA?=
5655

5756
OS := $(shell uname -s)
5857
ARCH := $(shell uname -m)
@@ -120,6 +119,8 @@ endif
120119
ifeq ($(findstring tts,$(GO_TAGS)),tts)
121120
# OPTIONAL_TARGETS+=go-piper/libpiper_binding.a
122121
# OPTIONAL_TARGETS+=backend-assets/espeak-ng-data
122+
PIPER_CGO_CXXFLAGS+=-I$(shell pwd)/go-piper/piper/src/cpp -I$(shell pwd)/go-piper/piper/build/fi/include -I$(shell pwd)/go-piper/piper/build/pi/include -I$(shell pwd)/go-piper/piper/build/si/include
123+
PIPER_CGO_LDFLAGS+=-L$(shell pwd)/go-piper/piper/build/fi/lib -L$(shell pwd)/go-piper/piper/build/pi/lib -L$(shell pwd)/go-piper/piper/build/si/lib -lfmt -lspdlog
123124
OPTIONAL_GRPC+=backend-assets/grpc/piper
124125
endif
125126

@@ -175,14 +176,10 @@ backend-assets/gpt4all: gpt4all/gpt4all-bindings/golang/libgpt4all.a
175176
@cp gpt4all/gpt4all-bindings/golang/buildllm/*.dylib backend-assets/gpt4all/ || true
176177
@cp gpt4all/gpt4all-bindings/golang/buildllm/*.dll backend-assets/gpt4all/ || true
177178

178-
backend-assets/espeak-ng-data:
179+
backend-assets/espeak-ng-data: go-piper
179180
mkdir -p backend-assets/espeak-ng-data
180-
ifdef ESPEAK_DATA
181-
@cp -rf $(ESPEAK_DATA)/. backend-assets/espeak-ng-data
182-
else
183-
@echo "ESPEAK_DATA not set, skipping tts. Note that this will break the tts functionality."
184-
@touch backend-assets/espeak-ng-data/keep
185-
endif
181+
$(MAKE) -C go-piper piper.o
182+
@cp -rf go-piper/piper/build/pi/share/espeak-ng-data/. backend-assets/espeak-ng-data
186183

187184
gpt4all/gpt4all-bindings/golang/libgpt4all.a: gpt4all
188185
$(MAKE) -C gpt4all/gpt4all-bindings/golang/ libgpt4all.a
@@ -503,7 +500,7 @@ backend-assets/grpc/stablediffusion: backend-assets/grpc
503500
fi
504501

505502
backend-assets/grpc/piper: backend-assets/grpc backend-assets/espeak-ng-data go-piper/libpiper_binding.a
506-
CGO_LDFLAGS="$(CGO_LDFLAGS)" LIBRARY_PATH=$(shell pwd)/go-piper \
503+
CGO_CXXFLAGS="$(PIPER_CGO_CXXFLAGS)" CGO_LDFLAGS="$(PIPER_CGO_LDFLAGS)" LIBRARY_PATH=$(shell pwd)/go-piper \
507504
$(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o backend-assets/grpc/piper ./cmd/grpc/piper/
508505

509506
backend-assets/grpc/whisper: backend-assets/grpc whisper.cpp/libwhisper.a

entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cd /build
55

66
if [ "$REBUILD" != "false" ]; then
77
rm -rf ./local-ai
8-
ESPEAK_DATA=/build/lib/Linux-$(uname -m)/piper_phonemize/lib/espeak-ng-data make build -j${BUILD_PARALLELISM:-1}
8+
make build -j${BUILD_PARALLELISM:-1}
99
else
1010
echo "@@@@@"
1111
echo "Skipping rebuild"

0 commit comments

Comments
 (0)