Repository navigation
fix: return validation errors for malformed metadata - #111
Draft
sunruize93-cmyk wants to merge 1 commit into
Draft
sunruize93-cmyk wants to merge 1 commit into
sunruize93-cmyk wants to merge 1 commit into
Conversation
Fixes MoonshotAI#110. Keep malformed dtype and shape values in Pydantic validation while preserving backend error responses. Add CPU-only API regressions for field locations and backend failures.
koriyoshi2041
left a comment
Contributor
There was a problem hiding this comment.
Validated exact head b855f6f9 on macOS arm64 with Python 3.13, FastAPI 0.159.1, Pydantic 2.14.1, and PyTorch 2.14.1. All 18 API tests pass. The malformed dtype/shape cases return 422 at the expected field location, load_metas is not called, and the backend RuntimeError/TypeError/ValueError controls still return 500. The conversion is confined to the two Pydantic validators; I did not find a broader exception-masking path in the diff.
This branch has not been deployed
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.
Fixes #110.
Summary
Validation
Tested at
b855f6f9d20bebb6d5664248164e01e7d995fe4e, based on official main84631a24f36349435f29cc9b305aa068bed87978.Both dependency sets used Python 3.12.13 and PyTorch 2.14.1:
Scope
CPU-only validation on macOS arm64. The hardware backend is stubbed, following the existing API test seam; the real application, metadata validators and HTTP transport execute. No GPU, RDMA, actual weight transfer or multi-node validation is claimed.
Kept as Draft pending my final review of the code.