mirror of
https://github.com/mudler/LocalAI.git
synced 2026-02-07 05:04:29 -05:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d65c16e364 | ||
|
|
25f45827ab | ||
|
|
f322f7c62d | ||
|
|
06351cbbb4 |
9
.github/workflows/release.yaml
vendored
9
.github/workflows/release.yaml
vendored
@@ -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
|
||||||
|
|||||||
4
Makefile
4
Makefile
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user