Skip to content

fix: onnxruntime-node session API (async create + inputMetadata indexing) - #1

Merged
ronaldtse merged 1 commit into
mainfrom
fix/ort-node-session-api
Aug 21, 2026
Merged

fix: onnxruntime-node session API (async create + inputMetadata indexing)#1
ronaldtse merged 1 commit into
mainfrom
fix/ort-node-session-api

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Summary

  • InferenceSession.fromBuffer is onnxruntime-web-only; node requires async create(buffer)Byt5 construction is now an async factory
  • session.inputMetadata is 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 on past_key_0 shape mismatch
  • Verified live end-to-end: load('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

  • 9/9 tests, tsc clean
  • CI green

…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.
@ronaldtse
ronaldtse merged commit 3195b73 into main Aug 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant