(opt)
Checking if there are existing .pt files to avoid tampering
Checking if there are existing .pt files to avoid tampering
Checking if there are existing . pt files to avoid tampering
def check_existing_pt_files(opt):
    """ Checking if there are existing .pt files to avoid tampering """
    # We will use glob.glob() to find sharded {train|valid}.[0-9]*.pt
    # when training, so check to avoid tampering with existing pt files
    # or mixing them up.
    for t in ['train', 'valid', 'vocab']:
        pattern = opt.save_data + '.' + t + '*.pt'
        if glob.glob(pattern):
            sys.stderr.write("Please backup existing pt file: %s, "
                             "to avoid tampering!\n" % pattern)
            sys.exit(1)
def check_existing_pt_files ( opt ) : # We will use glob.glob() to find sharded {train|valid}.[0-9]*.pt # when training, so check to avoid tampering with existing pt files # or mixing them up. for t in [ 'train' , 'valid' , 'vocab' ] : pattern = opt . save_data + '.' + t + '*.pt' if glob . glob ( pattern ) : sys . stderr . write ( "Please backup existing pt file: %s, " "to avoid tampering!\n" % pattern ) sys . exit ( 1 )