Skip to content
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

WASM: External initializers are not enabled in this build #192

Closed
decahedron1 opened this issue Apr 27, 2024 · 10 comments
Closed

WASM: External initializers are not enabled in this build #192

decahedron1 opened this issue Apr 27, 2024 · 10 comments

Comments

@decahedron1
Copy link
Member

          Hi

@decahedron1

Build and load of wasm module in the browser is successful.

But when inferencing the model, I face following error:

panicked at libtashkeel-wasm\src\lib.rs:23:34:
called `Result::unwrap()` on an `Err` value: InferenceError("Failed to run model using onnxruntime via ort. Caused by Failed to create ONNX Runtime session: Deserialize tensor attn_layers.0.ccm.layernorm.bias failed.External initializers are not enabled in this build

I'm using an ort model.

Originally posted by @mush42 in #75 (comment)

@decahedron1
Copy link
Member Author

@mush42 Are you able to upload the converted .ort model?

@decahedron1
Copy link
Member Author

Should be fixed by 80be206

@mush42
Copy link

mush42 commented Apr 28, 2024

@decahedron1
Here's the model. It is a quantized model using neural compressor.
model.zip

@decahedron1
Copy link
Member Author

Can you confirm that 80be206 fixed this issue by setting ort as a git dependency:

[dependencies]
ort = { git = "https://github.com/pykeio/ort.git", rev = "80be2068296b04e8ae0a442d4b9c2d635362d07e" }

@mush42
Copy link

mush42 commented Apr 28, 2024

@decahedron1 I confirm that the commit fixes the issue.

@mush42
Copy link

mush42 commented Apr 28, 2024

@decahedron1
If possible, make a new rc release.

@mush42
Copy link

mush42 commented Apr 28, 2024

My model is now live at:
https://mush42.github.io/libtashkeel/

@mush42
Copy link

mush42 commented May 1, 2024

Do you have any idea of what has been added to nightly to make ort work in wasm-unknown-unknown?

Just came by this:
https://github.com/Liamolucko/find_wasm_import

@decahedron1
Copy link
Member Author

No idea. My best guesses are rust-lang/rust#124036 or the LLVM 18 upgrade (which should land in v1.78 stable, releasing tomorrow).

@mush42
Copy link

mush42 commented May 1, 2024

OK.

Whatever it is, it seams to add around 5-6 MB to the .wasm module bundle.

Using stable, my build is around 6 MB when compiled with stable, jumped to 12 MB when compiled with nightly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants