Merge pull request #4295 from ollama/mxyng/fix-list
routes: skip invalid filepaths
This commit is contained in:
commit
1580ed4c06
1 changed files with 5 additions and 0 deletions
|
@ -732,6 +732,11 @@ func (s *Server) ListModelsHandler(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
n := model.ParseNameFromFilepath(rel)
|
n := model.ParseNameFromFilepath(rel)
|
||||||
|
if !n.IsValid() {
|
||||||
|
slog.Info("invalid model filepath", "path", rel)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
m, err := ParseNamedManifest(n)
|
m, err := ParseNamedManifest(n)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue