explosion / spaCy

💫 Industrial-strength Natural Language Processing (NLP) in Python
https://spacy.io
MIT License
30.37k stars 4.41k forks source link

User Warning Transformer with Torch #13475

Open hdaipteam opened 7 months ago

hdaipteam commented 7 months ago

How to reproduce the behaviour

nlp = spacy.load("en_core_web_sm")

Your Environment

I cought the warning if I am loading the pre-defined model in both version of SpaCy Latest / Dev

python3.11/site-packages/transformers/utils/generic.py:441: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead. _torch_pytree._register_pytree_node(

jefhil commented 6 months ago

I assume this is harmless but users see warnings like this and get worried. Any idea when this warning will go away?

nablabits commented 5 months ago

It seems that this was fixed back on Jan 3rd (source). It appears to me that Spacy does not require transformers (source), however spacy-transformers does (source) and allows for transformers >=3.4.0,<4.42.0 . The commit that fixed this belongs to 4.37.0 so @hdaipteam you might want to bump your local version of transformers

Bonnevie commented 1 month ago

@nablabits I have been trying to fix the warning this morning, but it seems that the current latest version of spacy-transformers doesn't have the relaxed constraint that is in the master branch, but rather has <4.37.0? I got this commit from the version tag: https://github.com/explosion/spacy-transformers/blob/ba6bf8202662f59aa1862bd4c5dd6fd0119a3335/requirements.txt

nablabits commented 4 weeks ago

Hey @Bonnevie, sorry the late reply, it appears to me that you are pointing to the commit on Apr 23rd, whereas mine points to May 30th, source, which is the latest one. Does this make sense on your end?