-
Notifications
You must be signed in to change notification settings - Fork 570
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
Degraded but fully working cache-system when symlinks are not supported #1067
Degraded but fully working cache-system when symlinks are not supported #1067
Conversation
The documentation is not available anymore as the PR was closed or merged. |
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.
Sounds approach, only left a comment
Codecov ReportBase: 84.16% // Head: 84.36% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1067 +/- ##
==========================================
+ Coverage 84.16% 84.36% +0.19%
==========================================
Files 40 40
Lines 4087 4100 +13
==========================================
+ Hits 3440 3459 +19
+ Misses 647 641 -6
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
Ok this sounds good to me. I don't have a windows setup handy right now but I can test on one later tonight.
@LysandreJik that would be perfect thank you 🤗 |
I just checked on Windows by first disabling developer mode. Using v0.9.1 or >>> from huggingface_hub import snapshot_download
>>> snapshot_download('distilbert-base-uncased')
Checking out this current branch and running the code: >>> from huggingface_hub import snapshot_download
>>> snapshot_download('distilbert-base-cased')
It seems it works! Any other situation you'd like me to test? |
Thanks a lot @LysandreJik, that's reassuring ! Just to be sure, could you also try |
…github.com:huggingface/huggingface_hub into 1062-remove-symlinks-on-windows-not-developer-mode
I confirm both |
Thanks @LysandreJik ! |
To be honest this should all be taken care of by running our CI on Windows. I had started here https://github.com/huggingface/huggingface_hub/tree/ci_windows-tests but never finished (it's already been 14 months 😅 ...) |
@LysandreJik yep true. Let's create an issue for that #1074 |
Related to #1062.
The proposed approach is to use the new cache system on every platform but have a "degraded" version when symlinks are not supported. The degraded version do not use symlinks but rather copypaste/move the blob files instead. Drawback is that some files might get duplicated in the cache if several revisions of the same repo are downloaded. This drawback can be mitigated by deleting older revisions (see
huggingface-cli delete-cache
command #1025). The advantage of this solution is that it should work seamlessly from a user perspective but also for developers (e.g. when downloading a repo, the repo structure will still be the same on disk)A warning will be displayed to encourage the user to enable developer mode/run as admin for a better cache system. Warning message can be disabled via a environment variable.
Todo: