Skip to content

Commit b35e3c4

Browse files
fix(dinov2_loader): adjust comment placement for clarity in weight loading
1 parent cdacd08 commit b35e3c4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/anomalib/models/components/dinov2/dinov2_loader.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ def _load_weights(
185185

186186
# Weights_only is set to True
187187
# See mitigation details in https://github.com/open-edge-platform/anomalib/pull/2729
188-
state_dict = torch.load(weight_path, map_location="cpu", weights_only=True) # nosec B614 # nosemgrep: trailofbits.python.pickles-in-pytorch.pickles-in-pytorch
188+
# nosemgrep: trailofbits.python.pickles-in-pytorch.pickles-in-pytorch
189+
state_dict = torch.load(weight_path, map_location="cpu", weights_only=True) # nosec B614
189190
model.load_state_dict(state_dict, strict=False)
190191

191192
def _get_weight_path(

0 commit comments

Comments
 (0)