mirror of
https://github.com/mudler/LocalAI.git
synced 2025-12-30 22:20:20 -06:00
feat(backends): add system backend, refactor (#6059)
- Add a system backend path - Refactor and consolidate system information in system state - Use system state in all the components to figure out the system paths to used whenever needed - Refactor BackendConfig -> ModelConfig. This was otherway misleading as now we do have a backend configuration which is not the model config. Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
committed by
GitHub
parent
253b7537dc
commit
089efe05fd
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/mudler/LocalAI/pkg/grpc"
|
||||
"github.com/mudler/LocalAI/pkg/model"
|
||||
"github.com/mudler/LocalAI/pkg/store"
|
||||
"github.com/mudler/LocalAI/pkg/system"
|
||||
)
|
||||
|
||||
func normalize(vecs [][]float32) {
|
||||
@@ -46,7 +47,7 @@ var _ = Describe("Integration tests for the stores backend(s) and internal APIs"
|
||||
|
||||
debug := true
|
||||
|
||||
bc := config.BackendConfig{
|
||||
bc := config.ModelConfig{
|
||||
Name: "store test",
|
||||
Debug: &debug,
|
||||
Backend: model.LocalStoreBackend,
|
||||
@@ -57,7 +58,12 @@ var _ = Describe("Integration tests for the stores backend(s) and internal APIs"
|
||||
model.WithModel("test"),
|
||||
}
|
||||
|
||||
sl = model.NewModelLoader("", false)
|
||||
systemState, err := system.GetSystemState(
|
||||
system.WithModelPath(tmpdir),
|
||||
)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
sl = model.NewModelLoader(systemState, false)
|
||||
sc, err = sl.Load(storeOpts...)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(sc).ToNot(BeNil())
|
||||
|
||||
Reference in New Issue
Block a user