From 998c745e2f475ec3ec43ac017bcebf3a7ce15b8b Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Sat, 13 Apr 2024 15:38:24 +0200 Subject: [PATCH] fix: try to gen proto with same environment --- backend/python/parler-tts/Makefile | 3 ++- backend/python/parler-tts/gen_grpc.sh | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 backend/python/parler-tts/gen_grpc.sh diff --git a/backend/python/parler-tts/Makefile b/backend/python/parler-tts/Makefile index 4497762e..9ade2107 100644 --- a/backend/python/parler-tts/Makefile +++ b/backend/python/parler-tts/Makefile @@ -36,4 +36,5 @@ protogen-clean: $(RM) backend_pb2_grpc.py backend_pb2.py backend_pb2_grpc.py backend_pb2.py: - python3 -m grpc_tools.protoc -I../.. --python_out=. --grpc_python_out=. backend.proto \ No newline at end of file + bash install.sh $(CONDA_ENV_PATH) + bash gen_grpc.sh \ No newline at end of file diff --git a/backend/python/parler-tts/gen_grpc.sh b/backend/python/parler-tts/gen_grpc.sh new file mode 100755 index 00000000..a2394674 --- /dev/null +++ b/backend/python/parler-tts/gen_grpc.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -ex +## A bash script wrapper that runs the transformers server with conda +## It uses the protoc compiler to generate the gRPC code from the environment, because +## The newer grpc versions are not compatible +#See: https://github.com/mudler/LocalAI/pull/2027 + +# Activate conda environment +source activate parler + +python3 -m grpc_tools.protoc -I../.. --python_out=. --grpc_python_out=. backend.proto \ No newline at end of file