cannot import name 'ALL_LAYERNORM_LAYERS' from 'transformers.trainer'
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.
change to from transformers.pytorch_utils import ALL_LAYERNORM_LAYERS
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