@@ -26,6 +26,10 @@ STABLEDIFFUSION_VERSION?=4a3cd6aeae6f66ee57eae9a0075f8c58c3a6a38f
26
26
TINYDREAM_REPO? =https://github.com/M0Rf30/go-tiny-dream
27
27
TINYDREAM_VERSION? =c04fa463ace9d9a6464313aa5f9cd0f953b6c057
28
28
29
+ # bark.cpp
30
+ BARKCPP_REPO? =https://github.com/PABannier/bark.cpp.git
31
+ BARKCPP_VERSION? =v1.0.0
32
+
29
33
ONNX_VERSION? =1.20.0
30
34
ONNX_ARCH? =x64
31
35
ONNX_OS? =linux
@@ -201,6 +205,7 @@ ALL_GRPC_BACKENDS+=backend-assets/grpc/llama-ggml
201
205
ALL_GRPC_BACKENDS+ =backend-assets/grpc/llama-cpp-grpc
202
206
ALL_GRPC_BACKENDS+ =backend-assets/util/llama-cpp-rpc-server
203
207
ALL_GRPC_BACKENDS+ =backend-assets/grpc/whisper
208
+ ALL_GRPC_BACKENDS+ =backend-assets/grpc/bark-cpp
204
209
ALL_GRPC_BACKENDS+ =backend-assets/grpc/local-store
205
210
ALL_GRPC_BACKENDS+ =backend-assets/grpc/silero-vad
206
211
ALL_GRPC_BACKENDS+ =$(OPTIONAL_GRPC )
@@ -233,6 +238,22 @@ sources/go-llama.cpp:
233
238
git checkout $(GOLLAMA_VERSION ) && \
234
239
git submodule update --init --recursive --depth 1 --single-branch
235
240
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
+
236
257
sources/go-llama.cpp/libbinding.a : sources/go-llama.cpp
237
258
$(MAKE ) -C sources/go-llama.cpp BUILD_TYPE=$(STABLE_BUILD_TYPE ) libbinding.a
238
259
@@ -302,7 +323,7 @@ sources/whisper.cpp:
302
323
sources/whisper.cpp/libwhisper.a : sources/whisper.cpp
303
324
cd sources/whisper.cpp && $(MAKE ) libwhisper.a libggml.a
304
325
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
306
327
307
328
replace :
308
329
$(GOCMD ) mod edit -replace github.com/ggerganov/whisper.cpp=$(CURDIR ) /sources/whisper.cpp
@@ -343,6 +364,7 @@ clean: ## Remove build related file
343
364
rm -rf release/
344
365
rm -rf backend-assets/*
345
366
$(MAKE ) -C backend/cpp/grpc clean
367
+ $(MAKE ) -C backend/go/bark clean
346
368
$(MAKE ) -C backend/cpp/llama clean
347
369
rm -rf backend/cpp/llama-* || true
348
370
$(MAKE ) dropreplace
@@ -792,6 +814,13 @@ ifneq ($(UPX),)
792
814
$(UPX) backend-assets/grpc/llama-ggml
793
815
endif
794
816
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
+
795
824
backend-assets/grpc/piper : sources/go-piper sources/go-piper/libpiper_binding.a backend-assets/grpc backend-assets/espeak-ng-data
796
825
CGO_CXXFLAGS=" $( PIPER_CGO_CXXFLAGS) " CGO_LDFLAGS=" $( PIPER_CGO_LDFLAGS) " LIBRARY_PATH=$(CURDIR ) /sources/go-piper \
797
826
$(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/piper ./backend/go/tts/
0 commit comments