fix: onnxruntime-node session API (async create + inputMetadata indexing) - #1
Merged
Conversation
…ta is position-indexed
Two load-path bugs against onnxruntime-node 1.x: (1) InferenceSession
.fromBuffer exists only in onnxruntime-web — construction is now an
async factory (Byt5.load); (2) session.inputMetadata is an array of
{name, shape} entries, not a name-keyed map — the old code fell back to
wrong KV dims (4/8 instead of the graph's) and the first decode step
failed. Verified live: khm-latn-1.0 resolves from the canonical index,
downloads, verifies, and decodes correctly.
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.
Summary
InferenceSession.fromBufferis onnxruntime-web-only; node requires asynccreate(buffer)—Byt5construction is now an async factorysession.inputMetadatais position-indexed[{name, shape}], not name-keyed — the name lookup silently fell back to wrong KV dims (4/8) and the first decode step failed onpast_key_0shape mismatchload('khm-latn-1.0')→ canonical index resolve → 1.4GB sha256-verified download → KV decode'ភាសា' → 'pheasaea'Known limitation (follow-up)
adm-zip caps reads at 2 GiB — split-part teacher-tier zips (tha-g2p-base-1.0, 2.78GB) download+verify fine but cannot be opened; client-tier artifacts (<2GiB) are unaffected. Streaming unzip is the fix.
Test plan