urchade / GLiNER

Generalist and Lightweight Model for Named Entity Recognition (Extract any entity types from texts) @ NAACL 2024
https://arxiv.org/abs/2311.08526
Apache License 2.0
1.48k stars 127 forks source link

Require torch>=2.1.0 #84

Closed GiCollini closed 5 months ago

GiCollini commented 6 months ago

Within the class method _from_pretrained in module model.py of latest version of the package (currently gliner==0.1.12) there is the following call (line 421) model.load_state_dict(state_dict, strict=strict, assign=True) where model is a torch.nn.Module. Despite in the requirements.txt it is state that the package require torch>=2.0.0, only for torch>=2.1.0 the method load_state_dict admits an argument assign.

urchade commented 5 months ago

Should be fixed now