Skip to content

Commit

Permalink
fix(welcome): do not list model twice if we have a config (#3790)
Browse files Browse the repository at this point in the history
Signed-off-by: Ettore Di Giacinto <[email protected]>
  • Loading branch information
mudler authored Oct 11, 2024
1 parent be6c4e6 commit a0f0505
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/http/endpoints/localai/welcome.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,20 @@ func WelcomeEndpoint(appConfig *config.ApplicationConfig,
galleryConfigs[m.Name] = cfg
}

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

// Get model statuses to display in the UI the operation in progress
processingModels, taskTypes := modelStatus()

summary := fiber.Map{
"Title": "LocalAI API - " + internal.PrintableVersion(),
"Version": internal.PrintableVersion(),
"Models": models,
"Models": modelsWithoutConfig,
"ModelsConfig": backendConfigs,
"GalleryConfig": galleryConfigs,
"IsP2PEnabled": p2p.IsP2PEnabled(),
Expand Down

0 comments on commit a0f0505

Please sign in to comment.