code: def convert_weights(model: nn.Module):
      """Convert applicable model parameters to fp16"""
  
      def _convert_weights_to_fp16(layer):
          if isinstance(layer, (nn.Conv1d, nn.Conv2d, nn.Linear)):
              layer.weight.data = layer.weight.data.half()
              if layer.bias is not None:
                  layer.bias.data = layer.bias.data.half()
  
          if isinstance(layer, nn.MultiheadAttention):
              for attr in [
                  *[f"{s}_proj_weight" for s in ["in", "q", "k", "v"]],
                  "in_proj_bias",
                  "bias_k",
                  "bias_v",
              ]:
                  tensor = getattr(layer, attr)
                  if tensor is not None:
                      tensor.data = tensor.data.half()
  
          for name in ["text_projection", "proj"]:
              if hasattr(layer, name):
                  attr = getattr(layer, name)
                  if attr is not None:
                      attr.data = attr.data.half()
  
      model.apply(_convert_weights_to_fp16)
  
file_path: towhee/towhee/models/clip/clip_utils.py
imports: from typing import Union, List, Dict
  from pkg_resources import packaging
  from torchvision.transforms import Compose, Resize, CenterCrop, ToTensor, Normalize
  from torchvision.transforms import InterpolationMode
  import torch
  import torchvision
  from torch import nn
  from .simple_tokenizer import SimpleTokenizer
label_desc: Use image node_id 7 for calling a global function with example usage: convert_weights(model) without return types