From 238fec244ae6c9a66bc7fafd76c7e14671110a6f Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Sun, 3 Dec 2023 21:16:36 +0100 Subject: [PATCH] fix(vall-e-x): correctly install reqs in environment (#1377) --- Dockerfile | 6 ------ backend/python/vall-e-x/Makefile | 1 + backend/python/vall-e-x/install.sh | 14 ++++++++++++++ backend/python/vall-e-x/run.sh | 2 +- docs/content/advanced/_index.en.md | 10 ++++++++++ 5 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 backend/python/vall-e-x/install.sh diff --git a/Dockerfile b/Dockerfile index c7da9f63b39..84a2673b163 100644 --- a/Dockerfile +++ b/Dockerfile @@ -185,12 +185,6 @@ RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \ PATH=$PATH:/opt/conda/bin make -C backend/python/petals \ ; fi -# Copy VALLE-X as it's not a real "lib" -# TODO: this is wrong - we should copy the lib into the conda env path -RUN if [ -d /usr/lib/vall-e-x ]; then \ - cp -rfv /usr/lib/vall-e-x/* ./ ; \ - fi - # we also copy exllama libs over to resolve exllama import error # TODO: check if this is still needed RUN if [ -d /usr/local/lib/python3.9/dist-packages/exllama ]; then \ diff --git a/backend/python/vall-e-x/Makefile b/backend/python/vall-e-x/Makefile index a4031484d05..0aa19205a14 100644 --- a/backend/python/vall-e-x/Makefile +++ b/backend/python/vall-e-x/Makefile @@ -3,6 +3,7 @@ ttsvalle: @echo "Creating virtual environment..." @conda env create --name ttsvalle --file ttsvalle.yml @echo "Virtual environment created." + bash install.sh .PHONY: run run: diff --git a/backend/python/vall-e-x/install.sh b/backend/python/vall-e-x/install.sh new file mode 100644 index 00000000000..71ec3998d5e --- /dev/null +++ b/backend/python/vall-e-x/install.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +## +## A bash script installs the required dependencies of VALL-E-X and prepares the environment +export PATH=$PATH:/opt/conda/bin + +# Activate conda environment +source activate ttsvalle + +echo $CONDA_PREFIX + +git clone https://github.com/Plachtaa/VALL-E-X.git $CONDA_PREFIX/vall-e-x && pushd $CONDA_PREFIX/vall-e-x && pip install -r requirements.txt && popd + +cp -rfv $CONDA_PREFIX/vall-e-x/* ./ \ No newline at end of file diff --git a/backend/python/vall-e-x/run.sh b/backend/python/vall-e-x/run.sh index 6e359507f85..41936882172 100755 --- a/backend/python/vall-e-x/run.sh +++ b/backend/python/vall-e-x/run.sh @@ -10,4 +10,4 @@ source activate ttsvalle # get the directory where the bash script is located DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -python $DIR/ttvalle.py $@ \ No newline at end of file +python $DIR/ttsvalle.py $@ \ No newline at end of file diff --git a/docs/content/advanced/_index.en.md b/docs/content/advanced/_index.en.md index fa100e4ab19..5f6332eeaf9 100644 --- a/docs/content/advanced/_index.en.md +++ b/docs/content/advanced/_index.en.md @@ -354,3 +354,13 @@ docker run --env REBUILD=true localai # Option 2: set within an env file docker run --env-file .env localai ``` + +### Build only a single backend + +You can control the backends that are built by setting the `GRPC_BACKENDS` environment variable. For instance, to build only the `llama-cpp` backend only: + +```bash +make GRPC_BACKENDS=backend-assets/grpc/llama-cpp build +``` + +By default, all the backends are built. \ No newline at end of file