mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-26 19:52:38 +00:00
[js/web] enable 'use_ort_model_bytes_directly' by default (#8734)
This commit is contained in:
parent
401de5911b
commit
cb67fca738
1 changed files with 15 additions and 0 deletions
|
|
@ -33,12 +33,27 @@ const getExecutionMode = (executionMode: 'sequential'|'parallel'): number => {
|
|||
}
|
||||
};
|
||||
|
||||
const appendDefaultOptions = (options: InferenceSession.SessionOptions): void => {
|
||||
if (!options.extra) {
|
||||
options.extra = {};
|
||||
}
|
||||
if (!options.extra.session) {
|
||||
options.extra.session = {};
|
||||
}
|
||||
const session = options.extra.session as Record<string, string>;
|
||||
if (!session.use_ort_model_bytes_directly) {
|
||||
// eslint-disable-next-line camelcase
|
||||
session.use_ort_model_bytes_directly = '1';
|
||||
}
|
||||
};
|
||||
|
||||
export const setSessionOptions = (options?: InferenceSession.SessionOptions): [number, number[]] => {
|
||||
const wasm = getInstance();
|
||||
let sessionOptionsHandle = 0;
|
||||
const allocs: number[] = [];
|
||||
|
||||
const sessionOptions: InferenceSession.SessionOptions = options || {};
|
||||
appendDefaultOptions(sessionOptions);
|
||||
|
||||
try {
|
||||
if (options?.graphOptimizationLevel === undefined) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue