From 97f1a52f31c96bd5dfe4a8e250fbd7ee4067916c Mon Sep 17 00:00:00 2001 From: evelynmitchell Date: Fri, 9 Feb 2024 18:40:54 -0700 Subject: [PATCH] torchfix lint --- swarms/utils/load_model_torch.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/swarms/utils/load_model_torch.py b/swarms/utils/load_model_torch.py index 53649e93..000ba299 100644 --- a/swarms/utils/load_model_torch.py +++ b/swarms/utils/load_model_torch.py @@ -38,13 +38,14 @@ def load_model_torch( try: if model is None: model = torch.load( - model_path, map_location=map_location, *args, **kwargs + model_path, map_location=map_location, weights_only=True, *args, **kwargs ) else: model.load_state_dict( torch.load( model_path, map_location=map_location, + weights_only=True, *args, **kwargs, ),