code: def create_eval_model(
      model_creator, hparams, scope=None, extra_args=None
  ):
      """Create train graph, model, src/tgt file holders, and iterator."""
      src_vocab_file = hparams.src_vocab_file
      tgt_vocab_file = hparams.tgt_vocab_file
      graph = tf.Graph()
  
      with graph.as_default(), tf.container(scope or "eval"):
          (
              src_vocab_table,
              tgt_vocab_table,
          ) = vocab_utils.create_vocab_tables(
              src_vocab_file, tgt_vocab_file, hparams.share_vocab
          )
          reverse_tgt_vocab_table = (
              lookup_ops.index_to_string_table_from_file(
                  tgt_vocab_file, default_value=vocab_utils.UNK
              )
          )
  
          src_file_placeholder = tf.placeholder(
              shape=(), dtype=tf.string
          )
          tgt_file_placeholder = tf.placeholder(
              shape=(), dtype=tf.string
          )
          src_dataset = tf.data.TextLineDataset(src_file_placeholder)
          tgt_dataset = tf.data.TextLineDataset(tgt_file_placeholder)
          iterator = iterator_utils.get_iterator(
              src_dataset,
              tgt_dataset,
              src_vocab_table,
              tgt_vocab_table,
              hparams.batch_size,
              sos=hparams.sos,
              eos=hparams.eos,
              random_seed=hparams.random_seed,
              num_buckets=hparams.num_buckets,
              src_max_len=hparams.src_max_len_infer,
              tgt_max_len=hparams.tgt_max_len_infer,
              use_char_encode=hparams.use_char_encode,
          )
          model = model_creator(
              hparams,
              iterator=iterator,
              mode=tf.contrib.learn.ModeKeys.EVAL,
              source_vocab_table=src_vocab_table,
              target_vocab_table=tgt_vocab_table,
              reverse_target_vocab_table=reverse_tgt_vocab_table,
              scope=scope,
              extra_args=extra_args,
          )
      return EvalModel(
          graph=graph,
          model=model,
          src_file_placeholder=src_file_placeholder,
          tgt_file_placeholder=tgt_file_placeholder,
          iterator=iterator,
      )
  
imports: from __future__ import print_function
  import collections
  import os
  import time
  import numpy
  import six
  import tensorflow
  from tensorflow.python.ops import lookup_ops
  from .utils import misc_utils, vocab_utils, iterator_utils
label_desc: Use image node_id 4 for calling a global function with example usage: create_eval_model(model_creator, hparams, scope, extra_args) and returns: EvalModel