huggingface / node-question-answering

Fast and production-ready question answering in Node.js
Apache License 2.0
466 stars 55 forks source link

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

Open zirlman opened 4 years ago

zirlman commented 4 years ago

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?

Pierrci commented 4 years ago

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).

franklevasseur commented 3 years ago

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
MeechaPooch commented 3 years ago

SAME! THIS IS SO ANNOYING!!!