Skip to content

fix: ValueError when using FromOriginalModelMixin in subclasses #8440 #8454

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 8 commits into from
Jun 28, 2024

Conversation

luocfprime
Copy link
Contributor

(cherry picked from commit 9285997)

What does this PR do?

Fixes # (issue)

#8440

Before submitting

import torch

from diffusers import AutoencoderKL


class MyVAE(AutoencoderKL):
    pass


if __name__ == "__main__":
    MyVAE.from_single_file("./checkpoints/realisticVisionV51_v51VAE.safetensors",
                           subfolder="vae",
                           torch_dtype=torch.float16,
                           use_safetensors=True)

    print("done.")

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.

@DN6

luocfprime and others added 2 commits June 11, 2024 20:46
@luocfprime
Copy link
Contributor Author

I made 2 commits to 1. resolve the review, 2. remove the redundant code fragments of the original code

@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.

@DN6
Copy link
Collaborator

DN6 commented Jun 17, 2024

Hi @fkcptlst I will resolve the issues with the CI and merge this soon. Thanks for being patient.

@DN6 DN6 merged commit a216b0b into huggingface:main Jun 28, 2024
15 checks passed
@luocfprime luocfprime deleted the patch-#8440 branch June 28, 2024 11:47
sayakpaul added a commit that referenced this pull request Dec 23, 2024
…#8454)

* fix: ValueError when using FromOriginalModelMixin in subclasses #8440

(cherry picked from commit 9285997)

* Update src/diffusers/loaders/single_file_model.py

Co-authored-by: Dhruv Nair <dhruv.nair@gmail.com>

* Update single_file_model.py

* Update single_file_model.py

---------

Co-authored-by: Dhruv Nair <dhruv.nair@gmail.com>
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
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.

4 participants