From 9dddd1134dd883289c29fcd15054a23fbebc2bb1 Mon Sep 17 00:00:00 2001 From: B4ckslash Date: Thu, 23 Nov 2023 15:22:37 +0100 Subject: [PATCH 1/8] fix: move python header comments below shebang in some backends (#1321) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix python header comments for some extra gRPC backends When a Python script is to be executed directly via exec(3), either the platform knows how to execute the file itself (i.e. special configuration is necessary) or the first line contains a shebang (#!) specifying the interpreter to run it (similar to shell scripts). The shebang MUST be on the first line for the script to work on all platforms, so any header comments need to be in the lines following it. Otherwise executing these scripts as extra backends will yield an "exec format error" message. Changes: * Move introductory comments below the shebang line * Change header comment in transformers.py to refer to the correct python module Signed-off-by: Marcus Köhler * Make header comment in ttsbark.py more specific Signed-off-by: Marcus Köhler --------- Signed-off-by: Marcus Köhler --- backend/python/bark/ttsbark.py | 5 ++--- backend/python/sentencetransformers/sentencetransformers.py | 2 +- backend/python/transformers/transformers.py | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/backend/python/bark/ttsbark.py b/backend/python/bark/ttsbark.py index d9891b3979b2..050c44ed4e74 100644 --- a/backend/python/bark/ttsbark.py +++ b/backend/python/bark/ttsbark.py @@ -1,8 +1,7 @@ +#!/usr/bin/env python3 """ -This is the extra gRPC server of LocalAI +This is an extra gRPC server of LocalAI for Bark TTS """ - -#!/usr/bin/env python3 from concurrent import futures import time import argparse diff --git a/backend/python/sentencetransformers/sentencetransformers.py b/backend/python/sentencetransformers/sentencetransformers.py index 03740917de75..905015e1a3c0 100755 --- a/backend/python/sentencetransformers/sentencetransformers.py +++ b/backend/python/sentencetransformers/sentencetransformers.py @@ -1,7 +1,7 @@ +#!/usr/bin/env python3 """ Extra gRPC server for HuggingFace SentenceTransformer models. """ -#!/usr/bin/env python3 from concurrent import futures import argparse diff --git a/backend/python/transformers/transformers.py b/backend/python/transformers/transformers.py index 03a48169389f..7d8d872b948c 100755 --- a/backend/python/transformers/transformers.py +++ b/backend/python/transformers/transformers.py @@ -1,7 +1,7 @@ +#!/usr/bin/env python3 """ -Extra gRPC server for HuggingFace SentenceTransformer models. +Extra gRPC server for HuggingFace AutoModel models. """ -#!/usr/bin/env python3 from concurrent import futures import argparse From 69f53211a17f0cad77c7011b43f314366fdb1e54 Mon Sep 17 00:00:00 2001 From: Dave Date: Thu, 23 Nov 2023 09:22:54 -0500 Subject: [PATCH 2/8] Feat: OSX Local Codesigning (#1319) * stage makefile * OSX local code signing and entitlements file to fix incoming connections prompt --- Entitlements.plist | 10 ++++++++++ Makefile | 9 +++++++++ 2 files changed, 19 insertions(+) create mode 100644 Entitlements.plist diff --git a/Entitlements.plist b/Entitlements.plist new file mode 100644 index 000000000000..300716e7d859 --- /dev/null +++ b/Entitlements.plist @@ -0,0 +1,10 @@ + + + + + com.apple.security.network.client + + com.apple.security.network.server + + + diff --git a/Makefile b/Makefile index 2e3370f92416..6b41e731e938 100644 --- a/Makefile +++ b/Makefile @@ -106,6 +106,12 @@ ifeq ($(BUILD_TYPE),clblas) CGO_LDFLAGS+=-lOpenCL -lclblast endif +ifeq ($(OS),Darwin) + ifeq ($(OSX_SIGNING_IDENTITY),) + OSX_SIGNING_IDENTITY := $(shell security find-identity -v -p codesigning | grep '"' | head -n 1 | sed -E 's/.*"(.*)"/\1/') + endif +endif + # glibc-static or glibc-devel-static required ifeq ($(STATIC),true) LD_FLAGS=-linkmode external -extldflags -static @@ -273,6 +279,9 @@ dist: build mkdir -p release cp $(BINARY_NAME) release/$(BINARY_NAME)-$(BUILD_ID)-$(OS)-$(ARCH) +osx-signed: build + codesign --deep --force --sign "$(OSX_SIGNING_IDENTITY)" --entitlements "./Entitlements.plist" "./$(BINARY_NAME)" + ## Run run: prepare ## run local-ai CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GOCMD) run ./ From ba5ab26f2e50ce950e0107970812ed519948c44f Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Thu, 23 Nov 2023 18:54:55 +0100 Subject: [PATCH 3/8] docs: Add llava, update hot topics (#1322) Signed-off-by: Ettore Di Giacinto --- README.md | 11 +++++-- docs/content/_index.en.md | 34 ++++---------------- docs/content/features/_index.en.md | 1 + docs/content/features/gpt-vision.md | 30 +++++++++++++++++ docs/content/model-compatibility/vall-e-x.md | 2 +- docs/content/model-compatibility/vllm.md | 2 +- 6 files changed, 47 insertions(+), 33 deletions(-) create mode 100644 docs/content/features/gpt-vision.md diff --git a/README.md b/README.md index 69c74acb2e4a..dbda44de7ad8 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ > :bulb: Get help - [❓FAQ](https://localai.io/faq/) [💭Discussions](https://github.com/go-skynet/LocalAI/discussions) [:speech_balloon: Discord](https://discord.gg/uJAeKSAGDy) [:book: Documentation website](https://localai.io/) > -> [💻 Quickstart](https://localai.io/basics/getting_started/) [📣 News](https://localai.io/basics/news/) [ 🛫 Examples ](https://github.com/go-skynet/LocalAI/tree/master/examples/) [ 🖼️ Models ](https://localai.io/models/) +> [💻 Quickstart](https://localai.io/basics/getting_started/) [📣 News](https://localai.io/basics/news/) [ 🛫 Examples ](https://github.com/go-skynet/LocalAI/tree/master/examples/) [ 🖼️ Models ](https://localai.io/models/) [ 🚀 Roadmap ](https://github.com/mudler/LocalAI/issues?q=is%3Aissue+is%3Aopen+label%3Aroadmap) [![tests](https://github.com/go-skynet/LocalAI/actions/workflows/test.yml/badge.svg)](https://github.com/go-skynet/LocalAI/actions/workflows/test.yml)[![Build and Release](https://github.com/go-skynet/LocalAI/actions/workflows/release.yaml/badge.svg)](https://github.com/go-skynet/LocalAI/actions/workflows/release.yaml)[![build container images](https://github.com/go-skynet/LocalAI/actions/workflows/image.yml/badge.svg)](https://github.com/go-skynet/LocalAI/actions/workflows/image.yml)[![Bump dependencies](https://github.com/go-skynet/LocalAI/actions/workflows/bump_deps.yaml/badge.svg)](https://github.com/go-skynet/LocalAI/actions/workflows/bump_deps.yaml)[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/localai)](https://artifacthub.io/packages/search?repo=localai) @@ -79,7 +79,12 @@ LocalAI was created by [Ettore Di Giacinto](https://github.com/mudler/) and is a Note that this started just as a [fun weekend project](https://localai.io/#backstory) in order to try to create the necessary pieces for a full AI assistant like `ChatGPT`: the community is growing fast and we are working hard to make it better and more stable. If you want to help, please consider contributing (see below)! -## 🔥🔥 [Hot topics / Roadmap](https://localai.io/#-hot-topics--roadmap) +## 🔥🔥 Hot topics / Roadmap + +- [Roadmap](https://github.com/mudler/LocalAI/issues?q=is%3Aissue+is%3Aopen+label%3Aroadmap) + +Hot topics: +- https://github.com/mudler/LocalAI/issues/1126 ## 🚀 [Features](https://localai.io/features/) @@ -91,7 +96,7 @@ Note that this started just as a [fun weekend project](https://localai.io/#backs - 🧠 [Embeddings generation for vector databases](https://localai.io/features/embeddings/) - ✍️ [Constrained grammars](https://localai.io/features/constrained_grammars/) - 🖼️ [Download Models directly from Huggingface ](https://localai.io/models/) - +- 🆕 [Vision API](https://localai.io/features/gpt-vision/) ## :book: 🎥 [Media, Blogs, Social](https://localai.io/basics/news/#media-blogs-social) diff --git a/docs/content/_index.en.md b/docs/content/_index.en.md index a2ced5b376d8..121e47827c2e 100644 --- a/docs/content/_index.en.md +++ b/docs/content/_index.en.md @@ -20,7 +20,7 @@ title = "LocalAI" > 💡 Get help - [❓FAQ](https://localai.io/faq/) [❓How tos](https://localai.io/howtos/) [💭Discussions](https://github.com/go-skynet/LocalAI/discussions) [💭Discord](https://discord.gg/uJAeKSAGDy) > -> [💻 Quickstart](https://localai.io/basics/getting_started/) [📣 News](https://localai.io/basics/news/) [ 🛫 Examples ](https://github.com/go-skynet/LocalAI/tree/master/examples/) [ 🖼️ Models ](https://localai.io/models/) +> [💻 Quickstart](https://localai.io/basics/getting_started/) [📣 News](https://localai.io/basics/news/) [ 🛫 Examples ](https://github.com/go-skynet/LocalAI/tree/master/examples/) [ 🖼️ Models ](https://localai.io/models/) [ 🚀 Roadmap ](https://github.com/mudler/LocalAI/issues?q=is%3Aissue+is%3Aopen+label%3Aroadmap) **LocalAI** is the free, Open Source OpenAI alternative. LocalAI act as a drop-in replacement REST API that's compatible with OpenAI API specifications for local inferencing. It allows you to run LLMs, generate images, audio (and not only) locally or on-prem with consumer grade hardware, supporting multiple model families that are compatible with the ggml format. Does not require GPU. It is maintained by [mudler](https://github.com/mudler). @@ -84,37 +84,15 @@ Note that this started just as a [fun weekend project](https://localai.io/#backs - 🧠 [Embeddings generation for vector databases](https://localai.io/features/embeddings/) - ✍️ [Constrained grammars](https://localai.io/features/constrained_grammars/) - 🖼️ [Download Models directly from Huggingface ](https://localai.io/models/) +- 🆕 [Vision API](https://localai.io/features/gpt-vision/) + ## 🔥🔥 Hot topics / Roadmap -- Backend rework for LocalAI v2 https://github.com/go-skynet/LocalAI/issues/1126 -- Roadmap: https://github.com/go-skynet/LocalAI/issues?q=is%3Aissue+is%3Aopen+label%3Aroadmap - -Some items: - -- [ ] Enable gallery management directly from the webui. https://github.com/go-skynet/LocalAI/issues/918 -- [x] llama.cpp lora adapters: https://github.com/go-skynet/LocalAI/issues/919 -- [ ] image variants and edits: https://github.com/go-skynet/LocalAI/issues/921 -- [ ] esrgan for diffusers: https://github.com/go-skynet/LocalAI/issues/917 -- [ ] ggml-stablediffusion: https://github.com/go-skynet/LocalAI/issues/916 -- [ ] SAM: https://github.com/go-skynet/LocalAI/issues/915 -- [x] diffusers lora adapters: https://github.com/go-skynet/LocalAI/issues/914 -- [ ] resource management and control: https://github.com/go-skynet/LocalAI/issues/912 -- [ ] ChatGLM: https://github.com/go-skynet/LocalAI/issues/754 -- [ ] text-to-video : https://github.com/go-skynet/LocalAI/issues/933 -- [ ] rustformers: https://github.com/go-skynet/LocalAI/issues/939 -- [x] Vall-e: https://github.com/go-skynet/LocalAI/issues/985 -- [ ] Speculative sampling: https://github.com/go-skynet/LocalAI/issues/1013 -- [ ] Falcon/GPTNeoX on llama.cpp: https://github.com/go-skynet/LocalAI/issues/1009 -- [ ] transformers/vllm: https://github.com/go-skynet/LocalAI/issues/1015 -- [ ] TortoiseTTS: https://github.com/go-skynet/LocalAI/issues/1016 -- [ ] Exllama2: https://github.com/go-skynet/LocalAI/issues/1053 -- [ ] ctransformers: https://github.com/go-skynet/LocalAI/issues/1056 -- [ ] GPTQ for LLama: https://github.com/go-skynet/LocalAI/issues/1055 -- [ ] LLaVA and miniGPT-4: https://github.com/go-skynet/LocalAI/issues/1054 -- [ ] Test generation inference: https://github.com/go-skynet/LocalAI/issues/1042 -- [ ] docs - extending LocalAI with external backends: https://github.com/go-skynet/LocalAI/issues/1057 +- [Roadmap](https://github.com/mudler/LocalAI/issues?q=is%3Aissue+is%3Aopen+label%3Aroadmap) +Hot topics: +- https://github.com/mudler/LocalAI/issues/1126 ## How does it work? diff --git a/docs/content/features/_index.en.md b/docs/content/features/_index.en.md index 173050d4c491..a0f4dc5dc196 100644 --- a/docs/content/features/_index.en.md +++ b/docs/content/features/_index.en.md @@ -13,4 +13,5 @@ This section contains the documentation for the features supported by LocalAI. - [🎨 Image generation]({{%relref "features/image-generation" %}}) - [🧠 Embeddings]({{%relref "features/embeddings" %}}) - [🔥 OpenAI functions]({{%relref "features/openai-functions" %}}) +- [🆕 GPT Vision API]({{%relref "features/gpt-vision" %}}) - [✍️ Constrained grammars]({{%relref "features/constrained_grammars" %}}) diff --git a/docs/content/features/gpt-vision.md b/docs/content/features/gpt-vision.md new file mode 100644 index 000000000000..3b37fe8ffdeb --- /dev/null +++ b/docs/content/features/gpt-vision.md @@ -0,0 +1,30 @@ + ++++ +disableToc = false +title = "🆕 GPT Vision" +weight = 2 ++++ + +{{% notice note %}} +Available only on `master` builds +{{% /notice %}} + +LocalAI supports understanding images by using [LLaVA](https://llava.hliu.cc/), and implements the [GPT Vision API](https://platform.openai.com/docs/guides/vision) from OpenAI. + +![llava](https://github.com/mudler/LocalAI/assets/2420543/cb0a0897-3b58-4350-af66-e6f4387b58d3) + +## Usage + +OpenAI docs: https://platform.openai.com/docs/guides/vision + +To let LocalAI understand and reply with what sees in the image, use the `/v1/chat/completions` endpoint, for example with curl: + +```bash +curl http://localhost:8080/v1/chat/completions -H "Content-Type: application/json" -d '{ + "model": "llava", + "messages": [{"role": "user", "content": [{"type":"text", "text": "What is in the image?"}, {"type": "image_url", "image_url": {"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg" }}], "temperature": 0.9}]}' +``` + +### Setup + +To setup the LLaVa models, follow the full example in the [configuration examples](https://github.com/mudler/LocalAI/blob/master/examples/configurations/README.md#llava). \ No newline at end of file diff --git a/docs/content/model-compatibility/vall-e-x.md b/docs/content/model-compatibility/vall-e-x.md index dd514131d740..5184efe67afb 100644 --- a/docs/content/model-compatibility/vall-e-x.md +++ b/docs/content/model-compatibility/vall-e-x.md @@ -1,7 +1,7 @@ +++ disableToc = false -title = "🆕 Vall-E-X" +title = "Vall-E-X" weight = 4 +++ diff --git a/docs/content/model-compatibility/vllm.md b/docs/content/model-compatibility/vllm.md index ae58ea7c788c..56c876ee195e 100644 --- a/docs/content/model-compatibility/vllm.md +++ b/docs/content/model-compatibility/vllm.md @@ -1,7 +1,7 @@ +++ disableToc = false -title = "🆕 vLLM" +title = "vLLM" weight = 4 +++ From b1a20effde68939dd15a5ff60a4b7dde43eadf9d Mon Sep 17 00:00:00 2001 From: "LocalAI [bot]" <139863280+localai-bot@users.noreply.github.com> Date: Fri, 24 Nov 2023 08:32:36 +0100 Subject: [PATCH 4/8] :arrow_up: Update ggerganov/llama.cpp (#1323) Signed-off-by: GitHub Co-authored-by: mudler --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6b41e731e938..e61a4c43e5ed 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ GOLLAMA_VERSION?=aeba71ee842819da681ea537e78846dc75949ac0 GOLLAMA_STABLE_VERSION?=50cee7712066d9e38306eccadcfbb44ea87df4b7 -CPPLLAMA_VERSION?=8e672efe632bb6a7333964a255c4b96f018b9a65 +CPPLLAMA_VERSION?=6b0a7420d03b9d13cb0e9439a01ce8476d8bf093 # gpt4all version GPT4ALL_REPO?=https://github.com/nomic-ai/gpt4all From 5a6a6de3d7687b7caddf42f0d73816fd72347ec6 Mon Sep 17 00:00:00 2001 From: B4ckslash Date: Fri, 24 Nov 2023 18:21:04 +0100 Subject: [PATCH 5/8] docs: Update Features->Embeddings page to reflect backend restructuring (#1325) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update path to sentencetransformers backend for local execution Signed-off-by: Marcus Köhler * Rename huggingface-embeddings -> sentencetransformers in embeddings.md for consistency with the backend structure The Dockerfile still knows the "huggingface-embeddings" backend (I assume for compatibility reasons) but uses the sentencetransformers backend under the hood anyway. I figured it would be good to update the docs to use the new naming to make it less confusing moving forward. As the docker container knows both the "huggingface-embeddings" and the "sentencetransformers" backend, this should not break anything. Signed-off-by: Marcus Köhler --------- Signed-off-by: Marcus Köhler --- docs/content/features/embeddings.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/content/features/embeddings.md b/docs/content/features/embeddings.md index 58992c303be5..09151af852d8 100644 --- a/docs/content/features/embeddings.md +++ b/docs/content/features/embeddings.md @@ -61,23 +61,23 @@ curl http://localhost:8080/embeddings -X POST -H "Content-Type: application/json ## Huggingface embeddings -To use `sentence-formers` and models in `huggingface` you can use the `huggingface` embedding backend. +To use `sentence-transformers` and models in `huggingface` you can use the `sentencetransformers` embedding backend. ```yaml name: text-embedding-ada-002 -backend: huggingface-embeddings +backend: sentencetransformers embeddings: true parameters: model: all-MiniLM-L6-v2 ``` -The `huggingface` backend uses Python [sentence-transformers](https://github.com/UKPLab/sentence-transformers). For a list of all pre-trained models available see here: https://github.com/UKPLab/sentence-transformers#pre-trained-models +The `sentencetransformers` backend uses Python [sentence-transformers](https://github.com/UKPLab/sentence-transformers). For a list of all pre-trained models available see here: https://github.com/UKPLab/sentence-transformers#pre-trained-models {{% notice note %}} -- The `huggingface` 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="huggingface-embeddings:/path/to/LocalAI/extra/grpc/huggingface/huggingface.py"` ) . -- The `huggingface` 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 `huggingface` backend. The models will be downloaded automatically the first time the API is used. +- 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 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. {{% /notice %}} From 97e9598c790b98436268fd41f76f2c95819f30bf Mon Sep 17 00:00:00 2001 From: "LocalAI [bot]" <139863280+localai-bot@users.noreply.github.com> Date: Fri, 24 Nov 2023 23:45:05 +0100 Subject: [PATCH 6/8] :arrow_up: Update ggerganov/llama.cpp (#1330) Signed-off-by: GitHub Co-authored-by: mudler --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e61a4c43e5ed..f1c1eb74b447 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ GOLLAMA_VERSION?=aeba71ee842819da681ea537e78846dc75949ac0 GOLLAMA_STABLE_VERSION?=50cee7712066d9e38306eccadcfbb44ea87df4b7 -CPPLLAMA_VERSION?=6b0a7420d03b9d13cb0e9439a01ce8476d8bf093 +CPPLLAMA_VERSION?=e9c13ff78114af6fc6a4f27cc8dcdda0f3d389fb # gpt4all version GPT4ALL_REPO?=https://github.com/nomic-ai/gpt4all From 6d187af643f2756b76d55ad8c56d225c18035f05 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Sat, 25 Nov 2023 08:48:24 +0100 Subject: [PATCH 7/8] fix: handle grpc and llama-cpp with REBUILD=true (#1328) Signed-off-by: Ettore Di Giacinto --- Dockerfile | 13 +++++++------ Makefile | 6 +++++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 16e605a9ad28..1634447318a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -88,12 +88,9 @@ ENV NVIDIA_VISIBLE_DEVICES=all WORKDIR /build -COPY Makefile . -RUN make get-sources -COPY go.mod . -RUN make prepare COPY . . COPY .git . +RUN make prepare # stablediffusion does not tolerate a newer version of abseil, build it first RUN GRPC_BACKENDS=backend-assets/grpc/stablediffusion make build @@ -102,7 +99,7 @@ RUN if [ "${BUILD_GRPC}" = "true" ]; then \ git clone --recurse-submodules -b v1.58.0 --depth 1 --shallow-submodules https://github.com/grpc/grpc && \ cd grpc && mkdir -p cmake/build && cd cmake/build && cmake -DgRPC_INSTALL=ON \ -DgRPC_BUILD_TESTS=OFF \ - ../.. && make -j12 install && rm -rf grpc \ + ../.. && make -j12 install \ ; fi # Rebuild with defaults backends @@ -144,7 +141,11 @@ WORKDIR /build # see https://github.com/go-skynet/LocalAI/pull/658#discussion_r1241971626 and # https://github.com/go-skynet/LocalAI/pull/434 COPY . . -RUN make prepare-sources + +COPY --from=builder /build/sources ./sources/ +COPY --from=builder /build/grpc ./grpc/ + +RUN make prepare-sources && cd /build/grpc/cmake/build && make install && rm -rf grpc # Copy the binary COPY --from=builder /build/local-ai ./ diff --git a/Makefile b/Makefile index f1c1eb74b447..d7fe0f5c809f 100644 --- a/Makefile +++ b/Makefile @@ -222,7 +222,10 @@ sources/go-llama-ggml/libbinding.a: sources/go-llama-ggml sources/go-piper/libpiper_binding.a: sources/go-piper $(MAKE) -C sources/go-piper libpiper_binding.a example/main -get-sources: sources/go-llama sources/go-llama-ggml sources/go-ggml-transformers sources/gpt4all sources/go-piper sources/go-rwkv sources/whisper.cpp sources/go-bert sources/go-stable-diffusion +backend/cpp/llama/llama.cpp: + $(MAKE) -C backend/cpp/llama llama.cpp + +get-sources: backend/cpp/llama/llama.cpp sources/go-llama sources/go-llama-ggml sources/go-ggml-transformers sources/gpt4all sources/go-piper sources/go-rwkv sources/whisper.cpp sources/go-bert sources/go-stable-diffusion touch $@ replace: @@ -236,6 +239,7 @@ replace: prepare-sources: get-sources replace $(GOCMD) mod download + touch $@ ## GENERIC rebuild: ## Rebuilds the project From 6f34e8f0448428980002e1f7fe5b2bd5a8069045 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Sat, 25 Nov 2023 13:53:51 +0100 Subject: [PATCH 8/8] fix: propagate CMAKE_ARGS when building grpc (#1334) Signed-off-by: Ettore Di Giacinto --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d7fe0f5c809f..7c5d01b66ee6 100644 --- a/Makefile +++ b/Makefile @@ -430,7 +430,7 @@ ifdef BUILD_GRPC_FOR_BACKEND_LLAMA export _PROTOBUF_PROTOC=${INSTALLED_PACKAGES}/bin/proto && \ export _GRPC_CPP_PLUGIN_EXECUTABLE=${INSTALLED_PACKAGES}/bin/grpc_cpp_plugin && \ export PATH=${PATH}:${INSTALLED_PACKAGES}/bin && \ - CMAKE_ARGS="${ADDED_CMAKE_ARGS}" LLAMA_VERSION=$(CPPLLAMA_VERSION) $(MAKE) -C backend/cpp/llama grpc-server + CMAKE_ARGS="${CMAKE_ARGS} ${ADDED_CMAKE_ARGS}" LLAMA_VERSION=$(CPPLLAMA_VERSION) $(MAKE) -C backend/cpp/llama grpc-server else echo "BUILD_GRPC_FOR_BACKEND_LLAMA is not defined." LLAMA_VERSION=$(CPPLLAMA_VERSION) $(MAKE) -C backend/cpp/llama grpc-server