Example #1
0
def find_restore(prev_model_output_dir, ori_path, scorer_type):
    if prev_model_output_dir is None:
        return None, None
    highest_fscore, highest_ckpt = util.find_highest_score(prev_model_output_dir, ori_path, scorer_type)
    logging.info(f"[Train] highest fscore: {highest_fscore}, ckpt: {highest_ckpt}")
    if highest_fscore == 0 and highest_ckpt == '.pt':
        logging.error(f"[Train] cannot find the highest ckpt")
        exit()
    return highest_fscore, highest_ckpt
Example #2
0
def find_best(output_dir, ori_path, scorer_type):
    if output_dir is None:
        return None, None
    highest_fscore, highest_ckpt = util.find_highest_score(
        output_dir, ori_path, scorer_type)
    logging.info(
        f"[Evaluate] highest fscore: {highest_fscore}, ckpt: {highest_ckpt}")
    if highest_fscore == 0 and highest_ckpt == '.pt':
        logging.error(f"[Evaluate] cannot find the highest ckpt")
        exit()
    return highest_fscore, highest_ckpt