diff options
author | Felix Erkinger | 2023-12-14 00:31:38 +0100 |
---|---|---|
committer | Felix Erkinger | 2023-12-14 00:31:38 +0100 |
commit | 7a3e5960970b5e64183c4d0f517d4d6d9d291063 (patch) | |
tree | 79422f4b304a2bcbe34987b2cb78e64a9990896f | |
parent | 221c54e1686b88c4c6d0e71e738ae0bc3294c53d (diff) | |
download | aur-7a3e5960970b5e64183c4d0f517d4d6d9d291063.tar.gz |
upgpkg: localai-git v2.0.0.28.g7641f92-2
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 44 |
2 files changed, 30 insertions, 18 deletions
@@ -1,7 +1,7 @@ pkgbase = localai-git pkgdesc = Self-hosted OpenAI API alternative - Open Source, community-driven and local-first. - pkgver = v2.0.0.23.g9aa2a7c - pkgrel = 5 + pkgver = v2.0.0.28.g7641f92 + pkgrel = 2 url = https://github.com/mudler/LocalAI arch = x86_64 license = MIT @@ -19,12 +19,14 @@ if test -n "$(echo "$_GO_TAGS" | grep -o "stablediffusion")"; then fi # list of backends to be build _GRPC_BACKENDS="backend-assets/grpc/llama-cpp backend-assets/grpc/whisper $_OPTIONAL_BACKENDS backend-assets/grpc/bert-embeddings" +# optional args for main Makefile calling +_OPTIONAL_MAKE_ARGS="$_OPTIONAL_MAKE_ARGS" _pkgname="localai" pkgbase="${_pkgname}-git" pkgname=("${pkgbase}") -pkgver=v2.0.0.23.g9aa2a7c -pkgrel=5 +pkgver=v2.0.0.28.g7641f92 +pkgrel=2 pkgdesc="Self-hosted OpenAI API alternative - Open Source, community-driven and local-first." url="https://github.com/mudler/LocalAI" license=('MIT') @@ -89,20 +91,32 @@ pkgver() { prepare() { cd "${srcdir}/${_pkgname}" - # list of backend sources to be recursive git checked out before build() - _EXTERNAL_SOURCES="backend/cpp/llama/llama.cpp sources/go-piper sources/whisper.cpp sources/go-bert" - # fetch sources for active backends - mkdir -p "sources" - make $_EXTERNAL_SOURCES + if test -n "$_OPTIONAL_MAKE_ARGS"; then + echo "_OPTIONAL_MAKE_ARGS=$_OPTIONAL_MAKE_ARGS" + fi + + # fix LLAMA_VERSION not set from CPPLLAMA_VERSION in llama.cpp build + sed -ri 's#^(\t+)(LLAMA_VERSION=\$\(CPPLLAMA_VERSION\) +)(\$\(MAKE\) -C backend/cpp/llama +)(grpc-server.*)#\1\3\2\4#g' Makefile + sed -ri 's#^(\t+\$\(MAKE\) -C backend/cpp/llama +)(llama.cpp.*$)#\1LLAMA_VERSION=$(CPPLLAMA_VERSION) \2#g' Makefile + + # fix deprecated memory_f16 in gpt_params + sed -ri 's#[ \t]+params.memory_f16 = request->f16memory\(\);[ \t]*##g' backend/cpp/llama/grpc-server.cpp - # modify get-sources, remove go mod edits for inactive backend sources + # modify get-sources + _EXTERNAL_SOURCES="backend/cpp/llama/llama.cpp sources/go-piper sources/whisper.cpp sources/go-bert" sed -ri "s#get-sources: .*#get-sources: $_EXTERNAL_SOURCES#g" Makefile + + # remove go mod edits for inactive backend sources sed -ri 's#.+\-replace github.com/nomic-ai/gpt4all/gpt4all.+##g' Makefile sed -ri 's#.+\-replace github.com/donomii/go-rwkv.cpp.+##g' Makefile sed -ri 's#.+\-replace github.com/go-skynet/go-ggml-transformers.cpp.+##g' Makefile sed -ri 's#.+\-replace github.com/mudler/go-stable-diffusion.+##g' Makefile - # # patch stablediffusion + # fetch sources of backends to be recursive git checked out before build() + mkdir -p "sources" + make $_OPTIONAL_MAKE_ARGS $_EXTERNAL_SOURCES + + # # fix stablediffusion # sed -ri "s/^(#include <ncnn\/)(benchmark|net)(\.h>)/\1src\/\2\3/g" \ # sources/go-stable-diffusion/stablediffusion.hpp @@ -113,23 +127,21 @@ prepare() { cp -r "${_pkgname}" "$n" done + # ROCM workarounds cd "${srcdir}/${_pkgname}-rocm" - # XXX workaround build error on ROCM by removing unsupported cf-protection from CMAKE_CXX_FLAGS + # workaround build error on ROCM by removing unsupported cf-protection from CMAKE_CXX_FLAGS sed -i '1s/^/string(REPLACE "-fcf-protection" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")\n/' \ backend/cpp/llama/llama.cpp/CMakeLists.txt - # XXX workaround --offload-arch for multiple GPU_TARGETS, makefile does "," splitting, data is ";" - # also: --ofload-arch is deprecated, replace it with -DGPU_TARGETS + # workaround --offload-arch for multiple GPU_TARGETS, makefile does "," splitting, data is ";" + # also: --ofload-arch is deprecated, replace it with -DGPU_TARGETS for i in backend/cpp/llama/llama.cpp/Makefile sources/whisper.cpp/Makefile; do sed -ri 's/^(.+HIPFLAGS.+\+=).+offload-arch=.+$/\1 -DGPU_TARGETS="$(GPU_TARGETS)"/g' "$i" done } _build() { - # build new mixtral - _OPTIONAL_MAKE_ARGS="CPPLLAMA_VERSION=9fb13f95840c722ad419f390dc8a9c86080a3700" - if test -n "$(echo "$_GO_TAGS" | grep -o "stablediffusion")"; then - make BUILD_TYPE="$1" GRPC_BACKENDS="backend-assets/grpc/stablediffusion" GO_TAGS="$_GO_TAGS" build + make BUILD_TYPE="$1" GRPC_BACKENDS="backend-assets/grpc/stablediffusion" GO_TAGS="$_GO_TAGS" $_OPTIONAL_MAKE_ARGS build fi make BUILD_TYPE="$1" GRPC_BACKENDS="$_GRPC_BACKENDS" GO_TAGS="$_GO_TAGS" $_OPTIONAL_MAKE_ARGS build } |