mirror of
https://github.com/mudler/LocalAI.git
synced 2024-06-07 19:40:48 +00:00
fix: dont commit generated files to git (#1993)
* fix: initial work towards not committing generated files to the repository Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com> * feat: improve build docs Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com> * fix: remove unused folder from .dockerignore and .gitignore Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com> * fix: attempt to fix extra backend tests Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com> * fix: attempt to fix other tests Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com> * fix: more test fixes Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com> * fix: fix apple tests Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com> * fix: more extras tests fixes Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com> * fix: add GOBIN to PATH in docker build Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com> * fix: extra tests and Dockerfile corrections Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com> * fix: remove build dependency checks Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com> * fix: add golang protobuf compilers to tests-linux action Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com> * fix: ensure protogen is run for extra backend installs Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com> * fix: use newer protobuf Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com> * fix: more missing protoc binaries Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com> * fix: missing dependencies during docker build Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com> * fix: don't install grpc compilers in the final stage if they aren't needed Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com> * fix: python-grpc-tools in 22.04 repos is too old Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com> * fix: add a couple of extra build dependencies to Makefile Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com> * fix: unbreak container rebuild functionality Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com> --------- Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com>
This commit is contained in:
parent
a8ebf6f575
commit
1981154f49
@ -1,4 +1,6 @@
|
|||||||
.idea
|
.idea
|
||||||
|
.github
|
||||||
|
.vscode
|
||||||
models
|
models
|
||||||
examples/chatbot-ui/models
|
examples/chatbot-ui/models
|
||||||
examples/rwkv/models
|
examples/rwkv/models
|
||||||
|
29
.github/workflows/test-extra.yml
vendored
29
.github/workflows/test-extra.yml
vendored
@ -32,8 +32,9 @@ jobs:
|
|||||||
sudo /bin/bash -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" | tee -a /etc/apt/sources.list.d/conda.list' && \
|
sudo /bin/bash -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" | tee -a /etc/apt/sources.list.d/conda.list' && \
|
||||||
sudo apt-get update && \
|
sudo apt-get update && \
|
||||||
sudo apt-get install -y conda
|
sudo apt-get install -y conda
|
||||||
sudo apt-get install -y ca-certificates cmake curl patch
|
sudo apt-get install -y ca-certificates cmake curl patch python3-pip
|
||||||
sudo apt-get install -y libopencv-dev
|
sudo apt-get install -y libopencv-dev
|
||||||
|
pip install --user grpcio-tools
|
||||||
|
|
||||||
sudo rm -rfv /usr/bin/conda || true
|
sudo rm -rfv /usr/bin/conda || true
|
||||||
|
|
||||||
@ -61,8 +62,9 @@ jobs:
|
|||||||
sudo /bin/bash -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" | tee -a /etc/apt/sources.list.d/conda.list' && \
|
sudo /bin/bash -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" | tee -a /etc/apt/sources.list.d/conda.list' && \
|
||||||
sudo apt-get update && \
|
sudo apt-get update && \
|
||||||
sudo apt-get install -y conda
|
sudo apt-get install -y conda
|
||||||
sudo apt-get install -y ca-certificates cmake curl patch
|
sudo apt-get install -y ca-certificates cmake curl patch python3-pip
|
||||||
sudo apt-get install -y libopencv-dev
|
sudo apt-get install -y libopencv-dev
|
||||||
|
pip install --user grpcio-tools
|
||||||
|
|
||||||
sudo rm -rfv /usr/bin/conda || true
|
sudo rm -rfv /usr/bin/conda || true
|
||||||
|
|
||||||
@ -90,8 +92,9 @@ jobs:
|
|||||||
sudo /bin/bash -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" | tee -a /etc/apt/sources.list.d/conda.list' && \
|
sudo /bin/bash -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" | tee -a /etc/apt/sources.list.d/conda.list' && \
|
||||||
sudo apt-get update && \
|
sudo apt-get update && \
|
||||||
sudo apt-get install -y conda
|
sudo apt-get install -y conda
|
||||||
sudo apt-get install -y ca-certificates cmake curl patch
|
sudo apt-get install -y ca-certificates cmake curl patch python3-pip
|
||||||
sudo apt-get install -y libopencv-dev
|
sudo apt-get install -y libopencv-dev
|
||||||
|
pip install --user grpcio-tools
|
||||||
|
|
||||||
sudo rm -rfv /usr/bin/conda || true
|
sudo rm -rfv /usr/bin/conda || true
|
||||||
|
|
||||||
@ -120,8 +123,9 @@ jobs:
|
|||||||
sudo /bin/bash -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" | tee -a /etc/apt/sources.list.d/conda.list' && \
|
sudo /bin/bash -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" | tee -a /etc/apt/sources.list.d/conda.list' && \
|
||||||
sudo apt-get update && \
|
sudo apt-get update && \
|
||||||
sudo apt-get install -y conda
|
sudo apt-get install -y conda
|
||||||
sudo apt-get install -y ca-certificates cmake curl patch
|
sudo apt-get install -y ca-certificates cmake curl patch python3-pip
|
||||||
sudo apt-get install -y libopencv-dev
|
sudo apt-get install -y libopencv-dev
|
||||||
|
pip install --user grpcio-tools
|
||||||
|
|
||||||
sudo rm -rfv /usr/bin/conda || true
|
sudo rm -rfv /usr/bin/conda || true
|
||||||
|
|
||||||
@ -151,8 +155,9 @@ jobs:
|
|||||||
# sudo /bin/bash -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" | tee -a /etc/apt/sources.list.d/conda.list' && \
|
# sudo /bin/bash -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" | tee -a /etc/apt/sources.list.d/conda.list' && \
|
||||||
# sudo apt-get update && \
|
# sudo apt-get update && \
|
||||||
# sudo apt-get install -y conda
|
# sudo apt-get install -y conda
|
||||||
# sudo apt-get install -y ca-certificates cmake curl patch
|
# sudo apt-get install -y ca-certificates cmake curl patch python3-pip
|
||||||
# sudo apt-get install -y libopencv-dev
|
# sudo apt-get install -y libopencv-dev
|
||||||
|
# pip install --user grpcio-tools
|
||||||
|
|
||||||
# sudo rm -rfv /usr/bin/conda || true
|
# sudo rm -rfv /usr/bin/conda || true
|
||||||
|
|
||||||
@ -222,8 +227,9 @@ jobs:
|
|||||||
# sudo /bin/bash -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" | tee -a /etc/apt/sources.list.d/conda.list' && \
|
# sudo /bin/bash -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" | tee -a /etc/apt/sources.list.d/conda.list' && \
|
||||||
# sudo apt-get update && \
|
# sudo apt-get update && \
|
||||||
# sudo apt-get install -y conda
|
# sudo apt-get install -y conda
|
||||||
# sudo apt-get install -y ca-certificates cmake curl patch
|
# sudo apt-get install -y ca-certificates cmake curl patch python3-pip
|
||||||
# sudo apt-get install -y libopencv-dev
|
# sudo apt-get install -y libopencv-dev
|
||||||
|
# pip install --user grpcio-tools
|
||||||
|
|
||||||
# sudo rm -rfv /usr/bin/conda || true
|
# sudo rm -rfv /usr/bin/conda || true
|
||||||
|
|
||||||
@ -254,8 +260,9 @@ jobs:
|
|||||||
# sudo /bin/bash -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" | tee -a /etc/apt/sources.list.d/conda.list' && \
|
# sudo /bin/bash -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" | tee -a /etc/apt/sources.list.d/conda.list' && \
|
||||||
# sudo apt-get update && \
|
# sudo apt-get update && \
|
||||||
# sudo apt-get install -y conda
|
# sudo apt-get install -y conda
|
||||||
# sudo apt-get install -y ca-certificates cmake curl patch
|
# sudo apt-get install -y ca-certificates cmake curl patch python3-pip
|
||||||
# sudo apt-get install -y libopencv-dev
|
# sudo apt-get install -y libopencv-dev
|
||||||
|
# pip install --user grpcio-tools
|
||||||
# sudo rm -rfv /usr/bin/conda || true
|
# sudo rm -rfv /usr/bin/conda || true
|
||||||
# - name: Test vllm
|
# - name: Test vllm
|
||||||
# run: |
|
# run: |
|
||||||
@ -280,8 +287,9 @@ jobs:
|
|||||||
sudo /bin/bash -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" | tee -a /etc/apt/sources.list.d/conda.list' && \
|
sudo /bin/bash -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" | tee -a /etc/apt/sources.list.d/conda.list' && \
|
||||||
sudo apt-get update && \
|
sudo apt-get update && \
|
||||||
sudo apt-get install -y conda
|
sudo apt-get install -y conda
|
||||||
sudo apt-get install -y ca-certificates cmake curl patch
|
sudo apt-get install -y ca-certificates cmake curl patch python3-pip
|
||||||
sudo apt-get install -y libopencv-dev
|
sudo apt-get install -y libopencv-dev
|
||||||
|
pip install --user grpcio-tools
|
||||||
sudo rm -rfv /usr/bin/conda || true
|
sudo rm -rfv /usr/bin/conda || true
|
||||||
- name: Test vall-e-x
|
- name: Test vall-e-x
|
||||||
run: |
|
run: |
|
||||||
@ -307,7 +315,8 @@ jobs:
|
|||||||
sudo /bin/bash -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" | tee -a /etc/apt/sources.list.d/conda.list' && \
|
sudo /bin/bash -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" | tee -a /etc/apt/sources.list.d/conda.list' && \
|
||||||
sudo apt-get update && \
|
sudo apt-get update && \
|
||||||
sudo apt-get install -y conda
|
sudo apt-get install -y conda
|
||||||
sudo apt-get install -y ca-certificates cmake curl patch espeak espeak-ng
|
sudo apt-get install -y ca-certificates cmake curl patch espeak espeak-ng python3-pip
|
||||||
|
pip install --user grpcio-tools
|
||||||
sudo rm -rfv /usr/bin/conda || true
|
sudo rm -rfv /usr/bin/conda || true
|
||||||
|
|
||||||
- name: Test coqui
|
- name: Test coqui
|
||||||
|
25
.github/workflows/test.yml
vendored
25
.github/workflows/test.yml
vendored
@ -70,17 +70,27 @@ jobs:
|
|||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install build-essential ffmpeg
|
sudo apt-get install build-essential curl ffmpeg
|
||||||
curl https://repo.anaconda.com/pkgs/misc/gpgkeys/anaconda.asc | gpg --dearmor > conda.gpg && \
|
curl https://repo.anaconda.com/pkgs/misc/gpgkeys/anaconda.asc | gpg --dearmor > conda.gpg && \
|
||||||
sudo install -o root -g root -m 644 conda.gpg /usr/share/keyrings/conda-archive-keyring.gpg && \
|
sudo install -o root -g root -m 644 conda.gpg /usr/share/keyrings/conda-archive-keyring.gpg && \
|
||||||
gpg --keyring /usr/share/keyrings/conda-archive-keyring.gpg --no-default-keyring --fingerprint 34161F5BF5EB1D4BFBBB8F0A8AEB4F8B29D82806 && \
|
gpg --keyring /usr/share/keyrings/conda-archive-keyring.gpg --no-default-keyring --fingerprint 34161F5BF5EB1D4BFBBB8F0A8AEB4F8B29D82806 && \
|
||||||
sudo /bin/bash -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" > /etc/apt/sources.list.d/conda.list' && \
|
sudo /bin/bash -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" > /etc/apt/sources.list.d/conda.list' && \
|
||||||
sudo /bin/bash -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" | tee -a /etc/apt/sources.list.d/conda.list' && \
|
sudo /bin/bash -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" | tee -a /etc/apt/sources.list.d/conda.list' && \
|
||||||
sudo apt-get update && \
|
sudo apt-get update && \
|
||||||
sudo apt-get install -y conda
|
sudo apt-get install -y conda
|
||||||
sudo apt-get install -y ca-certificates cmake curl patch
|
sudo apt-get install -y ca-certificates cmake patch python3-pip unzip
|
||||||
sudo apt-get install -y libopencv-dev
|
sudo apt-get install -y libopencv-dev
|
||||||
|
|
||||||
|
curl -L -s https://github.com/protocolbuffers/protobuf/releases/download/v26.1/protoc-26.1-linux-x86_64.zip -o protoc.zip && \
|
||||||
|
unzip -j -d /usr/local/bin protoc.zip bin/protoc && \
|
||||||
|
rm protoc.zip
|
||||||
|
|
||||||
|
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
||||||
|
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
||||||
|
|
||||||
|
# The python3-grpc-tools package in 22.04 is too old
|
||||||
|
pip install --user grpcio-tools
|
||||||
|
|
||||||
sudo rm -rfv /usr/bin/conda || true
|
sudo rm -rfv /usr/bin/conda || true
|
||||||
PATH=$PATH:/opt/conda/bin make -C backend/python/sentencetransformers
|
PATH=$PATH:/opt/conda/bin make -C backend/python/sentencetransformers
|
||||||
|
|
||||||
@ -89,7 +99,7 @@ jobs:
|
|||||||
GO_TAGS="tts" make -C sources/go-piper piper.o && \
|
GO_TAGS="tts" make -C sources/go-piper piper.o && \
|
||||||
sudo cp -rfv sources/go-piper/piper-phonemize/pi/lib/. /usr/lib/ && \
|
sudo cp -rfv sources/go-piper/piper-phonemize/pi/lib/. /usr/lib/ && \
|
||||||
# Pre-build stable diffusion before we install a newer version of abseil (not compatible with stablediffusion-ncn)
|
# Pre-build stable diffusion before we install a newer version of abseil (not compatible with stablediffusion-ncn)
|
||||||
GO_TAGS="stablediffusion tts" GRPC_BACKENDS=backend-assets/grpc/stablediffusion make build
|
PATH="$PATH:/root/go/bin" GO_TAGS="stablediffusion tts" GRPC_BACKENDS=backend-assets/grpc/stablediffusion make build
|
||||||
- name: Cache grpc
|
- name: Cache grpc
|
||||||
id: cache-grpc
|
id: cache-grpc
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@ -108,7 +118,7 @@ jobs:
|
|||||||
cd grpc && cd cmake/build && sudo make --jobs 5 install
|
cd grpc && cd cmake/build && sudo make --jobs 5 install
|
||||||
- name: Test
|
- name: Test
|
||||||
run: |
|
run: |
|
||||||
GO_TAGS="stablediffusion tts" make --jobs 5 --output-sync=target test
|
PATH="$PATH:/root/go/bin" GO_TAGS="stablediffusion tts" make --jobs 5 --output-sync=target test
|
||||||
- name: Setup tmate session if tests fail
|
- name: Setup tmate session if tests fail
|
||||||
if: ${{ failure() }}
|
if: ${{ failure() }}
|
||||||
uses: mxschmitt/action-tmate@v3
|
uses: mxschmitt/action-tmate@v3
|
||||||
@ -186,7 +196,8 @@ jobs:
|
|||||||
run: go version
|
run: go version
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
run: |
|
run: |
|
||||||
brew install protobuf grpc make
|
brew install protobuf grpc make protoc-gen-go protoc-gen-go-grpc
|
||||||
|
pip install --user grpcio-tools
|
||||||
- name: Test
|
- name: Test
|
||||||
run: |
|
run: |
|
||||||
export C_INCLUDE_PATH=/usr/local/include
|
export C_INCLUDE_PATH=/usr/local/include
|
||||||
|
5
.gitignore
vendored
5
.gitignore
vendored
@ -39,3 +39,8 @@ backend-assets/*
|
|||||||
!backend-assets/.keep
|
!backend-assets/.keep
|
||||||
prepare
|
prepare
|
||||||
/ggml-metal.metal
|
/ggml-metal.metal
|
||||||
|
|
||||||
|
# Protobuf generated files
|
||||||
|
*.pb.go
|
||||||
|
*pb2.py
|
||||||
|
*pb2_grpc.py
|
||||||
|
33
Dockerfile
33
Dockerfile
@ -20,12 +20,25 @@ ENV EXTERNAL_GRPC_BACKENDS="coqui:/build/backend/python/coqui/run.sh,huggingface
|
|||||||
ARG GO_TAGS="stablediffusion tinydream tts"
|
ARG GO_TAGS="stablediffusion tinydream tts"
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y ca-certificates curl patch pip cmake git && apt-get clean
|
apt-get install -y ca-certificates curl python3-pip unzip && apt-get clean
|
||||||
|
|
||||||
# Install Go
|
# Install Go
|
||||||
RUN curl -L -s https://go.dev/dl/go$GO_VERSION.linux-$TARGETARCH.tar.gz | tar -C /usr/local -xz
|
RUN curl -L -s https://go.dev/dl/go$GO_VERSION.linux-$TARGETARCH.tar.gz | tar -C /usr/local -xz
|
||||||
ENV PATH $PATH:/usr/local/go/bin
|
ENV PATH $PATH:/usr/local/go/bin
|
||||||
|
|
||||||
|
# Install grpc compilers
|
||||||
|
ENV PATH $PATH:/root/go/bin
|
||||||
|
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest && \
|
||||||
|
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
||||||
|
|
||||||
|
# Install protobuf (the version in 22.04 is too old)
|
||||||
|
RUN curl -L -s https://github.com/protocolbuffers/protobuf/releases/download/v26.1/protoc-26.1-linux-x86_64.zip -o protoc.zip && \
|
||||||
|
unzip -j -d /usr/local/bin protoc.zip bin/protoc && \
|
||||||
|
rm protoc.zip
|
||||||
|
|
||||||
|
# Install grpcio-tools (the version in 22.04 is too old)
|
||||||
|
RUN pip install --user grpcio-tools
|
||||||
|
|
||||||
COPY --chmod=644 custom-ca-certs/* /usr/local/share/ca-certificates/
|
COPY --chmod=644 custom-ca-certs/* /usr/local/share/ca-certificates/
|
||||||
RUN update-ca-certificates
|
RUN update-ca-certificates
|
||||||
|
|
||||||
@ -68,7 +81,8 @@ RUN test -n "$TARGETARCH" \
|
|||||||
|
|
||||||
FROM requirements-core as requirements-extras
|
FROM requirements-core as requirements-extras
|
||||||
|
|
||||||
RUN curl https://repo.anaconda.com/pkgs/misc/gpgkeys/anaconda.asc | gpg --dearmor > conda.gpg && \
|
RUN apt install -y gpg && \
|
||||||
|
curl https://repo.anaconda.com/pkgs/misc/gpgkeys/anaconda.asc | gpg --dearmor > conda.gpg && \
|
||||||
install -o root -g root -m 644 conda.gpg /usr/share/keyrings/conda-archive-keyring.gpg && \
|
install -o root -g root -m 644 conda.gpg /usr/share/keyrings/conda-archive-keyring.gpg && \
|
||||||
gpg --keyring /usr/share/keyrings/conda-archive-keyring.gpg --no-default-keyring --fingerprint 34161F5BF5EB1D4BFBBB8F0A8AEB4F8B29D82806 && \
|
gpg --keyring /usr/share/keyrings/conda-archive-keyring.gpg --no-default-keyring --fingerprint 34161F5BF5EB1D4BFBBB8F0A8AEB4F8B29D82806 && \
|
||||||
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" > /etc/apt/sources.list.d/conda.list && \
|
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" > /etc/apt/sources.list.d/conda.list && \
|
||||||
@ -100,7 +114,7 @@ ENV MAKEFLAGS=${MAKEFLAGS}
|
|||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y g++ cmake git && \
|
apt-get install -y build-essential cmake git && \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
@ -133,6 +147,12 @@ WORKDIR /build
|
|||||||
COPY . .
|
COPY . .
|
||||||
COPY .git .
|
COPY .git .
|
||||||
RUN echo "GO_TAGS: $GO_TAGS"
|
RUN echo "GO_TAGS: $GO_TAGS"
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y build-essential cmake git && \
|
||||||
|
apt-get clean && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN make prepare
|
RUN make prepare
|
||||||
|
|
||||||
# If we are building with clblas support, we need the libraries for the builds
|
# If we are building with clblas support, we need the libraries for the builds
|
||||||
@ -191,6 +211,11 @@ RUN if [ "${BUILD_TYPE}" = "clblas" ]; then \
|
|||||||
apt-get clean \
|
apt-get clean \
|
||||||
; fi
|
; fi
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y cmake git && \
|
||||||
|
apt-get clean && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
# we start fresh & re-copy all assets because `make build` does not clean up nicely after itself
|
# we start fresh & re-copy all assets because `make build` does not clean up nicely after itself
|
||||||
@ -202,7 +227,7 @@ COPY . .
|
|||||||
COPY --from=builder /build/sources ./sources/
|
COPY --from=builder /build/sources ./sources/
|
||||||
COPY --from=grpc /build/grpc ./grpc/
|
COPY --from=grpc /build/grpc ./grpc/
|
||||||
|
|
||||||
RUN make prepare-sources && cd /build/grpc/cmake/build && make install && rm -rf grpc
|
RUN make prepare-sources && cd /build/grpc/cmake/build && make install && rm -rf /build/grpc
|
||||||
|
|
||||||
# Copy the binary
|
# Copy the binary
|
||||||
COPY --from=builder /build/local-ai ./
|
COPY --from=builder /build/local-ai ./
|
||||||
|
144
Makefile
144
Makefile
@ -289,10 +289,12 @@ clean: ## Remove build related file
|
|||||||
rm -rf ./sources
|
rm -rf ./sources
|
||||||
rm -rf $(BINARY_NAME)
|
rm -rf $(BINARY_NAME)
|
||||||
rm -rf release/
|
rm -rf release/
|
||||||
rm -rf backend-assets
|
rm -rf backend-assets/*
|
||||||
$(MAKE) -C backend/cpp/grpc clean
|
$(MAKE) -C backend/cpp/grpc clean
|
||||||
$(MAKE) -C backend/cpp/llama clean
|
$(MAKE) -C backend/cpp/llama clean
|
||||||
$(MAKE) dropreplace
|
$(MAKE) dropreplace
|
||||||
|
$(MAKE) protogen-clean
|
||||||
|
rmdir pkg/grpc/proto || true
|
||||||
|
|
||||||
clean-tests:
|
clean-tests:
|
||||||
rm -rf test-models
|
rm -rf test-models
|
||||||
@ -416,30 +418,136 @@ help: ## Show this help.
|
|||||||
else if (/^## .*$$/) {printf " ${CYAN}%s${RESET}\n", substr($$1,4)} \
|
else if (/^## .*$$/) {printf " ${CYAN}%s${RESET}\n", substr($$1,4)} \
|
||||||
}' $(MAKEFILE_LIST)
|
}' $(MAKEFILE_LIST)
|
||||||
|
|
||||||
|
.PHONY: protogen
|
||||||
protogen: protogen-go protogen-python
|
protogen: protogen-go protogen-python
|
||||||
|
|
||||||
|
.PHONY: protogen-clean
|
||||||
|
protogen-clean: protogen-go-clean protogen-python-clean
|
||||||
|
|
||||||
|
.PHONY: protogen-go
|
||||||
protogen-go:
|
protogen-go:
|
||||||
|
mkdir -p pkg/grpc/proto
|
||||||
protoc -Ibackend/ --go_out=pkg/grpc/proto/ --go_opt=paths=source_relative --go-grpc_out=pkg/grpc/proto/ --go-grpc_opt=paths=source_relative \
|
protoc -Ibackend/ --go_out=pkg/grpc/proto/ --go_opt=paths=source_relative --go-grpc_out=pkg/grpc/proto/ --go-grpc_opt=paths=source_relative \
|
||||||
backend/backend.proto
|
backend/backend.proto
|
||||||
|
|
||||||
protogen-python:
|
.PHONY: protogen-go-clean
|
||||||
python3 -m grpc_tools.protoc -Ibackend/ --python_out=backend/python/sentencetransformers/ --grpc_python_out=backend/python/sentencetransformers/ backend/backend.proto
|
protogen-go-clean:
|
||||||
python3 -m grpc_tools.protoc -Ibackend/ --python_out=backend/python/transformers/ --grpc_python_out=backend/python/transformers/ backend/backend.proto
|
$(RM) pkg/grpc/proto/backend.pb.go pkg/grpc/proto/backend_grpc.pb.go
|
||||||
python3 -m grpc_tools.protoc -Ibackend/ --python_out=backend/python/transformers-musicgen/ --grpc_python_out=backend/python/transformers-musicgen/ backend/backend.proto
|
$(RM) bin/*
|
||||||
python3 -m grpc_tools.protoc -Ibackend/ --python_out=backend/python/autogptq/ --grpc_python_out=backend/python/autogptq/ backend/backend.proto
|
|
||||||
python3 -m grpc_tools.protoc -Ibackend/ --python_out=backend/python/exllama/ --grpc_python_out=backend/python/exllama/ backend/backend.proto
|
.PHONY: protogen-python
|
||||||
python3 -m grpc_tools.protoc -Ibackend/ --python_out=backend/python/bark/ --grpc_python_out=backend/python/bark/ backend/backend.proto
|
protogen-python: autogptq-protogen bark-protogen coqui-protogen diffusers-protogen exllama-protogen exllama2-protogen mamba-protogen petals-protogen sentencetransformers-protogen transformers-protogen transformers-musicgen-protogen vall-e-x-protogen vllm-protogen
|
||||||
python3 -m grpc_tools.protoc -Ibackend/ --python_out=backend/python/diffusers/ --grpc_python_out=backend/python/diffusers/ backend/backend.proto
|
|
||||||
python3 -m grpc_tools.protoc -Ibackend/ --python_out=backend/python/coqui/ --grpc_python_out=backend/python/coqui/ backend/backend.proto
|
.PHONY: protogen-python-clean
|
||||||
python3 -m grpc_tools.protoc -Ibackend/ --python_out=backend/python/vall-e-x/ --grpc_python_out=backend/python/vall-e-x/ backend/backend.proto
|
protogen-python-clean: autogptq-protogen-clean bark-protogen-clean coqui-protogen-clean diffusers-protogen-clean exllama-protogen-clean exllama2-protogen-clean mamba-protogen-clean petals-protogen-clean sentencetransformers-protogen-clean transformers-protogen-clean transformers-musicgen-protogen-clean vall-e-x-protogen-clean vllm-protogen-clean
|
||||||
python3 -m grpc_tools.protoc -Ibackend/ --python_out=backend/python/vllm/ --grpc_python_out=backend/python/vllm/ backend/backend.proto
|
|
||||||
python3 -m grpc_tools.protoc -Ibackend/ --python_out=backend/python/petals/ --grpc_python_out=backend/python/petals/ backend/backend.proto
|
.PHONY: autogptq-protogen
|
||||||
python3 -m grpc_tools.protoc -Ibackend/ --python_out=backend/python/mamba/ --grpc_python_out=backend/python/mamba/ backend/backend.proto
|
autogptq-protogen:
|
||||||
python3 -m grpc_tools.protoc -Ibackend/ --python_out=backend/python/exllama2/ --grpc_python_out=backend/python/exllama2/ backend/backend.proto
|
$(MAKE) -C backend/python/autogptq protogen
|
||||||
|
|
||||||
|
.PHONY: autogptq-protogen-clean
|
||||||
|
autogptq-protogen-clean:
|
||||||
|
$(MAKE) -C backend/python/autogptq protogen-clean
|
||||||
|
|
||||||
|
.PHONY: bark-protogen
|
||||||
|
bark-protogen:
|
||||||
|
$(MAKE) -C backend/python/bark protogen
|
||||||
|
|
||||||
|
.PHONY: bark-protogen-clean
|
||||||
|
bark-protogen-clean:
|
||||||
|
$(MAKE) -C backend/python/bark protogen-clean
|
||||||
|
|
||||||
|
.PHONY: coqui-protogen
|
||||||
|
coqui-protogen:
|
||||||
|
$(MAKE) -C backend/python/coqui protogen
|
||||||
|
|
||||||
|
.PHONY: coqui-protogen-clean
|
||||||
|
coqui-protogen-clean:
|
||||||
|
$(MAKE) -C backend/python/coqui protogen-clean
|
||||||
|
|
||||||
|
.PHONY: diffusers-protogen
|
||||||
|
diffusers-protogen:
|
||||||
|
$(MAKE) -C backend/python/diffusers protogen
|
||||||
|
|
||||||
|
.PHONY: diffusers-protogen-clean
|
||||||
|
diffusers-protogen-clean:
|
||||||
|
$(MAKE) -C backend/python/diffusers protogen-clean
|
||||||
|
|
||||||
|
.PHONY: exllama-protogen
|
||||||
|
exllama-protogen:
|
||||||
|
$(MAKE) -C backend/python/exllama protogen
|
||||||
|
|
||||||
|
.PHONY: exllama-protogen-clean
|
||||||
|
exllama-protogen-clean:
|
||||||
|
$(MAKE) -C backend/python/exllama protogen-clean
|
||||||
|
|
||||||
|
.PHONY: exllama2-protogen
|
||||||
|
exllama2-protogen:
|
||||||
|
$(MAKE) -C backend/python/exllama2 protogen
|
||||||
|
|
||||||
|
.PHONY: exllama2-protogen-clean
|
||||||
|
exllama2-protogen-clean:
|
||||||
|
$(MAKE) -C backend/python/exllama2 protogen-clean
|
||||||
|
|
||||||
|
.PHONY: mamba-protogen
|
||||||
|
mamba-protogen:
|
||||||
|
$(MAKE) -C backend/python/mamba protogen
|
||||||
|
|
||||||
|
.PHONY: mamba-protogen-clean
|
||||||
|
mamba-protogen-clean:
|
||||||
|
$(MAKE) -C backend/python/mamba protogen-clean
|
||||||
|
|
||||||
|
.PHONY: petals-protogen
|
||||||
|
petals-protogen:
|
||||||
|
$(MAKE) -C backend/python/petals protogen
|
||||||
|
|
||||||
|
.PHONY: petals-protogen-clean
|
||||||
|
petals-protogen-clean:
|
||||||
|
$(MAKE) -C backend/python/petals protogen-clean
|
||||||
|
|
||||||
|
.PHONY: sentencetransformers-protogen
|
||||||
|
sentencetransformers-protogen:
|
||||||
|
$(MAKE) -C backend/python/sentencetransformers protogen
|
||||||
|
|
||||||
|
.PHONY: sentencetransformers-protogen-clean
|
||||||
|
sentencetransformers-protogen-clean:
|
||||||
|
$(MAKE) -C backend/python/sentencetransformers protogen-clean
|
||||||
|
|
||||||
|
.PHONY: transformers-protogen
|
||||||
|
transformers-protogen:
|
||||||
|
$(MAKE) -C backend/python/transformers protogen
|
||||||
|
|
||||||
|
.PHONY: transformers-protogen-clean
|
||||||
|
transformers-protogen-clean:
|
||||||
|
$(MAKE) -C backend/python/transformers protogen-clean
|
||||||
|
|
||||||
|
.PHONY: transformers-musicgen-protogen
|
||||||
|
transformers-musicgen-protogen:
|
||||||
|
$(MAKE) -C backend/python/transformers-musicgen protogen
|
||||||
|
|
||||||
|
.PHONY: transformers-musicgen-protogen-clean
|
||||||
|
transformers-musicgen-protogen-clean:
|
||||||
|
$(MAKE) -C backend/python/transformers-musicgen protogen-clean
|
||||||
|
|
||||||
|
.PHONY: vall-e-x-protogen
|
||||||
|
vall-e-x-protogen:
|
||||||
|
$(MAKE) -C backend/python/vall-e-x protogen
|
||||||
|
|
||||||
|
.PHONY: vall-e-x-protogen-clean
|
||||||
|
vall-e-x-protogen-clean:
|
||||||
|
$(MAKE) -C backend/python/vall-e-x protogen-clean
|
||||||
|
|
||||||
|
.PHONY: vllm-protogen
|
||||||
|
vllm-protogen:
|
||||||
|
$(MAKE) -C backend/python/vllm protogen
|
||||||
|
|
||||||
|
.PHONY: vllm-protogen-clean
|
||||||
|
vllm-protogen-clean:
|
||||||
|
$(MAKE) -C backend/python/vllm protogen-clean
|
||||||
|
|
||||||
## GRPC
|
## GRPC
|
||||||
# Note: it is duplicated in the Dockerfile
|
# Note: it is duplicated in the Dockerfile
|
||||||
prepare-extra-conda-environments:
|
prepare-extra-conda-environments: protogen-python
|
||||||
$(MAKE) -C backend/python/autogptq
|
$(MAKE) -C backend/python/autogptq
|
||||||
$(MAKE) -C backend/python/bark
|
$(MAKE) -C backend/python/bark
|
||||||
$(MAKE) -C backend/python/coqui
|
$(MAKE) -C backend/python/coqui
|
||||||
@ -454,7 +562,7 @@ prepare-extra-conda-environments:
|
|||||||
$(MAKE) -C backend/python/petals
|
$(MAKE) -C backend/python/petals
|
||||||
$(MAKE) -C backend/python/exllama2
|
$(MAKE) -C backend/python/exllama2
|
||||||
|
|
||||||
prepare-test-extra:
|
prepare-test-extra: protogen-python
|
||||||
$(MAKE) -C backend/python/transformers
|
$(MAKE) -C backend/python/transformers
|
||||||
$(MAKE) -C backend/python/diffusers
|
$(MAKE) -C backend/python/diffusers
|
||||||
|
|
||||||
@ -478,7 +586,7 @@ backend-assets/gpt4all: sources/gpt4all sources/gpt4all/gpt4all-bindings/golang/
|
|||||||
@cp sources/gpt4all/gpt4all-bindings/golang/buildllm/*.dylib backend-assets/gpt4all/ || true
|
@cp sources/gpt4all/gpt4all-bindings/golang/buildllm/*.dylib backend-assets/gpt4all/ || true
|
||||||
@cp sources/gpt4all/gpt4all-bindings/golang/buildllm/*.dll backend-assets/gpt4all/ || true
|
@cp sources/gpt4all/gpt4all-bindings/golang/buildllm/*.dll backend-assets/gpt4all/ || true
|
||||||
|
|
||||||
backend-assets/grpc: replace
|
backend-assets/grpc: protogen-go replace
|
||||||
mkdir -p backend-assets/grpc
|
mkdir -p backend-assets/grpc
|
||||||
|
|
||||||
backend-assets/grpc/bert-embeddings: sources/go-bert sources/go-bert/libgobert.a backend-assets/grpc
|
backend-assets/grpc/bert-embeddings: sources/go-bert sources/go-bert/libgobert.a backend-assets/grpc
|
||||||
|
@ -1,457 +0,0 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// - protoc-gen-go-grpc v1.2.0
|
|
||||||
// - protoc v4.23.4
|
|
||||||
// source: backend/backend.proto
|
|
||||||
|
|
||||||
package proto
|
|
||||||
|
|
||||||
import (
|
|
||||||
context "context"
|
|
||||||
grpc "google.golang.org/grpc"
|
|
||||||
codes "google.golang.org/grpc/codes"
|
|
||||||
status "google.golang.org/grpc/status"
|
|
||||||
)
|
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
|
||||||
// is compatible with the grpc package it is being compiled against.
|
|
||||||
// Requires gRPC-Go v1.32.0 or later.
|
|
||||||
const _ = grpc.SupportPackageIsVersion7
|
|
||||||
|
|
||||||
// BackendClient is the client API for Backend service.
|
|
||||||
//
|
|
||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
||||||
type BackendClient interface {
|
|
||||||
Health(ctx context.Context, in *HealthMessage, opts ...grpc.CallOption) (*Reply, error)
|
|
||||||
Predict(ctx context.Context, in *PredictOptions, opts ...grpc.CallOption) (*Reply, error)
|
|
||||||
LoadModel(ctx context.Context, in *ModelOptions, opts ...grpc.CallOption) (*Result, error)
|
|
||||||
PredictStream(ctx context.Context, in *PredictOptions, opts ...grpc.CallOption) (Backend_PredictStreamClient, error)
|
|
||||||
Embedding(ctx context.Context, in *PredictOptions, opts ...grpc.CallOption) (*EmbeddingResult, error)
|
|
||||||
GenerateImage(ctx context.Context, in *GenerateImageRequest, opts ...grpc.CallOption) (*Result, error)
|
|
||||||
AudioTranscription(ctx context.Context, in *TranscriptRequest, opts ...grpc.CallOption) (*TranscriptResult, error)
|
|
||||||
TTS(ctx context.Context, in *TTSRequest, opts ...grpc.CallOption) (*Result, error)
|
|
||||||
TokenizeString(ctx context.Context, in *PredictOptions, opts ...grpc.CallOption) (*TokenizationResponse, error)
|
|
||||||
Status(ctx context.Context, in *HealthMessage, opts ...grpc.CallOption) (*StatusResponse, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
type backendClient struct {
|
|
||||||
cc grpc.ClientConnInterface
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewBackendClient(cc grpc.ClientConnInterface) BackendClient {
|
|
||||||
return &backendClient{cc}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) Health(ctx context.Context, in *HealthMessage, opts ...grpc.CallOption) (*Reply, error) {
|
|
||||||
out := new(Reply)
|
|
||||||
err := c.cc.Invoke(ctx, "/backend.Backend/Health", in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) Predict(ctx context.Context, in *PredictOptions, opts ...grpc.CallOption) (*Reply, error) {
|
|
||||||
out := new(Reply)
|
|
||||||
err := c.cc.Invoke(ctx, "/backend.Backend/Predict", in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) LoadModel(ctx context.Context, in *ModelOptions, opts ...grpc.CallOption) (*Result, error) {
|
|
||||||
out := new(Result)
|
|
||||||
err := c.cc.Invoke(ctx, "/backend.Backend/LoadModel", in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) PredictStream(ctx context.Context, in *PredictOptions, opts ...grpc.CallOption) (Backend_PredictStreamClient, error) {
|
|
||||||
stream, err := c.cc.NewStream(ctx, &Backend_ServiceDesc.Streams[0], "/backend.Backend/PredictStream", opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
x := &backendPredictStreamClient{stream}
|
|
||||||
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if err := x.ClientStream.CloseSend(); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return x, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type Backend_PredictStreamClient interface {
|
|
||||||
Recv() (*Reply, error)
|
|
||||||
grpc.ClientStream
|
|
||||||
}
|
|
||||||
|
|
||||||
type backendPredictStreamClient struct {
|
|
||||||
grpc.ClientStream
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *backendPredictStreamClient) Recv() (*Reply, error) {
|
|
||||||
m := new(Reply)
|
|
||||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return m, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) Embedding(ctx context.Context, in *PredictOptions, opts ...grpc.CallOption) (*EmbeddingResult, error) {
|
|
||||||
out := new(EmbeddingResult)
|
|
||||||
err := c.cc.Invoke(ctx, "/backend.Backend/Embedding", in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) GenerateImage(ctx context.Context, in *GenerateImageRequest, opts ...grpc.CallOption) (*Result, error) {
|
|
||||||
out := new(Result)
|
|
||||||
err := c.cc.Invoke(ctx, "/backend.Backend/GenerateImage", in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) AudioTranscription(ctx context.Context, in *TranscriptRequest, opts ...grpc.CallOption) (*TranscriptResult, error) {
|
|
||||||
out := new(TranscriptResult)
|
|
||||||
err := c.cc.Invoke(ctx, "/backend.Backend/AudioTranscription", in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) TTS(ctx context.Context, in *TTSRequest, opts ...grpc.CallOption) (*Result, error) {
|
|
||||||
out := new(Result)
|
|
||||||
err := c.cc.Invoke(ctx, "/backend.Backend/TTS", in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) TokenizeString(ctx context.Context, in *PredictOptions, opts ...grpc.CallOption) (*TokenizationResponse, error) {
|
|
||||||
out := new(TokenizationResponse)
|
|
||||||
err := c.cc.Invoke(ctx, "/backend.Backend/TokenizeString", in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) Status(ctx context.Context, in *HealthMessage, opts ...grpc.CallOption) (*StatusResponse, error) {
|
|
||||||
out := new(StatusResponse)
|
|
||||||
err := c.cc.Invoke(ctx, "/backend.Backend/Status", in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// BackendServer is the server API for Backend service.
|
|
||||||
// All implementations must embed UnimplementedBackendServer
|
|
||||||
// for forward compatibility
|
|
||||||
type BackendServer interface {
|
|
||||||
Health(context.Context, *HealthMessage) (*Reply, error)
|
|
||||||
Predict(context.Context, *PredictOptions) (*Reply, error)
|
|
||||||
LoadModel(context.Context, *ModelOptions) (*Result, error)
|
|
||||||
PredictStream(*PredictOptions, Backend_PredictStreamServer) error
|
|
||||||
Embedding(context.Context, *PredictOptions) (*EmbeddingResult, error)
|
|
||||||
GenerateImage(context.Context, *GenerateImageRequest) (*Result, error)
|
|
||||||
AudioTranscription(context.Context, *TranscriptRequest) (*TranscriptResult, error)
|
|
||||||
TTS(context.Context, *TTSRequest) (*Result, error)
|
|
||||||
TokenizeString(context.Context, *PredictOptions) (*TokenizationResponse, error)
|
|
||||||
Status(context.Context, *HealthMessage) (*StatusResponse, error)
|
|
||||||
mustEmbedUnimplementedBackendServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnimplementedBackendServer must be embedded to have forward compatible implementations.
|
|
||||||
type UnimplementedBackendServer struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (UnimplementedBackendServer) Health(context.Context, *HealthMessage) (*Reply, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Health not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) Predict(context.Context, *PredictOptions) (*Reply, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Predict not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) LoadModel(context.Context, *ModelOptions) (*Result, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method LoadModel not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) PredictStream(*PredictOptions, Backend_PredictStreamServer) error {
|
|
||||||
return status.Errorf(codes.Unimplemented, "method PredictStream not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) Embedding(context.Context, *PredictOptions) (*EmbeddingResult, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Embedding not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) GenerateImage(context.Context, *GenerateImageRequest) (*Result, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GenerateImage not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) AudioTranscription(context.Context, *TranscriptRequest) (*TranscriptResult, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method AudioTranscription not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) TTS(context.Context, *TTSRequest) (*Result, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method TTS not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) TokenizeString(context.Context, *PredictOptions) (*TokenizationResponse, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method TokenizeString not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) Status(context.Context, *HealthMessage) (*StatusResponse, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Status not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) mustEmbedUnimplementedBackendServer() {}
|
|
||||||
|
|
||||||
// UnsafeBackendServer may be embedded to opt out of forward compatibility for this service.
|
|
||||||
// Use of this interface is not recommended, as added methods to BackendServer will
|
|
||||||
// result in compilation errors.
|
|
||||||
type UnsafeBackendServer interface {
|
|
||||||
mustEmbedUnimplementedBackendServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterBackendServer(s grpc.ServiceRegistrar, srv BackendServer) {
|
|
||||||
s.RegisterService(&Backend_ServiceDesc, srv)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_Health_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(HealthMessage)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(BackendServer).Health(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: "/backend.Backend/Health",
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(BackendServer).Health(ctx, req.(*HealthMessage))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_Predict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(PredictOptions)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(BackendServer).Predict(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: "/backend.Backend/Predict",
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(BackendServer).Predict(ctx, req.(*PredictOptions))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_LoadModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(ModelOptions)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(BackendServer).LoadModel(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: "/backend.Backend/LoadModel",
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(BackendServer).LoadModel(ctx, req.(*ModelOptions))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_PredictStream_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
||||||
m := new(PredictOptions)
|
|
||||||
if err := stream.RecvMsg(m); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return srv.(BackendServer).PredictStream(m, &backendPredictStreamServer{stream})
|
|
||||||
}
|
|
||||||
|
|
||||||
type Backend_PredictStreamServer interface {
|
|
||||||
Send(*Reply) error
|
|
||||||
grpc.ServerStream
|
|
||||||
}
|
|
||||||
|
|
||||||
type backendPredictStreamServer struct {
|
|
||||||
grpc.ServerStream
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *backendPredictStreamServer) Send(m *Reply) error {
|
|
||||||
return x.ServerStream.SendMsg(m)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_Embedding_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(PredictOptions)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(BackendServer).Embedding(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: "/backend.Backend/Embedding",
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(BackendServer).Embedding(ctx, req.(*PredictOptions))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_GenerateImage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(GenerateImageRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(BackendServer).GenerateImage(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: "/backend.Backend/GenerateImage",
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(BackendServer).GenerateImage(ctx, req.(*GenerateImageRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_AudioTranscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(TranscriptRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(BackendServer).AudioTranscription(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: "/backend.Backend/AudioTranscription",
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(BackendServer).AudioTranscription(ctx, req.(*TranscriptRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_TTS_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(TTSRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(BackendServer).TTS(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: "/backend.Backend/TTS",
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(BackendServer).TTS(ctx, req.(*TTSRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_TokenizeString_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(PredictOptions)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(BackendServer).TokenizeString(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: "/backend.Backend/TokenizeString",
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(BackendServer).TokenizeString(ctx, req.(*PredictOptions))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(HealthMessage)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(BackendServer).Status(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: "/backend.Backend/Status",
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(BackendServer).Status(ctx, req.(*HealthMessage))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Backend_ServiceDesc is the grpc.ServiceDesc for Backend service.
|
|
||||||
// It's only intended for direct use with grpc.RegisterService,
|
|
||||||
// and not to be introspected or modified (even as a copy)
|
|
||||||
var Backend_ServiceDesc = grpc.ServiceDesc{
|
|
||||||
ServiceName: "backend.Backend",
|
|
||||||
HandlerType: (*BackendServer)(nil),
|
|
||||||
Methods: []grpc.MethodDesc{
|
|
||||||
{
|
|
||||||
MethodName: "Health",
|
|
||||||
Handler: _Backend_Health_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "Predict",
|
|
||||||
Handler: _Backend_Predict_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "LoadModel",
|
|
||||||
Handler: _Backend_LoadModel_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "Embedding",
|
|
||||||
Handler: _Backend_Embedding_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "GenerateImage",
|
|
||||||
Handler: _Backend_GenerateImage_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "AudioTranscription",
|
|
||||||
Handler: _Backend_AudioTranscription_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "TTS",
|
|
||||||
Handler: _Backend_TTS_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "TokenizeString",
|
|
||||||
Handler: _Backend_TokenizeString_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "Status",
|
|
||||||
Handler: _Backend_Status_Handler,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Streams: []grpc.StreamDesc{
|
|
||||||
{
|
|
||||||
StreamName: "PredictStream",
|
|
||||||
Handler: _Backend_PredictStream_Handler,
|
|
||||||
ServerStreams: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Metadata: "backend/backend.proto",
|
|
||||||
}
|
|
@ -1,4 +1,13 @@
|
|||||||
.PHONY: autogptq
|
.PHONY: autogptq
|
||||||
autogptq:
|
autogptq: protogen
|
||||||
$(MAKE) -C ../common-env/transformers
|
$(MAKE) -C ../common-env/transformers
|
||||||
|
|
||||||
|
.PHONY: protogen
|
||||||
|
protogen: backend_pb2_grpc.py backend_pb2.py
|
||||||
|
|
||||||
|
.PHONY: protogen-clean
|
||||||
|
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
|
File diff suppressed because one or more lines are too long
@ -1,495 +0,0 @@
|
|||||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
||||||
"""Client and server classes corresponding to protobuf-defined services."""
|
|
||||||
import grpc
|
|
||||||
|
|
||||||
import backend_pb2 as backend__pb2
|
|
||||||
|
|
||||||
|
|
||||||
class BackendStub(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def __init__(self, channel):
|
|
||||||
"""Constructor.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
channel: A grpc.Channel.
|
|
||||||
"""
|
|
||||||
self.Health = channel.unary_unary(
|
|
||||||
'/backend.Backend/Health',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Predict = channel.unary_unary(
|
|
||||||
'/backend.Backend/Predict',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.LoadModel = channel.unary_unary(
|
|
||||||
'/backend.Backend/LoadModel',
|
|
||||||
request_serializer=backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.PredictStream = channel.unary_stream(
|
|
||||||
'/backend.Backend/PredictStream',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Embedding = channel.unary_unary(
|
|
||||||
'/backend.Backend/Embedding',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.EmbeddingResult.FromString,
|
|
||||||
)
|
|
||||||
self.GenerateImage = channel.unary_unary(
|
|
||||||
'/backend.Backend/GenerateImage',
|
|
||||||
request_serializer=backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.AudioTranscription = channel.unary_unary(
|
|
||||||
'/backend.Backend/AudioTranscription',
|
|
||||||
request_serializer=backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TranscriptResult.FromString,
|
|
||||||
)
|
|
||||||
self.TTS = channel.unary_unary(
|
|
||||||
'/backend.Backend/TTS',
|
|
||||||
request_serializer=backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.TokenizeString = channel.unary_unary(
|
|
||||||
'/backend.Backend/TokenizeString',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TokenizationResponse.FromString,
|
|
||||||
)
|
|
||||||
self.Status = channel.unary_unary(
|
|
||||||
'/backend.Backend/Status',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StatusResponse.FromString,
|
|
||||||
)
|
|
||||||
self.StoresSet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresSet',
|
|
||||||
request_serializer=backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresDelete = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresDelete',
|
|
||||||
request_serializer=backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresGet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresGet',
|
|
||||||
request_serializer=backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresGetResult.FromString,
|
|
||||||
)
|
|
||||||
self.StoresFind = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresFind',
|
|
||||||
request_serializer=backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresFindResult.FromString,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class BackendServicer(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def Health(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Predict(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def LoadModel(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def PredictStream(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Embedding(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def GenerateImage(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def AudioTranscription(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TTS(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TokenizeString(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Status(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresSet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresDelete(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresGet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresFind(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
|
|
||||||
def add_BackendServicer_to_server(servicer, server):
|
|
||||||
rpc_method_handlers = {
|
|
||||||
'Health': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Health,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Predict': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Predict,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'LoadModel': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.LoadModel,
|
|
||||||
request_deserializer=backend__pb2.ModelOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'PredictStream': grpc.unary_stream_rpc_method_handler(
|
|
||||||
servicer.PredictStream,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Embedding': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Embedding,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.EmbeddingResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'GenerateImage': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.GenerateImage,
|
|
||||||
request_deserializer=backend__pb2.GenerateImageRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'AudioTranscription': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.AudioTranscription,
|
|
||||||
request_deserializer=backend__pb2.TranscriptRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.TranscriptResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'TTS': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TTS,
|
|
||||||
request_deserializer=backend__pb2.TTSRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'TokenizeString': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TokenizeString,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.TokenizationResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'Status': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Status,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.StatusResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresSet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresSet,
|
|
||||||
request_deserializer=backend__pb2.StoresSetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresDelete': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresDelete,
|
|
||||||
request_deserializer=backend__pb2.StoresDeleteOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresGet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresGet,
|
|
||||||
request_deserializer=backend__pb2.StoresGetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresGetResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresFind': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresFind,
|
|
||||||
request_deserializer=backend__pb2.StoresFindOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresFindResult.SerializeToString,
|
|
||||||
),
|
|
||||||
}
|
|
||||||
generic_handler = grpc.method_handlers_generic_handler(
|
|
||||||
'backend.Backend', rpc_method_handlers)
|
|
||||||
server.add_generic_rpc_handlers((generic_handler,))
|
|
||||||
|
|
||||||
|
|
||||||
# This class is part of an EXPERIMENTAL API.
|
|
||||||
class Backend(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Health(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Health',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Predict(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Predict',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def LoadModel(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/LoadModel',
|
|
||||||
backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def PredictStream(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_stream(request, target, '/backend.Backend/PredictStream',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Embedding(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Embedding',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.EmbeddingResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def GenerateImage(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/GenerateImage',
|
|
||||||
backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def AudioTranscription(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/AudioTranscription',
|
|
||||||
backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
backend__pb2.TranscriptResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TTS(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TTS',
|
|
||||||
backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TokenizeString(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TokenizeString',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.TokenizationResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Status(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Status',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.StatusResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresSet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresSet',
|
|
||||||
backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresDelete(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresDelete',
|
|
||||||
backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresGet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresGet',
|
|
||||||
backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresGetResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresFind(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresFind',
|
|
||||||
backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresFindResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
@ -1,15 +1,25 @@
|
|||||||
.PHONY: ttsbark
|
.PHONY: ttsbark
|
||||||
ttsbark:
|
ttsbark: protogen
|
||||||
$(MAKE) -C ../common-env/transformers
|
$(MAKE) -C ../common-env/transformers
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run:
|
run: protogen
|
||||||
@echo "Running bark..."
|
@echo "Running bark..."
|
||||||
bash run.sh
|
bash run.sh
|
||||||
@echo "bark run."
|
@echo "bark run."
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test: protogen
|
||||||
@echo "Testing bark..."
|
@echo "Testing bark..."
|
||||||
bash test.sh
|
bash test.sh
|
||||||
@echo "bark tested."
|
@echo "bark tested."
|
||||||
|
|
||||||
|
.PHONY: protogen
|
||||||
|
protogen: backend_pb2_grpc.py backend_pb2.py
|
||||||
|
|
||||||
|
.PHONY: protogen-clean
|
||||||
|
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
|
File diff suppressed because one or more lines are too long
@ -1,495 +0,0 @@
|
|||||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
||||||
"""Client and server classes corresponding to protobuf-defined services."""
|
|
||||||
import grpc
|
|
||||||
|
|
||||||
import backend_pb2 as backend__pb2
|
|
||||||
|
|
||||||
|
|
||||||
class BackendStub(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def __init__(self, channel):
|
|
||||||
"""Constructor.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
channel: A grpc.Channel.
|
|
||||||
"""
|
|
||||||
self.Health = channel.unary_unary(
|
|
||||||
'/backend.Backend/Health',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Predict = channel.unary_unary(
|
|
||||||
'/backend.Backend/Predict',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.LoadModel = channel.unary_unary(
|
|
||||||
'/backend.Backend/LoadModel',
|
|
||||||
request_serializer=backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.PredictStream = channel.unary_stream(
|
|
||||||
'/backend.Backend/PredictStream',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Embedding = channel.unary_unary(
|
|
||||||
'/backend.Backend/Embedding',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.EmbeddingResult.FromString,
|
|
||||||
)
|
|
||||||
self.GenerateImage = channel.unary_unary(
|
|
||||||
'/backend.Backend/GenerateImage',
|
|
||||||
request_serializer=backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.AudioTranscription = channel.unary_unary(
|
|
||||||
'/backend.Backend/AudioTranscription',
|
|
||||||
request_serializer=backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TranscriptResult.FromString,
|
|
||||||
)
|
|
||||||
self.TTS = channel.unary_unary(
|
|
||||||
'/backend.Backend/TTS',
|
|
||||||
request_serializer=backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.TokenizeString = channel.unary_unary(
|
|
||||||
'/backend.Backend/TokenizeString',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TokenizationResponse.FromString,
|
|
||||||
)
|
|
||||||
self.Status = channel.unary_unary(
|
|
||||||
'/backend.Backend/Status',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StatusResponse.FromString,
|
|
||||||
)
|
|
||||||
self.StoresSet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresSet',
|
|
||||||
request_serializer=backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresDelete = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresDelete',
|
|
||||||
request_serializer=backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresGet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresGet',
|
|
||||||
request_serializer=backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresGetResult.FromString,
|
|
||||||
)
|
|
||||||
self.StoresFind = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresFind',
|
|
||||||
request_serializer=backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresFindResult.FromString,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class BackendServicer(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def Health(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Predict(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def LoadModel(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def PredictStream(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Embedding(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def GenerateImage(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def AudioTranscription(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TTS(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TokenizeString(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Status(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresSet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresDelete(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresGet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresFind(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
|
|
||||||
def add_BackendServicer_to_server(servicer, server):
|
|
||||||
rpc_method_handlers = {
|
|
||||||
'Health': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Health,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Predict': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Predict,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'LoadModel': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.LoadModel,
|
|
||||||
request_deserializer=backend__pb2.ModelOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'PredictStream': grpc.unary_stream_rpc_method_handler(
|
|
||||||
servicer.PredictStream,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Embedding': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Embedding,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.EmbeddingResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'GenerateImage': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.GenerateImage,
|
|
||||||
request_deserializer=backend__pb2.GenerateImageRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'AudioTranscription': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.AudioTranscription,
|
|
||||||
request_deserializer=backend__pb2.TranscriptRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.TranscriptResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'TTS': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TTS,
|
|
||||||
request_deserializer=backend__pb2.TTSRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'TokenizeString': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TokenizeString,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.TokenizationResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'Status': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Status,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.StatusResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresSet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresSet,
|
|
||||||
request_deserializer=backend__pb2.StoresSetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresDelete': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresDelete,
|
|
||||||
request_deserializer=backend__pb2.StoresDeleteOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresGet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresGet,
|
|
||||||
request_deserializer=backend__pb2.StoresGetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresGetResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresFind': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresFind,
|
|
||||||
request_deserializer=backend__pb2.StoresFindOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresFindResult.SerializeToString,
|
|
||||||
),
|
|
||||||
}
|
|
||||||
generic_handler = grpc.method_handlers_generic_handler(
|
|
||||||
'backend.Backend', rpc_method_handlers)
|
|
||||||
server.add_generic_rpc_handlers((generic_handler,))
|
|
||||||
|
|
||||||
|
|
||||||
# This class is part of an EXPERIMENTAL API.
|
|
||||||
class Backend(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Health(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Health',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Predict(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Predict',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def LoadModel(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/LoadModel',
|
|
||||||
backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def PredictStream(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_stream(request, target, '/backend.Backend/PredictStream',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Embedding(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Embedding',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.EmbeddingResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def GenerateImage(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/GenerateImage',
|
|
||||||
backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def AudioTranscription(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/AudioTranscription',
|
|
||||||
backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
backend__pb2.TranscriptResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TTS(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TTS',
|
|
||||||
backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TokenizeString(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TokenizeString',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.TokenizationResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Status(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Status',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.StatusResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresSet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresSet',
|
|
||||||
backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresDelete(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresDelete',
|
|
||||||
backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresGet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresGet',
|
|
||||||
backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresGetResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresFind(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresFind',
|
|
||||||
backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresFindResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
@ -1,15 +1,25 @@
|
|||||||
.PHONY: coqui
|
.PHONY: coqui
|
||||||
coqui:
|
coqui: protogen
|
||||||
$(MAKE) -C ../common-env/transformers
|
$(MAKE) -C ../common-env/transformers
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run:
|
run: protogen
|
||||||
@echo "Running coqui..."
|
@echo "Running coqui..."
|
||||||
bash run.sh
|
bash run.sh
|
||||||
@echo "coqui run."
|
@echo "coqui run."
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test: protogen
|
||||||
@echo "Testing coqui..."
|
@echo "Testing coqui..."
|
||||||
bash test.sh
|
bash test.sh
|
||||||
@echo "coqui tested."
|
@echo "coqui tested."
|
||||||
|
|
||||||
|
.PHONY: protogen
|
||||||
|
protogen: backend_pb2_grpc.py backend_pb2.py
|
||||||
|
|
||||||
|
.PHONY: protogen-clean
|
||||||
|
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
|
File diff suppressed because one or more lines are too long
@ -1,495 +0,0 @@
|
|||||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
||||||
"""Client and server classes corresponding to protobuf-defined services."""
|
|
||||||
import grpc
|
|
||||||
|
|
||||||
import backend_pb2 as backend__pb2
|
|
||||||
|
|
||||||
|
|
||||||
class BackendStub(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def __init__(self, channel):
|
|
||||||
"""Constructor.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
channel: A grpc.Channel.
|
|
||||||
"""
|
|
||||||
self.Health = channel.unary_unary(
|
|
||||||
'/backend.Backend/Health',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Predict = channel.unary_unary(
|
|
||||||
'/backend.Backend/Predict',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.LoadModel = channel.unary_unary(
|
|
||||||
'/backend.Backend/LoadModel',
|
|
||||||
request_serializer=backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.PredictStream = channel.unary_stream(
|
|
||||||
'/backend.Backend/PredictStream',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Embedding = channel.unary_unary(
|
|
||||||
'/backend.Backend/Embedding',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.EmbeddingResult.FromString,
|
|
||||||
)
|
|
||||||
self.GenerateImage = channel.unary_unary(
|
|
||||||
'/backend.Backend/GenerateImage',
|
|
||||||
request_serializer=backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.AudioTranscription = channel.unary_unary(
|
|
||||||
'/backend.Backend/AudioTranscription',
|
|
||||||
request_serializer=backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TranscriptResult.FromString,
|
|
||||||
)
|
|
||||||
self.TTS = channel.unary_unary(
|
|
||||||
'/backend.Backend/TTS',
|
|
||||||
request_serializer=backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.TokenizeString = channel.unary_unary(
|
|
||||||
'/backend.Backend/TokenizeString',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TokenizationResponse.FromString,
|
|
||||||
)
|
|
||||||
self.Status = channel.unary_unary(
|
|
||||||
'/backend.Backend/Status',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StatusResponse.FromString,
|
|
||||||
)
|
|
||||||
self.StoresSet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresSet',
|
|
||||||
request_serializer=backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresDelete = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresDelete',
|
|
||||||
request_serializer=backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresGet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresGet',
|
|
||||||
request_serializer=backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresGetResult.FromString,
|
|
||||||
)
|
|
||||||
self.StoresFind = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresFind',
|
|
||||||
request_serializer=backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresFindResult.FromString,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class BackendServicer(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def Health(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Predict(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def LoadModel(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def PredictStream(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Embedding(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def GenerateImage(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def AudioTranscription(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TTS(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TokenizeString(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Status(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresSet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresDelete(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresGet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresFind(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
|
|
||||||
def add_BackendServicer_to_server(servicer, server):
|
|
||||||
rpc_method_handlers = {
|
|
||||||
'Health': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Health,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Predict': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Predict,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'LoadModel': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.LoadModel,
|
|
||||||
request_deserializer=backend__pb2.ModelOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'PredictStream': grpc.unary_stream_rpc_method_handler(
|
|
||||||
servicer.PredictStream,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Embedding': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Embedding,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.EmbeddingResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'GenerateImage': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.GenerateImage,
|
|
||||||
request_deserializer=backend__pb2.GenerateImageRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'AudioTranscription': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.AudioTranscription,
|
|
||||||
request_deserializer=backend__pb2.TranscriptRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.TranscriptResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'TTS': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TTS,
|
|
||||||
request_deserializer=backend__pb2.TTSRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'TokenizeString': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TokenizeString,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.TokenizationResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'Status': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Status,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.StatusResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresSet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresSet,
|
|
||||||
request_deserializer=backend__pb2.StoresSetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresDelete': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresDelete,
|
|
||||||
request_deserializer=backend__pb2.StoresDeleteOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresGet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresGet,
|
|
||||||
request_deserializer=backend__pb2.StoresGetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresGetResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresFind': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresFind,
|
|
||||||
request_deserializer=backend__pb2.StoresFindOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresFindResult.SerializeToString,
|
|
||||||
),
|
|
||||||
}
|
|
||||||
generic_handler = grpc.method_handlers_generic_handler(
|
|
||||||
'backend.Backend', rpc_method_handlers)
|
|
||||||
server.add_generic_rpc_handlers((generic_handler,))
|
|
||||||
|
|
||||||
|
|
||||||
# This class is part of an EXPERIMENTAL API.
|
|
||||||
class Backend(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Health(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Health',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Predict(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Predict',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def LoadModel(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/LoadModel',
|
|
||||||
backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def PredictStream(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_stream(request, target, '/backend.Backend/PredictStream',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Embedding(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Embedding',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.EmbeddingResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def GenerateImage(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/GenerateImage',
|
|
||||||
backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def AudioTranscription(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/AudioTranscription',
|
|
||||||
backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
backend__pb2.TranscriptResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TTS(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TTS',
|
|
||||||
backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TokenizeString(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TokenizeString',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.TokenizationResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Status(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Status',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.StatusResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresSet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresSet',
|
|
||||||
backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresDelete(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresDelete',
|
|
||||||
backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresGet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresGet',
|
|
||||||
backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresGetResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresFind(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresFind',
|
|
||||||
backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresFindResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
@ -12,15 +12,25 @@ export SKIP_CONDA=1
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: diffusers
|
.PHONY: diffusers
|
||||||
diffusers:
|
diffusers: protogen
|
||||||
@echo "Installing $(CONDA_ENV_PATH)..."
|
@echo "Installing $(CONDA_ENV_PATH)..."
|
||||||
bash install.sh $(CONDA_ENV_PATH)
|
bash install.sh $(CONDA_ENV_PATH)
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run:
|
run: protogen
|
||||||
@echo "Running diffusers..."
|
@echo "Running diffusers..."
|
||||||
bash run.sh
|
bash run.sh
|
||||||
@echo "Diffusers run."
|
@echo "Diffusers run."
|
||||||
|
|
||||||
test:
|
test: protogen
|
||||||
bash test.sh
|
bash test.sh
|
||||||
|
|
||||||
|
.PHONY: protogen
|
||||||
|
protogen: backend_pb2_grpc.py backend_pb2.py
|
||||||
|
|
||||||
|
.PHONY: protogen-clean
|
||||||
|
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
|
File diff suppressed because one or more lines are too long
@ -1,495 +0,0 @@
|
|||||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
||||||
"""Client and server classes corresponding to protobuf-defined services."""
|
|
||||||
import grpc
|
|
||||||
|
|
||||||
import backend_pb2 as backend__pb2
|
|
||||||
|
|
||||||
|
|
||||||
class BackendStub(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def __init__(self, channel):
|
|
||||||
"""Constructor.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
channel: A grpc.Channel.
|
|
||||||
"""
|
|
||||||
self.Health = channel.unary_unary(
|
|
||||||
'/backend.Backend/Health',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Predict = channel.unary_unary(
|
|
||||||
'/backend.Backend/Predict',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.LoadModel = channel.unary_unary(
|
|
||||||
'/backend.Backend/LoadModel',
|
|
||||||
request_serializer=backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.PredictStream = channel.unary_stream(
|
|
||||||
'/backend.Backend/PredictStream',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Embedding = channel.unary_unary(
|
|
||||||
'/backend.Backend/Embedding',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.EmbeddingResult.FromString,
|
|
||||||
)
|
|
||||||
self.GenerateImage = channel.unary_unary(
|
|
||||||
'/backend.Backend/GenerateImage',
|
|
||||||
request_serializer=backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.AudioTranscription = channel.unary_unary(
|
|
||||||
'/backend.Backend/AudioTranscription',
|
|
||||||
request_serializer=backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TranscriptResult.FromString,
|
|
||||||
)
|
|
||||||
self.TTS = channel.unary_unary(
|
|
||||||
'/backend.Backend/TTS',
|
|
||||||
request_serializer=backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.TokenizeString = channel.unary_unary(
|
|
||||||
'/backend.Backend/TokenizeString',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TokenizationResponse.FromString,
|
|
||||||
)
|
|
||||||
self.Status = channel.unary_unary(
|
|
||||||
'/backend.Backend/Status',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StatusResponse.FromString,
|
|
||||||
)
|
|
||||||
self.StoresSet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresSet',
|
|
||||||
request_serializer=backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresDelete = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresDelete',
|
|
||||||
request_serializer=backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresGet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresGet',
|
|
||||||
request_serializer=backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresGetResult.FromString,
|
|
||||||
)
|
|
||||||
self.StoresFind = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresFind',
|
|
||||||
request_serializer=backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresFindResult.FromString,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class BackendServicer(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def Health(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Predict(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def LoadModel(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def PredictStream(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Embedding(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def GenerateImage(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def AudioTranscription(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TTS(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TokenizeString(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Status(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresSet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresDelete(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresGet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresFind(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
|
|
||||||
def add_BackendServicer_to_server(servicer, server):
|
|
||||||
rpc_method_handlers = {
|
|
||||||
'Health': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Health,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Predict': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Predict,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'LoadModel': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.LoadModel,
|
|
||||||
request_deserializer=backend__pb2.ModelOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'PredictStream': grpc.unary_stream_rpc_method_handler(
|
|
||||||
servicer.PredictStream,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Embedding': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Embedding,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.EmbeddingResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'GenerateImage': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.GenerateImage,
|
|
||||||
request_deserializer=backend__pb2.GenerateImageRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'AudioTranscription': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.AudioTranscription,
|
|
||||||
request_deserializer=backend__pb2.TranscriptRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.TranscriptResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'TTS': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TTS,
|
|
||||||
request_deserializer=backend__pb2.TTSRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'TokenizeString': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TokenizeString,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.TokenizationResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'Status': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Status,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.StatusResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresSet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresSet,
|
|
||||||
request_deserializer=backend__pb2.StoresSetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresDelete': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresDelete,
|
|
||||||
request_deserializer=backend__pb2.StoresDeleteOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresGet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresGet,
|
|
||||||
request_deserializer=backend__pb2.StoresGetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresGetResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresFind': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresFind,
|
|
||||||
request_deserializer=backend__pb2.StoresFindOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresFindResult.SerializeToString,
|
|
||||||
),
|
|
||||||
}
|
|
||||||
generic_handler = grpc.method_handlers_generic_handler(
|
|
||||||
'backend.Backend', rpc_method_handlers)
|
|
||||||
server.add_generic_rpc_handlers((generic_handler,))
|
|
||||||
|
|
||||||
|
|
||||||
# This class is part of an EXPERIMENTAL API.
|
|
||||||
class Backend(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Health(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Health',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Predict(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Predict',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def LoadModel(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/LoadModel',
|
|
||||||
backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def PredictStream(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_stream(request, target, '/backend.Backend/PredictStream',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Embedding(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Embedding',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.EmbeddingResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def GenerateImage(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/GenerateImage',
|
|
||||||
backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def AudioTranscription(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/AudioTranscription',
|
|
||||||
backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
backend__pb2.TranscriptResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TTS(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TTS',
|
|
||||||
backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TokenizeString(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TokenizeString',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.TokenizationResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Status(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Status',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.StatusResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresSet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresSet',
|
|
||||||
backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresDelete(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresDelete',
|
|
||||||
backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresGet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresGet',
|
|
||||||
backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresGetResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresFind(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresFind',
|
|
||||||
backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresFindResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
@ -1,11 +1,21 @@
|
|||||||
export CONDA_ENV_PATH = "exllama.yml"
|
export CONDA_ENV_PATH = "exllama.yml"
|
||||||
|
|
||||||
.PHONY: exllama
|
.PHONY: exllama
|
||||||
exllama:
|
exllama: protogen
|
||||||
bash install.sh ${CONDA_ENV_PATH}
|
bash install.sh ${CONDA_ENV_PATH}
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run:
|
run: protogen
|
||||||
@echo "Running exllama..."
|
@echo "Running exllama..."
|
||||||
bash run.sh
|
bash run.sh
|
||||||
@echo "exllama run."
|
@echo "exllama run."
|
||||||
|
|
||||||
|
.PHONY: protogen
|
||||||
|
protogen: backend_pb2_grpc.py backend_pb2.py
|
||||||
|
|
||||||
|
.PHONY: protogen-clean
|
||||||
|
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
|
File diff suppressed because one or more lines are too long
@ -1,495 +0,0 @@
|
|||||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
||||||
"""Client and server classes corresponding to protobuf-defined services."""
|
|
||||||
import grpc
|
|
||||||
|
|
||||||
import backend_pb2 as backend__pb2
|
|
||||||
|
|
||||||
|
|
||||||
class BackendStub(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def __init__(self, channel):
|
|
||||||
"""Constructor.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
channel: A grpc.Channel.
|
|
||||||
"""
|
|
||||||
self.Health = channel.unary_unary(
|
|
||||||
'/backend.Backend/Health',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Predict = channel.unary_unary(
|
|
||||||
'/backend.Backend/Predict',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.LoadModel = channel.unary_unary(
|
|
||||||
'/backend.Backend/LoadModel',
|
|
||||||
request_serializer=backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.PredictStream = channel.unary_stream(
|
|
||||||
'/backend.Backend/PredictStream',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Embedding = channel.unary_unary(
|
|
||||||
'/backend.Backend/Embedding',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.EmbeddingResult.FromString,
|
|
||||||
)
|
|
||||||
self.GenerateImage = channel.unary_unary(
|
|
||||||
'/backend.Backend/GenerateImage',
|
|
||||||
request_serializer=backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.AudioTranscription = channel.unary_unary(
|
|
||||||
'/backend.Backend/AudioTranscription',
|
|
||||||
request_serializer=backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TranscriptResult.FromString,
|
|
||||||
)
|
|
||||||
self.TTS = channel.unary_unary(
|
|
||||||
'/backend.Backend/TTS',
|
|
||||||
request_serializer=backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.TokenizeString = channel.unary_unary(
|
|
||||||
'/backend.Backend/TokenizeString',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TokenizationResponse.FromString,
|
|
||||||
)
|
|
||||||
self.Status = channel.unary_unary(
|
|
||||||
'/backend.Backend/Status',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StatusResponse.FromString,
|
|
||||||
)
|
|
||||||
self.StoresSet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresSet',
|
|
||||||
request_serializer=backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresDelete = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresDelete',
|
|
||||||
request_serializer=backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresGet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresGet',
|
|
||||||
request_serializer=backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresGetResult.FromString,
|
|
||||||
)
|
|
||||||
self.StoresFind = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresFind',
|
|
||||||
request_serializer=backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresFindResult.FromString,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class BackendServicer(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def Health(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Predict(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def LoadModel(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def PredictStream(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Embedding(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def GenerateImage(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def AudioTranscription(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TTS(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TokenizeString(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Status(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresSet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresDelete(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresGet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresFind(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
|
|
||||||
def add_BackendServicer_to_server(servicer, server):
|
|
||||||
rpc_method_handlers = {
|
|
||||||
'Health': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Health,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Predict': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Predict,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'LoadModel': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.LoadModel,
|
|
||||||
request_deserializer=backend__pb2.ModelOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'PredictStream': grpc.unary_stream_rpc_method_handler(
|
|
||||||
servicer.PredictStream,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Embedding': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Embedding,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.EmbeddingResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'GenerateImage': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.GenerateImage,
|
|
||||||
request_deserializer=backend__pb2.GenerateImageRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'AudioTranscription': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.AudioTranscription,
|
|
||||||
request_deserializer=backend__pb2.TranscriptRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.TranscriptResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'TTS': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TTS,
|
|
||||||
request_deserializer=backend__pb2.TTSRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'TokenizeString': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TokenizeString,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.TokenizationResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'Status': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Status,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.StatusResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresSet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresSet,
|
|
||||||
request_deserializer=backend__pb2.StoresSetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresDelete': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresDelete,
|
|
||||||
request_deserializer=backend__pb2.StoresDeleteOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresGet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresGet,
|
|
||||||
request_deserializer=backend__pb2.StoresGetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresGetResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresFind': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresFind,
|
|
||||||
request_deserializer=backend__pb2.StoresFindOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresFindResult.SerializeToString,
|
|
||||||
),
|
|
||||||
}
|
|
||||||
generic_handler = grpc.method_handlers_generic_handler(
|
|
||||||
'backend.Backend', rpc_method_handlers)
|
|
||||||
server.add_generic_rpc_handlers((generic_handler,))
|
|
||||||
|
|
||||||
|
|
||||||
# This class is part of an EXPERIMENTAL API.
|
|
||||||
class Backend(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Health(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Health',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Predict(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Predict',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def LoadModel(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/LoadModel',
|
|
||||||
backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def PredictStream(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_stream(request, target, '/backend.Backend/PredictStream',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Embedding(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Embedding',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.EmbeddingResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def GenerateImage(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/GenerateImage',
|
|
||||||
backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def AudioTranscription(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/AudioTranscription',
|
|
||||||
backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
backend__pb2.TranscriptResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TTS(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TTS',
|
|
||||||
backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TokenizeString(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TokenizeString',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.TokenizationResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Status(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Status',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.StatusResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresSet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresSet',
|
|
||||||
backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresDelete(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresDelete',
|
|
||||||
backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresGet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresGet',
|
|
||||||
backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresGetResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresFind(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresFind',
|
|
||||||
backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresFindResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
@ -1,10 +1,20 @@
|
|||||||
.PHONY: exllama2
|
.PHONY: exllama2
|
||||||
exllama2:
|
exllama2: protogen
|
||||||
$(MAKE) -C ../common-env/transformers
|
$(MAKE) -C ../common-env/transformers
|
||||||
bash install.sh
|
bash install.sh
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run:
|
run: protogen
|
||||||
@echo "Running exllama2..."
|
@echo "Running exllama2..."
|
||||||
bash run.sh
|
bash run.sh
|
||||||
@echo "exllama2 run."
|
@echo "exllama2 run."
|
||||||
|
|
||||||
|
.PHONY: protogen
|
||||||
|
protogen: backend_pb2_grpc.py backend_pb2.py
|
||||||
|
|
||||||
|
.PHONY: protogen-clean
|
||||||
|
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
|
File diff suppressed because one or more lines are too long
@ -1,495 +0,0 @@
|
|||||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
||||||
"""Client and server classes corresponding to protobuf-defined services."""
|
|
||||||
import grpc
|
|
||||||
|
|
||||||
import backend_pb2 as backend__pb2
|
|
||||||
|
|
||||||
|
|
||||||
class BackendStub(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def __init__(self, channel):
|
|
||||||
"""Constructor.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
channel: A grpc.Channel.
|
|
||||||
"""
|
|
||||||
self.Health = channel.unary_unary(
|
|
||||||
'/backend.Backend/Health',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Predict = channel.unary_unary(
|
|
||||||
'/backend.Backend/Predict',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.LoadModel = channel.unary_unary(
|
|
||||||
'/backend.Backend/LoadModel',
|
|
||||||
request_serializer=backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.PredictStream = channel.unary_stream(
|
|
||||||
'/backend.Backend/PredictStream',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Embedding = channel.unary_unary(
|
|
||||||
'/backend.Backend/Embedding',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.EmbeddingResult.FromString,
|
|
||||||
)
|
|
||||||
self.GenerateImage = channel.unary_unary(
|
|
||||||
'/backend.Backend/GenerateImage',
|
|
||||||
request_serializer=backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.AudioTranscription = channel.unary_unary(
|
|
||||||
'/backend.Backend/AudioTranscription',
|
|
||||||
request_serializer=backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TranscriptResult.FromString,
|
|
||||||
)
|
|
||||||
self.TTS = channel.unary_unary(
|
|
||||||
'/backend.Backend/TTS',
|
|
||||||
request_serializer=backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.TokenizeString = channel.unary_unary(
|
|
||||||
'/backend.Backend/TokenizeString',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TokenizationResponse.FromString,
|
|
||||||
)
|
|
||||||
self.Status = channel.unary_unary(
|
|
||||||
'/backend.Backend/Status',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StatusResponse.FromString,
|
|
||||||
)
|
|
||||||
self.StoresSet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresSet',
|
|
||||||
request_serializer=backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresDelete = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresDelete',
|
|
||||||
request_serializer=backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresGet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresGet',
|
|
||||||
request_serializer=backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresGetResult.FromString,
|
|
||||||
)
|
|
||||||
self.StoresFind = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresFind',
|
|
||||||
request_serializer=backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresFindResult.FromString,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class BackendServicer(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def Health(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Predict(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def LoadModel(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def PredictStream(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Embedding(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def GenerateImage(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def AudioTranscription(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TTS(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TokenizeString(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Status(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresSet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresDelete(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresGet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresFind(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
|
|
||||||
def add_BackendServicer_to_server(servicer, server):
|
|
||||||
rpc_method_handlers = {
|
|
||||||
'Health': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Health,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Predict': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Predict,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'LoadModel': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.LoadModel,
|
|
||||||
request_deserializer=backend__pb2.ModelOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'PredictStream': grpc.unary_stream_rpc_method_handler(
|
|
||||||
servicer.PredictStream,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Embedding': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Embedding,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.EmbeddingResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'GenerateImage': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.GenerateImage,
|
|
||||||
request_deserializer=backend__pb2.GenerateImageRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'AudioTranscription': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.AudioTranscription,
|
|
||||||
request_deserializer=backend__pb2.TranscriptRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.TranscriptResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'TTS': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TTS,
|
|
||||||
request_deserializer=backend__pb2.TTSRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'TokenizeString': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TokenizeString,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.TokenizationResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'Status': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Status,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.StatusResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresSet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresSet,
|
|
||||||
request_deserializer=backend__pb2.StoresSetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresDelete': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresDelete,
|
|
||||||
request_deserializer=backend__pb2.StoresDeleteOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresGet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresGet,
|
|
||||||
request_deserializer=backend__pb2.StoresGetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresGetResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresFind': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresFind,
|
|
||||||
request_deserializer=backend__pb2.StoresFindOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresFindResult.SerializeToString,
|
|
||||||
),
|
|
||||||
}
|
|
||||||
generic_handler = grpc.method_handlers_generic_handler(
|
|
||||||
'backend.Backend', rpc_method_handlers)
|
|
||||||
server.add_generic_rpc_handlers((generic_handler,))
|
|
||||||
|
|
||||||
|
|
||||||
# This class is part of an EXPERIMENTAL API.
|
|
||||||
class Backend(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Health(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Health',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Predict(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Predict',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def LoadModel(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/LoadModel',
|
|
||||||
backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def PredictStream(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_stream(request, target, '/backend.Backend/PredictStream',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Embedding(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Embedding',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.EmbeddingResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def GenerateImage(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/GenerateImage',
|
|
||||||
backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def AudioTranscription(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/AudioTranscription',
|
|
||||||
backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
backend__pb2.TranscriptResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TTS(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TTS',
|
|
||||||
backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TokenizeString(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TokenizeString',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.TokenizationResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Status(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Status',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.StatusResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresSet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresSet',
|
|
||||||
backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresDelete(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresDelete',
|
|
||||||
backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresGet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresGet',
|
|
||||||
backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresGetResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresFind(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresFind',
|
|
||||||
backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresFindResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
@ -1,16 +1,26 @@
|
|||||||
.PHONY: mamba
|
.PHONY: mamba
|
||||||
mamba:
|
mamba: protogen
|
||||||
$(MAKE) -C ../common-env/transformers
|
$(MAKE) -C ../common-env/transformers
|
||||||
bash install.sh
|
bash install.sh
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run:
|
run: protogen
|
||||||
@echo "Running mamba..."
|
@echo "Running mamba..."
|
||||||
bash run.sh
|
bash run.sh
|
||||||
@echo "mamba run."
|
@echo "mamba run."
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test: protogen
|
||||||
@echo "Testing mamba..."
|
@echo "Testing mamba..."
|
||||||
bash test.sh
|
bash test.sh
|
||||||
@echo "mamba tested."
|
@echo "mamba tested."
|
||||||
|
|
||||||
|
.PHONY: protogen
|
||||||
|
protogen: backend_pb2_grpc.py backend_pb2.py
|
||||||
|
|
||||||
|
.PHONY: protogen-clean
|
||||||
|
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
|
File diff suppressed because one or more lines are too long
@ -1,495 +0,0 @@
|
|||||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
||||||
"""Client and server classes corresponding to protobuf-defined services."""
|
|
||||||
import grpc
|
|
||||||
|
|
||||||
import backend_pb2 as backend__pb2
|
|
||||||
|
|
||||||
|
|
||||||
class BackendStub(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def __init__(self, channel):
|
|
||||||
"""Constructor.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
channel: A grpc.Channel.
|
|
||||||
"""
|
|
||||||
self.Health = channel.unary_unary(
|
|
||||||
'/backend.Backend/Health',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Predict = channel.unary_unary(
|
|
||||||
'/backend.Backend/Predict',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.LoadModel = channel.unary_unary(
|
|
||||||
'/backend.Backend/LoadModel',
|
|
||||||
request_serializer=backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.PredictStream = channel.unary_stream(
|
|
||||||
'/backend.Backend/PredictStream',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Embedding = channel.unary_unary(
|
|
||||||
'/backend.Backend/Embedding',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.EmbeddingResult.FromString,
|
|
||||||
)
|
|
||||||
self.GenerateImage = channel.unary_unary(
|
|
||||||
'/backend.Backend/GenerateImage',
|
|
||||||
request_serializer=backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.AudioTranscription = channel.unary_unary(
|
|
||||||
'/backend.Backend/AudioTranscription',
|
|
||||||
request_serializer=backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TranscriptResult.FromString,
|
|
||||||
)
|
|
||||||
self.TTS = channel.unary_unary(
|
|
||||||
'/backend.Backend/TTS',
|
|
||||||
request_serializer=backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.TokenizeString = channel.unary_unary(
|
|
||||||
'/backend.Backend/TokenizeString',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TokenizationResponse.FromString,
|
|
||||||
)
|
|
||||||
self.Status = channel.unary_unary(
|
|
||||||
'/backend.Backend/Status',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StatusResponse.FromString,
|
|
||||||
)
|
|
||||||
self.StoresSet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresSet',
|
|
||||||
request_serializer=backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresDelete = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresDelete',
|
|
||||||
request_serializer=backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresGet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresGet',
|
|
||||||
request_serializer=backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresGetResult.FromString,
|
|
||||||
)
|
|
||||||
self.StoresFind = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresFind',
|
|
||||||
request_serializer=backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresFindResult.FromString,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class BackendServicer(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def Health(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Predict(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def LoadModel(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def PredictStream(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Embedding(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def GenerateImage(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def AudioTranscription(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TTS(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TokenizeString(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Status(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresSet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresDelete(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresGet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresFind(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
|
|
||||||
def add_BackendServicer_to_server(servicer, server):
|
|
||||||
rpc_method_handlers = {
|
|
||||||
'Health': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Health,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Predict': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Predict,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'LoadModel': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.LoadModel,
|
|
||||||
request_deserializer=backend__pb2.ModelOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'PredictStream': grpc.unary_stream_rpc_method_handler(
|
|
||||||
servicer.PredictStream,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Embedding': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Embedding,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.EmbeddingResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'GenerateImage': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.GenerateImage,
|
|
||||||
request_deserializer=backend__pb2.GenerateImageRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'AudioTranscription': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.AudioTranscription,
|
|
||||||
request_deserializer=backend__pb2.TranscriptRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.TranscriptResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'TTS': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TTS,
|
|
||||||
request_deserializer=backend__pb2.TTSRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'TokenizeString': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TokenizeString,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.TokenizationResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'Status': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Status,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.StatusResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresSet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresSet,
|
|
||||||
request_deserializer=backend__pb2.StoresSetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresDelete': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresDelete,
|
|
||||||
request_deserializer=backend__pb2.StoresDeleteOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresGet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresGet,
|
|
||||||
request_deserializer=backend__pb2.StoresGetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresGetResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresFind': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresFind,
|
|
||||||
request_deserializer=backend__pb2.StoresFindOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresFindResult.SerializeToString,
|
|
||||||
),
|
|
||||||
}
|
|
||||||
generic_handler = grpc.method_handlers_generic_handler(
|
|
||||||
'backend.Backend', rpc_method_handlers)
|
|
||||||
server.add_generic_rpc_handlers((generic_handler,))
|
|
||||||
|
|
||||||
|
|
||||||
# This class is part of an EXPERIMENTAL API.
|
|
||||||
class Backend(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Health(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Health',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Predict(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Predict',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def LoadModel(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/LoadModel',
|
|
||||||
backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def PredictStream(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_stream(request, target, '/backend.Backend/PredictStream',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Embedding(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Embedding',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.EmbeddingResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def GenerateImage(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/GenerateImage',
|
|
||||||
backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def AudioTranscription(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/AudioTranscription',
|
|
||||||
backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
backend__pb2.TranscriptResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TTS(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TTS',
|
|
||||||
backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TokenizeString(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TokenizeString',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.TokenizationResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Status(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Status',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.StatusResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresSet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresSet',
|
|
||||||
backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresDelete(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresDelete',
|
|
||||||
backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresGet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresGet',
|
|
||||||
backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresGetResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresFind(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresFind',
|
|
||||||
backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresFindResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
@ -1,17 +1,27 @@
|
|||||||
.PHONY: petals
|
.PHONY: petals
|
||||||
petals:
|
petals: protogen
|
||||||
@echo "Creating virtual environment..."
|
@echo "Creating virtual environment..."
|
||||||
bash install.sh "petals.yml"
|
bash install.sh "petals.yml"
|
||||||
@echo "Virtual environment created."
|
@echo "Virtual environment created."
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run:
|
run: protogen
|
||||||
@echo "Running petals..."
|
@echo "Running petals..."
|
||||||
bash run.sh
|
bash run.sh
|
||||||
@echo "petals run."
|
@echo "petals run."
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test: protogen
|
||||||
@echo "Testing petals..."
|
@echo "Testing petals..."
|
||||||
bash test.sh
|
bash test.sh
|
||||||
@echo "petals tested."
|
@echo "petals tested."
|
||||||
|
|
||||||
|
.PHONY: protogen
|
||||||
|
protogen: backend_pb2_grpc.py backend_pb2.py
|
||||||
|
|
||||||
|
.PHONY: protogen-clean
|
||||||
|
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
|
File diff suppressed because one or more lines are too long
@ -1,495 +0,0 @@
|
|||||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
||||||
"""Client and server classes corresponding to protobuf-defined services."""
|
|
||||||
import grpc
|
|
||||||
|
|
||||||
import backend_pb2 as backend__pb2
|
|
||||||
|
|
||||||
|
|
||||||
class BackendStub(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def __init__(self, channel):
|
|
||||||
"""Constructor.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
channel: A grpc.Channel.
|
|
||||||
"""
|
|
||||||
self.Health = channel.unary_unary(
|
|
||||||
'/backend.Backend/Health',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Predict = channel.unary_unary(
|
|
||||||
'/backend.Backend/Predict',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.LoadModel = channel.unary_unary(
|
|
||||||
'/backend.Backend/LoadModel',
|
|
||||||
request_serializer=backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.PredictStream = channel.unary_stream(
|
|
||||||
'/backend.Backend/PredictStream',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Embedding = channel.unary_unary(
|
|
||||||
'/backend.Backend/Embedding',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.EmbeddingResult.FromString,
|
|
||||||
)
|
|
||||||
self.GenerateImage = channel.unary_unary(
|
|
||||||
'/backend.Backend/GenerateImage',
|
|
||||||
request_serializer=backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.AudioTranscription = channel.unary_unary(
|
|
||||||
'/backend.Backend/AudioTranscription',
|
|
||||||
request_serializer=backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TranscriptResult.FromString,
|
|
||||||
)
|
|
||||||
self.TTS = channel.unary_unary(
|
|
||||||
'/backend.Backend/TTS',
|
|
||||||
request_serializer=backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.TokenizeString = channel.unary_unary(
|
|
||||||
'/backend.Backend/TokenizeString',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TokenizationResponse.FromString,
|
|
||||||
)
|
|
||||||
self.Status = channel.unary_unary(
|
|
||||||
'/backend.Backend/Status',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StatusResponse.FromString,
|
|
||||||
)
|
|
||||||
self.StoresSet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresSet',
|
|
||||||
request_serializer=backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresDelete = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresDelete',
|
|
||||||
request_serializer=backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresGet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresGet',
|
|
||||||
request_serializer=backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresGetResult.FromString,
|
|
||||||
)
|
|
||||||
self.StoresFind = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresFind',
|
|
||||||
request_serializer=backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresFindResult.FromString,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class BackendServicer(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def Health(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Predict(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def LoadModel(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def PredictStream(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Embedding(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def GenerateImage(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def AudioTranscription(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TTS(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TokenizeString(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Status(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresSet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresDelete(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresGet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresFind(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
|
|
||||||
def add_BackendServicer_to_server(servicer, server):
|
|
||||||
rpc_method_handlers = {
|
|
||||||
'Health': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Health,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Predict': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Predict,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'LoadModel': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.LoadModel,
|
|
||||||
request_deserializer=backend__pb2.ModelOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'PredictStream': grpc.unary_stream_rpc_method_handler(
|
|
||||||
servicer.PredictStream,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Embedding': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Embedding,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.EmbeddingResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'GenerateImage': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.GenerateImage,
|
|
||||||
request_deserializer=backend__pb2.GenerateImageRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'AudioTranscription': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.AudioTranscription,
|
|
||||||
request_deserializer=backend__pb2.TranscriptRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.TranscriptResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'TTS': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TTS,
|
|
||||||
request_deserializer=backend__pb2.TTSRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'TokenizeString': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TokenizeString,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.TokenizationResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'Status': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Status,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.StatusResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresSet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresSet,
|
|
||||||
request_deserializer=backend__pb2.StoresSetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresDelete': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresDelete,
|
|
||||||
request_deserializer=backend__pb2.StoresDeleteOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresGet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresGet,
|
|
||||||
request_deserializer=backend__pb2.StoresGetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresGetResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresFind': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresFind,
|
|
||||||
request_deserializer=backend__pb2.StoresFindOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresFindResult.SerializeToString,
|
|
||||||
),
|
|
||||||
}
|
|
||||||
generic_handler = grpc.method_handlers_generic_handler(
|
|
||||||
'backend.Backend', rpc_method_handlers)
|
|
||||||
server.add_generic_rpc_handlers((generic_handler,))
|
|
||||||
|
|
||||||
|
|
||||||
# This class is part of an EXPERIMENTAL API.
|
|
||||||
class Backend(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Health(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Health',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Predict(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Predict',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def LoadModel(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/LoadModel',
|
|
||||||
backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def PredictStream(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_stream(request, target, '/backend.Backend/PredictStream',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Embedding(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Embedding',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.EmbeddingResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def GenerateImage(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/GenerateImage',
|
|
||||||
backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def AudioTranscription(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/AudioTranscription',
|
|
||||||
backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
backend__pb2.TranscriptResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TTS(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TTS',
|
|
||||||
backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TokenizeString(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TokenizeString',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.TokenizationResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Status(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Status',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.StatusResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresSet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresSet',
|
|
||||||
backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresDelete(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresDelete',
|
|
||||||
backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresGet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresGet',
|
|
||||||
backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresGetResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresFind(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresFind',
|
|
||||||
backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresFindResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
@ -1,17 +1,27 @@
|
|||||||
.PHONY: sentencetransformers
|
.PHONY: sentencetransformers
|
||||||
sentencetransformers:
|
sentencetransformers: protogen
|
||||||
$(MAKE) -C ../common-env/transformers
|
$(MAKE) -C ../common-env/transformers
|
||||||
|
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run:
|
run: protogen
|
||||||
@echo "Running sentencetransformers..."
|
@echo "Running sentencetransformers..."
|
||||||
bash run.sh
|
bash run.sh
|
||||||
@echo "sentencetransformers run."
|
@echo "sentencetransformers run."
|
||||||
|
|
||||||
# It is not working well by using command line. It only6 works with IDE like VSCode.
|
# It is not working well by using command line. It only6 works with IDE like VSCode.
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test: protogen
|
||||||
@echo "Testing sentencetransformers..."
|
@echo "Testing sentencetransformers..."
|
||||||
bash test.sh
|
bash test.sh
|
||||||
@echo "sentencetransformers tested."
|
@echo "sentencetransformers tested."
|
||||||
|
|
||||||
|
.PHONY: protogen
|
||||||
|
protogen: backend_pb2_grpc.py backend_pb2.py
|
||||||
|
|
||||||
|
.PHONY: protogen-clean
|
||||||
|
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
|
File diff suppressed because one or more lines are too long
@ -1,495 +0,0 @@
|
|||||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
||||||
"""Client and server classes corresponding to protobuf-defined services."""
|
|
||||||
import grpc
|
|
||||||
|
|
||||||
import backend_pb2 as backend__pb2
|
|
||||||
|
|
||||||
|
|
||||||
class BackendStub(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def __init__(self, channel):
|
|
||||||
"""Constructor.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
channel: A grpc.Channel.
|
|
||||||
"""
|
|
||||||
self.Health = channel.unary_unary(
|
|
||||||
'/backend.Backend/Health',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Predict = channel.unary_unary(
|
|
||||||
'/backend.Backend/Predict',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.LoadModel = channel.unary_unary(
|
|
||||||
'/backend.Backend/LoadModel',
|
|
||||||
request_serializer=backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.PredictStream = channel.unary_stream(
|
|
||||||
'/backend.Backend/PredictStream',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Embedding = channel.unary_unary(
|
|
||||||
'/backend.Backend/Embedding',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.EmbeddingResult.FromString,
|
|
||||||
)
|
|
||||||
self.GenerateImage = channel.unary_unary(
|
|
||||||
'/backend.Backend/GenerateImage',
|
|
||||||
request_serializer=backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.AudioTranscription = channel.unary_unary(
|
|
||||||
'/backend.Backend/AudioTranscription',
|
|
||||||
request_serializer=backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TranscriptResult.FromString,
|
|
||||||
)
|
|
||||||
self.TTS = channel.unary_unary(
|
|
||||||
'/backend.Backend/TTS',
|
|
||||||
request_serializer=backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.TokenizeString = channel.unary_unary(
|
|
||||||
'/backend.Backend/TokenizeString',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TokenizationResponse.FromString,
|
|
||||||
)
|
|
||||||
self.Status = channel.unary_unary(
|
|
||||||
'/backend.Backend/Status',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StatusResponse.FromString,
|
|
||||||
)
|
|
||||||
self.StoresSet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresSet',
|
|
||||||
request_serializer=backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresDelete = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresDelete',
|
|
||||||
request_serializer=backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresGet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresGet',
|
|
||||||
request_serializer=backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresGetResult.FromString,
|
|
||||||
)
|
|
||||||
self.StoresFind = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresFind',
|
|
||||||
request_serializer=backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresFindResult.FromString,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class BackendServicer(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def Health(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Predict(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def LoadModel(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def PredictStream(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Embedding(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def GenerateImage(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def AudioTranscription(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TTS(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TokenizeString(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Status(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresSet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresDelete(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresGet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresFind(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
|
|
||||||
def add_BackendServicer_to_server(servicer, server):
|
|
||||||
rpc_method_handlers = {
|
|
||||||
'Health': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Health,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Predict': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Predict,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'LoadModel': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.LoadModel,
|
|
||||||
request_deserializer=backend__pb2.ModelOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'PredictStream': grpc.unary_stream_rpc_method_handler(
|
|
||||||
servicer.PredictStream,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Embedding': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Embedding,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.EmbeddingResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'GenerateImage': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.GenerateImage,
|
|
||||||
request_deserializer=backend__pb2.GenerateImageRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'AudioTranscription': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.AudioTranscription,
|
|
||||||
request_deserializer=backend__pb2.TranscriptRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.TranscriptResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'TTS': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TTS,
|
|
||||||
request_deserializer=backend__pb2.TTSRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'TokenizeString': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TokenizeString,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.TokenizationResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'Status': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Status,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.StatusResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresSet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresSet,
|
|
||||||
request_deserializer=backend__pb2.StoresSetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresDelete': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresDelete,
|
|
||||||
request_deserializer=backend__pb2.StoresDeleteOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresGet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresGet,
|
|
||||||
request_deserializer=backend__pb2.StoresGetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresGetResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresFind': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresFind,
|
|
||||||
request_deserializer=backend__pb2.StoresFindOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresFindResult.SerializeToString,
|
|
||||||
),
|
|
||||||
}
|
|
||||||
generic_handler = grpc.method_handlers_generic_handler(
|
|
||||||
'backend.Backend', rpc_method_handlers)
|
|
||||||
server.add_generic_rpc_handlers((generic_handler,))
|
|
||||||
|
|
||||||
|
|
||||||
# This class is part of an EXPERIMENTAL API.
|
|
||||||
class Backend(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Health(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Health',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Predict(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Predict',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def LoadModel(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/LoadModel',
|
|
||||||
backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def PredictStream(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_stream(request, target, '/backend.Backend/PredictStream',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Embedding(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Embedding',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.EmbeddingResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def GenerateImage(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/GenerateImage',
|
|
||||||
backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def AudioTranscription(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/AudioTranscription',
|
|
||||||
backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
backend__pb2.TranscriptResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TTS(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TTS',
|
|
||||||
backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TokenizeString(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TokenizeString',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.TokenizationResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Status(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Status',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.StatusResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresSet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresSet',
|
|
||||||
backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresDelete(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresDelete',
|
|
||||||
backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresGet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresGet',
|
|
||||||
backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresGetResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresFind(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresFind',
|
|
||||||
backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresFindResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
@ -1,16 +1,25 @@
|
|||||||
|
|
||||||
.PHONY: transformers-musicgen
|
.PHONY: transformers-musicgen
|
||||||
transformers-musicgen:
|
transformers-musicgen: protogen
|
||||||
$(MAKE) -C ../common-env/transformers
|
$(MAKE) -C ../common-env/transformers
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run:
|
run: protogen
|
||||||
@echo "Running transformers..."
|
@echo "Running transformers..."
|
||||||
bash run.sh
|
bash run.sh
|
||||||
@echo "transformers run."
|
@echo "transformers run."
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test: protogen
|
||||||
@echo "Testing transformers..."
|
@echo "Testing transformers..."
|
||||||
bash test.sh
|
bash test.sh
|
||||||
@echo "transformers tested."
|
@echo "transformers tested."
|
||||||
|
|
||||||
|
.PHONY: protogen
|
||||||
|
protogen: backend_pb2_grpc.py backend_pb2.py
|
||||||
|
|
||||||
|
.PHONY: protogen-clean
|
||||||
|
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
|
File diff suppressed because one or more lines are too long
@ -1,495 +0,0 @@
|
|||||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
||||||
"""Client and server classes corresponding to protobuf-defined services."""
|
|
||||||
import grpc
|
|
||||||
|
|
||||||
import backend_pb2 as backend__pb2
|
|
||||||
|
|
||||||
|
|
||||||
class BackendStub(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def __init__(self, channel):
|
|
||||||
"""Constructor.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
channel: A grpc.Channel.
|
|
||||||
"""
|
|
||||||
self.Health = channel.unary_unary(
|
|
||||||
'/backend.Backend/Health',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Predict = channel.unary_unary(
|
|
||||||
'/backend.Backend/Predict',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.LoadModel = channel.unary_unary(
|
|
||||||
'/backend.Backend/LoadModel',
|
|
||||||
request_serializer=backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.PredictStream = channel.unary_stream(
|
|
||||||
'/backend.Backend/PredictStream',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Embedding = channel.unary_unary(
|
|
||||||
'/backend.Backend/Embedding',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.EmbeddingResult.FromString,
|
|
||||||
)
|
|
||||||
self.GenerateImage = channel.unary_unary(
|
|
||||||
'/backend.Backend/GenerateImage',
|
|
||||||
request_serializer=backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.AudioTranscription = channel.unary_unary(
|
|
||||||
'/backend.Backend/AudioTranscription',
|
|
||||||
request_serializer=backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TranscriptResult.FromString,
|
|
||||||
)
|
|
||||||
self.TTS = channel.unary_unary(
|
|
||||||
'/backend.Backend/TTS',
|
|
||||||
request_serializer=backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.TokenizeString = channel.unary_unary(
|
|
||||||
'/backend.Backend/TokenizeString',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TokenizationResponse.FromString,
|
|
||||||
)
|
|
||||||
self.Status = channel.unary_unary(
|
|
||||||
'/backend.Backend/Status',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StatusResponse.FromString,
|
|
||||||
)
|
|
||||||
self.StoresSet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresSet',
|
|
||||||
request_serializer=backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresDelete = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresDelete',
|
|
||||||
request_serializer=backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresGet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresGet',
|
|
||||||
request_serializer=backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresGetResult.FromString,
|
|
||||||
)
|
|
||||||
self.StoresFind = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresFind',
|
|
||||||
request_serializer=backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresFindResult.FromString,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class BackendServicer(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def Health(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Predict(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def LoadModel(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def PredictStream(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Embedding(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def GenerateImage(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def AudioTranscription(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TTS(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TokenizeString(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Status(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresSet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresDelete(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresGet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresFind(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
|
|
||||||
def add_BackendServicer_to_server(servicer, server):
|
|
||||||
rpc_method_handlers = {
|
|
||||||
'Health': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Health,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Predict': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Predict,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'LoadModel': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.LoadModel,
|
|
||||||
request_deserializer=backend__pb2.ModelOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'PredictStream': grpc.unary_stream_rpc_method_handler(
|
|
||||||
servicer.PredictStream,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Embedding': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Embedding,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.EmbeddingResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'GenerateImage': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.GenerateImage,
|
|
||||||
request_deserializer=backend__pb2.GenerateImageRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'AudioTranscription': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.AudioTranscription,
|
|
||||||
request_deserializer=backend__pb2.TranscriptRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.TranscriptResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'TTS': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TTS,
|
|
||||||
request_deserializer=backend__pb2.TTSRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'TokenizeString': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TokenizeString,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.TokenizationResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'Status': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Status,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.StatusResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresSet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresSet,
|
|
||||||
request_deserializer=backend__pb2.StoresSetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresDelete': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresDelete,
|
|
||||||
request_deserializer=backend__pb2.StoresDeleteOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresGet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresGet,
|
|
||||||
request_deserializer=backend__pb2.StoresGetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresGetResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresFind': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresFind,
|
|
||||||
request_deserializer=backend__pb2.StoresFindOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresFindResult.SerializeToString,
|
|
||||||
),
|
|
||||||
}
|
|
||||||
generic_handler = grpc.method_handlers_generic_handler(
|
|
||||||
'backend.Backend', rpc_method_handlers)
|
|
||||||
server.add_generic_rpc_handlers((generic_handler,))
|
|
||||||
|
|
||||||
|
|
||||||
# This class is part of an EXPERIMENTAL API.
|
|
||||||
class Backend(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Health(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Health',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Predict(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Predict',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def LoadModel(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/LoadModel',
|
|
||||||
backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def PredictStream(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_stream(request, target, '/backend.Backend/PredictStream',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Embedding(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Embedding',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.EmbeddingResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def GenerateImage(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/GenerateImage',
|
|
||||||
backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def AudioTranscription(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/AudioTranscription',
|
|
||||||
backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
backend__pb2.TranscriptResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TTS(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TTS',
|
|
||||||
backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TokenizeString(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TokenizeString',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.TokenizationResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Status(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Status',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.StatusResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresSet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresSet',
|
|
||||||
backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresDelete(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresDelete',
|
|
||||||
backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresGet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresGet',
|
|
||||||
backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresGetResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresFind(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresFind',
|
|
||||||
backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresFindResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
@ -1,16 +1,26 @@
|
|||||||
.PHONY: transformers
|
.PHONY: transformers
|
||||||
transformers:
|
transformers: protogen
|
||||||
$(MAKE) -C ../common-env/transformers
|
$(MAKE) -C ../common-env/transformers
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run:
|
run: protogen
|
||||||
@echo "Running transformers..."
|
@echo "Running transformers..."
|
||||||
bash run.sh
|
bash run.sh
|
||||||
@echo "transformers run."
|
@echo "transformers run."
|
||||||
|
|
||||||
# It is not working well by using command line. It only6 works with IDE like VSCode.
|
# It is not working well by using command line. It only6 works with IDE like VSCode.
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test: protogen
|
||||||
@echo "Testing transformers..."
|
@echo "Testing transformers..."
|
||||||
bash test.sh
|
bash test.sh
|
||||||
@echo "transformers tested."
|
@echo "transformers tested."
|
||||||
|
|
||||||
|
.PHONY: protogen
|
||||||
|
protogen: backend_pb2_grpc.py backend_pb2.py
|
||||||
|
|
||||||
|
.PHONY: protogen-clean
|
||||||
|
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
|
File diff suppressed because one or more lines are too long
@ -1,495 +0,0 @@
|
|||||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
||||||
"""Client and server classes corresponding to protobuf-defined services."""
|
|
||||||
import grpc
|
|
||||||
|
|
||||||
import backend_pb2 as backend__pb2
|
|
||||||
|
|
||||||
|
|
||||||
class BackendStub(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def __init__(self, channel):
|
|
||||||
"""Constructor.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
channel: A grpc.Channel.
|
|
||||||
"""
|
|
||||||
self.Health = channel.unary_unary(
|
|
||||||
'/backend.Backend/Health',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Predict = channel.unary_unary(
|
|
||||||
'/backend.Backend/Predict',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.LoadModel = channel.unary_unary(
|
|
||||||
'/backend.Backend/LoadModel',
|
|
||||||
request_serializer=backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.PredictStream = channel.unary_stream(
|
|
||||||
'/backend.Backend/PredictStream',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Embedding = channel.unary_unary(
|
|
||||||
'/backend.Backend/Embedding',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.EmbeddingResult.FromString,
|
|
||||||
)
|
|
||||||
self.GenerateImage = channel.unary_unary(
|
|
||||||
'/backend.Backend/GenerateImage',
|
|
||||||
request_serializer=backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.AudioTranscription = channel.unary_unary(
|
|
||||||
'/backend.Backend/AudioTranscription',
|
|
||||||
request_serializer=backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TranscriptResult.FromString,
|
|
||||||
)
|
|
||||||
self.TTS = channel.unary_unary(
|
|
||||||
'/backend.Backend/TTS',
|
|
||||||
request_serializer=backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.TokenizeString = channel.unary_unary(
|
|
||||||
'/backend.Backend/TokenizeString',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TokenizationResponse.FromString,
|
|
||||||
)
|
|
||||||
self.Status = channel.unary_unary(
|
|
||||||
'/backend.Backend/Status',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StatusResponse.FromString,
|
|
||||||
)
|
|
||||||
self.StoresSet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresSet',
|
|
||||||
request_serializer=backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresDelete = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresDelete',
|
|
||||||
request_serializer=backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresGet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresGet',
|
|
||||||
request_serializer=backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresGetResult.FromString,
|
|
||||||
)
|
|
||||||
self.StoresFind = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresFind',
|
|
||||||
request_serializer=backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresFindResult.FromString,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class BackendServicer(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def Health(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Predict(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def LoadModel(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def PredictStream(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Embedding(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def GenerateImage(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def AudioTranscription(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TTS(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TokenizeString(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Status(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresSet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresDelete(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresGet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresFind(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
|
|
||||||
def add_BackendServicer_to_server(servicer, server):
|
|
||||||
rpc_method_handlers = {
|
|
||||||
'Health': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Health,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Predict': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Predict,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'LoadModel': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.LoadModel,
|
|
||||||
request_deserializer=backend__pb2.ModelOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'PredictStream': grpc.unary_stream_rpc_method_handler(
|
|
||||||
servicer.PredictStream,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Embedding': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Embedding,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.EmbeddingResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'GenerateImage': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.GenerateImage,
|
|
||||||
request_deserializer=backend__pb2.GenerateImageRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'AudioTranscription': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.AudioTranscription,
|
|
||||||
request_deserializer=backend__pb2.TranscriptRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.TranscriptResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'TTS': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TTS,
|
|
||||||
request_deserializer=backend__pb2.TTSRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'TokenizeString': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TokenizeString,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.TokenizationResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'Status': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Status,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.StatusResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresSet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresSet,
|
|
||||||
request_deserializer=backend__pb2.StoresSetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresDelete': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresDelete,
|
|
||||||
request_deserializer=backend__pb2.StoresDeleteOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresGet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresGet,
|
|
||||||
request_deserializer=backend__pb2.StoresGetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresGetResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresFind': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresFind,
|
|
||||||
request_deserializer=backend__pb2.StoresFindOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresFindResult.SerializeToString,
|
|
||||||
),
|
|
||||||
}
|
|
||||||
generic_handler = grpc.method_handlers_generic_handler(
|
|
||||||
'backend.Backend', rpc_method_handlers)
|
|
||||||
server.add_generic_rpc_handlers((generic_handler,))
|
|
||||||
|
|
||||||
|
|
||||||
# This class is part of an EXPERIMENTAL API.
|
|
||||||
class Backend(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Health(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Health',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Predict(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Predict',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def LoadModel(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/LoadModel',
|
|
||||||
backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def PredictStream(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_stream(request, target, '/backend.Backend/PredictStream',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Embedding(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Embedding',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.EmbeddingResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def GenerateImage(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/GenerateImage',
|
|
||||||
backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def AudioTranscription(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/AudioTranscription',
|
|
||||||
backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
backend__pb2.TranscriptResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TTS(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TTS',
|
|
||||||
backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TokenizeString(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TokenizeString',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.TokenizationResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Status(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Status',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.StatusResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresSet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresSet',
|
|
||||||
backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresDelete(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresDelete',
|
|
||||||
backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresGet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresGet',
|
|
||||||
backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresGetResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresFind(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresFind',
|
|
||||||
backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresFindResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
@ -3,18 +3,28 @@ export SKIP_CONDA=1
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: ttsvalle
|
.PHONY: ttsvalle
|
||||||
ttsvalle:
|
ttsvalle: protogen
|
||||||
$(MAKE) -C ../common-env/transformers
|
$(MAKE) -C ../common-env/transformers
|
||||||
bash install.sh
|
bash install.sh
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run:
|
run: protogen
|
||||||
@echo "Running ttsvalle..."
|
@echo "Running ttsvalle..."
|
||||||
bash run.sh
|
bash run.sh
|
||||||
@echo "ttsvalle run."
|
@echo "ttsvalle run."
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test: protogen
|
||||||
@echo "Testing valle..."
|
@echo "Testing valle..."
|
||||||
bash test.sh
|
bash test.sh
|
||||||
@echo "valle tested."
|
@echo "valle tested."
|
||||||
|
|
||||||
|
.PHONY: protogen
|
||||||
|
protogen: backend_pb2_grpc.py backend_pb2.py
|
||||||
|
|
||||||
|
.PHONY: protogen-clean
|
||||||
|
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
|
File diff suppressed because one or more lines are too long
@ -1,495 +0,0 @@
|
|||||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
||||||
"""Client and server classes corresponding to protobuf-defined services."""
|
|
||||||
import grpc
|
|
||||||
|
|
||||||
import backend_pb2 as backend__pb2
|
|
||||||
|
|
||||||
|
|
||||||
class BackendStub(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def __init__(self, channel):
|
|
||||||
"""Constructor.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
channel: A grpc.Channel.
|
|
||||||
"""
|
|
||||||
self.Health = channel.unary_unary(
|
|
||||||
'/backend.Backend/Health',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Predict = channel.unary_unary(
|
|
||||||
'/backend.Backend/Predict',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.LoadModel = channel.unary_unary(
|
|
||||||
'/backend.Backend/LoadModel',
|
|
||||||
request_serializer=backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.PredictStream = channel.unary_stream(
|
|
||||||
'/backend.Backend/PredictStream',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Embedding = channel.unary_unary(
|
|
||||||
'/backend.Backend/Embedding',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.EmbeddingResult.FromString,
|
|
||||||
)
|
|
||||||
self.GenerateImage = channel.unary_unary(
|
|
||||||
'/backend.Backend/GenerateImage',
|
|
||||||
request_serializer=backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.AudioTranscription = channel.unary_unary(
|
|
||||||
'/backend.Backend/AudioTranscription',
|
|
||||||
request_serializer=backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TranscriptResult.FromString,
|
|
||||||
)
|
|
||||||
self.TTS = channel.unary_unary(
|
|
||||||
'/backend.Backend/TTS',
|
|
||||||
request_serializer=backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.TokenizeString = channel.unary_unary(
|
|
||||||
'/backend.Backend/TokenizeString',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TokenizationResponse.FromString,
|
|
||||||
)
|
|
||||||
self.Status = channel.unary_unary(
|
|
||||||
'/backend.Backend/Status',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StatusResponse.FromString,
|
|
||||||
)
|
|
||||||
self.StoresSet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresSet',
|
|
||||||
request_serializer=backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresDelete = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresDelete',
|
|
||||||
request_serializer=backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresGet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresGet',
|
|
||||||
request_serializer=backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresGetResult.FromString,
|
|
||||||
)
|
|
||||||
self.StoresFind = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresFind',
|
|
||||||
request_serializer=backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresFindResult.FromString,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class BackendServicer(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def Health(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Predict(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def LoadModel(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def PredictStream(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Embedding(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def GenerateImage(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def AudioTranscription(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TTS(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TokenizeString(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Status(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresSet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresDelete(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresGet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresFind(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
|
|
||||||
def add_BackendServicer_to_server(servicer, server):
|
|
||||||
rpc_method_handlers = {
|
|
||||||
'Health': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Health,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Predict': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Predict,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'LoadModel': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.LoadModel,
|
|
||||||
request_deserializer=backend__pb2.ModelOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'PredictStream': grpc.unary_stream_rpc_method_handler(
|
|
||||||
servicer.PredictStream,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Embedding': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Embedding,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.EmbeddingResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'GenerateImage': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.GenerateImage,
|
|
||||||
request_deserializer=backend__pb2.GenerateImageRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'AudioTranscription': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.AudioTranscription,
|
|
||||||
request_deserializer=backend__pb2.TranscriptRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.TranscriptResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'TTS': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TTS,
|
|
||||||
request_deserializer=backend__pb2.TTSRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'TokenizeString': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TokenizeString,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.TokenizationResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'Status': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Status,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.StatusResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresSet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresSet,
|
|
||||||
request_deserializer=backend__pb2.StoresSetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresDelete': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresDelete,
|
|
||||||
request_deserializer=backend__pb2.StoresDeleteOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresGet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresGet,
|
|
||||||
request_deserializer=backend__pb2.StoresGetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresGetResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresFind': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresFind,
|
|
||||||
request_deserializer=backend__pb2.StoresFindOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresFindResult.SerializeToString,
|
|
||||||
),
|
|
||||||
}
|
|
||||||
generic_handler = grpc.method_handlers_generic_handler(
|
|
||||||
'backend.Backend', rpc_method_handlers)
|
|
||||||
server.add_generic_rpc_handlers((generic_handler,))
|
|
||||||
|
|
||||||
|
|
||||||
# This class is part of an EXPERIMENTAL API.
|
|
||||||
class Backend(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Health(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Health',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Predict(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Predict',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def LoadModel(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/LoadModel',
|
|
||||||
backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def PredictStream(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_stream(request, target, '/backend.Backend/PredictStream',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Embedding(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Embedding',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.EmbeddingResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def GenerateImage(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/GenerateImage',
|
|
||||||
backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def AudioTranscription(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/AudioTranscription',
|
|
||||||
backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
backend__pb2.TranscriptResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TTS(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TTS',
|
|
||||||
backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TokenizeString(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TokenizeString',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.TokenizationResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Status(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Status',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.StatusResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresSet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresSet',
|
|
||||||
backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresDelete(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresDelete',
|
|
||||||
backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresGet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresGet',
|
|
||||||
backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresGetResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresFind(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresFind',
|
|
||||||
backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresFindResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
@ -1,15 +1,25 @@
|
|||||||
.PHONY: vllm
|
.PHONY: vllm
|
||||||
vllm:
|
vllm: protogen
|
||||||
$(MAKE) -C ../common-env/transformers
|
$(MAKE) -C ../common-env/transformers
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run:
|
run: protogen
|
||||||
@echo "Running vllm..."
|
@echo "Running vllm..."
|
||||||
bash run.sh
|
bash run.sh
|
||||||
@echo "vllm run."
|
@echo "vllm run."
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test: protogen
|
||||||
@echo "Testing vllm..."
|
@echo "Testing vllm..."
|
||||||
bash test.sh
|
bash test.sh
|
||||||
@echo "vllm tested."
|
@echo "vllm tested."
|
||||||
|
|
||||||
|
.PHONY: protogen
|
||||||
|
protogen: backend_pb2_grpc.py backend_pb2.py
|
||||||
|
|
||||||
|
.PHONY: protogen-clean
|
||||||
|
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
|
File diff suppressed because one or more lines are too long
@ -1,495 +0,0 @@
|
|||||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
||||||
"""Client and server classes corresponding to protobuf-defined services."""
|
|
||||||
import grpc
|
|
||||||
|
|
||||||
import backend_pb2 as backend__pb2
|
|
||||||
|
|
||||||
|
|
||||||
class BackendStub(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def __init__(self, channel):
|
|
||||||
"""Constructor.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
channel: A grpc.Channel.
|
|
||||||
"""
|
|
||||||
self.Health = channel.unary_unary(
|
|
||||||
'/backend.Backend/Health',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Predict = channel.unary_unary(
|
|
||||||
'/backend.Backend/Predict',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.LoadModel = channel.unary_unary(
|
|
||||||
'/backend.Backend/LoadModel',
|
|
||||||
request_serializer=backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.PredictStream = channel.unary_stream(
|
|
||||||
'/backend.Backend/PredictStream',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Reply.FromString,
|
|
||||||
)
|
|
||||||
self.Embedding = channel.unary_unary(
|
|
||||||
'/backend.Backend/Embedding',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.EmbeddingResult.FromString,
|
|
||||||
)
|
|
||||||
self.GenerateImage = channel.unary_unary(
|
|
||||||
'/backend.Backend/GenerateImage',
|
|
||||||
request_serializer=backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.AudioTranscription = channel.unary_unary(
|
|
||||||
'/backend.Backend/AudioTranscription',
|
|
||||||
request_serializer=backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TranscriptResult.FromString,
|
|
||||||
)
|
|
||||||
self.TTS = channel.unary_unary(
|
|
||||||
'/backend.Backend/TTS',
|
|
||||||
request_serializer=backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.TokenizeString = channel.unary_unary(
|
|
||||||
'/backend.Backend/TokenizeString',
|
|
||||||
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.TokenizationResponse.FromString,
|
|
||||||
)
|
|
||||||
self.Status = channel.unary_unary(
|
|
||||||
'/backend.Backend/Status',
|
|
||||||
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StatusResponse.FromString,
|
|
||||||
)
|
|
||||||
self.StoresSet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresSet',
|
|
||||||
request_serializer=backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresDelete = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresDelete',
|
|
||||||
request_serializer=backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.Result.FromString,
|
|
||||||
)
|
|
||||||
self.StoresGet = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresGet',
|
|
||||||
request_serializer=backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresGetResult.FromString,
|
|
||||||
)
|
|
||||||
self.StoresFind = channel.unary_unary(
|
|
||||||
'/backend.Backend/StoresFind',
|
|
||||||
request_serializer=backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
response_deserializer=backend__pb2.StoresFindResult.FromString,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class BackendServicer(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
def Health(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Predict(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def LoadModel(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def PredictStream(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Embedding(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def GenerateImage(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def AudioTranscription(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TTS(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def TokenizeString(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def Status(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresSet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresDelete(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresGet(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
def StoresFind(self, request, context):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
||||||
context.set_details('Method not implemented!')
|
|
||||||
raise NotImplementedError('Method not implemented!')
|
|
||||||
|
|
||||||
|
|
||||||
def add_BackendServicer_to_server(servicer, server):
|
|
||||||
rpc_method_handlers = {
|
|
||||||
'Health': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Health,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Predict': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Predict,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'LoadModel': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.LoadModel,
|
|
||||||
request_deserializer=backend__pb2.ModelOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'PredictStream': grpc.unary_stream_rpc_method_handler(
|
|
||||||
servicer.PredictStream,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Reply.SerializeToString,
|
|
||||||
),
|
|
||||||
'Embedding': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Embedding,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.EmbeddingResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'GenerateImage': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.GenerateImage,
|
|
||||||
request_deserializer=backend__pb2.GenerateImageRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'AudioTranscription': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.AudioTranscription,
|
|
||||||
request_deserializer=backend__pb2.TranscriptRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.TranscriptResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'TTS': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TTS,
|
|
||||||
request_deserializer=backend__pb2.TTSRequest.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'TokenizeString': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.TokenizeString,
|
|
||||||
request_deserializer=backend__pb2.PredictOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.TokenizationResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'Status': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.Status,
|
|
||||||
request_deserializer=backend__pb2.HealthMessage.FromString,
|
|
||||||
response_serializer=backend__pb2.StatusResponse.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresSet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresSet,
|
|
||||||
request_deserializer=backend__pb2.StoresSetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresDelete': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresDelete,
|
|
||||||
request_deserializer=backend__pb2.StoresDeleteOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.Result.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresGet': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresGet,
|
|
||||||
request_deserializer=backend__pb2.StoresGetOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresGetResult.SerializeToString,
|
|
||||||
),
|
|
||||||
'StoresFind': grpc.unary_unary_rpc_method_handler(
|
|
||||||
servicer.StoresFind,
|
|
||||||
request_deserializer=backend__pb2.StoresFindOptions.FromString,
|
|
||||||
response_serializer=backend__pb2.StoresFindResult.SerializeToString,
|
|
||||||
),
|
|
||||||
}
|
|
||||||
generic_handler = grpc.method_handlers_generic_handler(
|
|
||||||
'backend.Backend', rpc_method_handlers)
|
|
||||||
server.add_generic_rpc_handlers((generic_handler,))
|
|
||||||
|
|
||||||
|
|
||||||
# This class is part of an EXPERIMENTAL API.
|
|
||||||
class Backend(object):
|
|
||||||
"""Missing associated documentation comment in .proto file."""
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Health(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Health',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Predict(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Predict',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def LoadModel(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/LoadModel',
|
|
||||||
backend__pb2.ModelOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def PredictStream(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_stream(request, target, '/backend.Backend/PredictStream',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.Reply.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Embedding(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Embedding',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.EmbeddingResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def GenerateImage(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/GenerateImage',
|
|
||||||
backend__pb2.GenerateImageRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def AudioTranscription(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/AudioTranscription',
|
|
||||||
backend__pb2.TranscriptRequest.SerializeToString,
|
|
||||||
backend__pb2.TranscriptResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TTS(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TTS',
|
|
||||||
backend__pb2.TTSRequest.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def TokenizeString(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TokenizeString',
|
|
||||||
backend__pb2.PredictOptions.SerializeToString,
|
|
||||||
backend__pb2.TokenizationResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def Status(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Status',
|
|
||||||
backend__pb2.HealthMessage.SerializeToString,
|
|
||||||
backend__pb2.StatusResponse.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresSet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresSet',
|
|
||||||
backend__pb2.StoresSetOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresDelete(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresDelete',
|
|
||||||
backend__pb2.StoresDeleteOptions.SerializeToString,
|
|
||||||
backend__pb2.Result.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresGet(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresGet',
|
|
||||||
backend__pb2.StoresGetOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresGetResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def StoresFind(request,
|
|
||||||
target,
|
|
||||||
options=(),
|
|
||||||
channel_credentials=None,
|
|
||||||
call_credentials=None,
|
|
||||||
insecure=False,
|
|
||||||
compression=None,
|
|
||||||
wait_for_ready=None,
|
|
||||||
timeout=None,
|
|
||||||
metadata=None):
|
|
||||||
return grpc.experimental.unary_unary(request, target, '/backend.Backend/StoresFind',
|
|
||||||
backend__pb2.StoresFindOptions.SerializeToString,
|
|
||||||
backend__pb2.StoresFindResult.FromString,
|
|
||||||
options, channel_credentials,
|
|
||||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
@ -36,14 +36,28 @@ To install the dependencies follow the instructions below:
|
|||||||
Install `xcode` from the App Store
|
Install `xcode` from the App Store
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
brew install abseil cmake go grpc protobuf wget
|
brew install abseil cmake go grpc protobuf protoc-gen-go protoc-gen-go-grpc python wget
|
||||||
|
```
|
||||||
|
|
||||||
|
After installing the above dependencies, you need to install grpcio-tools from PyPI. You could do this via a pip --user install or a virtualenv.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pip install --user grpcio-tools
|
||||||
```
|
```
|
||||||
|
|
||||||
{{% /tab %}}
|
{{% /tab %}}
|
||||||
{{% tab tabName="Debian" %}}
|
{{% tab tabName="Debian" %}}
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
apt install golang protobuf-compiler-grpc libgrpc-dev make cmake
|
apt install cmake golang libgrpc-dev make protobuf-compiler-grpc python3-grpc-tools
|
||||||
|
```
|
||||||
|
|
||||||
|
After you have golang installed and working, you can install the required binaries for compiling the golang protobuf components via the following commands
|
||||||
|
|
||||||
|
```bash
|
||||||
|
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
||||||
|
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
{{% /tab %}}
|
{{% /tab %}}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,618 +0,0 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// - protoc-gen-go-grpc v1.3.0
|
|
||||||
// - protoc v5.26.1
|
|
||||||
// source: backend.proto
|
|
||||||
|
|
||||||
package proto
|
|
||||||
|
|
||||||
import (
|
|
||||||
context "context"
|
|
||||||
grpc "google.golang.org/grpc"
|
|
||||||
codes "google.golang.org/grpc/codes"
|
|
||||||
status "google.golang.org/grpc/status"
|
|
||||||
)
|
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
|
||||||
// is compatible with the grpc package it is being compiled against.
|
|
||||||
// Requires gRPC-Go v1.32.0 or later.
|
|
||||||
const _ = grpc.SupportPackageIsVersion7
|
|
||||||
|
|
||||||
const (
|
|
||||||
Backend_Health_FullMethodName = "/backend.Backend/Health"
|
|
||||||
Backend_Predict_FullMethodName = "/backend.Backend/Predict"
|
|
||||||
Backend_LoadModel_FullMethodName = "/backend.Backend/LoadModel"
|
|
||||||
Backend_PredictStream_FullMethodName = "/backend.Backend/PredictStream"
|
|
||||||
Backend_Embedding_FullMethodName = "/backend.Backend/Embedding"
|
|
||||||
Backend_GenerateImage_FullMethodName = "/backend.Backend/GenerateImage"
|
|
||||||
Backend_AudioTranscription_FullMethodName = "/backend.Backend/AudioTranscription"
|
|
||||||
Backend_TTS_FullMethodName = "/backend.Backend/TTS"
|
|
||||||
Backend_TokenizeString_FullMethodName = "/backend.Backend/TokenizeString"
|
|
||||||
Backend_Status_FullMethodName = "/backend.Backend/Status"
|
|
||||||
Backend_StoresSet_FullMethodName = "/backend.Backend/StoresSet"
|
|
||||||
Backend_StoresDelete_FullMethodName = "/backend.Backend/StoresDelete"
|
|
||||||
Backend_StoresGet_FullMethodName = "/backend.Backend/StoresGet"
|
|
||||||
Backend_StoresFind_FullMethodName = "/backend.Backend/StoresFind"
|
|
||||||
)
|
|
||||||
|
|
||||||
// BackendClient is the client API for Backend service.
|
|
||||||
//
|
|
||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
||||||
type BackendClient interface {
|
|
||||||
Health(ctx context.Context, in *HealthMessage, opts ...grpc.CallOption) (*Reply, error)
|
|
||||||
Predict(ctx context.Context, in *PredictOptions, opts ...grpc.CallOption) (*Reply, error)
|
|
||||||
LoadModel(ctx context.Context, in *ModelOptions, opts ...grpc.CallOption) (*Result, error)
|
|
||||||
PredictStream(ctx context.Context, in *PredictOptions, opts ...grpc.CallOption) (Backend_PredictStreamClient, error)
|
|
||||||
Embedding(ctx context.Context, in *PredictOptions, opts ...grpc.CallOption) (*EmbeddingResult, error)
|
|
||||||
GenerateImage(ctx context.Context, in *GenerateImageRequest, opts ...grpc.CallOption) (*Result, error)
|
|
||||||
AudioTranscription(ctx context.Context, in *TranscriptRequest, opts ...grpc.CallOption) (*TranscriptResult, error)
|
|
||||||
TTS(ctx context.Context, in *TTSRequest, opts ...grpc.CallOption) (*Result, error)
|
|
||||||
TokenizeString(ctx context.Context, in *PredictOptions, opts ...grpc.CallOption) (*TokenizationResponse, error)
|
|
||||||
Status(ctx context.Context, in *HealthMessage, opts ...grpc.CallOption) (*StatusResponse, error)
|
|
||||||
StoresSet(ctx context.Context, in *StoresSetOptions, opts ...grpc.CallOption) (*Result, error)
|
|
||||||
StoresDelete(ctx context.Context, in *StoresDeleteOptions, opts ...grpc.CallOption) (*Result, error)
|
|
||||||
StoresGet(ctx context.Context, in *StoresGetOptions, opts ...grpc.CallOption) (*StoresGetResult, error)
|
|
||||||
StoresFind(ctx context.Context, in *StoresFindOptions, opts ...grpc.CallOption) (*StoresFindResult, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
type backendClient struct {
|
|
||||||
cc grpc.ClientConnInterface
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewBackendClient(cc grpc.ClientConnInterface) BackendClient {
|
|
||||||
return &backendClient{cc}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) Health(ctx context.Context, in *HealthMessage, opts ...grpc.CallOption) (*Reply, error) {
|
|
||||||
out := new(Reply)
|
|
||||||
err := c.cc.Invoke(ctx, Backend_Health_FullMethodName, in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) Predict(ctx context.Context, in *PredictOptions, opts ...grpc.CallOption) (*Reply, error) {
|
|
||||||
out := new(Reply)
|
|
||||||
err := c.cc.Invoke(ctx, Backend_Predict_FullMethodName, in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) LoadModel(ctx context.Context, in *ModelOptions, opts ...grpc.CallOption) (*Result, error) {
|
|
||||||
out := new(Result)
|
|
||||||
err := c.cc.Invoke(ctx, Backend_LoadModel_FullMethodName, in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) PredictStream(ctx context.Context, in *PredictOptions, opts ...grpc.CallOption) (Backend_PredictStreamClient, error) {
|
|
||||||
stream, err := c.cc.NewStream(ctx, &Backend_ServiceDesc.Streams[0], Backend_PredictStream_FullMethodName, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
x := &backendPredictStreamClient{stream}
|
|
||||||
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if err := x.ClientStream.CloseSend(); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return x, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type Backend_PredictStreamClient interface {
|
|
||||||
Recv() (*Reply, error)
|
|
||||||
grpc.ClientStream
|
|
||||||
}
|
|
||||||
|
|
||||||
type backendPredictStreamClient struct {
|
|
||||||
grpc.ClientStream
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *backendPredictStreamClient) Recv() (*Reply, error) {
|
|
||||||
m := new(Reply)
|
|
||||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return m, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) Embedding(ctx context.Context, in *PredictOptions, opts ...grpc.CallOption) (*EmbeddingResult, error) {
|
|
||||||
out := new(EmbeddingResult)
|
|
||||||
err := c.cc.Invoke(ctx, Backend_Embedding_FullMethodName, in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) GenerateImage(ctx context.Context, in *GenerateImageRequest, opts ...grpc.CallOption) (*Result, error) {
|
|
||||||
out := new(Result)
|
|
||||||
err := c.cc.Invoke(ctx, Backend_GenerateImage_FullMethodName, in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) AudioTranscription(ctx context.Context, in *TranscriptRequest, opts ...grpc.CallOption) (*TranscriptResult, error) {
|
|
||||||
out := new(TranscriptResult)
|
|
||||||
err := c.cc.Invoke(ctx, Backend_AudioTranscription_FullMethodName, in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) TTS(ctx context.Context, in *TTSRequest, opts ...grpc.CallOption) (*Result, error) {
|
|
||||||
out := new(Result)
|
|
||||||
err := c.cc.Invoke(ctx, Backend_TTS_FullMethodName, in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) TokenizeString(ctx context.Context, in *PredictOptions, opts ...grpc.CallOption) (*TokenizationResponse, error) {
|
|
||||||
out := new(TokenizationResponse)
|
|
||||||
err := c.cc.Invoke(ctx, Backend_TokenizeString_FullMethodName, in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) Status(ctx context.Context, in *HealthMessage, opts ...grpc.CallOption) (*StatusResponse, error) {
|
|
||||||
out := new(StatusResponse)
|
|
||||||
err := c.cc.Invoke(ctx, Backend_Status_FullMethodName, in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) StoresSet(ctx context.Context, in *StoresSetOptions, opts ...grpc.CallOption) (*Result, error) {
|
|
||||||
out := new(Result)
|
|
||||||
err := c.cc.Invoke(ctx, Backend_StoresSet_FullMethodName, in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) StoresDelete(ctx context.Context, in *StoresDeleteOptions, opts ...grpc.CallOption) (*Result, error) {
|
|
||||||
out := new(Result)
|
|
||||||
err := c.cc.Invoke(ctx, Backend_StoresDelete_FullMethodName, in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) StoresGet(ctx context.Context, in *StoresGetOptions, opts ...grpc.CallOption) (*StoresGetResult, error) {
|
|
||||||
out := new(StoresGetResult)
|
|
||||||
err := c.cc.Invoke(ctx, Backend_StoresGet_FullMethodName, in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *backendClient) StoresFind(ctx context.Context, in *StoresFindOptions, opts ...grpc.CallOption) (*StoresFindResult, error) {
|
|
||||||
out := new(StoresFindResult)
|
|
||||||
err := c.cc.Invoke(ctx, Backend_StoresFind_FullMethodName, in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// BackendServer is the server API for Backend service.
|
|
||||||
// All implementations must embed UnimplementedBackendServer
|
|
||||||
// for forward compatibility
|
|
||||||
type BackendServer interface {
|
|
||||||
Health(context.Context, *HealthMessage) (*Reply, error)
|
|
||||||
Predict(context.Context, *PredictOptions) (*Reply, error)
|
|
||||||
LoadModel(context.Context, *ModelOptions) (*Result, error)
|
|
||||||
PredictStream(*PredictOptions, Backend_PredictStreamServer) error
|
|
||||||
Embedding(context.Context, *PredictOptions) (*EmbeddingResult, error)
|
|
||||||
GenerateImage(context.Context, *GenerateImageRequest) (*Result, error)
|
|
||||||
AudioTranscription(context.Context, *TranscriptRequest) (*TranscriptResult, error)
|
|
||||||
TTS(context.Context, *TTSRequest) (*Result, error)
|
|
||||||
TokenizeString(context.Context, *PredictOptions) (*TokenizationResponse, error)
|
|
||||||
Status(context.Context, *HealthMessage) (*StatusResponse, error)
|
|
||||||
StoresSet(context.Context, *StoresSetOptions) (*Result, error)
|
|
||||||
StoresDelete(context.Context, *StoresDeleteOptions) (*Result, error)
|
|
||||||
StoresGet(context.Context, *StoresGetOptions) (*StoresGetResult, error)
|
|
||||||
StoresFind(context.Context, *StoresFindOptions) (*StoresFindResult, error)
|
|
||||||
mustEmbedUnimplementedBackendServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnimplementedBackendServer must be embedded to have forward compatible implementations.
|
|
||||||
type UnimplementedBackendServer struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (UnimplementedBackendServer) Health(context.Context, *HealthMessage) (*Reply, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Health not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) Predict(context.Context, *PredictOptions) (*Reply, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Predict not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) LoadModel(context.Context, *ModelOptions) (*Result, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method LoadModel not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) PredictStream(*PredictOptions, Backend_PredictStreamServer) error {
|
|
||||||
return status.Errorf(codes.Unimplemented, "method PredictStream not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) Embedding(context.Context, *PredictOptions) (*EmbeddingResult, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Embedding not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) GenerateImage(context.Context, *GenerateImageRequest) (*Result, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GenerateImage not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) AudioTranscription(context.Context, *TranscriptRequest) (*TranscriptResult, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method AudioTranscription not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) TTS(context.Context, *TTSRequest) (*Result, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method TTS not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) TokenizeString(context.Context, *PredictOptions) (*TokenizationResponse, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method TokenizeString not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) Status(context.Context, *HealthMessage) (*StatusResponse, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Status not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) StoresSet(context.Context, *StoresSetOptions) (*Result, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method StoresSet not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) StoresDelete(context.Context, *StoresDeleteOptions) (*Result, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method StoresDelete not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) StoresGet(context.Context, *StoresGetOptions) (*StoresGetResult, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method StoresGet not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) StoresFind(context.Context, *StoresFindOptions) (*StoresFindResult, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method StoresFind not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBackendServer) mustEmbedUnimplementedBackendServer() {}
|
|
||||||
|
|
||||||
// UnsafeBackendServer may be embedded to opt out of forward compatibility for this service.
|
|
||||||
// Use of this interface is not recommended, as added methods to BackendServer will
|
|
||||||
// result in compilation errors.
|
|
||||||
type UnsafeBackendServer interface {
|
|
||||||
mustEmbedUnimplementedBackendServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterBackendServer(s grpc.ServiceRegistrar, srv BackendServer) {
|
|
||||||
s.RegisterService(&Backend_ServiceDesc, srv)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_Health_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(HealthMessage)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(BackendServer).Health(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Backend_Health_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(BackendServer).Health(ctx, req.(*HealthMessage))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_Predict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(PredictOptions)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(BackendServer).Predict(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Backend_Predict_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(BackendServer).Predict(ctx, req.(*PredictOptions))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_LoadModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(ModelOptions)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(BackendServer).LoadModel(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Backend_LoadModel_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(BackendServer).LoadModel(ctx, req.(*ModelOptions))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_PredictStream_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
||||||
m := new(PredictOptions)
|
|
||||||
if err := stream.RecvMsg(m); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return srv.(BackendServer).PredictStream(m, &backendPredictStreamServer{stream})
|
|
||||||
}
|
|
||||||
|
|
||||||
type Backend_PredictStreamServer interface {
|
|
||||||
Send(*Reply) error
|
|
||||||
grpc.ServerStream
|
|
||||||
}
|
|
||||||
|
|
||||||
type backendPredictStreamServer struct {
|
|
||||||
grpc.ServerStream
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *backendPredictStreamServer) Send(m *Reply) error {
|
|
||||||
return x.ServerStream.SendMsg(m)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_Embedding_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(PredictOptions)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(BackendServer).Embedding(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Backend_Embedding_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(BackendServer).Embedding(ctx, req.(*PredictOptions))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_GenerateImage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(GenerateImageRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(BackendServer).GenerateImage(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Backend_GenerateImage_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(BackendServer).GenerateImage(ctx, req.(*GenerateImageRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_AudioTranscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(TranscriptRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(BackendServer).AudioTranscription(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Backend_AudioTranscription_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(BackendServer).AudioTranscription(ctx, req.(*TranscriptRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_TTS_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(TTSRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(BackendServer).TTS(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Backend_TTS_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(BackendServer).TTS(ctx, req.(*TTSRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_TokenizeString_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(PredictOptions)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(BackendServer).TokenizeString(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Backend_TokenizeString_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(BackendServer).TokenizeString(ctx, req.(*PredictOptions))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(HealthMessage)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(BackendServer).Status(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Backend_Status_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(BackendServer).Status(ctx, req.(*HealthMessage))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_StoresSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(StoresSetOptions)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(BackendServer).StoresSet(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Backend_StoresSet_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(BackendServer).StoresSet(ctx, req.(*StoresSetOptions))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_StoresDelete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(StoresDeleteOptions)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(BackendServer).StoresDelete(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Backend_StoresDelete_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(BackendServer).StoresDelete(ctx, req.(*StoresDeleteOptions))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_StoresGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(StoresGetOptions)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(BackendServer).StoresGet(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Backend_StoresGet_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(BackendServer).StoresGet(ctx, req.(*StoresGetOptions))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Backend_StoresFind_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(StoresFindOptions)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(BackendServer).StoresFind(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Backend_StoresFind_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(BackendServer).StoresFind(ctx, req.(*StoresFindOptions))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Backend_ServiceDesc is the grpc.ServiceDesc for Backend service.
|
|
||||||
// It's only intended for direct use with grpc.RegisterService,
|
|
||||||
// and not to be introspected or modified (even as a copy)
|
|
||||||
var Backend_ServiceDesc = grpc.ServiceDesc{
|
|
||||||
ServiceName: "backend.Backend",
|
|
||||||
HandlerType: (*BackendServer)(nil),
|
|
||||||
Methods: []grpc.MethodDesc{
|
|
||||||
{
|
|
||||||
MethodName: "Health",
|
|
||||||
Handler: _Backend_Health_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "Predict",
|
|
||||||
Handler: _Backend_Predict_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "LoadModel",
|
|
||||||
Handler: _Backend_LoadModel_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "Embedding",
|
|
||||||
Handler: _Backend_Embedding_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "GenerateImage",
|
|
||||||
Handler: _Backend_GenerateImage_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "AudioTranscription",
|
|
||||||
Handler: _Backend_AudioTranscription_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "TTS",
|
|
||||||
Handler: _Backend_TTS_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "TokenizeString",
|
|
||||||
Handler: _Backend_TokenizeString_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "Status",
|
|
||||||
Handler: _Backend_Status_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "StoresSet",
|
|
||||||
Handler: _Backend_StoresSet_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "StoresDelete",
|
|
||||||
Handler: _Backend_StoresDelete_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "StoresGet",
|
|
||||||
Handler: _Backend_StoresGet_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "StoresFind",
|
|
||||||
Handler: _Backend_StoresFind_Handler,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Streams: []grpc.StreamDesc{
|
|
||||||
{
|
|
||||||
StreamName: "PredictStream",
|
|
||||||
Handler: _Backend_PredictStream_Handler,
|
|
||||||
ServerStreams: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Metadata: "backend.proto",
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user