Open zirlman opened 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).
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
SAME! THIS IS SO ANNOYING!!!
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?