diff options
-rw-r--r-- | .SRCINFO | 3 | ||||
-rw-r--r-- | PKGBUILD | 37 |
2 files changed, 23 insertions, 17 deletions
@@ -1,7 +1,7 @@ pkgbase = localai-git pkgdesc = The free, Open Source OpenAI alternative. Self-hosted, community-driven and local-first. pkgver = v1.40.0.60.gfd1b7b3 - pkgrel = 2 + pkgrel = 3 url = https://github.com/mudler/LocalAI arch = x86_64 license = MIT @@ -11,7 +11,6 @@ pkgbase = localai-git depends = ffmpeg depends = opencv depends = blas-openblas - depends = onnxruntime provides = localai conflicts = localai source = localai::git+https://github.com/mudler/LocalAI @@ -2,8 +2,16 @@ _ENABLE_CUDA=0 _ENABLE_ROCM=0 -# _GOTAGS="tts stablediffusion" -_GRPC_BACKENDS="backend-assets/grpc/bert-embeddings backend-assets/grpc/llama-cpp backend-assets/grpc/whisper" +_GO_TAGS="" +# _GO_TAGS="tts stablediffusion" +_OPTIONAL_BACKENDS="" +if test "$(echo "$_GO_TAGS" | grep -o "tts")" = "tts"; then + _OPTIONAL_BACKENDS="backend-assets/grpc/piper $_OPTIONAL_BACKENDS" +fi +if test "$(echo "$_GO_TAGS" | grep -o "stablediffusion")" = "stablediffusion"; then + _OPTIONAL_BACKENDS="backend-assets/grpc/stablediffusion $_OPTIONAL_BACKENDS" +fi +_GRPC_BACKENDS="backend-assets/grpc/bert-embeddings backend-assets/grpc/llama-cpp backend-assets/grpc/whisper $_OPTIONAL_BACKENDS" # backend-assets/grpc/rwkv if test -n "$GPU_TARGETS"; then _AMDGPU_TARGETS="$GPU_TARGETS"; fi _AMDGPU_TARGETS="${AMDGPU_TARGETS:-gfx900;gfx906;gfx908;gfx90a;gfx1030;gfx1100;gfx1101;gfx1102}" @@ -12,7 +20,7 @@ _pkgname="localai" pkgbase="${_pkgname}-git" pkgname=("${pkgbase}") pkgver=v1.40.0.60.gfd1b7b3 -pkgrel=2 +pkgrel=3 pkgdesc="The free, Open Source OpenAI alternative. Self-hosted, community-driven and local-first." url="https://github.com/mudler/LocalAI" license=('MIT') @@ -25,7 +33,6 @@ depends=( 'ffmpeg' 'opencv' 'blas-openblas' - 'onnxruntime' ) makedepends=( 'go' @@ -33,6 +40,13 @@ makedepends=( 'cmake' ) +if test "$(echo "$_GO_TAGS" | grep -o "tts")" = "tts"; then + depends+=( + 'onnxruntime' + 'libucd-git' + ) +fi + if [[ $_ENABLE_CUDA = 1 ]]; then pkgname+=("${pkgbase}-cuda") makedepends+=( @@ -55,11 +69,6 @@ source=( "${_pkgname}"::"git+https://github.com/mudler/LocalAI" "whisper-1.5.1.patch" ) -# "go-piper"::"git+https://github.com/mudler/go-piper" -# "go-rwkv"::"git+https://github.com/donomii/go-rwkv.cpp" -# "whisper.cpp"::"git+https://github.com/ggerganov/whisper.cpp.git" -# "go-bert"::"git+https://github.com/go-skynet/go-bert.cpp" -# "go-stable-diffusion"::"git+https://github.com/mudler/go-stable-diffusion" sha256sums=( 'SKIP' @@ -75,14 +84,12 @@ prepare() { # move backend_data to /usr/share sed -ri "s#/tmp/localai/backend_data#/usr/share/${_pkgname}#g" main.go - # remove unbuild sources go-llama go-llama-ggml go-ggml-transformers gpt4all + # remove sources for not build backends: go-llama go-llama-ggml go-ggml-transformers gpt4all _SOURCES="go-piper go-rwkv whisper.cpp go-bert go-stable-diffusion" _SOURCES_PATHS="$(echo "$_SOURCES" | tr " " "\n" | sed -r "s#(.+)#sources/\1#" | tr "\n" " ")" sed -ri "s#get-sources: .*#get-sources: backend/cpp/llama/llama.cpp $_SOURCES_PATHS#g" Makefile sed -ri 's#.+\-replace github.com/nomic-ai/gpt4all/gpt4all.+##g' Makefile sed -ri 's#.+\-replace github.com/go-skynet/go-ggml-transformers.cpp.+##g' Makefile - # fix not building hash - # sed -ri 's#CPPLLAMA_VERSION\?=3e73d31d9cc0232882ce61c64742aff3ecfec416#CPPLLAMA_VERSION?=64e64aa2557d97490b2fe1262b313e2f4a1607e3#g' Makefile mkdir -p "sources" make $_SOURCES_PATHS @@ -102,16 +109,16 @@ pkgver() { build() { cd "${srcdir}/${_pkgname}-cpu" - make CPPLLAMA_VERSION="$_CPPLLAMA_VERSION" BUILD_TYPE="openblas" GRPC_BACKENDS="$_GRPC_BACKENDS" GOTAGS="$_GOTAGS" prepare build + make BUILD_TYPE="openblas" GRPC_BACKENDS="$_GRPC_BACKENDS" GO_TAGS="$_GO_TAGS" build if [[ $_ENABLE_ROCM = 1 ]]; then cd "${srcdir}/${_pkgname}-rocm" AMDGPU_TARGETS="$_AMDGPU_TARGETS" GPU_TARGETS="$_AMDGPU_TARGETS" \ - make CPPLLAMA_VERSION="$_CPPLLAMA_VERSION" BUILD_TYPE="hipblas" GRPC_BACKENDS="$_GRPC_BACKENDS" GOTAGS="$_GOTAGS" prepare build + make BUILD_TYPE="hipblas" GRPC_BACKENDS="$_GRPC_BACKENDS" GO_TAGS="$_GO_TAGS" build fi if [[ $_ENABLE_CUDA = 1 ]]; then cd "${srcdir}/${_pkgname}-cuda" - make CPPLLAMA_VERSION="$_CPPLLAMA_VERSION" BUILD_TYPE="cublas" GRPC_BACKENDS="$_GRPC_BACKENDS" GOTAGS="$_GOTAGS" prepare build + make BUILD_TYPE="cublas" GRPC_BACKENDS="$_GRPC_BACKENDS" GO_TAGS="$_GO_TAGS" build fi } |