@@ -26,6 +26,10 @@ STABLEDIFFUSION_VERSION?=4a3cd6aeae6f66ee57eae9a0075f8c58c3a6a38f
2626TINYDREAM_REPO? =https://github.com/M0Rf30/go-tiny-dream
2727TINYDREAM_VERSION? =c04fa463ace9d9a6464313aa5f9cd0f953b6c057
2828
29+ # bark.cpp
30+ BARKCPP_REPO? =https://github.com/PABannier/bark.cpp.git
31+ BARKCPP_VERSION? =v1.0.0
32+
2933ONNX_VERSION? =1.20.0
3034ONNX_ARCH? =x64
3135ONNX_OS? =linux
@@ -201,6 +205,7 @@ ALL_GRPC_BACKENDS+=backend-assets/grpc/llama-ggml
201205ALL_GRPC_BACKENDS+ =backend-assets/grpc/llama-cpp-grpc
202206ALL_GRPC_BACKENDS+ =backend-assets/util/llama-cpp-rpc-server
203207ALL_GRPC_BACKENDS+ =backend-assets/grpc/whisper
208+ ALL_GRPC_BACKENDS+ =backend-assets/grpc/bark-cpp
204209ALL_GRPC_BACKENDS+ =backend-assets/grpc/local-store
205210ALL_GRPC_BACKENDS+ =backend-assets/grpc/silero-vad
206211ALL_GRPC_BACKENDS+ =$(OPTIONAL_GRPC )
@@ -233,6 +238,22 @@ sources/go-llama.cpp:
233238 git checkout $(GOLLAMA_VERSION ) && \
234239 git submodule update --init --recursive --depth 1 --single-branch
235240
241+ sources/bark.cpp :
242+ git clone --recursive https://github.com/PABannier/bark.cpp.git sources/bark.cpp && \
243+ cd sources/bark.cpp && \
244+ git checkout $(BARKCPP_VERSION ) && \
245+ git submodule update --init --recursive --depth 1 --single-branch
246+
247+ sources/bark.cpp/build/libbark.a : sources/bark.cpp
248+ cd sources/bark.cpp && \
249+ mkdir build && \
250+ cd build && \
251+ cmake $(CMAKE_ARGS ) .. && \
252+ cmake --build . --config Release
253+
254+ backend/go/bark/libbark.a : sources/bark.cpp/build/libbark.a
255+ $(MAKE ) -C backend/go/bark libbark.a
256+
236257sources/go-llama.cpp/libbinding.a : sources/go-llama.cpp
237258 $(MAKE ) -C sources/go-llama.cpp BUILD_TYPE=$(STABLE_BUILD_TYPE ) libbinding.a
238259
@@ -302,7 +323,7 @@ sources/whisper.cpp:
302323sources/whisper.cpp/libwhisper.a : sources/whisper.cpp
303324 cd sources/whisper.cpp && $(MAKE ) libwhisper.a libggml.a
304325
305- get-sources : sources/go-llama.cpp sources/go-piper sources/whisper.cpp sources/go-stable-diffusion sources/go-tiny-dream backend/cpp/llama/llama.cpp
326+ get-sources : sources/go-llama.cpp sources/go-piper sources/bark.cpp sources/ whisper.cpp sources/go-stable-diffusion sources/go-tiny-dream backend/cpp/llama/llama.cpp
306327
307328replace :
308329 $(GOCMD ) mod edit -replace github.com/ggerganov/whisper.cpp=$(CURDIR ) /sources/whisper.cpp
@@ -343,6 +364,7 @@ clean: ## Remove build related file
343364 rm -rf release/
344365 rm -rf backend-assets/*
345366 $(MAKE ) -C backend/cpp/grpc clean
367+ $(MAKE ) -C backend/go/bark clean
346368 $(MAKE ) -C backend/cpp/llama clean
347369 rm -rf backend/cpp/llama-* || true
348370 $(MAKE ) dropreplace
@@ -792,6 +814,13 @@ ifneq ($(UPX),)
792814 $(UPX) backend-assets/grpc/llama-ggml
793815endif
794816
817+ backend-assets/grpc/bark-cpp : backend/go/bark/libbark.a backend-assets/grpc
818+ CGO_LDFLAGS=" $( CGO_LDFLAGS) " C_INCLUDE_PATH=$(CURDIR ) /backend/go/bark/ LIBRARY_PATH=$(CURDIR ) /backend/go/bark/ \
819+ $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/bark-cpp ./backend/go/bark/
820+ ifneq ($(UPX ) ,)
821+ $(UPX) backend-assets/grpc/bark-cpp
822+ endif
823+
795824backend-assets/grpc/piper : sources/go-piper sources/go-piper/libpiper_binding.a backend-assets/grpc backend-assets/espeak-ng-data
796825 CGO_CXXFLAGS=" $( PIPER_CGO_CXXFLAGS) " CGO_LDFLAGS=" $( PIPER_CGO_LDFLAGS) " LIBRARY_PATH=$(CURDIR ) /sources/go-piper \
797826 $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/piper ./backend/go/tts/
0 commit comments