def main()

in dpr_scale/data_prep/prep_conv_datasets.py [0:0]


def main(args, logger):
    logger.info(args.__dict__)
    if not args.in_file_path or not args.out_file_path:
        logger.error("You must provide paths to input and output files.")
        return
    if not os.path.exists(args.in_file_path):
        logger.error(f"{args.in_file_path} doens't exist")
        return
    os.makedirs(os.path.dirname(args.out_file_path), exist_ok=True)

    prep_func = (
        prep_dpr_dstc7 if args.dataset == "dstc7" else prep_dpr_ubuntuv2
    )
    num_samples = prep_func(args.in_file_path, args.out_file_path)
    logger.info(f"{num_samples} were written to {args.out_file_path}")