github.com/anchore/syft@v1.38.2/syft/pkg/cataloger/ai/package.go (about)

     1  package ai
     2  
     3  import (
     4  	"github.com/anchore/syft/syft/file"
     5  	"github.com/anchore/syft/syft/pkg"
     6  )
     7  
     8  func newGGUFPackage(metadata *pkg.GGUFFileHeader, modelName, version, license string, locations ...file.Location) pkg.Package {
     9  	p := pkg.Package{
    10  		Name:      modelName,
    11  		Version:   version,
    12  		Locations: file.NewLocationSet(locations...),
    13  		Type:      pkg.ModelPkg,
    14  		Licenses:  pkg.NewLicenseSet(pkg.NewLicensesFromValues(license)...),
    15  		Metadata:  *metadata,
    16  		// NOTE: PURL is intentionally not set as the package-url spec
    17  		// has not yet finalized support for ML model packages
    18  	}
    19  	p.SetID()
    20  
    21  	return p
    22  }