huggingface / node-question-answering

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

List of other models? #10

Closed DesiKeki closed 3 years ago

DesiKeki commented 4 years ago

I tried downloading other models like

bert-uncased
bert-cased
bert-base-uncased
bert-large-uncased
bert-large-uncased-whole-word-masking-finetuned-squad

None of them worked and gave errors like below:

npx question-answering download bert-uncased --format saved_model
cli.js download [model]

Download a model (defaults to distilbert-cased)

Positionals:
  model                                   [string] [default: "distilbert-cased"]

Options:
  --version    Show version number                                     [boolean]
  --help       Show help                                               [boolean]
  --dir        The target directory to which download the model
                                                 [string] [default: "./.models"]
  --format     Format to download              [string] [default: "saved_model"]
  --force, -f  Force download of model and vocab, erasing existing if already
               present                                                 [boolean]

Error: The requested model doesn't seem to exist
    at Object.downloadModel [as handler] (C:\Users\keki\node_modules\question-answering\scripts\cli.js:91:13)
    at processTicksAndRejections (internal/process/task_queues.js:94:5)

Where can I get the list of valid model names to download?

Pierrci commented 4 years ago

Hi @DesiKeki, you're a bit ahead of time haha, this will be possible in the next version which will be released soon, you can check it out at https://github.com/huggingface/node-question-answering/tree/v3

If you want to try it, you can install it in your project from source by doing npm i git://github.com/huggingface/node-question-answering.git#v3, followed by a tsc -p tconfig.prog.json in the node_module/question-answering directory (you'll need to have typescript installed on your machine for that).

Pierrci commented 4 years ago

Actually I just published a release candidate version, you can directly install it with npm i question-answering@next and start using it without needing to compile anything :)

DesiKeki commented 4 years ago

Thanks a lot @Pierrci . Let me try this and get back again if I see any issues.

DesiKeki commented 4 years ago

Hi @Pierrci , after downloading and using bert-large-cased-whole-word-masking-finetuned-squad I am getting following error:

**node .\index.js**                                                                                                                                               C:\Users\Vivek\YU\covidiots_nlp\covidiots\node_modules\@tensorflow\tfjs-node\dist\index.js:49
    throw new Error("The Node.js native addon module (tfjs_binding.node) can not "
    ^

Error: The Node.js native addon module (tfjs_binding.node) can not be found at path: C:\Users\Vivek\YU\covidiots_nlp\covidiots\node_modules\@tensorflow\tfjs-node\lib\napi-v5\tfjs_binding.node.
Please run command 'npm rebuild @tensorflow/tfjs-node build-addon-from-source' to rebuild the native addon module.
If you have problem with building the addon module, please check https://github.com/tensorflow/tfjs/blob/master/tfjs-node/WINDOWS_TROUBLESHOOTING.md or file an issue.
    at Object.<anonymous> (C:\Users\Vivek\YU\covidiots_nlp\covidiots\node_modules\@tensorflow\tfjs-node\dist\index.js:49:11)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Module.require (internal/modules/cjs/loader.js:848:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (C:\Users\Vivek\YU\covidiots_nlp\covidiots\node_modules\question-answering\dist\models\saved-model.model.js:10:25)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)

I have tried doing npm rebuild @tensorflow/tfjs-node-gpu build-addon-from-source as suggested in the error message and also later tried npm install @tensorflow/tfjs-node-gpu , but nothing is working for me. Can you please let me know what I might be doing wrong here.