System Info
Hi I was attempting to build a chrome extension using @huggingface/transformers, I ran into a problem where chrome extensions are not allowed to load code from remotely hosted code. So when initializing, I get problems loading https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.3.3/dist/ort-wasm-simd-threaded.jsep.mjs
Error in worker: Error: no available backend found. ERR: [wasm] TypeError: Failed to fetch dynamically imported module
and then I try to add the cdn url to my manifest of allowed script-src I get and Insecure CSP value since manifest v3 prohibits these now.
I think I could get around this by downloading the cdn file locally and bundling with my extension, but I am unsure how to then tell hugging face to use the local mjs instead of going to the CDN.
I noticed that in the legacy version of this repo @xenova/transformers, https://github.com/huggingface/transformers.js/tree/main/examples/extension the extension works properly! and I verified that switching to that repo fixed my issue.
Would it be possible to have @huggingface/transformers or make the url configurable so i can point to a local bundled js if I want to?
Who can help?
@Rocketknight1
Information
Tasks
Reproduction
Steps to reproduce:
- clone https://github.com/huggingface/transformers.js/tree/main/examples/extension
- build and see that it works!
- switch to use huggingface/transformers -> see that it does not work since the CDN is blocked
Expected behavior
I expect to be able to run the model without having to get ort-wasm-simd-threaded.jsep.mjs from a CDN at runtime