code: def create_siamese_model(
      query_config: DictConfig,
      response_config: DictConfig,
      query_model: Optional[nn.Module] = None,
      response_model: Optional[nn.Module] = None,
      pretrained: Optional[bool] = True,
  ):
      """
      Create the query and response models and make them share the same encoders for the same modalities.
  
      Parameters
      ----------
      query_config
          The query config.
      response_config
          The response config.
      query_model
          The query model if already created.
      response_model
          The response model if already created.
  
      Returns
      -------
      The query and response models satisfying the siamese constraint.
      """
      if query_model is None:
          single_models, query_fusion_model = create_fusion_model_dict(
              config=query_config.model,
              pretrained=pretrained,
          )
      else:
          single_models, query_fusion_model = get_fusion_model_dict(
              model=query_model,
          )
  
      if response_model is None:
          (
              single_models,
              response_fusion_model,
          ) = create_fusion_model_dict(
              config=response_config.model,
              single_models=single_models,
              pretrained=pretrained,
          )
      else:
          single_models, response_fusion_model = get_fusion_model_dict(
              model=response_model,
              single_models=single_models,
          )
  
      share_fusion = is_share_fusion(
          query_model_names=query_config.model.names,
          response_model_names=response_config.model.names,
      )
      query_model, response_model = make_siamese(
          query_config=query_config,
          response_config=response_config,
          single_models=single_models,
          query_fusion_model=query_fusion_model,
          response_fusion_model=response_fusion_model,
          share_fusion=share_fusion,
          initialized=False,
      )
  
      return query_model, response_model
  
imports: import copy
  import functools
  import heapq
  import logging
  from typing import Dict, List, Optional, Union
  import pandas
  import torch
  from omegaconf import DictConfig
  from torch import nn
  from torch.nn import functional
  from ..constants import FUSION, QUERY, RESPONSE
  from .data import data_to_df
  from .model import create_model
label_desc: Use image node_id 5 for calling a global function with example usage: create_siamese_model(query_config, response_config, query_model, response_model, pretrained) and returns: query_model,  response_model