def setup_graph():
  """Sets up the Tenorflow graph for inference."""
  # Set up the model for inference
  model_config = load_config(os.path.join(FLAGS.config_filepath))
  placeholder, features, labels = input_pipeline.create_placeholder_inputs(
      model_config.model_parameters.use_segment_ids,
      model_config.model_parameters.use_foreign_key_features,
      model_config.model_parameters.use_alignment_features)

  model_fn = model_builder.build_model_fn(
      model_config,
      FLAGS.output_vocab_filepath,
      FLAGS.clean_output_vocab_filepath,
      beam_size=FLAGS.beam_size)
  mode = tf_estimator.ModeKeys.PREDICT
  predictions = model_fn(features, labels, mode).predictions

  saver = tf.train.Saver()

  return saver, placeholder, predictions
Sets up the Tenorflow graph for inference.
language/xsp/model/run_inference.py