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

[LoRA] fix conversion utility so that lora dora loads correctly #8688

Merged
merged 3 commits into from
Jun 27, 2024

Conversation

sayakpaul
Copy link
Member

What does this PR do?

I broke the external DoRA checkpoint loading support in #8295. Not sure how it got slipped in my testing. From https://github.com/huggingface/diffusers/actions/runs/9654288185/jobs/19382757500/summary_raw, I checked that the integration was broken.

This PR fixes that.

@@ -214,7 +214,7 @@ def _convert_non_diffusers_lora_to_diffusers(state_dict, unet_name="unet", text_
if len(state_dict) > 0:
raise ValueError(f"The following keys have not been correctly renamed: \n\n {', '.join(state_dict.keys())}")

logger.info("Kohya-style checkpoint detected.")
logger.info("Non-diffusers checkpoint detected.")
Copy link
Member Author

Choose a reason for hiding this comment

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

At this point a checkpoint can be of any supported type: BenTrainer, Kohya, OneTrainer, etc.

@sayakpaul sayakpaul marked this pull request as ready for review June 25, 2024 04:35
@sayakpaul sayakpaul requested a review from yiyixuxu June 25, 2024 04:35
@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.

@sayakpaul
Copy link
Member Author

Failing test is unrelated.

@sayakpaul sayakpaul merged commit adbb048 into main Jun 27, 2024
17 of 18 checks passed
@sayakpaul sayakpaul deleted the fix-dora-loading branch June 27, 2024 03:28
sayakpaul added a commit that referenced this pull request Jun 27, 2024
fix conversion utility so that lora dora loads correctly
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