From ac2e91d6fdeb21940c8edf5ec232e7e36f655b28 Mon Sep 17 00:00:00 2001 From: marvinfriede <51965259+marvinfriede@users.noreply.github.com> Date: Thu, 19 Sep 2024 08:45:24 -0500 Subject: [PATCH] Load with `weights_only=True` --- src/tad_dftd3/data/radii.py | 2 +- src/tad_dftd3/reference.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tad_dftd3/data/radii.py b/src/tad_dftd3/data/radii.py index 3a66a47..95ffc34 100644 --- a/src/tad_dftd3/data/radii.py +++ b/src/tad_dftd3/data/radii.py @@ -52,7 +52,7 @@ def _load_vdw_rad_d3( VDW radii. """ path = op.join(op.dirname(__file__), "vdw-d3.pt") - return torch.load(path).type(dtype).to(device) + return torch.load(path, weights_only=True).to(device=device, dtype=dtype) VDW_D3 = _load_vdw_rad_d3() diff --git a/src/tad_dftd3/reference.py b/src/tad_dftd3/reference.py index 5c71fea..e9d2330 100644 --- a/src/tad_dftd3/reference.py +++ b/src/tad_dftd3/reference.py @@ -178,7 +178,7 @@ def _load_c6( Reference C6 coefficients. """ path = op.join(op.dirname(__file__), "reference-c6.pt") - return torch.load(path).type(dtype).to(device) + return torch.load(path, weights_only=True).to(device=device, dtype=dtype) class Reference: