From f480a3618ab6eff2afd5ff157eb62bfbc4e89e29 Mon Sep 17 00:00:00 2001 From: Yulong Wang <7679871+fs-eire@users.noreply.github.com> Date: Tue, 3 Oct 2023 17:55:01 -0700 Subject: [PATCH] [hotfix] fix session option access in Node.js binding (#17762) ### Description fix session option access in Node.js binding ### Motivation and Context This is a bug that affect transformer.js using ONNX Runtime Node.js binding. Issue: #17377 This bug is already fixed in main branch, but it is not picked in 1.16 release. --- js/node/src/inference_session_wrap.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/node/src/inference_session_wrap.cc b/js/node/src/inference_session_wrap.cc index 78f32ec09250b..f8aeadbe27c56 100644 --- a/js/node/src/inference_session_wrap.cc +++ b/js/node/src/inference_session_wrap.cc @@ -68,7 +68,7 @@ Napi::Value InferenceSessionWrap::LoadModel(const Napi::CallbackInfo &info) { int64_t bytesOffset = info[1].As().Int64Value(); int64_t bytesLength = info[2].As().Int64Value(); - ParseSessionOptions(info[1].As(), sessionOptions); + ParseSessionOptions(info[3].As(), sessionOptions); this->session_.reset( new Ort::Session(OrtEnv(), reinterpret_cast(buffer) + bytesOffset, bytesLength, sessionOptions)); } else {