Code Monkey home page Code Monkey logo

Comments (7)

brendantwy avatar brendantwy commented on August 18, 2024 3

Update

So apparently changing the current node version from 18.15.0 to 16.19.1 fixed it. No idea how node versions affect the lib.

Edit

Found the cause. Node 18 contains a new experimental fetch API. Disabling it with --no-experimental-fetch flag works as well

Sidenote

If your .bin model file is > 2Gb using the native fasttext wasm functions to load said model will fail. Very unfortunate :(

from fasttext.js.

loretoparisi avatar loretoparisi commented on August 18, 2024 2

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.
I will investigate a bit more node 18 and WASM and update the README.md

from fasttext.js.

sneljo1 avatar sneljo1 commented on August 18, 2024 1

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

from fasttext.js.

loretoparisi avatar loretoparisi commented on August 18, 2024

@sneljo1 do you have the error log from wasm module init?

from fasttext.js.

nemphys avatar nemphys commented on August 18, 2024

Downgrading to Node 16/18 in 2024 is not a viable option anymore, and the error is still there with Node 20.
Is there a change that a proper solution is found for this issue?

from fasttext.js.

loretoparisi avatar loretoparisi commented on August 18, 2024

Downgrading to Node 16/18 in 2024 is not a viable option anymore, and the error is still there with Node 20.

Is there a change that a proper solution is found for this issue?

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.

from fasttext.js.

nemphys avatar nemphys commented on August 18, 2024

After commenting out

FastTextWasm = require('./wasm/fasttext')

everything seems to work fine, since wasm is not needed in my case, maybe it should be initialized only when needed.

from fasttext.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.