@@ -306,7 +306,7 @@ test: prepare test-models/testmodel grpcs
306
306
@echo ' Running tests'
307
307
export GO_TAGS=" tts stablediffusion"
308
308
$(MAKE ) prepare-test
309
- HUGGINGFACE_GRPC=$(abspath ./) /extra/grpc /huggingface/run.sh TEST_DIR=$(abspath ./) /test-dir/ FIXTURES=$(abspath ./) /tests/fixtures CONFIG_FILE=$(abspath ./) /test-models/config.yaml MODELS_PATH=$(abspath ./) /test-models \
309
+ HUGGINGFACE_GRPC=$(abspath ./) /backend/python /huggingface/run.sh TEST_DIR=$(abspath ./) /test-dir/ FIXTURES=$(abspath ./) /tests/fixtures CONFIG_FILE=$(abspath ./) /test-models/config.yaml MODELS_PATH=$(abspath ./) /test-models \
310
310
$(GOCMD ) run github.com/onsi/ginkgo/v2/ginkgo --label-filter=" !gpt4all && !llama && !llama-gguf" --flake-attempts 5 --fail-fast -v -r ./api ./pkg
311
311
$(MAKE ) test-gpt4all
312
312
$(MAKE ) test-llama
@@ -374,27 +374,27 @@ protogen: protogen-go protogen-python
374
374
375
375
protogen-go :
376
376
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative \
377
- pkg/grpc/proto /backend.proto
377
+ backend /backend.proto
378
378
379
379
protogen-python :
380
- python3 -m grpc_tools.protoc -Ipkg/grpc/proto/ --python_out=extra/grpc /huggingface/ --grpc_python_out=extra/grpc /huggingface/ pkg/grpc/proto /backend.proto
381
- python3 -m grpc_tools.protoc -Ipkg/grpc/proto/ --python_out=extra/grpc /autogptq/ --grpc_python_out=extra/grpc /autogptq/ pkg/grpc/proto /backend.proto
382
- python3 -m grpc_tools.protoc -Ipkg/grpc/proto/ --python_out=extra/grpc /exllama/ --grpc_python_out=extra/grpc /exllama/ pkg/grpc/proto /backend.proto
383
- python3 -m grpc_tools.protoc -Ipkg/grpc/proto/ --python_out=extra/grpc /bark/ --grpc_python_out=extra/grpc /bark/ pkg/grpc/proto /backend.proto
384
- python3 -m grpc_tools.protoc -Ipkg/grpc/proto/ --python_out=extra/grpc /diffusers/ --grpc_python_out=extra/grpc /diffusers/ pkg/grpc/proto /backend.proto
385
- python3 -m grpc_tools.protoc -Ipkg/grpc/proto/ --python_out=extra/grpc /vall-e-x/ --grpc_python_out=extra/grpc /vall-e-x/ pkg/grpc/proto /backend.proto
386
- python3 -m grpc_tools.protoc -Ipkg/grpc/proto/ --python_out=extra/grpc /vllm/ --grpc_python_out=extra/grpc /vllm/ pkg/grpc/proto /backend.proto
380
+ python3 -m grpc_tools.protoc -Ipkg/grpc/proto/ --python_out=backend/python /huggingface/ --grpc_python_out=backend/python /huggingface/ backend /backend.proto
381
+ python3 -m grpc_tools.protoc -Ipkg/grpc/proto/ --python_out=backend/python /autogptq/ --grpc_python_out=backend/python /autogptq/ backend /backend.proto
382
+ python3 -m grpc_tools.protoc -Ipkg/grpc/proto/ --python_out=backend/python /exllama/ --grpc_python_out=backend/python /exllama/ backend /backend.proto
383
+ python3 -m grpc_tools.protoc -Ipkg/grpc/proto/ --python_out=backend/python /bark/ --grpc_python_out=backend/python /bark/ backend /backend.proto
384
+ python3 -m grpc_tools.protoc -Ipkg/grpc/proto/ --python_out=backend/python /diffusers/ --grpc_python_out=backend/python /diffusers/ backend /backend.proto
385
+ python3 -m grpc_tools.protoc -Ipkg/grpc/proto/ --python_out=backend/python /vall-e-x/ --grpc_python_out=backend/python /vall-e-x/ backend /backend.proto
386
+ python3 -m grpc_tools.protoc -Ipkg/grpc/proto/ --python_out=backend/python /vllm/ --grpc_python_out=backend/python /vllm/ backend /backend.proto
387
387
388
388
# # GRPC
389
389
# Note: it is duplicated in the Dockerfile
390
390
prepare-extra-conda-environments :
391
- $(MAKE ) -C extra/grpc /autogptq
392
- $(MAKE ) -C extra/grpc /bark
393
- $(MAKE ) -C extra/grpc /diffusers
394
- $(MAKE ) -C extra/grpc /vllm
395
- $(MAKE ) -C extra/grpc /huggingface
396
- $(MAKE ) -C extra/grpc /vall-e-x
397
- $(MAKE ) -C extra/grpc /exllama
391
+ $(MAKE ) -C backend/python /autogptq
392
+ $(MAKE ) -C backend/python /bark
393
+ $(MAKE ) -C backend/python /diffusers
394
+ $(MAKE ) -C backend/python /vllm
395
+ $(MAKE ) -C backend/python /huggingface
396
+ $(MAKE ) -C backend/python /vall-e-x
397
+ $(MAKE ) -C backend/python /exllama
398
398
399
399
400
400
backend-assets/grpc :
@@ -403,7 +403,7 @@ backend-assets/grpc:
403
403
backend-assets/grpc/llama : backend-assets/grpc go-llama/libbinding.a
404
404
$(GOCMD ) mod edit -replace github.com/go-skynet/go-llama.cpp=$(shell pwd) /go-llama
405
405
CGO_LDFLAGS=" $( CGO_LDFLAGS) " C_INCLUDE_PATH=$(shell pwd) /go-llama LIBRARY_PATH=$(shell pwd) /go-llama \
406
- $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/llama ./cmd/grpc /llama/
406
+ $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/llama ./backend/go/llm /llama/
407
407
# TODO: every binary should have its own folder instead, so can have different metal implementations
408
408
ifeq ($(BUILD_TYPE ) ,metal)
409
409
cp go-llama/build/bin/ggml-metal.metal backend-assets/grpc/
@@ -443,68 +443,68 @@ endif
443
443
backend-assets/grpc/llama-stable : backend-assets/grpc go-llama-stable/libbinding.a
444
444
$(GOCMD ) mod edit -replace github.com/go-skynet/go-llama.cpp=$(shell pwd) /go-llama-stable
445
445
CGO_LDFLAGS=" $( CGO_LDFLAGS) " C_INCLUDE_PATH=$(shell pwd) /go-llama-stable LIBRARY_PATH=$(shell pwd) /go-llama \
446
- $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/llama-stable ./cmd/grpc /llama-stable/
446
+ $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/llama-stable ./backend/go/llm /llama-stable/
447
447
448
448
backend-assets/grpc/gpt4all : backend-assets/grpc backend-assets/gpt4all gpt4all/gpt4all-bindings/golang/libgpt4all.a
449
449
CGO_LDFLAGS=" $( CGO_LDFLAGS) " C_INCLUDE_PATH=$(shell pwd) /gpt4all/gpt4all-bindings/golang/ LIBRARY_PATH=$(shell pwd) /gpt4all/gpt4all-bindings/golang/ \
450
- $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/gpt4all ./cmd/grpc /gpt4all/
450
+ $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/gpt4all ./backend/go/llm /gpt4all/
451
451
452
452
backend-assets/grpc/dolly : backend-assets/grpc go-ggml-transformers/libtransformers.a
453
453
CGO_LDFLAGS=" $( CGO_LDFLAGS) " C_INCLUDE_PATH=$(shell pwd) /go-ggml-transformers LIBRARY_PATH=$(shell pwd) /go-ggml-transformers \
454
- $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/dolly ./cmd/grpc /dolly/
454
+ $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/dolly ./backend/go/llm /dolly/
455
455
456
456
backend-assets/grpc/gpt2 : backend-assets/grpc go-ggml-transformers/libtransformers.a
457
457
CGO_LDFLAGS=" $( CGO_LDFLAGS) " C_INCLUDE_PATH=$(shell pwd) /go-ggml-transformers LIBRARY_PATH=$(shell pwd) /go-ggml-transformers \
458
- $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/gpt2 ./cmd/grpc /gpt2/
458
+ $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/gpt2 ./backend/go/llm /gpt2/
459
459
460
460
backend-assets/grpc/gptj : backend-assets/grpc go-ggml-transformers/libtransformers.a
461
461
CGO_LDFLAGS=" $( CGO_LDFLAGS) " C_INCLUDE_PATH=$(shell pwd) /go-ggml-transformers LIBRARY_PATH=$(shell pwd) /go-ggml-transformers \
462
- $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/gptj ./cmd/grpc /gptj/
462
+ $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/gptj ./backend/go/llm /gptj/
463
463
464
464
backend-assets/grpc/gptneox : backend-assets/grpc go-ggml-transformers/libtransformers.a
465
465
CGO_LDFLAGS=" $( CGO_LDFLAGS) " C_INCLUDE_PATH=$(shell pwd) /go-ggml-transformers LIBRARY_PATH=$(shell pwd) /go-ggml-transformers \
466
- $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/gptneox ./cmd/grpc /gptneox/
466
+ $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/gptneox ./backend/go/llm /gptneox/
467
467
468
468
backend-assets/grpc/mpt : backend-assets/grpc go-ggml-transformers/libtransformers.a
469
469
CGO_LDFLAGS=" $( CGO_LDFLAGS) " C_INCLUDE_PATH=$(shell pwd) /go-ggml-transformers LIBRARY_PATH=$(shell pwd) /go-ggml-transformers \
470
- $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/mpt ./cmd/grpc /mpt/
470
+ $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/mpt ./backend/go/llm /mpt/
471
471
472
472
backend-assets/grpc/replit : backend-assets/grpc go-ggml-transformers/libtransformers.a
473
473
CGO_LDFLAGS=" $( CGO_LDFLAGS) " C_INCLUDE_PATH=$(shell pwd) /go-ggml-transformers LIBRARY_PATH=$(shell pwd) /go-ggml-transformers \
474
- $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/replit ./cmd/grpc /replit/
474
+ $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/replit ./backend/go/llm /replit/
475
475
476
476
backend-assets/grpc/falcon-ggml : backend-assets/grpc go-ggml-transformers/libtransformers.a
477
477
CGO_LDFLAGS=" $( CGO_LDFLAGS) " C_INCLUDE_PATH=$(shell pwd) /go-ggml-transformers LIBRARY_PATH=$(shell pwd) /go-ggml-transformers \
478
- $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/falcon-ggml ./cmd/grpc /falcon-ggml/
478
+ $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/falcon-ggml ./backend/go/llm /falcon-ggml/
479
479
480
480
backend-assets/grpc/starcoder : backend-assets/grpc go-ggml-transformers/libtransformers.a
481
481
CGO_LDFLAGS=" $( CGO_LDFLAGS) " C_INCLUDE_PATH=$(shell pwd) /go-ggml-transformers LIBRARY_PATH=$(shell pwd) /go-ggml-transformers \
482
- $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/starcoder ./cmd/grpc /starcoder/
482
+ $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/starcoder ./backend/go/llm /starcoder/
483
483
484
484
backend-assets/grpc/rwkv : backend-assets/grpc go-rwkv/librwkv.a
485
485
CGO_LDFLAGS=" $( CGO_LDFLAGS) " C_INCLUDE_PATH=$(shell pwd) /go-rwkv LIBRARY_PATH=$(shell pwd) /go-rwkv \
486
- $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/rwkv ./cmd/grpc/rwkv/
486
+ $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/rwkv ./backend/go/llm/rwkv
487
487
488
488
backend-assets/grpc/bert-embeddings : backend-assets/grpc go-bert/libgobert.a
489
489
CGO_LDFLAGS=" $( CGO_LDFLAGS) " C_INCLUDE_PATH=$(shell pwd) /go-bert LIBRARY_PATH=$(shell pwd) /go-bert \
490
- $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/bert-embeddings ./cmd/grpc/ bert-embeddings /
490
+ $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/bert-embeddings ./backend/go/llm/ bert/
491
491
492
492
backend-assets/grpc/langchain-huggingface : backend-assets/grpc
493
- $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/langchain-huggingface ./cmd/grpc/ langchain-huggingface /
493
+ $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/langchain-huggingface ./backend/go/llm/ langchain/
494
494
495
495
backend-assets/grpc/stablediffusion : backend-assets/grpc
496
496
if [ ! -f backend-assets/grpc/stablediffusion ]; then \
497
497
$(MAKE ) go-stable-diffusion/libstablediffusion.a; \
498
498
CGO_LDFLAGS=" $( CGO_LDFLAGS) " C_INCLUDE_PATH=$(shell pwd) /go-stable-diffusion/ LIBRARY_PATH=$(shell pwd) /go-stable-diffusion/ \
499
- $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/stablediffusion ./cmd/grpc/stablediffusion /; \
499
+ $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/stablediffusion ./backend/go/image /; \
500
500
fi
501
501
502
502
backend-assets/grpc/piper : backend-assets/grpc backend-assets/espeak-ng-data go-piper/libpiper_binding.a
503
503
CGO_CXXFLAGS=" $( PIPER_CGO_CXXFLAGS) " CGO_LDFLAGS=" $( PIPER_CGO_LDFLAGS) " LIBRARY_PATH=$(shell pwd) /go-piper \
504
- $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/piper ./cmd/grpc/piper /
504
+ $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/piper ./backend/go/tts /
505
505
506
506
backend-assets/grpc/whisper : backend-assets/grpc whisper.cpp/libwhisper.a
507
507
CGO_LDFLAGS=" $( CGO_LDFLAGS) " C_INCLUDE_PATH=$(shell pwd) /whisper.cpp LIBRARY_PATH=$(shell pwd) /whisper.cpp \
508
- $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/whisper ./cmd/grpc/whisper /
508
+ $(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/whisper ./backend/go/transcribe /
509
509
510
510
grpcs : prepare $(GRPC_BACKENDS )
0 commit comments