-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Web] chrome V3 extension TypeError: URL.createObjectURL is not a function
#14445
Comments
thank you for the feedback. it looks like |
Context: microsoft/onnxruntime#14445 When moving to Chrome V3, we hit the error: TypeError: URL.createObjectURL is not a function at Object.locateFile (packed.js:formatted:18165:126) at O (packed.js:formatted:345:61) at Object.ib (packed.js:formatted:718:49) at Object.mb (packed.js:formatted:722:73) at fe (packed.js:formatted:594:48) at Te (packed.js:formatted:807:42) at ort-wasm-simd-threaded.wasm:0x772d56 at ort-wasm-simd-threaded.wasm:0xeb64e at ort-wasm-simd-threaded.wasm:0x1c4048 at ort-wasm-simd-threaded.wasm:0xe5575 It appears we can set `numThreads` to 1 to avoid this code path. There appear to be different `.wasm` files: Uncompressed Compressed 8667133 2411351 ort-wasm-simd-threaded.wasm 8719890 2413744 ort-wasm-simd.wasm 7908412 2248465 ort-wasm-threaded.wasm 7960955 2252902 ort-wasm.wasm And it looks like we can drop the two `*-threaded.wasm` files. Size difference: --14513792 release.zip ++ 9853726 release.zip The extension seems to work as before, still on Chrome V2 in main.
Thanks! It appears I can workaround with jonathanpeppers/inclusive-code-reviews-browser#195 Is there a doc/readme that explains what the 4 different |
One thing is that you might want to use chrome.runtime.getURL("asserts/model.onnx") to fetch the model. |
The error does not happen in loading the model, it happens when initializing the web assembly. The reason why |
@fs-eire do you know any drawbacks to the single-threaded version? We're not trying to call our model multiple times in parallel, really just sending 1 request at a time. |
@fs-eire - got it. @jonathanpeppers, the disadvantage for single threaded is only performance. Your model looked not very compute intensive so you might not notice. |
Context: microsoft/onnxruntime#14445 When moving to Chrome V3, we hit the error: TypeError: URL.createObjectURL is not a function at Object.locateFile (packed.js:formatted:18165:126) at O (packed.js:formatted:345:61) at Object.ib (packed.js:formatted:718:49) at Object.mb (packed.js:formatted:722:73) at fe (packed.js:formatted:594:48) at Te (packed.js:formatted:807:42) at ort-wasm-simd-threaded.wasm:0x772d56 at ort-wasm-simd-threaded.wasm:0xeb64e at ort-wasm-simd-threaded.wasm:0x1c4048 at ort-wasm-simd-threaded.wasm:0xe5575 It appears we can set `numThreads` to 1 to avoid this code path. There appear to be different `.wasm` files: Uncompressed Compressed 8667133 2411351 ort-wasm-simd-threaded.wasm 8719890 2413744 ort-wasm-simd.wasm 7908412 2248465 ort-wasm-threaded.wasm 7960955 2252902 ort-wasm.wasm And it looks like we can drop the two `*-threaded.wasm` files. Size difference: --14513792 release.zip ++ 9853726 release.zip The extension seems to work as before, still on Chrome V2 in main.
I got this error, specifically working with
I added |
However, running single threaded slows everything down. I'd love to work on this if anyone points me in the right direction :-) |
I can look at it - might be a little complicated to fix. |
An update to allow multi-threading would be really beneficial ! |
Would love to get an update on this. At the moment the the node library is pretty much unusable for me due to lacking support for |
Indeed this is blocking the efficient usage of the very popular transformers.js in the browser for local and private ML. @fs-eire @guschmue |
I would love to see the update as well. I wanted to work with transformers.js to run LLMs in the browser but this issue makes it very inefficient due to lack of multithreading support. |
Have you tried running onnxruntime-web inside an offscreen document? These are meant to supplement extension service workers in case additional APIs are required that are not available in a service worker. |
this PR should fix this: |
Describe the issue
We are using
onnxruntime-web
in a Chrome extension.We are in the process of migrating to Chrome V3 format (worked great in V2) and hit the error:
URL.createObjectURL
does not appear to be available to Chrome V3 extensions.Is there a different way for us to use
onnxruntime
and avoid this API? Thanks!To reproduce
You could install our extension: release.zip
Editing a multi-line text box (like GitHub) hits the error, and you can view from the extensions page:
Source code here: jonathanpeppers/inclusive-code-reviews-browser#90
Urgency
Medium. Chrome V2 extensions are being phased out this year, and this seems to be a blocker.
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.13.1
Execution Provider
WASM
The text was updated successfully, but these errors were encountered: