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 download local dir edge case (remove lru_cache) #2629

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Oct 23, 2024

Fix #2607.

See #2607 (comment) for explanations.

In the end I went for the solution to remove @lru_cache usage. This leads to more IO disk calls but less code complexity. Hopefully the extra cost is likely to be negligible.

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

Copy link
Contributor

@hanouticelina hanouticelina left a comment

Choose a reason for hiding this comment

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

thanks @Wauplin! I usually lean towards keeping @lru_cache and simplifying the functions as much as possible but in this case, it's worth prioritizing simplicity over minor performance optimizations, especially when the cost of a few extra disk operations is probably negligible

Copy link
Member

@pcuenca pcuenca left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you! 🙌

@Wauplin
Copy link
Contributor Author

Wauplin commented Oct 24, 2024

Thanks for the reviews 🤗

@Wauplin Wauplin merged commit 7709178 into main Oct 24, 2024
18 checks passed
@Wauplin Wauplin deleted the 2607-fix-download-local-dir-edge-case branch October 24, 2024 09:16
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.

snapshot_download edge case exception
4 participants