mirror of
https://github.com/mudler/LocalAI.git
synced 2024-12-24 06:46:39 +00:00
6daef00d30
* chore: simplify passing options to ModelOptions Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * chore(refactor): do not expose internal backend Loader Signed-off-by: Ettore Di Giacinto <mudler@localai.io> --------- Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
23 lines
503 B
Go
23 lines
503 B
Go
package backend
|
|
|
|
import (
|
|
"github.com/mudler/LocalAI/core/config"
|
|
|
|
"github.com/mudler/LocalAI/pkg/grpc"
|
|
"github.com/mudler/LocalAI/pkg/model"
|
|
)
|
|
|
|
func StoreBackend(sl *model.ModelLoader, appConfig *config.ApplicationConfig, storeName string) (grpc.Backend, error) {
|
|
if storeName == "" {
|
|
storeName = "default"
|
|
}
|
|
|
|
sc := []model.Option{
|
|
model.WithBackendString(model.LocalStoreBackend),
|
|
model.WithAssetDir(appConfig.AssetsDestination),
|
|
model.WithModel(storeName),
|
|
}
|
|
|
|
return sl.Load(sc...)
|
|
}
|