Skip to content

Commit

Permalink
Fix weights-manifest change check
Browse files Browse the repository at this point in the history
The weights are changed if there is no cache (no previous value) or the
value differs.

Signed-off-by: Iskren Chernev <[email protected]>
  • Loading branch information
ichernev committed Aug 1, 2023
1 parent 02c4a3e commit 3f17d74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/image/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func Build(cfg *config.Config, dir, imageName string, secrets []string, noCache,
return fmt.Errorf("Failed to generate weights manifest: %w", err)
}
cachedManifest, err := weights.LoadManifest(weightsManifestPath)
changed := err != nil && weightsManifest.Equal(cachedManifest)
changed := cachedManifest == nil || !weightsManifest.Equal(cachedManifest)

Check failure on line 54 in pkg/image/build.go

View workflow job for this annotation

GitHub Actions / Test Go (ubuntu-latest-8-cores)

ineffectual assignment to err (ineffassign)

Check failure on line 54 in pkg/image/build.go

View workflow job for this annotation

GitHub Actions / Test Go (macos-12)

ineffectual assignment to err (ineffassign)
if changed {
if err := buildWeightsImage(dir, weightsDockerfile, imageName+"-weights", secrets, noCache, progressOutput); err != nil {
return fmt.Errorf("Failed to build model weights Docker image: %w", err)
Expand Down

0 comments on commit 3f17d74

Please sign in to comment.