@@ -33,6 +33,9 @@ PIPER_VERSION?=7fe05263b4ca3ffa93a53e2737643a6a6afb9a7b
3333# stablediffusion version
3434STABLEDIFFUSION_VERSION? =902db5f066fd137697e3b69d0fa10d4782bd2c2f
3535
36+ # tinydream version
37+ TINYDREAM_VERSION? =772a9c0d9aaf768290e63cca3c904fe69faf677a
38+
3639export BUILD_TYPE? =
3740export STABLE_BUILD_TYPE? =$(BUILD_TYPE )
3841export CMAKE_ARGS? =
@@ -122,6 +125,11 @@ ifeq ($(findstring stablediffusion,$(GO_TAGS)),stablediffusion)
122125 OPTIONAL_GRPC+=backend-assets/grpc/stablediffusion
123126endif
124127
128+ ifeq ($(findstring tinydream,$(GO_TAGS ) ) ,tinydream)
129+ # OPTIONAL_TARGETS+=go-tiny-dream/libtinydream.a
130+ OPTIONAL_GRPC+=backend-assets/grpc/tinydream
131+ endif
132+
125133ifeq ($(findstring tts,$(GO_TAGS ) ) ,tts)
126134# OPTIONAL_TARGETS+=go-piper/libpiper_binding.a
127135# OPTIONAL_TARGETS+=backend-assets/espeak-ng-data
@@ -165,6 +173,14 @@ sources/go-stable-diffusion:
165173sources/go-stable-diffusion/libstablediffusion.a :
166174 $(MAKE ) -C sources/go-stable-diffusion libstablediffusion.a
167175
176+ # # tiny-dream
177+ sources/go-tiny-dream :
178+ git clone --recurse-submodules https://github.com/M0Rf30/go-tiny-dream sources/go-tiny-dream
179+ cd sources/go-tiny-dream && git checkout -b build $(TINYDREAM_VERSION ) && git submodule update --init --recursive --depth 1
180+
181+ sources/go-tiny-dream/libtinydream.a :
182+ $(MAKE ) -C sources/go-tiny-dream libtinydream.a
183+
168184# # RWKV
169185sources/go-rwkv :
170186 git clone --recurse-submodules $(RWKV_REPO ) sources/go-rwkv
@@ -225,7 +241,7 @@ sources/go-piper/libpiper_binding.a: sources/go-piper
225241backend/cpp/llama/llama.cpp :
226242 $(MAKE ) -C backend/cpp/llama llama.cpp
227243
228- get-sources : backend/cpp/llama/llama.cpp sources/go-llama sources/go-llama-ggml sources/go-ggml-transformers sources/gpt4all sources/go-piper sources/go-rwkv sources/whisper.cpp sources/go-bert sources/go-stable-diffusion
244+ get-sources : backend/cpp/llama/llama.cpp sources/go-llama sources/go-llama-ggml sources/go-ggml-transformers sources/gpt4all sources/go-piper sources/go-rwkv sources/whisper.cpp sources/go-bert sources/go-stable-diffusion sources/go-tiny-dream
229245 touch $@
230246
231247replace :
@@ -235,6 +251,7 @@ replace:
235251 $(GOCMD ) mod edit -replace github.com/ggerganov/whisper.cpp=$(shell pwd) /sources/whisper.cpp
236252 $(GOCMD ) mod edit -replace github.com/go-skynet/go-bert.cpp=$(shell pwd) /sources/go-bert
237253 $(GOCMD ) mod edit -replace github.com/mudler/go-stable-diffusion=$(shell pwd) /sources/go-stable-diffusion
254+ $(GOCMD ) mod edit -replace github.com/M0Rf30/go-tiny-dream=$(shell pwd) /sources/go-tiny-dream
238255 $(GOCMD ) mod edit -replace github.com/mudler/go-piper=$(shell pwd) /sources/go-piper
239256
240257prepare-sources : get-sources replace
@@ -253,6 +270,7 @@ rebuild: ## Rebuilds the project
253270 $(MAKE ) -C sources/go-stable-diffusion clean
254271 $(MAKE ) -C sources/go-bert clean
255272 $(MAKE ) -C sources/go-piper clean
273+ $(MAKE ) -C sources/go-tiny-dream clean
256274 $(MAKE ) build
257275
258276prepare : prepare-sources $(OPTIONAL_TARGETS )
@@ -316,6 +334,7 @@ test: prepare test-models/testmodel grpcs
316334 $(MAKE ) test-llama-gguf
317335 $(MAKE ) test-tts
318336 $(MAKE ) test-stablediffusion
337+ $(MAKE ) test-tinydream
319338
320339prepare-e2e :
321340 mkdir -p $(TEST_DIR )
@@ -357,6 +376,10 @@ test-stablediffusion: prepare-test
357376 TEST_DIR=$(abspath ./) /test-dir/ FIXTURES=$(abspath ./) /tests/fixtures CONFIG_FILE=$(abspath ./) /test-models/config.yaml MODELS_PATH=$(abspath ./) /test-models \
358377 $(GOCMD ) run github.com/onsi/ginkgo/v2/ginkgo --label-filter=" stablediffusion" --flake-attempts 1 -v -r ./api ./pkg
359378
379+ test-tinydream : prepare-test
380+ TEST_DIR=$(abspath ./) /test-dir/ FIXTURES=$(abspath ./) /tests/fixtures CONFIG_FILE=$(abspath ./) /test-models/config.yaml MODELS_PATH=$(abspath ./) /test-models \
381+ $(GOCMD ) run github.com/onsi/ginkgo/v2/ginkgo --label-filter=" tinydream" --flake-attempts 1 -v -r ./api ./pkg
382+
360383test-container :
361384 docker build --target requirements -t local-ai-test-container .
362385 docker run -ti --rm --entrypoint /bin/bash -ti -v $(abspath ./) :/build local-ai-test-container
@@ -501,9 +524,13 @@ backend-assets/grpc/stablediffusion: backend-assets/grpc
501524 if [ ! -f backend-assets/grpc/stablediffusion ]; then \
502525 $(MAKE ) sources/go-stable-diffusion/libstablediffusion.a; \
503526 CGO_LDFLAGS=" $( CGO_LDFLAGS) " C_INCLUDE_PATH=$(shell pwd) /sources/go-stable-diffusion/ LIBRARY_PATH=$(shell pwd) /sources/go-stable-diffusion/ \
504- $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/stablediffusion ./backend/go/image/; \
527+ $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/stablediffusion ./backend/go/image/stablediffusion ; \
505528 fi
506529
530+ backend-assets/grpc/tinydream : backend-assets/grpc sources/go-tiny-dream/libtinydream.a
531+ CGO_LDFLAGS=" $( CGO_LDFLAGS) " LIBRARY_PATH=$(shell pwd) /go-tiny-dream \
532+ $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/tinydream ./backend/go/image/tinydream
533+
507534backend-assets/grpc/piper : backend-assets/grpc backend-assets/espeak-ng-data sources/go-piper/libpiper_binding.a
508535 CGO_CXXFLAGS=" $( PIPER_CGO_CXXFLAGS) " CGO_LDFLAGS=" $( PIPER_CGO_LDFLAGS) " LIBRARY_PATH=$(shell pwd) /sources/go-piper \
509536 $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/piper ./backend/go/tts/
0 commit comments