Compare commits

..

4 Commits

Author SHA1 Message Date
Ettore Di Giacinto
d65c16e364 debug 2024-06-14 08:42:15 +02:00
LocalAI [bot]
25f45827ab ⬆️ Update ggerganov/whisper.cpp (#2565)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: mudler <2420543+mudler@users.noreply.github.com>
2024-06-14 00:26:51 +00:00
LocalAI [bot]
f322f7c62d ⬆️ Update ggerganov/llama.cpp (#2564)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: mudler <2420543+mudler@users.noreply.github.com>
2024-06-13 23:47:50 +00:00
Ettore Di Giacinto
06351cbbb4 feat(binary): support extracted bundled libs on darwin (#2563)
When offering fallback libs, use the proper env var for darwin

Note: this does not include the libraries itself, but only sets the
proper env var for the libs to be picked up on darwin.

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
2024-06-13 22:59:42 +02:00
3 changed files with 17 additions and 10 deletions

View File

@@ -249,6 +249,11 @@ jobs:
build-macOS-arm64: build-macOS-arm64:
runs-on: macos-14 runs-on: macos-14
steps: steps:
- name: Setup tmate session if tests fail
uses: mxschmitt/action-tmate@v3.18
with:
connect-timeout-seconds: 180
limit-access-to-actor: true
- name: Clone - name: Clone
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
@@ -257,10 +262,6 @@ jobs:
with: with:
go-version: '1.21.x' go-version: '1.21.x'
cache: false cache: false
- name: Setup tmate session if tests fail
uses: mxschmitt/action-tmate@v3.18
with:
limit-access-to-actor: true
- name: Dependencies - name: Dependencies
run: | run: |
brew install protobuf grpc brew install protobuf grpc

View File

@@ -5,7 +5,7 @@ BINARY_NAME=local-ai
# llama.cpp versions # llama.cpp versions
GOLLAMA_STABLE_VERSION?=2b57a8ae43e4699d3dc5d1496a1ccd42922993be GOLLAMA_STABLE_VERSION?=2b57a8ae43e4699d3dc5d1496a1ccd42922993be
CPPLLAMA_VERSION?=963552903f51043ee947a8deeaaa7ec00bc3f1a4 CPPLLAMA_VERSION?=172c8256840ffd882ab9992ecedbb587d9b21f15
# gpt4all version # gpt4all version
GPT4ALL_REPO?=https://github.com/nomic-ai/gpt4all GPT4ALL_REPO?=https://github.com/nomic-ai/gpt4all
@@ -16,7 +16,7 @@ RWKV_REPO?=https://github.com/donomii/go-rwkv.cpp
RWKV_VERSION?=661e7ae26d442f5cfebd2a0881b44e8c55949ec6 RWKV_VERSION?=661e7ae26d442f5cfebd2a0881b44e8c55949ec6
# whisper.cpp version # whisper.cpp version
WHISPER_CPP_VERSION?=420b6abc54008ab634f5887dc45bd77122c2f320 WHISPER_CPP_VERSION?=b29b3b29240aac8b71ce8e5a4360c1f1562ad66f
# bert.cpp version # bert.cpp version
BERT_VERSION?=710044b124545415f555e4260d16b146c725a6e4 BERT_VERSION?=710044b124545415f555e4260d16b146c725a6e4

View File

@@ -6,6 +6,7 @@ import (
"io/fs" "io/fs"
"os" "os"
"path/filepath" "path/filepath"
"runtime"
) )
func ResolvePath(dir string, paths ...string) string { func ResolvePath(dir string, paths ...string) string {
@@ -55,20 +56,25 @@ func ExtractFiles(content embed.FS, extractDir string) error {
// we might use this mechanism to carry over e.g. Nvidia CUDA libraries // we might use this mechanism to carry over e.g. Nvidia CUDA libraries
// from the embedded FS to the target directory // from the embedded FS to the target directory
// Skip this if LOCALAI_SKIP_LD_LIBRARY_PATH is set // Skip this if LOCALAI_SKIP_LIBRARY_PATH is set
if os.Getenv("LOCALAI_SKIP_LD_LIBRARY_PATH") != "" { if os.Getenv("LOCALAI_SKIP_LIBRARY_PATH") != "" {
return err return err
} }
lpathVar := "LD_LIBRARY_PATH"
if runtime.GOOS == "darwin" {
lpathVar = "DYLD_FALLBACK_LIBRARY_PATH" // should it be DYLD_LIBRARY_PATH ?
}
for _, libDir := range []string{filepath.Join(extractDir, "backend_assets", "lib"), filepath.Join(extractDir, "lib")} { for _, libDir := range []string{filepath.Join(extractDir, "backend_assets", "lib"), filepath.Join(extractDir, "lib")} {
if _, err := os.Stat(libDir); err == nil { if _, err := os.Stat(libDir); err == nil {
ldLibraryPath := os.Getenv("LD_LIBRARY_PATH") ldLibraryPath := os.Getenv(lpathVar)
if ldLibraryPath == "" { if ldLibraryPath == "" {
ldLibraryPath = libDir ldLibraryPath = libDir
} else { } else {
ldLibraryPath = fmt.Sprintf("%s:%s", ldLibraryPath, libDir) ldLibraryPath = fmt.Sprintf("%s:%s", ldLibraryPath, libDir)
} }
os.Setenv("LD_LIBRARY_PATH", ldLibraryPath) os.Setenv(lpathVar, ldLibraryPath)
} }
} }
return err return err