Skip to content

Commit 059625b

Browse files
committed
fix future warning with torch.load
1 parent 28e14f4 commit 059625b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/tests_pytorch/callbacks/test_model_checkpoint_manual_opt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def test_model_checkpoint_manual_opt():
110110
model_before_opt = load_model(best_step, model.saved_models)
111111
# Load the best checkpoint
112112
best_ckpt_path = trainer.checkpoint_callback.best_model_path
113-
best_ckpt = torch.load(best_ckpt_path)["state_dict"]
113+
best_ckpt = torch.load(best_ckpt_path, weights_only=True)["state_dict"]
114114

115115
# The checkpoint should match the model before opt.step(), not after
116116
for layer_name, layer_value in best_ckpt.items():

0 commit comments

Comments
 (0)