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

This commit is contained in:
Yiorgis Gozadinos 2023-10-17 19:02:43 +02:00
parent f55bdb6f10
commit 8c6c2cbc8c

View file

@ -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()})