From 8c6c2cbc8cd23ab966132fe58d0140477f0b2138 Mon Sep 17 00:00:00 2001 From: Yiorgis Gozadinos Date: Tue, 17 Oct 2023 19:02:43 +0200 Subject: [PATCH] When the .ollama folder is broken or there are no models return an empty list on /api/tags --- server/routes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/routes.go b/server/routes.go index 637ba49f..c02ca3ed 100644 --- a/server/routes.go +++ b/server/routes.go @@ -481,7 +481,7 @@ func GetModelInfo(name string) (*api.ShowResponse, error) { } func ListModelsHandler(c *gin.Context) { - var models []api.ModelResponse + models := make([]api.ModelResponse, 0) fp, err := GetManifestPath() if err != nil { c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})