Repository navigation
test: add 10 tests for checkpoints module (re-land of #7) - #12
Merged
Merged
Conversation
print_state_dict_shapes: - prints each key - keys appear in sorted order - empty dict prints nothing - shape appears in output - single-key dict get_state_dict: - returns dict - all keys from the safetensors file present - tensor values returned via safe_open's get_tensor - empty checkpoint returns empty dict - safe_open called with framework='pt' and device='cpu' Tensor I/O is mocked via unittest.mock — no real .safetensors files required. Re-land of #7 (hai-pilgrim's PR had Co-Authored-By trailer that can't ship per repo convention); also dropped unused pytest import and renamed E741 'l' to 'line'.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft re-land of #7 — hai-pilgrim's PR was 3 months stale and its commit had a
Co-Authored-By: Claudetrailer (can't ship per repo convention). Test file was new (no conflict). Also fixed 2 ruff violations the original had (unusedpytestimport, E741l→line).Summary
10 unit tests for
markutils.checkpointscoveringprint_state_dict_shapesandget_state_dict. All tensor I/O mocked — no real.safetensorsfiles needed.Test plan
pytest tests/test_checkpoints.py→ 10 passeduvx ruff checkcleanDraft so you can decide between this and asking hai-pilgrim to rebase #7 directly.