node-question-answering icon indicating copy to clipboard operation
node-question-answering copied to clipboard

Can't resolve '/bin-package' via webpack

Open zirlman opened this issue 4 years ago • 3 comments

I'm trying to use this module for a chrome extension using webpack. When I run npx webpack I receive the following error: ERROR in ./node_modules/question-answering/node_modules/tokenizers/bindings/native.js Module not found: Error: Can't resolve '/bin-package' in '....\node_modules\question-answering\node_modules\tokenizers\bindings' @ ./node_modules/question-answering/node_modules/tokenizers/bindings/native.js 1:15-38 @ ./node_modules/question-answering/node_modules/tokenizers/bindings/decoders.js @ ./node_modules/question-answering/node_modules/tokenizers/implementations/tokenizers/bert-wordpiece.tokenizer.js @ ./node_modules/question-answering/node_modules/tokenizers/implementations/tokenizers/index.js @ ./node_modules/question-answering/node_modules/tokenizers/index.js @ ./node_modules/question-answering/dist/qa.js @ ./node_modules/question-answering/dist/index.js

Is this module compatible with webpack? P.S. If not, how can I run huggingface models using TFJS?

zirlman avatar May 18 '20 10:05 zirlman

Unfortunately, the Tokenizers library used internally for tokenization doesn't provide bindings for the browser but only for Nodejs (see https://github.com/huggingface/tokenizers/issues/63), so you can't use this library with webpack (I suppose you're trying to use it in the browser).

Pierrci avatar Jun 26 '20 22:06 Pierrci

huggingface/tokenizers don't seem to work on windows either:

Error, \\?\C:\Users\franc\Documents-franc\botpress-root\botpress2\modules\unsupervised_qna\node_modules\tokenizers\bin-package\index.node is not a valid Win32 application.
\\?\C:\Users\franc\Documents-franc\botpress-root\botpress2\modules\unsupervised_qna\node_modules\tokenizers\bin-package\index.node

franklevasseur avatar Mar 09 '21 03:03 franklevasseur

SAME! THIS IS SO ANNOYING!!!

MeechaPooch avatar May 27 '21 20:05 MeechaPooch