Skip to content

Commit

Permalink
Merge pull request #47 from NingW101/refactor
Browse files Browse the repository at this point in the history
Remove binary from repo, download them when build with hosting mode
  • Loading branch information
NingW101 authored Aug 13, 2024
2 parents a26afd7 + 80ffc90 commit 4543174
Show file tree
Hide file tree
Showing 101 changed files with 22,733 additions and 403,706 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ node_modules
dist
*.log
.vscode
*.wasm
23 changes: 22 additions & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const TRANSFORMER_LOCAL_MODEL_PATH = "/models/";
// We keep these 2 wasm files temporally and may unify them later.

export const TRANSFORMERS_V3_ORT_ENV_WASM_FILE_PATH =
"/models/wasm/ort-web@1_17_1/";
"/models/frameworks/ort-web/ort-web@1_17_1/";

export const MEDIAPIPE_WASM_FILE_PATH = "/models/mediapipe/tasks-genai/wasm";

Expand Down Expand Up @@ -117,5 +117,26 @@ export const ALL_NEEDED_MODEL_RESOURCES = {
"https://huggingface.co/Xenova/Phi-3-mini-4k-instruct_fp16/resolve/main/",
localFolderPathPrefix: "Xenova/",
resources: ["onnx/model_q4.onnx", "onnx/model_q4.onnx_data"]
},

// ort web wasm
"ort-web@1_18_0": {
linkPathPrefix: "https://cdn.jsdelivr.net/npm/onnxruntime-web@1.18.0/dist/",
localFolderPathPrefix: "frameworks/ort-web/",
resources: ["ort-wasm-simd.jsep.wasm"]
},

"ort-web@1_17_1": {
linkPathPrefix: "https://cdn.jsdelivr.net/npm/onnxruntime-web@1.17.1/dist/",
localFolderPathPrefix: "frameworks/ort-web/",
resources: ["ort-wasm-simd.jsep.wasm"]
},

// mediapipe
"tasks-genai": {
linkPathPrefix:
"https://cdn.jsdelivr.net/npm/@mediapipe/tasks-genai@0.10.14/wasm/",
localFolderPathPrefix: "frameworks/mediapipe/",
resources: ["genai_wasm_internal.wasm"]
}
};
2 changes: 1 addition & 1 deletion copy_models.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const resources = ["models", "samples/common/3rdparty"];
const resources = ["models"];

const REMOTE_DEMOS_DIST = {
"samples/phi3-webgpu/dist/assets": "/assets",
Expand Down
1 change: 0 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export default [
},
{
ignores: [
"samples/common/3rdparty/**/*.js",
"dist/**/*.js",
"samples/phi3-webgpu/node_modules/**/*.js",
"samples/phi3-webgpu/dist/**/*.js",
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Loading

0 comments on commit 4543174

Please sign in to comment.