增加下载工具

This commit is contained in:
2025-03-20 18:24:12 +08:00
parent 6bf7db1f4c
commit 6cdf4cbcd6
12 changed files with 131 additions and 9 deletions

12
src/backend/config.ts Normal file
View File

@ -0,0 +1,12 @@
import path from "path";
const defaultAddonDir = path.join(__dirname, "../../build")
const aiConfig = {
"MNN_ADDON_FILE": path.join(defaultAddonDir, "mnn.node"),
"ORT_ADDON_FILE": path.join(defaultAddonDir, "ort.node"),
};
export function setConfig<K extends keyof typeof aiConfig>(key: K, value: typeof aiConfig[K]) { aiConfig[key] = value; }
export function getConfig<K extends keyof typeof aiConfig>(key: K): typeof aiConfig[K] { return aiConfig[key]; }