mirror of
https://github.com/mudler/LocalAI.git
synced 2026-02-19 23:45:59 -05:00
fix: do not keep track model if not existing (#8603)
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
committed by
GitHub
parent
dadc7158fb
commit
76fba02e56
@@ -17,11 +17,15 @@ import (
|
||||
|
||||
var forceBackendShutdown bool = os.Getenv("LOCALAI_FORCE_BACKEND_SHUTDOWN") == "true"
|
||||
|
||||
var (
|
||||
modelNotFoundErr = errors.New("model not found")
|
||||
)
|
||||
|
||||
func (ml *ModelLoader) deleteProcess(s string) error {
|
||||
model, ok := ml.models[s]
|
||||
if !ok {
|
||||
xlog.Debug("Model not found", "model", s)
|
||||
return fmt.Errorf("model %s not found", s)
|
||||
return modelNotFoundErr
|
||||
}
|
||||
|
||||
retries := 1
|
||||
|
||||
@@ -540,7 +540,7 @@ func (wd *WatchDog) evictLRUModel() {
|
||||
wd.Unlock()
|
||||
|
||||
// Shutdown the model
|
||||
if err := wd.pm.ShutdownModel(lruModel.model); err != nil {
|
||||
if err := wd.pm.ShutdownModel(lruModel.model); err != nil && err != modelNotFoundErr {
|
||||
xlog.Error("[WatchDog] error shutting down model during memory reclamation", "error", err, "model", lruModel.model)
|
||||
} else {
|
||||
// Untrack the model
|
||||
|
||||
Reference in New Issue
Block a user