Skip to content

Commit

Permalink
fix(ui): do not show duplicate entries if not installed by gallery
Browse files Browse the repository at this point in the history
Signed-off-by: Ettore Di Giacinto <[email protected]>
  • Loading branch information
mudler committed Aug 1, 2024
1 parent e4b91e9 commit 3b9532c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/http/endpoints/localai/welcome.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ func WelcomeEndpoint(appConfig *config.ApplicationConfig,
backendConfigs := cl.GetAllBackendConfigs()

galleryConfigs := map[string]*gallery.Config{}
modelsWithBackendConfig := map[string]interface{}{}

for _, m := range backendConfigs {
modelsWithBackendConfig[m.Name] = nil

cfg, err := gallery.GetLocalModelConfiguration(ml.ModelPath, m.Name)
if err != nil {
Expand All @@ -32,7 +35,7 @@ func WelcomeEndpoint(appConfig *config.ApplicationConfig,
modelsWithoutConfig := []string{}

for _, m := range models {
if _, ok := galleryConfigs[m]; !ok {
if _, ok := modelsWithBackendConfig[m]; !ok {
modelsWithoutConfig = append(modelsWithoutConfig, m)
}
}
Expand Down

0 comments on commit 3b9532c

Please sign in to comment.