Skip to content

Commit

Permalink
fix(ui): do not show duplicate entries if not installed by gallery (m…
Browse files Browse the repository at this point in the history
…udler#3107)

Signed-off-by: Ettore Di Giacinto <[email protected]>
  • Loading branch information
mudler authored Aug 1, 2024
1 parent e4b91e9 commit d792cf1
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 d792cf1

Please sign in to comment.