Transformers error?

Author: WindowsNTCreated Nov 2, 2025Updated Nov 2, 2025

Just tried it in a fresh windows installation

ImportError: cannot import name 'apply_chunking_to_forward' from 'transformers.modeling_utils' (F:\TP2Modules\img\lib\site-packages\transformers\modeling_utils.py)

It used to work in the past. Perhaps you can add

from transformers.pytorch_utils import apply_chunking_to_forward # change modeling_utils to pytorch_utils