To enable the export stage with a CLIP model, configure the configuration files:
In the
defaults
section ofconf/config.yaml
, update theexport
field to point to the desired CLIP configuration file. For example, if you want to use theclip/export_clip
configuration, change theexport
field toclip/export_clip
.defaults: - export: clip/export_clip ...
In the
stages
field ofconf/config.yaml
, make sure theexport
stage is included. For example,stages: - export ...
Configure
infer.max_batch_size
of theconf/export/clip/export_clip.yaml
file to set the max_batch_size to use for the ONNX and NVIDIA TensorRT model.Set the resolution of the model with
max_dim
in theinfer
field. One can also set theinfer.max_text
to be the maximum text size for the text_encoder. This will be used to generate the ONNX and NVIDIA TensorRT formats.
Remarks:
To load a pretrained checkpoint for inference, set the
restore_from_path
field in themodel
section to the path of the pretrained checkpoint in.nemo
format inconf/export/clip/export_clip.yaml
.