From 0e5737a9006a9d2ad51bcd1eefe442829d93b076 Mon Sep 17 00:00:00 2001 From: Wanming Lin Date: Wed, 28 Feb 2024 15:32:47 +0800 Subject: [PATCH] [DO NOT MERGE] Code example for testing ORT-Web WebNN EP This is a very rough example to enable WebNN in transfermer.js, I just add some hard codes to make the "Image classification w/ google/vite-base-patch16-224" fp32 model work with ORT Web WebNN EP. This PR depends on https://github.com/xenova/transformers.js/pull/596 --- examples/demo-site/src/index.html | 4 ++-- examples/demo-site/src/worker.js | 8 ++++++-- package.json | 4 ++-- src/backends/onnx.js | 3 ++- src/env.js | 5 +++-- src/models.js | 30 +++++++++++++++++++++++------- 6 files changed, 38 insertions(+), 16 deletions(-) diff --git a/examples/demo-site/src/index.html b/examples/demo-site/src/index.html index 9613acf63..fe186d163 100644 --- a/examples/demo-site/src/index.html +++ b/examples/demo-site/src/index.html @@ -86,7 +86,7 @@

Demo