Skip to content

Conversation

@sayakpaul
Copy link
Member

@sayakpaul sayakpaul commented Dec 15, 2023

What does this PR do?

Potentially fixes: #6089. #6110 is related too. I decided to throw an error rather than trying to engineer a solution. I think that's best here because _best_guess_weight_name() solves a particular use case and I don't think we should overengineer it.

Copy link
Collaborator

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

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

Looks good to me @sayakpaul! Thanks for working on this. Agree with you that if another more complete solution already exists then let's not spend too much time maintaining this use case.

f for f in os.listdir(pretrained_model_name_or_path_or_dict) if f.endswith(file_extension)
]
else:
elif not local_files_only:
Copy link
Collaborator

@Wauplin Wauplin Dec 15, 2023

Choose a reason for hiding this comment

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

I don't understand why this change. Given we raise an exception above if local_files_only is True, then it's not needed to check it here, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right. Resolved in 88b93c9.

@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 sayakpaul merged commit a81334e into main Dec 16, 2023
donhardman pushed a commit to donhardman/diffusers that referenced this pull request Dec 18, 2023
… ofline (huggingface#6184)

* add an error message when dealing with _best_guess_weight_name ofline

* simplify condition
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
… ofline (huggingface#6184)

* add an error message when dealing with _best_guess_weight_name ofline

* simplify condition
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
… ofline (huggingface#6184)

* add an error message when dealing with _best_guess_weight_name ofline

* simplify condition
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.

Loading LORA weights with load_lora_weights do not respect HF_HUB_OFFLINE / local_file_only

5 participants