Skip to content

Conversation

@luaenrique
Copy link
Contributor

@luaenrique luaenrique commented Oct 27, 2025

What does this PR do?

Fixes #41902

This PR prevents tokens from being passed twice when loading adapters in from_pretrained. Fixes TypeError: find_adapter_config_file() got multiple values for keyword argument 'token'.

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.

@Rocketknight1
Copy link
Member

Happy to merge the quick fix, since it seems safe! There might be a slightly cleaner way to avoid tokens ending up in those kwargs in the first place, but we can worry about that later, it's much less urgent.

@luaenrique
Copy link
Contributor Author

Happy to merge the quick fix, since it seems safe! There might be a slightly cleaner way to avoid tokens ending up in those kwargs in the first place, but we can worry about that later, it's much less urgent.

I will explore a different way of doing it in my spare time and share with you here when I get the proper time :) thanks!

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@Rocketknight1 Rocketknight1 enabled auto-merge (squash) October 28, 2025 15:06
@Rocketknight1 Rocketknight1 merged commit 4d0b675 into huggingface:main Oct 28, 2025
23 checks passed
i3hz pushed a commit to i3hz/transformers that referenced this pull request Oct 30, 2025
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.

Cannot load models in latest transformers version

3 participants