def get_lang_examples()

in mgsm_eval.py [0:0]


def get_lang_examples(lang: str) -> list[dict[str, str]]:
    fpath = LANG_TO_FPATH[lang]
    examples = []
    with common.url_to_fileobj(fpath, binary=True) as f:
        for raw_line in f:
            line = raw_line.decode("utf-8").strip()
            inputs, targets = line.split("\t")
            if "." in targets:
                raise ValueError(f"targets {targets} contains a decimal point.")
            # targets = int(targets.replace(",", ""))
            examples.append({"inputs": inputs, "targets": targets, "lang": lang})
    return examples