import tensorflow as tf


  if FLAGS.do_serve:

    def serving_input_fn():
      with tf.variable_scope("foo"):
        feature_spec = {
            "input_ids": tf.FixedLenFeature([FLAGS.max_seq_length], tf.int64),
            "input_mask": tf.FixedLenFeature([FLAGS.max_seq_length], tf.int64),
            "segment_ids": tf.FixedLenFeature([FLAGS.max_seq_length], tf.int64),
            "label_ids": tf.FixedLenFeature([], tf.int64),
          }
        serialized_tf_example = tf.placeholder(dtype=tf.string,
                                               shape=[None],
                                               name='input_example_tensor')
