Skip to content

Revert error to warning when loading LoRA from repo with multiple weights #11568

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

Merged
merged 1 commit into from
May 19, 2025

Conversation

apolinario
Copy link
Collaborator

@apolinario apolinario commented May 17, 2025

What does this PR do?

Reverts back from a raised error to a warning if a LoRA repository contains multiple *.safetensors files.

Pros:

  1. Avoids applications breaking if a 3rd party does an action, scenario: a LoRA repo had a single LoRA, so the codebase works. Then, the LoRa repo author uploads a second LoRA to the repo. Now the app breaks due to the action of the 3rd party
  2. More Hub-centric: users can just pass the Hub nicename of a LoRA without worrying too much about weight-names (not an obvious interaction on the Hub to get weight names)

I know there are pros and cons and I'm sure this has been discussed before. But this is such a simple PR that I just did it in case it's helpful. Feel free to reject/close if not aligned and happy to further discuss in case we can find some other solution.

Before submitting

Who can review?

@yiyixuxu @sayakpaul @BenjaminBossan

@apolinario apolinario changed the title Revert error to warning when loading LoRA from repo with multiple wei… May 17, 2025
@apolinario apolinario marked this pull request as draft May 17, 2025 04:07
@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.

Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

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

I don't mind it.

@DN6 DN6 marked this pull request as ready for review May 19, 2025 08:03
@DN6 DN6 merged commit 915c537 into main May 19, 2025
33 checks passed
@DN6 DN6 added the roadmap Add to current release roadmap label Jun 5, 2025
@DN6 DN6 moved this from In Progress to Done in Diffusers Roadmap 0.34 Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
roadmap Add to current release roadmap
4 participants