mirror of
https://github.com/mudler/LocalAI.git
synced 2024-12-25 07:11:03 +00:00
24 lines
553 B
Go
24 lines
553 B
Go
|
package backend
|
||
|
|
||
|
import (
|
||
|
"github.com/go-skynet/LocalAI/core/config"
|
||
|
|
||
|
"github.com/go-skynet/LocalAI/pkg/grpc"
|
||
|
"github.com/go-skynet/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.BackendLoader(sc...)
|
||
|
}
|
||
|
|