def METHOD_NAME(args):
    with open(args.data, "r") as fp:
        lines = fp.read().split("\n")
        root = lines.pop(0).strip()
        files = [osp.join(root, line.split("\t")[0]) for line in lines if len(line) > 0]
        if getattr(args, "sample_pct", 0) > 0:
            files = random.sample(files, int(args.sample_pct * len(files)))
        num = len(files)
        reader = Wav2VecFeatureReader(args.checkpoint, args.layer)
        def iterate():
            for fname in files:
                feats = reader.get_feats(fname)
                yield feats.cpu().numpy()
    return iterate, num