class_docstr: Base class for multi-modal image-text data
docstr: Helper function to build the multi-modal image-text model
docstr_tok: ["Helper","function","to","build","the","multi-modal","image-text","model"]
code: def build_model(cls, opts, *args, **kwargs) -> BaseAnyNNModel:
      """Helper function to build the multi-modal image-text model"""
      projection_dim = getattr(
          opts, "model.multi_modal_image_text.clip.projection_dim", -1
      )
      if projection_dim < 1:
          logger.error("Projection dimension should be > 1. Got: {}")
  
      image_encoder: BaseImageEncoder = get_model(
          opts=opts, category="classification", *args, **kwargs
      )
      text_encoder: BaseTextEncoder = build_text_encoder(
          opts=opts, projection_dim=projection_dim, *args, **kwargs
      )
  
      # replace the classifier in image encoder with the task specific classifier
      image_encoder.classifier = update_image_classifier(
          opts,
          image_classifier=image_encoder.classifier,
          projection_dim=projection_dim,
      )
  
      model = cls(
          opts,
          image_encoder=image_encoder,
          text_encoder=text_encoder,
          *args,
          **kwargs,
      )
  
      if getattr(
          opts, "model.multi_modal_image_text.freeze_batch_norm"
      ):
          cls.freeze_norm_layers(opts, model)
      return model
  
imports: import argparse
  import math
  from typing import Dict, Optional
  import torch
  from torch import Tensor, nn
  from cvnets.image_projection_layers import build_image_projection_head
  from cvnets.image_projection_layers.base_image_projection import get_in_feature_dimension
  from cvnets.models import MODEL_REGISTRY, BaseAnyNNModel, get_model
  from cvnets.models.classification.base_image_encoder import BaseImageEncoder
  from cvnets.models.multi_modal_img_text.base_multi_modal_img_text import BaseMultiModalImageText
  from cvnets.text_encoders import BaseTextEncoder, build_text_encoder
  from utils import logger
label_desc: Use image node_id 8 for calling the CLIP obj's underlying member method code with example usage: obj.build_model(cls, opts) and returns: model