code: def test_initialize_from_clip_model(self, config, modality_name):
      params = {
          f"{modality_name}_encoder": {
              "conv1": {
                  "kernel": np.zeros((4 * 4 * 3, 8)),
              },
              "class_embedding": np.zeros((8, 10)),
              "VisionTransformer": {
                  "transformer": np.zeros((10,)),
                  "ln_pre": np.zeros((10,)),
                  "ln_post": np.zeros((10,)),
                  "positional_embedding": np.zeros((17, 10)),
              },
          },
          "text_encoder": {
              "positional_embedding": np.zeros((15, 10)),
              "token_embedding": np.zeros((100, 10)),
              "transformer": np.zeros((10,)),
              "ln_final": np.zeros((10,)),
          },
          "text_projection": {
              "kernel": np.zeros((16, 16)),
          },
          f"{modality_name}_projection": {
              "kernel": np.zeros((16, 16)),
          },
      }
      clip_params = {
          "params": {
              "text": {
                  "positional_embedding": np.ones((31, 10)),
                  "transformer": np.ones((10,)),
                  "ln_final": np.ones((10,)),
                  "token_embedding": np.ones((100, 10)),
                  "text_projection": {
                      "kernel": np.ones((16, 16)),
                  },
              },
              "visual": {
                  "conv1": {
                      "kernel": np.ones((4, 4, 3, 8)),
                  },
                  "class_embedding": np.ones((10,)),
                  "ln_post": np.ones((10,)),
                  "ln_pre": np.ones((10,)),
                  "positional_embedding": np.ones((10, 10)),
                  "proj": {
                      "kernel": np.ones((16, 16)),
                  },
                  "transformer": np.ones((10,)),
              },
          }
      }
      train_state = train_utils.TrainState(
          tx=struct.field(pytree_node=False),
          params=flax.core.freeze(params),
      )
      expected_params = {
          f"{modality_name}_encoder": {
              "conv1": {
                  "kernel": np.ones((4 * 4 * 3, 8)),
              },
              "class_embedding": jnp.ones((8, 10)),
              "VisionTransformer": {
                  "transformer": np.ones((10,)),
                  "ln_pre": np.ones((10,)),
                  "ln_post": np.ones((10,)),
                  "positional_embedding": jnp.ones((17, 10)),
              },
          },
          "text_encoder": {
              "positional_embedding": np.ones((15, 10)),
              "token_embedding": np.ones((100, 10)),
              "transformer": np.ones((10,)),
              "ln_final": np.ones((10,)),
          },
          "text_projection": {
              "kernel": np.ones((16, 16)),
          },
          f"{modality_name}_projection": {
              "kernel": np.ones((16, 16)),
          },
      }
      train_state = model_utils.initialize_from_clip_model(
          config,
          train_state,
          clip_params,
          load_image_tower=True,
          load_text_tower=True,
          video_modality_name=modality_name,
      )
      params = flax.core.unfreeze(train_state.params)
      self.assertDictEqualRecursive(params, expected_params)
  
file_path: scenic/scenic/projects/unloc/model_utils_test.py
imports: from absl.testing import absltest
  from absl.testing import parameterized
  import flax
  from flax import struct
  import jax.numpy
  import ml_collections
  import numpy
  from scenic.projects.unloc import model_utils
  from scenic.train_lib import train_utils
label_desc: Use image node_id 7 for calling the ModelUtilsTest obj's underlying member method code with example usage: obj.test_initialize_from_clip_model(config, modality_name) without return types