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

Don't write the ref file unless necessary #2657

Merged
merged 5 commits into from
Nov 14, 2024
Merged

Conversation

d8ahazard
Copy link
Contributor

Updating snapshot_download so that it doesn't re-write the commit hash every single time.

This has been incredibly problematic if we're keeping a repo saved to disk, and snapshot_download can't write to that disk.

This should at least partially resolve the issue.

@Wauplin
Copy link
Contributor

Wauplin commented Nov 8, 2024

What's the underlying issue you are facing? Is it a permission error? In that case I'd be more inclined to add a try/except instead of additional logic to read before writing (more error-prone)

@d8ahazard
Copy link
Contributor Author

d8ahazard commented Nov 8, 2024 via email

@d8ahazard
Copy link
Contributor Author

What's the underlying issue you are facing? Is it a permission error? In that case I'd be more inclined to add a try/except instead of additional logic to read before writing (more error-prone)

See my additional commit - I added exception handling for both parts of dealing with the ref file.

Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

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

Thanks @d8ahazard!

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

@d8ahazard
Copy link
Contributor Author

Thanks @d8ahazard!

Thank you! You have no idea how many headaches this is going to solve for me. ;)

@Wauplin Wauplin merged commit d30853b into huggingface:main Nov 14, 2024
14 checks passed
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.

3 participants