Skip to content

Conversation

@winglian
Copy link
Contributor

@winglian winglian commented Dec 2, 2025

What does this PR do?

#41993 breaks calls to model.enable_input_require_grads()

stderr: [rank1]:   File "/home/wing/axolotl-dev/src/axolotl/loaders/adapter.py", line 188, in load_adapter
stderr: [rank1]:     model.enable_input_require_grads()
stderr: [rank1]:   File "/home/wing/.venvs/axolotl/lib/python3.11/site-packages/transformers/modeling_utils.py", line 1986, in enable_input_require_grads
stderr: [rank1]:     input_embeddings = module.get_input_embeddings()          
stderr: [rank1]:                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                                        
stderr: [rank1]:   File "/home/wing/.venvs/axolotl/lib/python3.11/site-packages/transformers/modeling_utils.py", line 993, in get_input_embeddings
stderr: [rank1]:     raise NotImplementedError(
stderr: [rank1]: NotImplementedError: `get_input_embeddings` not auto‑handled for SiglipVisionTransformer; please override in the subclass.

Fixes # (issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

Copy link
Member

@zucchini-nlp zucchini-nlp left a comment

Choose a reason for hiding this comment

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

Instead of an try/except, we should add the embedding layer's name for siglip model imo. There might be a few more models though that do not have an input embedding layer. Not sure why we didn't catch them with tests

CC @molbap as well who added the feat :)

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.

3 participants