Fixed the API endpoint /api/tags when the model list is empty. (#4424)

* Fixed the API endpoint /api/tags to return {models: []} instead of {models: null} when the model list is empty.

* Update server/routes.go

---------

Co-authored-by: Jeffrey Morgan <jmorganca@gmail.com>
This commit is contained in:
Ryo Machida
2024-05-15 03:18:10 +09:00
committed by GitHub
parent 6a1b471365
commit 798b107f19
2 changed files with 2 additions and 1 deletions

View File

@@ -725,7 +725,7 @@ func (s *Server) ListModelsHandler(c *gin.Context) {
return
}
var models []api.ModelResponse
models := []api.ModelResponse{}
if err := filepath.Walk(manifests, func(path string, info os.FileInfo, _ error) error {
if !info.IsDir() {
rel, err := filepath.Rel(manifests, path)