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

fix loading sharded checkpoints from subfolder #8798

Merged
merged 4 commits into from
Jul 6, 2024
Merged

Conversation

yiyixuxu
Copy link
Collaborator

@yiyixuxu yiyixuxu commented Jul 5, 2024

needed for this #8796

@yiyixuxu
Copy link
Collaborator Author

yiyixuxu commented Jul 5, 2024

currently we are not able to load shared checkpoints from a subfolder, e.g. cannot load lavender #8796 (comment)

I just added a commit to make it work, feel free to take this over and make it better @sayakpaul

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

@@ -221,7 +221,7 @@ def _fetch_index_file(
local_files_only=local_files_only,
token=token,
revision=revision,
subfolder=subfolder,
subfolder=None,
Copy link
Member

Choose a reason for hiding this comment

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

Why should this be None, though?

Copy link
Member

Choose a reason for hiding this comment

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

That is because subfolder is already determined here:

index_file_in_repo = Path(

@sayakpaul
Copy link
Member

@yiyixuxu thanks! I added two commits:

  • Use os.path.join.
  • Added a test.

I think the PR should be good to merge after you review it.

@yiyixuxu yiyixuxu merged commit 9e9ed35 into main Jul 6, 2024
18 checks passed
@yiyixuxu yiyixuxu deleted the shard-subfolder branch July 6, 2024 21:32
sayakpaul added a commit that referenced this pull request Dec 23, 2024
* fix load sharded checkpoints from subfolder{

* style

* os.path.join

* add a small test

---------

Co-authored-by: sayakpaul <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.

3 participants