mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-29 15:04:59 +00:00
fix: handle grpc and llama-cpp with REBUILD=true (#1328)
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
97e9598c79
commit
6d187af643
2 changed files with 12 additions and 7 deletions
13
Dockerfile
13
Dockerfile
|
@ -88,12 +88,9 @@ ENV NVIDIA_VISIBLE_DEVICES=all
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
COPY Makefile .
|
|
||||||
RUN make get-sources
|
|
||||||
COPY go.mod .
|
|
||||||
RUN make prepare
|
|
||||||
COPY . .
|
COPY . .
|
||||||
COPY .git .
|
COPY .git .
|
||||||
|
RUN make prepare
|
||||||
|
|
||||||
# stablediffusion does not tolerate a newer version of abseil, build it first
|
# stablediffusion does not tolerate a newer version of abseil, build it first
|
||||||
RUN GRPC_BACKENDS=backend-assets/grpc/stablediffusion make build
|
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 && \
|
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 \
|
cd grpc && mkdir -p cmake/build && cd cmake/build && cmake -DgRPC_INSTALL=ON \
|
||||||
-DgRPC_BUILD_TESTS=OFF \
|
-DgRPC_BUILD_TESTS=OFF \
|
||||||
../.. && make -j12 install && rm -rf grpc \
|
../.. && make -j12 install \
|
||||||
; fi
|
; fi
|
||||||
|
|
||||||
# Rebuild with defaults backends
|
# Rebuild with defaults backends
|
||||||
|
@ -144,7 +141,11 @@ WORKDIR /build
|
||||||
# see https://github.com/go-skynet/LocalAI/pull/658#discussion_r1241971626 and
|
# see https://github.com/go-skynet/LocalAI/pull/658#discussion_r1241971626 and
|
||||||
# https://github.com/go-skynet/LocalAI/pull/434
|
# https://github.com/go-skynet/LocalAI/pull/434
|
||||||
COPY . .
|
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 the binary
|
||||||
COPY --from=builder /build/local-ai ./
|
COPY --from=builder /build/local-ai ./
|
||||||
|
|
6
Makefile
6
Makefile
|
@ -222,7 +222,10 @@ sources/go-llama-ggml/libbinding.a: sources/go-llama-ggml
|
||||||
sources/go-piper/libpiper_binding.a: sources/go-piper
|
sources/go-piper/libpiper_binding.a: sources/go-piper
|
||||||
$(MAKE) -C sources/go-piper libpiper_binding.a example/main
|
$(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 $@
|
touch $@
|
||||||
|
|
||||||
replace:
|
replace:
|
||||||
|
@ -236,6 +239,7 @@ replace:
|
||||||
|
|
||||||
prepare-sources: get-sources replace
|
prepare-sources: get-sources replace
|
||||||
$(GOCMD) mod download
|
$(GOCMD) mod download
|
||||||
|
touch $@
|
||||||
|
|
||||||
## GENERIC
|
## GENERIC
|
||||||
rebuild: ## Rebuilds the project
|
rebuild: ## Rebuilds the project
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue