Skip to content

Commit 4c355d8

Browse files
authored
Merge pull request #1143 from SlncTrZ/CntrB/fix/security/unsafe-loading-of-pytorch-models-pickle-
Security: Unsafe Loading of PyTorch Models (Pickle RCE)
2 parents d744148 + cfecb3e commit 4c355d8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

manga_translator/inpainting/ldm/modules/midas/midas/base_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def load(self, path):
88
Args:
99
path (str): file path
1010
"""
11-
parameters = torch.load(path, map_location=torch.device('cpu'))
11+
parameters = torch.load(path, map_location=torch.device('cpu'), weights_only=True)
1212

1313
if "optimizer" in parameters:
1414
parameters = parameters["model"]

0 commit comments

Comments
 (0)