diff --git a/belt_nlp/bert.py b/belt_nlp/bert.py index cd049c3..395295e 100644 --- a/belt_nlp/bert.py +++ b/belt_nlp/bert.py @@ -149,7 +149,7 @@ def load(cls, model_dir: str, device: str = "cuda:0", many_gpus: bool = False) - with open(file=model_dir / "params.json", mode="r", encoding="utf-8") as file: params = json.load(file) tokenizer = AutoTokenizer.from_pretrained(model_dir) - neural_network = torch.load(f=model_dir / "model.bin", map_location=device) + neural_network = torch.load(f=model_dir / "model.bin", map_location=device, weights_only=False) return cls( **params, tokenizer=tokenizer,