Skip to content

Commit dc307a1

Browse files
authored
feat: add vall-e-x (#1007)
**Description** This PR fixes #985 **Notes for Reviewers** **[Signed commits](../CONTRIBUTING.md#signing-off-on-commits-developer-certificate-of-origin)** - [ ] Yes, I signed my commits. <!-- Thank you for contributing to LocalAI! Contributing Conventions: 1. Include descriptive PR titles with [<component-name>] prepended. 2. Build and test your changes before submitting a PR. 3. Sign your commits By following the community's contribution conventions upfront, the review process will be accelerated and your PR merged more quickly. --> Signed-off-by: Ettore Di Giacinto <[email protected]>
1 parent e798115 commit dc307a1

File tree

14 files changed

+809
-266
lines changed

14 files changed

+809
-266
lines changed

Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ARG TARGETARCH
1111
ARG TARGETVARIANT
1212

1313
ENV BUILD_TYPE=${BUILD_TYPE}
14-
ENV EXTERNAL_GRPC_BACKENDS="huggingface-embeddings:/build/extra/grpc/huggingface/huggingface.py,autogptq:/build/extra/grpc/autogptq/autogptq.py,bark:/build/extra/grpc/bark/ttsbark.py,diffusers:/build/extra/grpc/diffusers/backend_diffusers.py,exllama:/build/extra/grpc/exllama/exllama.py"
14+
ENV EXTERNAL_GRPC_BACKENDS="huggingface-embeddings:/build/extra/grpc/huggingface/huggingface.py,autogptq:/build/extra/grpc/autogptq/autogptq.py,bark:/build/extra/grpc/bark/ttsbark.py,diffusers:/build/extra/grpc/diffusers/backend_diffusers.py,exllama:/build/extra/grpc/exllama/exllama.py,vall-e-x:/build/extra/grpc/vall-e-x/ttsvalle.py"
1515
ENV GALLERIES='[{"name":"model-gallery", "url":"github:go-skynet/model-gallery/index.yaml"}, {"url": "github:go-skynet/model-gallery/huggingface.yaml","name":"huggingface"}]'
1616
ARG GO_TAGS="stablediffusion tts"
1717

@@ -47,6 +47,9 @@ RUN if [ "${BUILD_TYPE}" = "cublas" ] && [ "${TARGETARCH}" = "amd64" ]; then \
4747
fi
4848
RUN pip install -r /build/extra/requirements.txt && rm -rf /build/extra/requirements.txt
4949

50+
# Vall-e-X
51+
RUN git clone https://github.com/Plachtaa/VALL-E-X.git /usr/lib/vall-e-x && cd /usr/lib/vall-e-x && pip install -r requirements.txt
52+
5053
WORKDIR /build
5154

5255
# OpenBLAS requirements
@@ -130,6 +133,10 @@ WORKDIR /build
130133
COPY . .
131134
RUN make prepare-sources
132135
COPY --from=builder /build/local-ai ./
136+
137+
# Copy VALLE-X as it's not a real "lib"
138+
RUN cp -rfv /usr/lib/vall-e-x/* extra/grpc/vall-e-x/
139+
133140
# To resolve exllama import error
134141
RUN if [ "${BUILD_TYPE}" = "cublas" ] && [ "${TARGETARCH:-$(go env GOARCH)}" = "amd64" ]; then \
135142
cp -rfv /usr/local/lib/python3.9/dist-packages/exllama extra/grpc/exllama/;\

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ protogen-python:
357357
python3 -m grpc_tools.protoc -Ipkg/grpc/proto/ --python_out=extra/grpc/exllama/ --grpc_python_out=extra/grpc/exllama/ pkg/grpc/proto/backend.proto
358358
python3 -m grpc_tools.protoc -Ipkg/grpc/proto/ --python_out=extra/grpc/bark/ --grpc_python_out=extra/grpc/bark/ pkg/grpc/proto/backend.proto
359359
python3 -m grpc_tools.protoc -Ipkg/grpc/proto/ --python_out=extra/grpc/diffusers/ --grpc_python_out=extra/grpc/diffusers/ pkg/grpc/proto/backend.proto
360+
python3 -m grpc_tools.protoc -Ipkg/grpc/proto/ --python_out=extra/grpc/vall-e-x/ --grpc_python_out=extra/grpc/vall-e-x/ pkg/grpc/proto/backend.proto
360361

361362
## GRPC
362363

api/backend/options.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ func gRPCModelOpts(c config.Config) *pb.ModelOptions {
4242
Seed: int32(c.Seed),
4343
NBatch: int32(b),
4444
NoMulMatQ: c.NoMulMatQ,
45+
AudioPath: c.VallE.AudioPath,
4546
LoraAdapter: c.LoraAdapter,
4647
LoraBase: c.LoraBase,
4748
NGQA: c.NGQA,

api/config/config.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ type Config struct {
4343

4444
// GRPC Options
4545
GRPC GRPC `yaml:"grpc"`
46+
47+
// Vall-e-x
48+
VallE VallE `yaml:"vall-e"`
49+
}
50+
51+
type VallE struct {
52+
AudioPath string `yaml:"audio_path"`
4653
}
4754

4855
type FeatureFlag map[string]*bool

extra/grpc/autogptq/backend_pb2.py

Lines changed: 28 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)