Skip to content

Commit d5a4526

Browse files
committed
fix: load code formula model with torch.load weights_only=True
Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
1 parent 6d4043c commit d5a4526

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • docling_ibm_models/code_formula_model/models

docling_ibm_models/code_formula_model/models/sam.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ def _build_sam(
508508

509509
if checkpoint is not None:
510510
# with open(checkpoint, "rb") as f:
511-
state_dict = torch.load(checkpoint)
511+
state_dict = torch.load(checkpoint, weights_only=True)
512512

513513
image_encoder.load_state_dict(state_dict, strict=True)
514514
return image_encoder

0 commit comments

Comments
 (0)