Skip to content

Fix local_files_only for checkpoints with shards #10294

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 1 commit into from
Dec 19, 2024

Conversation

hlky
Copy link
Contributor

@hlky hlky commented Dec 18, 2024

What does this PR do?

Discussed internally https://huggingface.slack.com/archives/C07S1S33BQD/p1734513644104739

Works if we just let huggingface_hub handle local_files_only. Also tested with the cases from #8913 and #8898

from huggingface_hub import snapshot_download
from diffusers import UNet2DConditionModel

ckpt_path = snapshot_download("hf-internal-testing/unet2d-sharded-dummy-subfolder")
loaded_model = UNet2DConditionModel.from_pretrained(ckpt_path, subfolder="unet", local_files_only=True)

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.

cc @yiyixuxu

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

Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

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

thanks!

@yiyixuxu yiyixuxu requested a review from DN6 December 18, 2024 22:29
@yiyixuxu yiyixuxu merged commit 074798b into huggingface:main Dec 19, 2024
12 checks passed
Foundsheep pushed a commit to Foundsheep/diffusers that referenced this pull request Dec 23, 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.

4 participants