fix from_pretrained in offline mode when model is preloaded in cache#31010
fix from_pretrained in offline mode when model is preloaded in cache#31010LysandreJik merged 3 commits intohuggingface:mainfrom
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.
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? 🤗
Signed-off-by: Raphael Glon <oOraph@users.noreply.github.com>
Signed-off-by: Raphael Glon <oOraph@users.noreply.github.com>
58cc68a to
257e639
Compare
Done @ArthurZucker , added some unit test -> fails before fix, succeeds after |
Signed-off-by: Raphael Glon <oOraph@users.noreply.github.com>
8035e72 to
2eefca1
Compare
ArthurZucker
left a comment
There was a problem hiding this comment.
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 <oOraph@users.noreply.github.com> * fix from_pretrained in offline mode when model is preloaded in cache Signed-off-by: Raphael Glon <oOraph@users.noreply.github.com> * minor: fmt Signed-off-by: Raphael Glon <oOraph@users.noreply.github.com> --------- Signed-off-by: Raphael Glon <oOraph@users.noreply.github.com> Co-authored-by: Raphael Glon <oOraph@users.noreply.github.com>
What does this PR do?
Fixes # (issue)
fix model load in offline mode
Who can review?
@ArthurZucker
@Wauplin
Reproduce: