code: def initialize_text_encoder_from_clip_params(
      params: Dict[str, Any],
      restored_params: Mapping[str, Any],
      load_projection: bool = False,
      model_prefix_path: Optional[List[str]] = None,
  ):
      """Initialize text encoder from a CLIP model."""
      if model_prefix_path:
          to_params = params[model_prefix_path[0]]
          for prefix in model_prefix_path[1:]:
              to_params = to_params[prefix]
      else:
          to_params = params
      for m_key, m_params in restored_params.items():
          if m_key == "positional_embedding":
              to_params[m_key] = init_text_posemb(
                  to_params[m_key], m_params
              )
          elif m_key == "text_projection":
              if load_projection:
                  to_params[m_key] = m_params
          else:
              logging.info("Loading `%s` from checkpoint.", m_key)
              to_params[m_key] = m_params
  
imports: from typing import Any, Dict, List, Mapping, Optional, Sequence, Union
  from absl import logging
  import flax
  import jax
  import jax.numpy
  import ml_collections
  import numpy
  from scenic.projects.vivit import model_utils
  from scenic.train_lib import train_utils
label_desc: Use image node_id 9 for calling a global function with example usage: initialize_text_encoder_from_clip_params(params, restored_params, load_projection, model_prefix_path) without return types