transformers - ✅(Solved) Fix Many import errors after update from 4.57.0 to 5.5.0 [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
huggingface/transformers#45278Fetched 2026-04-08 03:00:49
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Timeline (top)
commented ×1labeled ×1

PR fix notes

PR #3603: bump transformers to 5.5.4 and trl to latest 1.1.0

Description (problem / solution / changelog)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

Summary by CodeRabbit

  • Chores
    • Updated transformers dependency to version 5.5.4
    • Updated trl dependency to version 1.1.0
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Changed files

  • requirements.txt (modified, +6/-6)
  • src/axolotl/cli/utils/lora_merge.py (modified, +28/-6)
  • src/axolotl/loaders/adapter.py (modified, +109/-0)
RAW_BUFFERClick to expand / collapse

System Info

After updating Transformers from version 4.57.0 to version 5.5.0, I get the following import errors: ImportError: cannot import name 'HybridCache' from 'transformers' ImportError: cannot import name 'AutoModelForVision2Seq' from 'transformers' ImportError: cannot import name 'PretrainedConfig' from 'transformers.modeling_utils'

What should I do to avoid them?

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

from transformers.modeling_utils import PretrainedConfig, PreTrainedModel from transformers import Cache, DynamicCache, EncoderDecoderCache, HybridCache, PreTrainedModel

Expected behavior

No import errors

extent analysis

TL;DR

Check the documentation for version 5.5.0 of the Transformers library to ensure that the imported classes and functions are still available and have not been deprecated or moved.

Guidance

  • Review the release notes and documentation for version 5.5.0 of the Transformers library to see if there have been any changes to the imported classes and functions.
  • Verify that the import statements are correct and match the documentation for version 5.5.0.
  • Consider downgrading to version 4.57.0 if the imported classes and functions are no longer available in version 5.5.0.
  • Check if there are any alternative classes or functions that can be used instead of the deprecated ones.

Example

No code snippet is provided as it is not clearly supported by the issue.

Notes

The issue may be due to changes in the library's API between versions 4.57.0 and 5.5.0. Without more information about the library's documentation and release notes, it is difficult to provide a more specific solution.

Recommendation

Apply workaround: Check the library's documentation and release notes to find alternative classes or functions, or consider downgrading to version 4.57.0 if necessary, as the imported classes and functions may have been deprecated or removed in version 5.5.0.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

No import errors

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING