aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Erkinger2023-11-28 18:07:40 +0100
committerFelix Erkinger2023-11-28 18:07:40 +0100
commitdfeb6af9a5ecd73b05dbfa01beab60e42b4408a7 (patch)
tree7e1a1eb7df012015b17f829529ff59bdb60f35aa
parent3fbc13779a9fdbc705777c41f53727b26c390770 (diff)
downloadaur-dfeb6af9a5ecd73b05dbfa01beab60e42b4408a7.tar.gz
upgpkg: localai-git v1.40.0.58.gb782136-1
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD81
-rw-r--r--whisper-1.5.1.patch (renamed from whisper-gpu.patch)20
3 files changed, 75 insertions, 42 deletions
diff --git a/.SRCINFO b/.SRCINFO
index db5f7b5d7030..1ebe8fe3b70f 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = localai-git
pkgdesc = The free, Open Source OpenAI alternative. Self-hosted, community-driven and local-first.
- pkgver = 944.20d637e
+ pkgver = v1.40.0.58.gb782136
pkgrel = 1
url = https://github.com/mudler/LocalAI
arch = x86_64
@@ -8,26 +8,14 @@ pkgbase = localai-git
makedepends = go
makedepends = git
makedepends = cmake
- makedepends = ffmpeg
- makedepends = opencv
- makedepends = blas-openblas
- makedepends = rocm-hip-sdk
depends = ffmpeg
depends = opencv
depends = blas-openblas
- provides = localai=944.20d637e
provides = localai
conflicts = localai
source = localai::git+https://github.com/mudler/LocalAI
- source = whisper-gpu.patch
+ source = whisper-1.5.1.patch
sha256sums = SKIP
sha256sums = SKIP
pkgname = localai-git
-
-pkgname = localai-git-rocm
- pkgdesc = The free, Open Source OpenAI alternative. Self-hosted, community-driven and local-first. (with ROCM support)
- depends = ffmpeg
- depends = opencv
- depends = blas-openblas
- depends = rocm-hip-runtime
diff --git a/PKGBUILD b/PKGBUILD
index b07e0b71e1a7..12890c6f5693 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,61 +2,96 @@
_pkgname="localai"
pkgbase="${_pkgname}-git"
-pkgname=("${pkgbase}" "${pkgbase}-rocm")
-pkgver="944.20d637e"
+pkgname=("${pkgbase}")
+# "${pkgbase}-rocm"
+pkgver="v1.40.0.58.gb782136"
pkgrel=1
pkgdesc="The free, Open Source OpenAI alternative. Self-hosted, community-driven and local-first."
url="https://github.com/mudler/LocalAI"
license=('MIT')
arch=('x86_64')
-depends=('ffmpeg' 'opencv' 'blas-openblas')
-makedepends=('go' 'git' 'cmake' 'ffmpeg' 'opencv' 'blas-openblas' 'rocm-hip-sdk')
-provides=("localai=${pkgver}" 'localai')
+provides=('localai')
conflicts=('localai')
-source=("${_pkgname}"::"git+https://github.com/mudler/LocalAI"
- "whisper-gpu.patch")
-sha256sums=('SKIP'
- 'SKIP')
-pkgver() {
- cd "${srcdir}/${_pkgname}"
- echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
-}
+depends=(
+ 'ffmpeg'
+ 'opencv'
+ 'blas-openblas'
+ # 'onnxruntime'
+)
+makedepends=(
+ 'go'
+ 'git'
+ 'cmake'
+ # 'rocm-hip-sdk'
+)
+
+source=(
+ "${_pkgname}"::"git+https://github.com/mudler/LocalAI"
+ "whisper-1.5.1.patch"
+)
+
+sha256sums=(
+ 'SKIP'
+ 'SKIP'
+)
prepare() {
cd "${srcdir}/${_pkgname}"
- make prepare
+
+ patch -Np1 -i "${srcdir}/whisper-1.5.1.patch"
+ sed -ri "s#/tmp/localai/backend_data#/usr/share/${_pkgname}#g" main.go
+
+ # OPTIONAL_GRPC="backend-assets/grpc/piper"
+ # GOTAGS="tts"
+ GRPC_BACKENDS="backend-assets/grpc/langchain-huggingface backend-assets/grpc/bert-embeddings backend-assets/grpc/llama-cpp backend-assets/grpc/gpt4all backend-assets/grpc/dolly backend-assets/grpc/rwkv backend-assets/grpc/whisper $OPTIONAL_GRPC"
+ make GRPC_BACKENDS="$GRPC_BACKENDS" GOTAGS="$GOTAGS" prepare
cd "${srcdir}"
cp -r "${_pkgname}" "${_pkgname}-rocm"
cd "${srcdir}/${_pkgname}-rocm"
- patch -Np1 -i "${srcdir}/whisper-gpu.patch"
+
+ if test -z "$AMDGPU_TARGETS"; then
+ if test -z "$GPU_TARGETS"; then
+ GPU_TARGETS='gfx900;gfx906;gfx908;gfx90a;gfx1030;gfx1100;gfx1101;gfx1102'
+ fi
+ else
+ GPU_TARGETS="$AMDGPU_TARGETS"
+ fi
+
+}
+
+pkgver() {
+ cd "${srcdir}/../${_pkgname}"
+ echo "$(git describe --always --tags | tr "-" ".")"
}
build() {
cd "${srcdir}/${_pkgname}"
- make BUILD_TYPE="openblas" GOTAGS="tts" build
+ make BUILD_TYPE="openblas" GRPC_BACKENDS="$GRPC_BACKENDS" GOTAGS="$GOTAGS" build
- cd "${srcdir}/${_pkgname}-rocm"
- GPU_TARGETS='gfx900;gfx906;gfx908;gfx90a;gfx1030;gfx1100;gfx1101;gfx1102' \
- make BUILD_TYPE="hipblas" GOTAGS="tts" build
+ # cd "${srcdir}/${_pkgname}-rocm"
+ # GPU_TARGETS="$GPU_TARGETS" \
+ # make BUILD_TYPE="hipblas" GRPC_BACKENDS="$GRPC_BACKENDS" GOTAGS="$GOTAGS" build
}
package_localai-git() {
- cd "${_pkgname}-${pkgver}"
+ cd "${srcdir}/${_pkgname}"
- install -Dm755 "${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}"
+ install -Dm755 "local-ai" "${pkgdir}/usr/bin/local-ai"
+ # install -D backend-assets/espeak-ng-data -t "${pkgdir}/usr/share/${_pkgname}"
install -Dm644 README.md -t "${pkgdir}/usr/share/doc/${_pkgname}"
}
package_localai-git-rocm() {
- cd "${_pkgname}-${pkgver}-rocm"
+ cd "${srcdir}/${_pkgname}-rocm"
pkgdesc+=' (with ROCM support)'
depends+=('rocm-hip-runtime')
- install -Dm755 "${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}"
+ install -Dm755 "local-ai" "${pkgdir}/usr/bin/local-ai"
+ # install -D backend-assets/espeak-ng-data -t "${pkgdir}/usr/share/${_pkgname}"
install -Dm644 README.md -t "${pkgdir}/usr/share/doc/${_pkgname}"
}
diff --git a/whisper-gpu.patch b/whisper-1.5.1.patch
index 2e018edb2734..ac7557f63f8e 100644
--- a/whisper-gpu.patch
+++ b/whisper-1.5.1.patch
@@ -1,5 +1,15 @@
+From 90f96c5ea447ff7a9e796e772a4e53cec3d38235 Mon Sep 17 00:00:00 2001
+From: Felix Erkinger <wuxxin@gmail.com>
+Date: Sat, 18 Nov 2023 00:58:03 +0100
+Subject: [PATCH] update whisper_cpp to 1.5.1 with OPENBLAS, METAL, HIPBLAS,
+ CUBLAS, CLBLAST support
+
+---
+ Makefile | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
diff --git a/Makefile b/Makefile
-index 666bc8d..d487165 100644
+index 22689eb31..f7c7ca80e 100644
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,7 @@ RWKV_REPO?=https://github.com/donomii/go-rwkv.cpp
@@ -7,7 +17,7 @@ index 666bc8d..d487165 100644
# whisper.cpp version
-WHISPER_CPP_VERSION?=85ed71aaec8e0612a84c0b67804bde75aa75a273
-+WHISPER_CPP_VERSION?=d38af151a1ed5378c5a9ae368e767ed22c8ab141
++WHISPER_CPP_VERSION?=9d6ebd877ce7d99053423d186e6f5387a4a4753c
# bert.cpp version
BERT_VERSION?=6abe312cded14042f6b7c3cd8edf082713334a4d
@@ -37,7 +47,7 @@ index 666bc8d..d487165 100644
ifeq ($(BUILD_TYPE),metal)
CGO_LDFLAGS+=-framework Foundation -framework Metal -framework MetalKit -framework MetalPerformanceShaders
export LLAMA_METAL=1
-+ # export WHISPER_METAL=1
++ export WHISPER_METAL=1
endif
ifeq ($(BUILD_TYPE),clblas)
@@ -45,8 +55,8 @@ index 666bc8d..d487165 100644
+ export WHISPER_CLBLAST=1
endif
- # glibc-static or glibc-devel-static required
-@@ -224,6 +229,7 @@ replace:
+ ifeq ($(OS),Darwin)
+@@ -233,6 +238,7 @@ replace:
$(GOCMD) mod edit -replace github.com/go-skynet/go-ggml-transformers.cpp=$(shell pwd)/sources/go-ggml-transformers
$(GOCMD) mod edit -replace github.com/donomii/go-rwkv.cpp=$(shell pwd)/sources/go-rwkv
$(GOCMD) mod edit -replace github.com/ggerganov/whisper.cpp=$(shell pwd)/sources/whisper.cpp