GLiNER icon indicating copy to clipboard operation
GLiNER copied to clipboard

cannot import name 'ALL_LAYERNORM_LAYERS' from 'transformers.trainer'

Open ffletcherr opened this issue 5 months ago • 2 comments

error:

cannot import name 'ALL_LAYERNORM_LAYERS' from 'transformers.trainer'

when:

from gliner.training import Trainer, TrainingArguments

https://github.com/huggingface/transformers/pull/38922

transformers>=4.53.1 gliner>=0.2.21


downgrade to transformers==4.52.4 fixed this.

ffletcherr avatar Jul 06 '25 23:07 ffletcherr

change to from transformers.pytorch_utils import ALL_LAYERNORM_LAYERS

JunrQ avatar Jul 20 '25 06:07 JunrQ

https://huggingface.co/knowledgator/modern-gliner-bi-large-v1.0

if we want a clean install , even these worked for me with python 3.11.9

pip install gliner -U #latest gliner pip install git+https://github.com/huggingface/transformers.git #latest transformer

still have to do this tho change to from transformers.pytorch_utils import ALL_LAYERNORM_LAYERS

dcrey7 avatar Jul 21 '25 18:07 dcrey7