Skip to content

Commit

Permalink
add compability to torch 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
helpmefindaname committed Jan 31, 2025
1 parent e2865f7 commit 79aa337
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion flair/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 79aa337

Please sign in to comment.