diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 28 |
1 files changed, 13 insertions, 15 deletions
@@ -9,7 +9,7 @@ _AMDGPU_TARGETS="gfx900;gfx906;gfx908;gfx90a;gfx1030;gfx1100;gfx1101;gfx1102" if test -n "$GPU_TARGETS"; then _AMDGPU_TARGETS="$GPU_TARGETS"; fi if test -n "$AMDGPU_TARGETS"; then _AMDGPU_TARGETS="$AMDGPU_TARGETS"; fi _GO_TAGS="" -# _GO_TAGS="tts stablediffusion" +# _GO_TAGS="tts tinydream stablediffusion" _OPTIONAL_BACKENDS="" if test -n "$(echo "$_GO_TAGS" | grep -o "tts")"; then _OPTIONAL_BACKENDS="backend-assets/grpc/piper $_OPTIONAL_BACKENDS" @@ -17,6 +17,9 @@ fi if test -n "$(echo "$_GO_TAGS" | grep -o "stablediffusion")"; then _OPTIONAL_BACKENDS="backend-assets/grpc/stablediffusion $_OPTIONAL_BACKENDS" fi +if test -n "$(echo "$_GO_TAGS" | grep -o "tinydream")"; then + _OPTIONAL_BACKENDS="backend-assets/grpc/tinydream $_OPTIONAL_BACKENDS" +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 @@ -25,7 +28,7 @@ _pkgname="localai" pkgbase="${_pkgname}-git" pkgname=("${pkgbase}") -pkgver=v2.0.0.28.g7641f92 +pkgver=v2.5.1.3.g5828849 pkgrel=2 pkgdesc="Self-hosted OpenAI API alternative - Open Source, community-driven and local-first." url="https://github.com/mudler/LocalAI" @@ -36,12 +39,12 @@ provides=('localai') conflicts=('localai') depends=( + 'grpc' ) makedepends=( 'go' 'git' 'cmake' - 'grpc' 'opencv' 'blas-openblas' 'sdl2' @@ -52,7 +55,6 @@ if test "$(echo "$_GO_TAGS" | grep -o "tts")" = "tts"; then makedepends+=( 'onnxruntime' ) - # 'piper-phonemize' is build from piper fi if [[ $_ENABLE_CUDA = 1 ]]; then @@ -95,15 +97,8 @@ prepare() { 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 - _EXTERNAL_SOURCES="backend/cpp/llama/llama.cpp sources/go-piper sources/whisper.cpp sources/go-bert" + _EXTERNAL_SOURCES="backend/cpp/llama/llama.cpp sources/go-piper sources/whisper.cpp sources/go-bert sources/go-tiny-dream" sed -ri "s#get-sources: .*#get-sources: $_EXTERNAL_SOURCES#g" Makefile # remove go mod edits for inactive backend sources @@ -112,6 +107,9 @@ prepare() { 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 + # verbose output of find + # sed -ri 's#^([\t ]+)(LLAMA_VERSION=.+-C backend/cpp/llama grpc-server[\t ]*)#\1CMAKE_ARGS="${CMAKE_ARGS} --debug-find" \2##g' Makefile + # fetch sources of backends to be recursive git checked out before build() mkdir -p "sources" make $_OPTIONAL_MAKE_ARGS $_EXTERNAL_SOURCES @@ -129,11 +127,11 @@ prepare() { # ROCM workarounds cd "${srcdir}/${_pkgname}-rocm" - # workaround build error on ROCM by removing unsupported cf-protection from CMAKE_CXX_FLAGS + # fix 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 - # workaround --offload-arch for multiple GPU_TARGETS, makefile does "," splitting, data is ";" - # also: --ofload-arch is deprecated, replace it with -DGPU_TARGETS + # fix --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 |