feat(libpath): refactor and expose functions for external library paths (#2578)

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto 2024-06-16 13:58:28 +02:00 committed by GitHub
parent ac4a94dd44
commit 94cfaad7f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 59 additions and 23 deletions

View file

@ -9,6 +9,7 @@ import (
"github.com/go-skynet/LocalAI/core/services"
"github.com/go-skynet/LocalAI/internal"
"github.com/go-skynet/LocalAI/pkg/assets"
"github.com/go-skynet/LocalAI/pkg/library"
"github.com/go-skynet/LocalAI/pkg/model"
pkgStartup "github.com/go-skynet/LocalAI/pkg/startup"
"github.com/go-skynet/LocalAI/pkg/xsysinfo"
@ -109,6 +110,11 @@ func Startup(opts ...config.AppOption) (*config.BackendConfigLoader, *model.Mode
}
}
if options.LibPath != "" {
// If there is a lib directory, set LD_LIBRARY_PATH to include it
library.LoadExternal(options.LibPath)
}
// turn off any process that was started by GRPC if the context is canceled
go func() {
<-options.Context.Done()