def skip(save_folder, conf, meta_files, opt_file): """ Detects if the AMI data_preparation has been already done. If the preparation has been done, we can skip it. Returns ------- bool if True, the preparation phase can be skipped. if False, it must be done. """ # Checking if meta (json) files are available skip = True for file_path in meta_files: if not os.path.isfile(file_path): skip = False # Checking saved options save_opt_file = os.path.join(save_folder, opt_file) if skip is True: if os.path.isfile(save_opt_file): opts_old = load_pkl(save_opt_file) if opts_old == conf: skip = True else: skip = False else: skip = False return skip
def skip(splits, save_folder, conf): """ Detect when the librispeech data prep can be skipped. Arguments --------- splits : list A list of the splits expected in the preparation. save_folder : str The location of the seave directory conf : dict The configuration options to ensure they haven't changed. Returns ------- bool if True, the preparation phase can be skipped. if False, it must be done. """ # Checking csv files skip = True for split in splits: if not os.path.isfile(os.path.join(save_folder, split + ".csv")): skip = False # Checking saved options save_opt = os.path.join(save_folder, OPT_FILE) if skip is True: if os.path.isfile(save_opt): opts_old = load_pkl(save_opt) if opts_old == conf: skip = True else: skip = False else: skip = False return skip
def skip(splits, save_folder, conf): """ Detects if the AMI data_preparation has been already done. If the preparation has been done, we can skip it. Returns ------- bool if True, the preparation phase can be skipped. if False, it must be done. """ # Checking csv files skip = True split_files = { "train": TRAIN_CSV, "dev": DEV_CSV, "eval": EVAL_CSV, } for split in splits: if not os.path.isfile( os.path.join(save_folder, "csv", split_files[split])): skip = False # Checking saved options save_opt = os.path.join(save_folder, OPT_FILE) if skip is True: if os.path.isfile(save_opt): opts_old = load_pkl(save_opt) if opts_old == conf: skip = True else: skip = False else: skip = False return skip