-
Notifications
You must be signed in to change notification settings - Fork 31.6k
fix from_pretrained in offline mode when model is preloaded in cache #31010
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
Conversation
|
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. |
ArthurZucker
left a comment
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.
Thanks! Can you add this example by using HF hub to downlaod snapshot of a .bin file in a temp repo? and test both the flag to go offline and the local_files_only in from pretrained? 🤗
Wauplin
left a comment
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.
Thanks @oOraph!
Signed-off-by: Raphael Glon <[email protected]>
Signed-off-by: Raphael Glon <[email protected]>
58cc68a to
257e639
Compare
Done @ArthurZucker , added some unit test -> fails before fix, succeeds after |
Signed-off-by: Raphael Glon <[email protected]>
8035e72 to
2eefca1
Compare
LysandreJik
left a comment
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.
Thanks!
ArthurZucker
left a comment
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.
https://huggingface.co/hf-internal-testing/tiny-random-SiglipForImageClassification/tree/main does not have a bin file, so we are not testing the case we solved before. Otherwise LGTM
…31010) * Unit test to verify fix Signed-off-by: Raphael Glon <[email protected]> * fix from_pretrained in offline mode when model is preloaded in cache Signed-off-by: Raphael Glon <[email protected]> * minor: fmt Signed-off-by: Raphael Glon <[email protected]> --------- Signed-off-by: Raphael Glon <[email protected]> Co-authored-by: Raphael Glon <[email protected]>
What does this PR do?
Fixes # (issue)
fix model load in offline mode
Who can review?
@ArthurZucker
@Wauplin
Reproduce: