Repository navigation
Conversation
…dows test_verify_rejects_a_changed_safetensors_file loaded the exported file with safetensors.load_file and then saved the altered tensors over the same path. On Windows load_file keeps the file memory-mapped, so save_file fails with os error 1224 before verify is ever called. Write the altered weights to a second file instead; the test still checks that verify rejects a safetensors file whose weights differ from the chain. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
No actionable comments were generated in the recent review. WalkthroughThe changed-file verification test now saves modified tensors to ChangesSafetensors verification
Estimated code review effort: 2 (Simple) | ~5 minutes Change: Other Possibly related PRs
Suggested reviewers: Merge Risk:
|
Link your account with GitcordThanks for opening this PR, @ArnabOPP! To receive Discord notifications and contributor tracking for this organization:
Once linked, Gitcord can notify you about reviews, merges, and more. — Posted by Gitcord |
test_verify_rejects_a_changed_safetensors_filefails on Windows. The test loads the exported file withsafetensors.load_file, which keeps it memory-mapped on Windows, then saves the altered tensors over the same path.save_filefails withos error 1224("user-mapped section open"), soverifyis never called.The fix writes the altered weights to a second file,
altered.safetensors, and verifies that. The test still checks thatverifyrejects a safetensors file whose weights differ from the chain.export_safetensors.pyitself is unaffected, because it only reads the file.Testing: On Windows 11, Python 3.11, CPU,
tests/simplegave 128 passed and 1 failed before the change.test_export_safetensors.pynow passes 7 of 7. I didn't re-run the full suite after the change, and I didn't run it on Linux.This was found and fixed with Claude Code (Claude Sonnet 5.5). I ran the tests and reviewed the change myself.
🤖 Generated with Claude Code
Summary by CodeRabbit