Closed rxavier closed 7 months ago
I think you should upgrade the version of flair. Try version 0.13.1
Thanks, that fixed that error but now
TypeError: Module.load_state_dict() got an unexpected keyword argument 'assign'
I think the assign
kwarg was added to torch 2.1.0 and I'm using 2.0.1. Would it be worth it to specify a minimum torch version in GLiNER's reqs or set assign=False
which is the default in torch?
same, you can remove "assign" in the code
I'm not sure whether you're suggesting I edit it for my use case or that I submit a PR with the change.
edit for you use
this is due to mismatch in version, some people encounter the same error
In that case, since GLiNER does not work with torch < 2.1.0
, shouldn't this be specified in the requirements?
python = "^3.8.0" click = "^8.0.1" torch = ">=2.0.0" transformers = "^4.38.2" huggingface-hub = "^0.21.4" flair = "^0.13.1" seqeval = "^1.2.2" tqdm = "^4.66.2"
I don't think those requirements are anywhere in this repo, so it's not something that will be checked when installing GLiNER. In fact, when I first installed it pulled flair==0.6.1.post1
In any case, by using assign
within load_state_dict
you're essentially requiring torch >= 2.1.0
which is higher even.
@rxavier do you still have the issue ? try install newer version of gliner
I'm trying to integrate this model into an existing app that hosts other zero shot models (not for NER though, but there's a lot of shared dependencies).
I went ahead and installed GLiNER. This is my requirements.txt after doing so (python 3.10.4):
And this is the error I'm getting when running the example in this repo's README, with both base and multi models.