Fine-tuning
NSFW Content filtering essentially performs linear probing on top of existing CLIP checkpoint. The
recommended configuration can be found in the conf/fine_tuning/nsfw
which corresponds to CLIP L-14 version.
You can access and modify parameters to customize the hyperparameters according to your specific
training requirements and base model needs.
To enable the training stage with an NSFW model, configure the following configuration files:
In the
defaults
section, update thetraining
field to point to the desired NSFW configuration file. The only provided configuration for now isnsfw_L_14.yaml
.defaults: - _self_ - cluster: bcm - fine_tuning: nsfw/nsfw_L_14 ...
In the
stages
field ofconf/config.yaml
, make sure the training stage is included. For example,stages: - fine_tuning ...
Execute launcher pipeline:
python3 main.py
Remarks:
You should feed the trained CLIP checkpoint into NSFW training by specifying
training.model.restore_from_path
(or setrestore_from_path
field in themodel
section ofnsfw/nsfw_L_14.yaml
). The checkpoint can be sourced from either NeMo or converted from Hugging Face in the form of a.nemo
file.