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 f84143e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/image/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ func Build(cfg *config.Config, dir, imageName string, secrets []string, noCache,
if err != nil {
return fmt.Errorf("Failed to generate weights manifest: %w", err)
}
cachedManifest, err := weights.LoadManifest(weightsManifestPath)
changed := err != nil && weightsManifest.Equal(cachedManifest)
cachedManifest, _ := weights.LoadManifest(weightsManifestPath)
changed := cachedManifest == nil || !weightsManifest.Equal(cachedManifest)
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 f84143e

Please sign in to comment.