code: def check_models_equal(model1, model2):
      models_are_equal = True
      flat_params_1 = flatten_dict(model1.params)
      flat_params_2 = flatten_dict(model2.params)
      for key in flat_params_1.keys():
          if (
              np.sum(np.abs(flat_params_1[key] - flat_params_2[key]))
              > 1e-4
          ):
              models_are_equal = False
  
      return models_are_equal
  
imports: import copy
  import inspect
  import json
  import random
  import tempfile
  import unittest
  from typing import List, Tuple
  import numpy
  import transformers
  from huggingface_hub import HfFolder, delete_repo, set_access_token
  from requests.exceptions import HTTPError
  from transformers import BertConfig, is_flax_available, is_torch_available
  from transformers.models.auto import get_values
  from transformers.testing_utils import TOKEN, USER, CaptureLogger, is_pt_flax_cross_test, is_staging_test, require_flax, torch_device
  from transformers.utils import logging
  from transformers.utils.generic import ModelOutput
label_desc: Use image node_id 5 for calling a global function with example usage: check_models_equal(model1, model2) and returns: models_are_equal