mirror of
https://github.com/mudler/LocalAI.git
synced 2025-02-21 09:41:45 +00:00
fix(ui): do not show duplicate entries if not installed by gallery (#3107)
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
e4b91e9dbb
commit
d792cf115b
@ -17,7 +17,10 @@ func WelcomeEndpoint(appConfig *config.ApplicationConfig,
|
|||||||
backendConfigs := cl.GetAllBackendConfigs()
|
backendConfigs := cl.GetAllBackendConfigs()
|
||||||
|
|
||||||
galleryConfigs := map[string]*gallery.Config{}
|
galleryConfigs := map[string]*gallery.Config{}
|
||||||
|
modelsWithBackendConfig := map[string]interface{}{}
|
||||||
|
|
||||||
for _, m := range backendConfigs {
|
for _, m := range backendConfigs {
|
||||||
|
modelsWithBackendConfig[m.Name] = nil
|
||||||
|
|
||||||
cfg, err := gallery.GetLocalModelConfiguration(ml.ModelPath, m.Name)
|
cfg, err := gallery.GetLocalModelConfiguration(ml.ModelPath, m.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -32,7 +35,7 @@ func WelcomeEndpoint(appConfig *config.ApplicationConfig,
|
|||||||
modelsWithoutConfig := []string{}
|
modelsWithoutConfig := []string{}
|
||||||
|
|
||||||
for _, m := range models {
|
for _, m := range models {
|
||||||
if _, ok := galleryConfigs[m]; !ok {
|
if _, ok := modelsWithBackendConfig[m]; !ok {
|
||||||
modelsWithoutConfig = append(modelsWithoutConfig, m)
|
modelsWithoutConfig = append(modelsWithoutConfig, m)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user