You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The dependency is huge and probably if you're not using it, you're not loving pulling in a GB of model. It would be nice if there was a way to have two image variants to reduce the size.
The text was updated successfully, but these errors were encountered:
I'm not a fan of programs that download stuff, needed at runtime, at runtime. It adds some uncertainty whether the download succeeds or fails, which could be completely avoided. You also had to manage the lifetime of the model (and dependency), when users attempted to cache it between versions in a volume/mount.
I'm not familiar with Node/JS, but it seems to have a variant of feature/optional/extra dependencies I know from other languages called optional dependencies. The concept would be to make the dependency optional and handle the case where the import fails in code, so it ends up like a feature switch. Using npm install --omit=optional would not fetch the dependency and the NSFW protection would be disabled.
Then you could build two images, one with and one without that feature and the model. Users could choose which one they want by pulling one or the other container image tag.
Node.JS optionals aren't the right tool for this, in the first line
If a dependency can be used, but you would like npm to proceed if it cannot be found or fails to install, then you may put it in the optionalDependencies object
I do agree with your point, probably having a "base" docker image and one with the models would work best. I'll rename the issue.
Half-Shot
changed the title
Consider downloading nsfwjs model at runtime
Consider providing a non-NSFW model variant of Mjolnir to reduce image size
Oct 2, 2024
The dependency is huge and probably if you're not using it, you're not loving pulling in a GB of model. It would be nice if there was a way to have two image variants to reduce the size.
The text was updated successfully, but these errors were encountered: