code: def get_model(
      hparams=None,
      mode=tf_estimator.ModeKeys.TRAIN,
      has_input=True,
      model_cls=transformer.Transformer,
  ):
      if hparams is None:
          hparams = transformer.transformer_tiny()
      hparams.hidden_size = 8
      hparams.filter_size = 32
      hparams.num_heads = 1
      hparams.layer_prepostprocess_dropout = 0.0
  
      if hparams.get("problem_hparams", None) is None:
          p_hparams = problem_hparams.test_problem_hparams(
              VOCAB_SIZE, VOCAB_SIZE, hparams
          )
      if not has_input:
          del p_hparams.modality["inputs"]
      hparams.problem_hparams = p_hparams
  
      inputs = np.random.randint(
          VOCAB_SIZE, size=(BATCH_SIZE, INPUT_LENGTH, 1, 1)
      )
      targets = np.random.randint(
          VOCAB_SIZE, size=(BATCH_SIZE, TARGET_LENGTH, 1, 1)
      )
      features = {
          "targets": tf.constant(
              targets, dtype=tf.int32, name="targets"
          ),
          "target_space_id": tf.constant(1, dtype=tf.int32),
      }
      if has_input:
          features["inputs"] = tf.constant(
              inputs, dtype=tf.int32, name="inputs"
          )
  
      return model_cls(hparams, mode, p_hparams), features
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from tensor2tensor.data_generators import librispeech
  from tensor2tensor.data_generators import problem_hparams
  from tensor2tensor.models import transformer
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 1 for calling a global function with example usage: get_model(hparams, mode, has_input, model_cls) and returns: model_cls,  features