mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-04 09:42:53 +00:00
fix(welcome): do not list model twice if we have a config (#3790)
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
be6c4e6061
commit
a0f0505f0d
@ -29,13 +29,20 @@ func WelcomeEndpoint(appConfig *config.ApplicationConfig,
|
|||||||
galleryConfigs[m.Name] = cfg
|
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
|
// Get model statuses to display in the UI the operation in progress
|
||||||
processingModels, taskTypes := modelStatus()
|
processingModels, taskTypes := modelStatus()
|
||||||
|
|
||||||
summary := fiber.Map{
|
summary := fiber.Map{
|
||||||
"Title": "LocalAI API - " + internal.PrintableVersion(),
|
"Title": "LocalAI API - " + internal.PrintableVersion(),
|
||||||
"Version": internal.PrintableVersion(),
|
"Version": internal.PrintableVersion(),
|
||||||
"Models": models,
|
"Models": modelsWithoutConfig,
|
||||||
"ModelsConfig": backendConfigs,
|
"ModelsConfig": backendConfigs,
|
||||||
"GalleryConfig": galleryConfigs,
|
"GalleryConfig": galleryConfigs,
|
||||||
"IsP2PEnabled": p2p.IsP2PEnabled(),
|
"IsP2PEnabled": p2p.IsP2PEnabled(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user