utils/update_metadata.py/update_metadata
def update_metadata(token, commit_sha):
    """
    Update the metadata for the Transformers repo.
    """
    with tempfile.TemporaryDirectory() as tmp_dir:
        repo = Repository(tmp_dir, clone_from="huggingface/transformers-metadata", repo_type="dataset", token=token)

        frameworks_table = get_frameworks_table()
        frameworks_dataset = Dataset.from_pandas(frameworks_table)
        frameworks_dataset.to_json(os.path.join(tmp_dir, "frameworks.json"))

        tags_dataset = Dataset.from_json(os.path.join(tmp_dir, "pipeline_tags.json"))
        table = {
            tags_dataset[i]["model_class"]: (tags_dataset[i]["pipeline_tag"], tags_dataset[i]["auto_class"])
            for i in range(len(tags_dataset))
        }
        table = update_pipeline_and_auto_class_table(table)

        # Sort the model classes to avoid some nondeterministic updates to create false update commits.
        model_classes = sorted(table.keys())
        tags_table = pd.DataFrame(
            {
                "model_class": model_classes,
                "pipeline_tag": [table[m][0] for m in model_classes],
                "auto_class": [table[m][1] for m in model_classes],
            }
        )
        tags_dataset = Dataset.from_pandas(tags_table)
        tags_dataset.to_json(os.path.join(tmp_dir, "pipeline_tags.json"))

        if repo.is_repo_clean():
            print("Nothing to commit!")
        else:
            if commit_sha is not None:
                commit_message = (
                    f"Update with commit {commit_sha}\n\nSee: "
                    f"https://github.com/huggingface/transformers/commit/{commit_sha}"
                )
            else:
                commit_message = "Update"
            repo.push_to_hub(commit_message)