From 79aa33706e7f753f2edf962feb1d75de22af0d1d Mon Sep 17 00:00:00 2001 From: Benedikt Fuchs Date: Fri, 31 Jan 2025 14:09:37 +0100 Subject: [PATCH] add compability to torch 2.6 --- flair/file_utils.py | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flair/file_utils.py b/flair/file_utils.py index 518d69e809..53fac0f75b 100644 --- a/flair/file_utils.py +++ b/flair/file_utils.py @@ -382,4 +382,4 @@ def load_torch_state(model_file: str) -> dict[str, typing.Any]: # to load models on some Mac/Windows setups # see https://github.com/zalandoresearch/flair/issues/351 f = load_big_file(model_file) - return torch.load(f, map_location="cpu") + return torch.load(f, map_location="cpu", weights_only=False) diff --git a/requirements.txt b/requirements.txt index 2704114ace..39cf750c66 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,7 +17,7 @@ scikit-learn>=1.0.2 segtok>=1.5.11 sqlitedict>=2.0.0 tabulate>=0.8.10 -torch>=1.5.0,!=1.8 +torch>=1.13.1 tqdm>=4.63.0 transformer-smaller-training-vocab>=0.2.3 transformers[sentencepiece]>=4.25.0,<5.0.0