mirror of
https://github.com/ollama/ollama.git
synced 2025-03-29 11:11:47 +01:00
routes: skip invalid filepaths
This commit is contained in:
parent
5cde17a096
commit
a7ee84fc31
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user