mirror of
https://github.com/ollama/ollama.git
synced 2025-07-28 16:33:09 +02:00
Merge pull request #4295 from ollama/mxyng/fix-list
routes: skip invalid filepaths
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user