MCPcopy
hub / github.com/mudler/LocalAI / SafetyScanGalleryModel

Function SafetyScanGalleryModel

core/gallery/models.go:488–497  ·  view source on GitHub ↗
(galleryModel *GalleryModel)

Source from the content-addressed store, hash-verified

486}
487
488func SafetyScanGalleryModel(galleryModel *GalleryModel) error {
489 for _, file := range galleryModel.AdditionalFiles {
490 scanResults, err := downloader.HuggingFaceScan(downloader.URI(file.URI))
491 if err != nil && errors.Is(err, downloader.ErrUnsafeFilesFound) {
492 xlog.Error("Contains unsafe file(s)!", "model", galleryModel.Name, "clamAV", scanResults.ClamAVInfectedFiles, "pickles", scanResults.DangerousPickles)
493 return err
494 }
495 }
496 return nil
497}

Callers 2

RunMethod · 0.92
SafetyScanGalleryModelsFunction · 0.85

Calls 4

HuggingFaceScanFunction · 0.92
URITypeAlias · 0.92
IsMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected