parser: fix parsing Modelfiles with multiple FROM commands (#8449)

This commit is contained in:
Jeffrey Morgan 2025-01-16 00:14:04 -08:00 committed by GitHub
parent 93a8daf285
commit 42cf4db601
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 4 deletions

View file

@ -62,7 +62,13 @@ func (f Modelfile) CreateRequest(relativeDir string) (*api.CreateRequest, error)
return nil, err
}
req.Files = digestMap
if req.Files == nil {
req.Files = digestMap
} else {
for k, v := range digestMap {
req.Files[k] = v
}
}
case "adapter":
path, err := expandPath(c.Args, relativeDir)
if err != nil {