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, ),