transformers - 💡(How to fix) Fix ImportError: cannot import name 'AutoModelWithLMHead' from 'transformers'

Official PRs (…)
ON THIS PAGE

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…

Error Message

Hi, I am in a virtual conda environment, trying to import AutoModelWithLMHead, AutoTokenizer, and EsmModel. I can't change the models being used, because I am trying to recreate a peer-reviewed source model code. I have installed pytorch (2.12.0), and transformers (5.10.0.dev0). When I go to load in the requisite packages, I get the error that the module(s) listed does not exist. Any assistance on this would be very appreciated, thank you!

Root Cause

Hi, I am in a virtual conda environment, trying to import AutoModelWithLMHead, AutoTokenizer, and EsmModel. I can't change the models being used, because I am trying to recreate a peer-reviewed source model code. I have installed pytorch (2.12.0), and transformers (5.10.0.dev0). When I go to load in the requisite packages, I get the error that the module(s) listed does not exist. Any assistance on this would be very appreciated, thank you!

RAW_BUFFERClick to expand / collapse

Hi, I am in a virtual conda environment, trying to import AutoModelWithLMHead, AutoTokenizer, and EsmModel. I can't change the models being used, because I am trying to recreate a peer-reviewed source model code. I have installed pytorch (2.12.0), and transformers (5.10.0.dev0). When I go to load in the requisite packages, I get the error that the module(s) listed does not exist. Any assistance on this would be very appreciated, thank you!

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING