Skip to content

[DiffusionPipeline] Deprecate not throwing error when loading non-existant variant #4011

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 5 commits into from
Jul 10, 2023

Conversation

patrickvonplaten
Copy link
Contributor

@patrickvonplaten patrickvonplaten commented Jul 9, 2023

What does this PR do?

Thanks for pointing out this problem @vladmandic . Upon thinking about it, I don't think we should even allow default to fp32 when trying to load "fp16" variants. Added a deprecation warning now.

Note that one can very easily test with this function if the variant is present: https://github.com/huggingface/diffusers/pull/4011/files#r1257526906

So ideally this should be done before downloading - e.g. via:

from huggingface_hub import model_info

info = model_info("<your/repo/id>")
filenames = {sibling.rfilename for sibling in info.siblings}

We can however also very easily check post-download what variants have been downloaded as shown here: #4011 (comment)


filenames = get_all_filenames(str(cached_folder))

all_model_files, variant_model_files = variant_compatible_siblings(filenames, variant=variant)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's how one can easily test which variant was downloaded

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jul 9, 2023

The documentation is not available anymore as the PR was closed or merged.

@vladmandic
Copy link
Contributor

LGTM, thanks @patrickvonplaten

@patrickvonplaten patrickvonplaten merged commit e4f6c37 into main Jul 10, 2023
@patrickvonplaten patrickvonplaten deleted the fix_variant branch July 10, 2023 10:12
patrickvonplaten added a commit that referenced this pull request Jul 11, 2023
…stant variant (#4011)

* Deprecate variant nicely

* make style

* Apply suggestions from code review

Co-authored-by: Sayak Paul <[email protected]>

* Apply suggestions from code review

Co-authored-by: Pedro Cuenca <[email protected]>

---------

Co-authored-by: Sayak Paul <[email protected]>
Co-authored-by: Pedro Cuenca <[email protected]>
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
…stant variant (huggingface#4011)

* Deprecate variant nicely

* make style

* Apply suggestions from code review

Co-authored-by: Sayak Paul <[email protected]>

* Apply suggestions from code review

Co-authored-by: Pedro Cuenca <[email protected]>

---------

Co-authored-by: Sayak Paul <[email protected]>
Co-authored-by: Pedro Cuenca <[email protected]>
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
…stant variant (huggingface#4011)

* Deprecate variant nicely

* make style

* Apply suggestions from code review

Co-authored-by: Sayak Paul <[email protected]>

* Apply suggestions from code review

Co-authored-by: Pedro Cuenca <[email protected]>

---------

Co-authored-by: Sayak Paul <[email protected]>
Co-authored-by: Pedro Cuenca <[email protected]>
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.

5 participants