代码优化
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import { getConfig } from "../../config";
|
||||
import { CommonSession, dataTypeFrom, isTypedArray, SessionNodeData, SessionNodeInfo, SessionRunInputOption, SessionRunOutput } from "../common";
|
||||
|
||||
export class MNNSession extends CommonSession {
|
||||
@ -7,7 +8,7 @@ export class MNNSession extends CommonSession {
|
||||
|
||||
public constructor(modelData: Uint8Array) {
|
||||
super();
|
||||
const addon = require("../../../build/mnn.node")
|
||||
const addon = require(getConfig("MNN_ADDON_FILE"));
|
||||
this.#session = new addon.MNNSession(modelData);
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { getConfig } from "../../config";
|
||||
import { CommonSession, dataTypeFrom, isTypedArray, SessionNodeData, SessionNodeInfo, SessionRunInputOption, SessionRunOutput } from "../common";
|
||||
|
||||
export class OrtSession extends CommonSession {
|
||||
@ -7,7 +8,7 @@ export class OrtSession extends CommonSession {
|
||||
|
||||
public constructor(modelData: Uint8Array) {
|
||||
super();
|
||||
const addon = require("../../../build/ort.node")
|
||||
const addon = require(getConfig("ORT_ADDON_FILE"));
|
||||
this.#session = new addon.OrtSession(modelData);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user