From cf21c49fd8b6bbed223cda0efb979ba78397cfbf Mon Sep 17 00:00:00 2001 From: Ghislain Vaillant Date: Mon, 31 Mar 2025 11:27:44 +0200 Subject: [PATCH] BUG: Set weights_only to False explicitly Due to a change of default value since PyTorch v2.6 Co-Authored-By: Vincent Zossou --- medkit/text/ner/nlstruct_entity_matcher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/medkit/text/ner/nlstruct_entity_matcher.py b/medkit/text/ner/nlstruct_entity_matcher.py index a8bb7493..03cfa7cd 100644 --- a/medkit/text/ner/nlstruct_entity_matcher.py +++ b/medkit/text/ner/nlstruct_entity_matcher.py @@ -128,7 +128,7 @@ def _load_from_checkpoint_dir(checkpoint_dir: Path, device): # Force the filename to use the checkpoint directory checkpoint_filepath = checkpoint_filepaths[0] - loaded = torch.load(checkpoint_filepath, map_location=device) + loaded = torch.load(checkpoint_filepath, map_location=device, weights_only=False) config = loaded["config"] # modify config if the encoder is a 'concat'model