Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make hf_olmo support new transformers versions #556

Merged
merged 5 commits into from
Apr 24, 2024

Conversation

2015aroras
Copy link
Collaborator

hf_olmo and the OLMo integration into transformers are not compatible, since both try to register a model from the string "olmo". In particular, hf_olmo fails to import. This change makes hf_olmo not register the model & config when the new transformers version is present. Thus:

  • On old versions, AutoModelForCausalLM.from_pretrained("allenai/OLMo-1B") will work properly as before (if hf_olmo is imported). AutoModelForCausalLM.from_pretrained("allenai/OLMo-1B-hf") will break.
  • On new versions, AutoModelForCausalLM.from_pretrained("allenai/OLMo-1B") will break (none of the weights will get loaded). AutoModelForCausalLM.from_pretrained("allenai/OLMo-1B-hf") will work properly. Using OLMoForCausalLM.from_pretrained("allenai/OLMo-1B") with OLMoForCausalLM from hf_olmo will work just like in old versions.

Copy link
Member

@epwalsh epwalsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@2015aroras 2015aroras merged commit 3b16e21 into main Apr 24, 2024
10 of 11 checks passed
@2015aroras 2015aroras deleted the shanea/make-hf-olmo-support-new-transformers branch April 24, 2024 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants