skip hidden files in list models handler (#4247)

This commit is contained in:
Bruce MacDonald 2024-05-07 19:01:45 -07:00 committed by GitHub
parent dc9b1111e0
commit 8cbd3e7510
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -733,6 +733,12 @@ func (s *Server) ListModelsHandler(c *gin.Context) {
return err
}
if hidden, err := filepath.Match(".*", filepath.Base(rel)); err != nil {
return err
} else if hidden {
return nil
}
n := model.ParseNameFromFilepath(rel)
m, err := ParseNamedManifest(n)
if err != nil {