def main(args):
    """
    `uid syn ref text`
    """
    in_root = Path(args.generation_root).resolve()
    ext = args.audio_format
    with open(args.audio_manifest) as f, open(args.output_path, "w") as f_out:
        reader = csv.DictReader(
            f, delimiter="\t", quotechar=None, doublequote=False,
            lineterminator="\n", quoting=csv.QUOTE_NONE
        )
        header = ["id", "syn", "ref", "text", "speaker"]
        f_out.write("\t".join(header) + "\n")
        for row in reader:
            dir_name = f"{ext}_{args.sample_rate}hz_{args.vocoder}"
            id_ = row["id"]
            syn = (in_root / dir_name / f"{id_}.{ext}").as_posix()
            ref = row["audio"]
            if args.use_resynthesized_target:
                ref = (in_root / f"{dir_name}_tgt" / f"{id_}.{ext}").as_posix()
            if args.eval_target:
                syn = row["audio"]
            sample = [id_, syn, ref, row["tgt_text"], row["speaker"]]
            f_out.write("\t".join(sample) + "\n")
    print(f"wrote evaluation file to {args.output_path}")
`uid syn ref text`
examples/speech_synthesis/evaluation/get_eval_manifest.py