Allow ONNX imports without external data files - #2
Conversation
|
|
|
@copilot you can test with https://huggingface.co/justinchuby/Muse-Glimmer-30B-ONNX-INT4-CUDA |
Co-authored-by: justinchuby <11205048+justinchuby@users.noreply.github.com>
Co-authored-by: justinchuby <11205048+justinchuby@users.noreply.github.com>
Co-authored-by: justinchuby <11205048+justinchuby@users.noreply.github.com>
Hugging Face DNS is blocked in this runner, so I couldn’t download that graph directly. I validated the same external-data encoding with the regression fixture and fixed two related bare-model edge cases in |
|
@copilot it should just never look at any external data file, because they can be very large |
There was a problem hiding this comment.
Pull request overview
This PR updates the ONNX inspection/import pipeline so browser uploads can successfully inspect standalone .onnx protobufs even when referenced external-data sidecars are absent, while still preserving initializer external-data metadata and validating/hash-checking any sidecars that are provided.
Changes:
- Allow
resolveExternalData()to returnundefinedand skip external sidecar hashing/range validation when the sidecar is not supplied. - Update browser model-package import to treat missing sidecars as optional, while still rejecting unsafe external-data locations.
- Add/adjust tests and documentation to cover missing sidecars, path normalization, and traversal rejection.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/web/src/model-package-import.ts | Makes browser import tolerant of missing external-data sidecars and avoids passing dummy metadata into ONNX architecture normalization. |
| packages/web/src/model-package-import.test.ts | Adds coverage for missing sidecars, relative-path normalization, and unsafe-path rejection. |
| packages/onnx-inspector/src/index.ts | Extends the inspector resolver contract to allow “no sidecar supplied” and normalizes external-data locations. |
| docs/DESIGN.md | Documents that browser imports may omit external-data files while still validating/hash-checking provided sidecars. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: justinchuby <11205048+justinchuby@users.noreply.github.com>
Addressed in |
@copilot no need to reject anything if you are not reading it in the first place. External data validation is not this apps concern. |
Co-authored-by: justinchuby <11205048+justinchuby@users.noreply.github.com>
Addressed in |
ONNX model uploads failed when referenced external-data sidecars were absent, although simulation only requires initializer metadata embedded in the model protobuf.
Model inspection
Browser import
.onnxfiles without requiring weight data.Coverage and documentation