routes: skip invalid filepaths

This commit is contained in:
Michael Yang 2024-05-09 11:23:22 -07:00
parent 5cde17a096
commit a7ee84fc31

View file

@ -732,6 +732,11 @@ func (s *Server) ListModelsHandler(c *gin.Context) {
}
n := model.ParseNameFromFilepath(rel)
if !n.IsValid() {
slog.Info("invalid model filepath", "path", rel)
return nil
}
m, err := ParseNamedManifest(n)
if err != nil {
return err