From ec02ee9852d15adf80efb62a5596a79e3959fb74 Mon Sep 17 00:00:00 2001 From: Nikos Livathinos Date: Tue, 21 Apr 2026 11:02:46 +0200 Subject: [PATCH] fix: Load TableFormer model with torch.load(..., weights_only=True) Signed-off-by: Nikos Livathinos --- docling_ibm_models/tableformer/models/common/base_model.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docling_ibm_models/tableformer/models/common/base_model.py b/docling_ibm_models/tableformer/models/common/base_model.py index 2ed6ff8..2bda350 100644 --- a/docling_ibm_models/tableformer/models/common/base_model.py +++ b/docling_ibm_models/tableformer/models/common/base_model.py @@ -254,7 +254,9 @@ def _load_best_checkpoint(self): "Loading model checkpoint file: {}".format(checkpoint_file) ) saved_model = torch.load( - checkpoint_file, map_location=self._device, weights_only=False + checkpoint_file, + map_location=self._device, + weights_only=True, ) return saved_model, checkpoint_file except RuntimeError: