mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-28 06:25:00 +00:00
groundwork: ListModels Filtering Upgrade (#2773)
* seperate the filtering from the middleware changes --------- Signed-off-by: Dave Lee <dave@gray101.com>
This commit is contained in:
parent
f84b55d1ef
commit
307a835199
11 changed files with 387 additions and 81 deletions
|
@ -303,7 +303,7 @@ func RegisterUIRoutes(app *fiber.App,
|
|||
|
||||
// Show the Chat page
|
||||
app.Get("/chat/:model", func(c *fiber.Ctx) error {
|
||||
backendConfigs, _ := services.ListModels(cl, ml, "", true)
|
||||
backendConfigs, _ := services.ListModels(cl, ml, config.NoFilterFn, services.SKIP_IF_CONFIGURED)
|
||||
|
||||
summary := fiber.Map{
|
||||
"Title": "LocalAI - Chat with " + c.Params("model"),
|
||||
|
@ -318,7 +318,7 @@ func RegisterUIRoutes(app *fiber.App,
|
|||
})
|
||||
|
||||
app.Get("/talk/", func(c *fiber.Ctx) error {
|
||||
backendConfigs, _ := services.ListModels(cl, ml, "", true)
|
||||
backendConfigs, _ := services.ListModels(cl, ml, config.NoFilterFn, services.SKIP_IF_CONFIGURED)
|
||||
|
||||
if len(backendConfigs) == 0 {
|
||||
// If no model is available redirect to the index which suggests how to install models
|
||||
|
@ -339,7 +339,7 @@ func RegisterUIRoutes(app *fiber.App,
|
|||
|
||||
app.Get("/chat/", func(c *fiber.Ctx) error {
|
||||
|
||||
backendConfigs, _ := services.ListModels(cl, ml, "", true)
|
||||
backendConfigs, _ := services.ListModels(cl, ml, config.NoFilterFn, services.SKIP_IF_CONFIGURED)
|
||||
|
||||
if len(backendConfigs) == 0 {
|
||||
// If no model is available redirect to the index which suggests how to install models
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue