spaCy icon indicating copy to clipboard operation
spaCy copied to clipboard

User Warning Transformer with Torch

Open hdaipteam opened this issue 1 year ago • 4 comments

How to reproduce the behaviour

nlp = spacy.load("en_core_web_sm")

Your Environment

  • Operating System: Ubuntu 22.04
  • Python Version Used: 3.11
  • spaCy Version Used: 3.7.2 - latest / 4.0.0-dev
  • Environment Information: IPyNotebook

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(

hdaipteam avatar May 03 '24 11:05 hdaipteam

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

jefhil avatar May 09 '24 13:05 jefhil

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

nablabits avatar Jun 08 '24 18:06 nablabits