Commit 8c6c2cbc authored by Yiorgis Gozadinos's avatar Yiorgis Gozadinos
Browse files

When the .ollama folder is broken or there are no models return an empty list on /api/tags

parent f55bdb6f
...@@ -481,7 +481,7 @@ func GetModelInfo(name string) (*api.ShowResponse, error) { ...@@ -481,7 +481,7 @@ func GetModelInfo(name string) (*api.ShowResponse, error) {
} }
func ListModelsHandler(c *gin.Context) { func ListModelsHandler(c *gin.Context) {
var models []api.ModelResponse models := make([]api.ModelResponse, 0)
fp, err := GetManifestPath() fp, err := GetManifestPath()
if err != nil { if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment