utils/check_table.py/check_onnx_model_list
def check_onnx_model_list(overwrite=False):
    """Check the model list in the serialization.mdx is consistent with the state of the lib and maybe `overwrite`."""
    current_list, start_index, end_index, lines = _find_text_in_file(
        filename=os.path.join(PATH_TO_DOCS, "serialization.mdx"),
        start_prompt="<!--This table is automatically generated by `make fix-copies`, do not fill manually!-->",
        end_prompt="In the next two sections, we'll show you how to:",
    )
    new_list = get_onnx_model_list()

    if current_list != new_list:
        if overwrite:
            with open(os.path.join(PATH_TO_DOCS, "serialization.mdx"), "w", encoding="utf-8", newline="\n") as f:
                f.writelines(lines[:start_index] + [new_list] + lines[end_index:])
        else:
            raise ValueError("The list of ONNX-supported models needs an update. Run `make fix-copies` to fix this.")