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

[from_single_file()]fix: local single file loading. #5440

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

sayakpaul
Copy link
Member

@sayakpaul sayakpaul commented Oct 18, 2023

Fixes #5390.

In favor of closing: #5439. Copying over what I said in #5439:

TL;DR: It's a must for the user to locally save the tokenizers and configurations under the same paths (such as "openai/clip-vit-large-patch14") to ensure local_files_only=True works in the right manner.

Here is an end-to-end demonstration of how this should be done:
https://colab.research.google.com/gist/sayakpaul/b086a1089f6723d3aa01b67f77f1ebbc/scratchpad.ipynb

@@ -2832,6 +2832,7 @@ def from_single_file(cls, pretrained_model_link_or_path, **kwargs):
tokenizer=tokenizer,
original_config_file=original_config_file,
config_files=config_files,
local_files_only=local_files_only,
Copy link
Member Author

Choose a reason for hiding this comment

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

We never actually passed it to the method.

Copy link
Contributor

@patrickvonplaten patrickvonplaten left a comment

Choose a reason for hiding this comment

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

Very nice! Thanks for the fix

@sayakpaul sayakpaul merged commit 87fd3ce into main Oct 18, 2023
13 checks passed
@sayakpaul sayakpaul deleted the fix/local-loading-single-file branch October 18, 2023 12:03
mhetrerajat pushed a commit to mhetrerajat/diffusers that referenced this pull request Oct 23, 2023
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
@Louis24
Copy link

Louis24 commented Jan 16, 2024

Fixes #5390.

In favor of closing: #5439. Copying over what I said in #5439:

TL;DR: It's a must for the user to locally save the tokenizers and configurations under the same paths (such as "openai/clip-vit-large-patch14") to ensure local_files_only=True works in the right manner.

Here is an end-to-end demonstration of how this should be done: https://colab.research.google.com/gist/sayakpaul/b086a1089f6723d3aa01b67f77f1ebbc/scratchpad.ipynb

yep, thank you for this info,could specify the path like: "C:\Zero\Python\AIGC\Stable Diffusion WebUI Q v4.4.cache\huggingface\hub\models--openai--clip-vit-large-patch14"?

AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
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.

SDXL pipeline downloads text encoder even when local_files_only=True
3 participants