-
Notifications
You must be signed in to change notification settings - Fork 574
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
Conversation
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) |
If the model is on a read-only drive, this will break. My logic fixes that.
Ideally, you should probably have both. Only write when you need to, and
also wrap it all in a try catch so it doesn't break the whole program if
something fails.
…On Fri, Nov 8, 2024, 3:33 AM Lucain ***@***.***> wrote:
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)
—
Reply to this email directly, view it on GitHub
<#2657 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMO4NGT6RFB2AS4FHSLQCTZ7SAM3AVCNFSM6AAAAABRL6BTZGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRUGIZTGMBRHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
See my additional commit - I added exception handling for both parts of dealing with the ref file. |
Co-authored-by: Lucain <lucainp@gmail.com>
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 @d8ahazard!
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. |
Thank you! You have no idea how many headaches this is going to solve for me. ;) |
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.