-
Notifications
You must be signed in to change notification settings - Fork 29
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
Fail to load WASM error #35
Comments
UpdateSo apparently changing the current node version from 18.15.0 to 16.19.1 fixed it. No idea how node versions affect the lib. EditFound the cause. Node 18 contains a new experimental fetch API. Disabling it with SidenoteIf your .bin model file is > 2Gb using the native fasttext wasm functions to load said model will fail. Very unfortunate :( |
amazing finding, thank you! I actually had the same error when released the last update few days ago, while the problem of 2GB is well-known due to Wasm 32bit architecture. Wasm 64bit is a work in progress and it should come in 2023. |
Also having this issue regardless of node version. Also, the model used is very small so should also not be an issue. Seems to complain just when even only importing the module |
@sneljo1 do you have the error log from wasm module init? |
Downgrading to Node 16/18 in 2024 is not a viable option anymore, and the error is still there with Node 20. |
agreed, it should work on node ETS. I will investigate a bit more. There were some underlying changes in the WASM ABI and wasm modules support since Node 18 that requires some work. |
After commenting out
everything seems to work fine, since wasm is not needed in my case, maybe it should be initialized only when needed. |
Thanks @nemphys, that worked. Also I created a patch to remove FastTextWasm diff --git a/node_modules/fasttext.js/lib/index.js b/node_modules/fasttext.js/lib/index.js
index a7a7b01..5fd90f8 100644
--- a/node_modules/fasttext.js/lib/index.js
+++ b/node_modules/fasttext.js/lib/index.js
@@ -12,8 +12,7 @@
path = require('path'),
os = require('os'),
Util = require('./util'),
- Deque = require('./deque'),
- FastTextWasm = require('./wasm/fasttext');
+ Deque = require('./deque');
var FastText;
FastText = (function () { Note: With this patch you can't use |
Heya, I am currently facing this error when calling FastText.loadWASM():
Below is my code snippet, following the example given in this issue:
There is no issues with my model directory and I tried running the snippet via the npm install package and git clone installation method.
The text was updated successfully, but these errors were encountered: