From bbc4779c8ab191f8383d4580bebf06cc1be2113e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20K=C3=B6hler?= Date: Wed, 29 Nov 2023 10:22:42 +0100 Subject: [PATCH 1/2] Update docs for new requirements.txt path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcus Köhler --- docs/content/features/embeddings.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/content/features/embeddings.md b/docs/content/features/embeddings.md index 09151af852d8..61d7b6888089 100644 --- a/docs/content/features/embeddings.md +++ b/docs/content/features/embeddings.md @@ -75,7 +75,10 @@ The `sentencetransformers` backend uses Python [sentence-transformers](https://g {{% notice note %}} -- The `sentencetransformers` backend is an optional backend of LocalAI and uses Python. If you are running `LocalAI` from the containers you are good to go and should be already configured for use. If you are running `LocalAI` manually you must install the python dependencies (`pip install -r /path/to/LocalAI/extra/requirements`) and specify the extra backend in the `EXTERNAL_GRPC_BACKENDS` environment variable ( `EXTERNAL_GRPC_BACKENDS="sentencetransformers:/path/to/LocalAI/backend/python/sentencetransformers/sentencetransformers.py"` ) . +- The `sentencetransformers` backend is an optional backend of LocalAI and uses Python. If you are running `LocalAI` from the containers you are good to go and should be already configured for use. +- If you are running `LocalAI` manually you must install the python dependencies (`make prepare-extra-conda-environments`). This requires `conda` to be installed. +- For local execution, you also have to specify the extra backend in the `EXTERNAL_GRPC_BACKENDS` environment variable. + - Example: `EXTERNAL_GRPC_BACKENDS="sentencetransformers:/path/to/LocalAI/backend/python/sentencetransformers/sentencetransformers.py"` - The `sentencetransformers` backend does support only embeddings of text, and not of tokens. If you need to embed tokens you can use the `bert` backend or `llama.cpp`. - No models are required to be downloaded before using the `sentencetransformers` backend. The models will be downloaded automatically the first time the API is used. From 7b4b8526b823665edcae4a8357606f3971ee8449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20K=C3=B6hler?= Date: Thu, 30 Nov 2023 14:29:11 +0100 Subject: [PATCH 2/2] Fix typo (.PONY -> .PHONY) in python backend makefiles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcus Köhler --- backend/python/autogptq/Makefile | 2 +- backend/python/bark/Makefile | 4 ++-- backend/python/diffusers/Makefile | 6 +++--- backend/python/exllama/Makefile | 6 +++--- backend/python/petals/Makefile | 6 +++--- backend/python/sentencetransformers/Makefile | 8 ++++---- backend/python/transformers/Makefile | 8 ++++---- backend/python/vall-e-x/Makefile | 6 +++--- backend/python/vllm/Makefile | 6 +++--- 9 files changed, 26 insertions(+), 26 deletions(-) diff --git a/backend/python/autogptq/Makefile b/backend/python/autogptq/Makefile index 78d476630cca..120065dc29f6 100644 --- a/backend/python/autogptq/Makefile +++ b/backend/python/autogptq/Makefile @@ -1,4 +1,4 @@ -.PONY: autogptq +.PHONY: autogptq autogptq: @echo "Creating virtual environment..." @conda env create --name autogptq --file autogptq.yml diff --git a/backend/python/bark/Makefile b/backend/python/bark/Makefile index d050493025f1..03dc9921bc4d 100644 --- a/backend/python/bark/Makefile +++ b/backend/python/bark/Makefile @@ -1,5 +1,5 @@ -.PONY: ttsbark +.PHONY: ttsbark ttsbark: @echo "Creating virtual environment..." @conda env create --name ttsbark --file ttsbark.yml - @echo "Virtual environment created." \ No newline at end of file + @echo "Virtual environment created." diff --git a/backend/python/diffusers/Makefile b/backend/python/diffusers/Makefile index 270c0c6e7da9..fa0087e2a99e 100644 --- a/backend/python/diffusers/Makefile +++ b/backend/python/diffusers/Makefile @@ -1,11 +1,11 @@ -.PONY: diffusers +.PHONY: diffusers diffusers: @echo "Creating virtual environment..." @conda env create --name diffusers --file diffusers.yml @echo "Virtual environment created." -.PONY: run +.PHONY: run run: @echo "Running diffusers..." bash run.sh - @echo "Diffusers run." \ No newline at end of file + @echo "Diffusers run." diff --git a/backend/python/exllama/Makefile b/backend/python/exllama/Makefile index 8410bc5eb40e..a130f071f169 100644 --- a/backend/python/exllama/Makefile +++ b/backend/python/exllama/Makefile @@ -1,11 +1,11 @@ -.PONY: exllama +.PHONY: exllama exllama: @echo "Creating virtual environment..." @conda env create --name exllama --file exllama.yml @echo "Virtual environment created." -.PONY: run +.PHONY: run run: @echo "Running exllama..." bash run.sh - @echo "exllama run." \ No newline at end of file + @echo "exllama run." diff --git a/backend/python/petals/Makefile b/backend/python/petals/Makefile index db71a175b76e..52ce15d25716 100644 --- a/backend/python/petals/Makefile +++ b/backend/python/petals/Makefile @@ -1,11 +1,11 @@ -.PONY: petals +.PHONY: petals petals: @echo "Creating virtual environment..." @conda env create --name petals --file petals.yml @echo "Virtual environment created." -.PONY: run +.PHONY: run run: @echo "Running petals..." bash run.sh - @echo "petals run." \ No newline at end of file + @echo "petals run." diff --git a/backend/python/sentencetransformers/Makefile b/backend/python/sentencetransformers/Makefile index d80872af4888..3aff62cd9050 100644 --- a/backend/python/sentencetransformers/Makefile +++ b/backend/python/sentencetransformers/Makefile @@ -1,18 +1,18 @@ -.PONY: sentencetransformers +.PHONY: sentencetransformers sentencetransformers: @echo "Creating virtual environment..." @conda env create --name sentencetransformers --file sentencetransformers.yml @echo "Virtual environment created." -.PONY: run +.PHONY: run run: @echo "Running sentencetransformers..." bash run.sh @echo "sentencetransformers run." # It is not working well by using command line. It only6 works with IDE like VSCode. -.PONY: test +.PHONY: test test: @echo "Testing sentencetransformers..." bash test.sh - @echo "sentencetransformers tested." \ No newline at end of file + @echo "sentencetransformers tested." diff --git a/backend/python/transformers/Makefile b/backend/python/transformers/Makefile index 3644423de1ff..c7ead70911d2 100644 --- a/backend/python/transformers/Makefile +++ b/backend/python/transformers/Makefile @@ -1,18 +1,18 @@ -.PONY: transformers +.PHONY: transformers transformers: @echo "Creating virtual environment..." @conda env create --name transformers --file transformers.yml @echo "Virtual environment created." -.PONY: run +.PHONY: run run: @echo "Running transformers..." bash run.sh @echo "transformers run." # It is not working well by using command line. It only6 works with IDE like VSCode. -.PONY: test +.PHONY: test test: @echo "Testing transformers..." bash test.sh - @echo "transformers tested." \ No newline at end of file + @echo "transformers tested." diff --git a/backend/python/vall-e-x/Makefile b/backend/python/vall-e-x/Makefile index 7216967d5a54..a4031484d059 100644 --- a/backend/python/vall-e-x/Makefile +++ b/backend/python/vall-e-x/Makefile @@ -1,11 +1,11 @@ -.PONY: ttsvalle +.PHONY: ttsvalle ttsvalle: @echo "Creating virtual environment..." @conda env create --name ttsvalle --file ttsvalle.yml @echo "Virtual environment created." -.PONY: run +.PHONY: run run: @echo "Running ttsvalle..." bash run.sh - @echo "ttsvalle run." \ No newline at end of file + @echo "ttsvalle run." diff --git a/backend/python/vllm/Makefile b/backend/python/vllm/Makefile index 613010486bf3..b8a07596a93c 100644 --- a/backend/python/vllm/Makefile +++ b/backend/python/vllm/Makefile @@ -1,11 +1,11 @@ -.PONY: vllm +.PHONY: vllm vllm: @echo "Creating virtual environment..." @conda env create --name vllm --file vllm.yml @echo "Virtual environment created." -.PONY: run +.PHONY: run run: @echo "Running vllm..." bash run.sh - @echo "vllm run." \ No newline at end of file + @echo "vllm run."