-
Notifications
You must be signed in to change notification settings - Fork 6.2k
[core] respect local_files_only=True
when using sharded checkpoints
#12005
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
Changes from 7 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
8d431dc
tighten compilation tests for quantization
sayakpaul 69920ef
feat: model_info but local.
sayakpaul d5c1772
up
sayakpaul f38a644
Revert "tighten compilation tests for quantization"
sayakpaul 2d993b7
Merge branch 'main' into local-model-info
sayakpaul 85279df
Merge branch 'main' into local-model-info
sayakpaul d117474
Merge branch 'main' into local-model-info
sayakpaul 71843a0
Merge branch 'main' into local-model-info
sayakpaul fb2397f
up
sayakpaul 832de66
Merge branch 'main' into local-model-info
sayakpaul 01784c3
Merge branch 'main' into local-model-info
sayakpaul b7af511
reviewer feedback.
sayakpaul 04cd2dc
reviewer feedback.
sayakpaul 1c528a4
up
sayakpaul 1b939e5
up
sayakpaul 2a9734f
empty
sayakpaul 09e063c
Merge branch 'main' into local-model-info
sayakpaul 7fd1a82
update
DN6 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the purpose of this check is to verify if the necessary sharded files are present in the model repo before attempting a download, presumably to avoid a large download if all files aren't present. If we cannot connect to the hub, we just have to assume the necessary shard files are already present locally.
I think we can just skip this check if
local_files_only=True
and then check if all the shard filenames are present in thecached_folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about now?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think just this is sufficient
Run snapshot download
Then after the cached_filenames is created, iterate over the files to verify they exist
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
snapshot_download()
whenlocal_files_only=False
, that might be unnecessary.snapshot_download()
after also runningmodel_info()
?snapshot_download()
regardless oflocal_files_only
var, I think we should have it insidetry-except
in case the endpoint cannot be pinged for some reason and raise theConnectionError
as before.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See if b7af511 resolves this.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see what you mean. Let me update. Sorry about the back and forth.