infinitered / nsfwjs

NSFW detection on the client-side via TensorFlow.js
https://nsfwjs.com/
MIT License
8.09k stars 545 forks source link

Dist models just increase the size of node_modules unnecessarily (and aren't useful) #905

Open ghnp5 opened 6 hours ago

ghnp5 commented 6 hours ago

Now that the models are bundled, with PR #811, the size of "node_modules/nsfwjs" is now 3 x 3 Models bigger.

The modules appear in the following subdirectories:

models
esm
cjs

The 3 models, in these 3 folders.

And, none of them are really usable... because they're in the .min.js format.

Therefore, I still need to ship my own files, with the actual raw models, in some directory that is not the node_modules.

Is it possible to either remove the bundled models completely, by ignoring them in the build/publish, or at least ship only ONE version of them, being the raw files?

Thank you very much!

GantMan commented 3 hours ago

These should have been stripped out!

https://github.com/infinitered/nsfwjs/blob/master/.npmignore#L32

If you send a PR to strip out the model folder ( and essentially the demos ) we can merge it and do a new release.

cc: @mazenchami