Content Summary Upgrading transformers to >=4.54 causes an ImportError in eagle/model/modeling_qwen3_kv.py due to the removal of transformers.utils.LossKwargs. Pinning transformers to 4.53.3 works, but newer versions fail to import and the program cannot start.
Environment
OS: Linux Ubuntu 22.04.3 LTS
Python: 3.9 (also reproducible on 3.13)
torch: 2.6.0
transformers: >=4.54 fails, 4.53.3 works
Steps to Reproduce
Install transformers>=4.54
Run:
python -m eagle.evaluation.gen_ea_answer_llama3chat
--ea-model-path yuhuili/EAGLE3-LLaMA3.1-Instruct-8B
--base-model-path meta-llama/Llama-3.1-8B-Instruct
Actual Behavior:
ImportError: cannot import name 'LossKwargs' from 'transformers.utils'
at eagle/model/modeling_qwen3_kv.py:44
from transformers.utils import LossKwargs, auto_docstring, can_return_tuple, logging