@@ -28,7 +28,7 @@ WHISPER_CPP_VERSION?=85ed71aaec8e0612a84c0b67804bde75aa75a273
2828BERT_VERSION? =6abe312cded14042f6b7c3cd8edf082713334a4d
2929
3030# go-piper version
31- PIPER_VERSION? =56b8a81b4760a6fbee1a82e62f007ae7e8f010a7
31+ PIPER_VERSION? =736f6fb639ab8e3397356e48eeb6bdcb9da88a78
3232
3333# stablediffusion version
3434STABLEDIFFUSION_VERSION? =d89260f598afb809279bc72aa0107b4292587632
@@ -52,7 +52,6 @@ override LD_FLAGS += -X "github.com/go-skynet/LocalAI/internal.Version=$(VERSION
5252override LD_FLAGS += -X "github.com/go-skynet/LocalAI/internal.Commit=$(shell git rev-parse HEAD) "
5353
5454OPTIONAL_TARGETS? =
55- ESPEAK_DATA? =
5655
5756OS := $(shell uname -s)
5857ARCH := $(shell uname -m)
@@ -120,6 +119,8 @@ endif
120119ifeq ($(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
124125endif
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
187184gpt4all/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
505502backend-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
509506backend-assets/grpc/whisper : backend-assets/grpc whisper.cpp/libwhisper.a
0 commit comments