Code Monkey home page Code Monkey logo

Comments (3)

syl22-00 avatar syl22-00 commented on September 13, 2024

It should be explained there:
https://github.com/syl22-00/pocketsphinx.js#i-embedding-the-files-into-one-large-javascript-file

If it does not work, please detail what you have done to package your acoustic model.

Meanwhile, the issue title is about the language model, but we are discussing the acoustic model.

from pocketsphinx.js.

Wavehk avatar Wavehk commented on September 13, 2024

Thanks for quick reply,
I have read through the steps again, I tried again with the following build command:

cmake -DEMSCRIPTEN=1 -DCMAKE_TOOLCHAIN_FILE="{path to emsdk}/emscripten/1.30.0/cmake/Modules/Platform/Emscripten.cmake" -DLM_BASE="pocketsphinx/model/en-us" -DLM_FILES="en-us" ..

Copying /Users/tat/Downloads/pocketsphinx.js/am/rm1_200 to binary dir
Copying pocketsphinx/model/en-us/en-us to binary dir
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/tat/Downloads/pocketsphinx.js/build

I am building on a mac pro with 12GB ram, after a long build time and returns errorFATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory

Any idea why or how to fix? many thanks

from pocketsphinx.js.

syl22-00 avatar syl22-00 commented on September 13, 2024

So first, you are confusing acoustic and language model:

  • What is in the pocketsphinx/model/en-us/en-us/en-us folder is an acoustic model. This is a bunch of files inside a folder, that's why the CMake settings are called HMM_BASE and HMM_FOLDERS.
  • The language model is the file en-us.lm.dmp, and if you use a statistical language model, you should also load the pronunciation dictionary cmudict-en-us.dict.

Then, as explained in the README file, if you want to use those larger models, you should use external packaging as explained in the docs. Each file will become one JavaScript file. If you try to package all inside one JavaScript file, the node.js process exceeds its max allowed memory, which is the error message you see (it does not matter how much RAM you have, it is a node.js thing).

from pocketsphinx.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.