Skip to content

Commit

Permalink
Update Transformers.js to fix Image Classification MLTensorUsage error
Browse files Browse the repository at this point in the history
  • Loading branch information
ibelem committed Nov 25, 2024
1 parent 45ae5c5 commit 278ca25
Show file tree
Hide file tree
Showing 17 changed files with 510 additions and 653 deletions.

This file was deleted.

This file was deleted.

Binary file not shown.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions assets/dist_transformers/Notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Notes

This version of Transformers.js distribution was built using the following components::

1. ONNX Runtime Web: [1.21.0-dev.20241122-a2ba3cb547](https://www.npmjs.com/package/onnxruntime-web/v/1.21.0-dev.20241122-a2ba3cb547)
2. Transformers.js: [v3 branch](https://github.com/huggingface/transformers.js/commit/7a58d6e11968dd85dc87ce37b2ab37213165889a)
3. Get performance data: [patch](https://github.com/ibelem/transformers.js/commit/5d1416f90d6e0a67dc84757bc6fe9754a86946d7)
5 changes: 3 additions & 2 deletions demos/image-classification/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
//
// An example how to run Image Classification with webnn in onnxruntime-web.
//
import * as transformers from "../../assets/dist_transformers/1.21.0-dev.20241109/transformers.js";

import * as transformers from "../../assets/dist_transformers/1.21.0-dev.20241122/transformers.js";
import {
$,
$$,
Expand All @@ -23,7 +24,7 @@ import {
transformers.env.backends.onnx.wasm.proxy = false;
transformers.env.backends.onnx.wasm.simd = true;
transformers.env.backends.onnx.wasm.numThreads = 1;
transformers.env.backends.onnx.wasm.wasmPaths = "../../assets/dist_transformers/1.21.0-dev.20241109/";
transformers.env.backends.onnx.wasm.wasmPaths = "../../assets/dist_transformers/1.21.0-dev.20241122/";

const useRemoteModels = location.hostname.includes("github.io");
transformers.env.allowRemoteModels = useRemoteModels;
Expand Down

0 comments on commit 278ca25

Please sign in to comment.