def main()

in text-semantic-search/index_builder/builder/task.py [0:0]


def main():

  args = get_args()

  time_start = datetime.utcnow()
  logging.info('Index building started...')
  index.build_index(args.embedding_files, LOCAL_INDEX_FILE, args.num_trees)
  time_end = datetime.utcnow()
  logging.info('Index building  finished.')
  time_elapsed = time_end - time_start
  logging.info('Index building  elapsed time: {} seconds'.format(time_elapsed.total_seconds()))

  time_start = datetime.utcnow()
  logging.info('Uploading index artefacts started...')
  upload_artefacts(args.index_file)
  time_end = datetime.utcnow()
  logging.info('Uploading index artefacts finished.')
  time_elapsed = time_end - time_start
  logging.info('Uploading index artefacts elapsed time: {} seconds'.format(time_elapsed.total_seconds()))