import tensorflow as tf

        writer.write('model_checkpoint_path: "%s-%s"\n' % (os.path.join(FLAGS.recover_dir, "input.ckpt"), str(FLAGS.ckpt_no_input)))
        writer.write('all_model_checkpoint_paths: "%s-%s"\n' % (os.path.join(FLAGS.recover_dir, "input.ckpt"), str(FLAGS.ckpt_no_input)))

  if FLAGS.use_hvd and hvd.rank() == 0 and (FLAGS.do_train or FLAGS.do_train_eval):
    (cpath, cname) = os.path.split(FLAGS.bert_config_file)
    tf.gfile.Copy(FLAGS.bert_config_file, os.path.join(FLAGS.output_dir, cname), True)

  input_files = []
  if FLAGS.input_file is not None:
    for input_pattern in FLAGS.input_file.split(","):
      input_files.extend(tf.gfile.Glob(input_pattern))
  if FLAGS.input_dir is not None:
    for filename in tf.gfile.ListDirectory(FLAGS.input_dir):
      input_files.extend(tf.gfile.Glob(os.path.join(FLAGS.input_dir, filename)))

  tf.logging.info("*** Input Files ***")
  for input_file in input_files:
    tf.logging.info("  %s" % input_file)

  validation_input_files = []
  if FLAGS.validation_input_file is None and FLAGS.validation_input_dir is None:
    validation_input_files = input_files
  else:
    if FLAGS.validation_input_file is not None:
      for input_pattern in FLAGS.validation_input_file.split(","):
        validation_input_files.extend(tf.gfile.Glob(input_pattern))
    if FLAGS.validation_input_dir is not None:
      for filename in tf.gfile.ListDirectory(FLAGS.validation_input_dir):
        validation_input_files.extend(tf.gfile.Glob(os.path.join(FLAGS.validation_input_dir, filename)))

