"...composable_kernel_onnx.git" did not exist on "fd49ff8080b90687108c46f92321ce10ecc743dc"
Unverified Commit e67ccf06 authored by Lysandre Debut's avatar Lysandre Debut Committed by GitHub
Browse files

Transformers Metadata (#30344)

parent 32d4bef6
...@@ -282,10 +282,40 @@ def update_metadata(token: str, commit_sha: str): ...@@ -282,10 +282,40 @@ def update_metadata(token: str, commit_sha: str):
) )
tags_dataset = Dataset.from_pandas(tags_table) tags_dataset = Dataset.from_pandas(tags_table)
hub_frameworks_json = hf_hub_download(
repo_id="huggingface/transformers-metadata",
filename="frameworks.json",
repo_type="dataset",
token=token,
)
with open(hub_frameworks_json) as f:
hub_frameworks_json = f.read()
hub_pipeline_tags_json = hf_hub_download(
repo_id="huggingface/transformers-metadata",
filename="pipeline_tags.json",
repo_type="dataset",
token=token,
)
with open(hub_pipeline_tags_json) as f:
hub_pipeline_tags_json = f.read()
with tempfile.TemporaryDirectory() as tmp_dir: with tempfile.TemporaryDirectory() as tmp_dir:
frameworks_dataset.to_json(os.path.join(tmp_dir, "frameworks.json")) frameworks_dataset.to_json(os.path.join(tmp_dir, "frameworks.json"))
tags_dataset.to_json(os.path.join(tmp_dir, "pipeline_tags.json")) tags_dataset.to_json(os.path.join(tmp_dir, "pipeline_tags.json"))
with open(os.path.join(tmp_dir, "frameworks.json")) as f:
frameworks_json = f.read()
with open(os.path.join(tmp_dir, "pipeline_tags.json")) as f:
pipeline_tags_json = f.read()
frameworks_equal = hub_frameworks_json == frameworks_json
hub_pipeline_tags_equal = hub_pipeline_tags_json == pipeline_tags_json
if frameworks_equal and hub_pipeline_tags_equal:
print("No updates on the Hub, not pushing the metadata files.")
return
if commit_sha is not None: if commit_sha is not None:
commit_message = ( commit_message = (
f"Update with commit {commit_sha}\n\nSee: " f"Update with commit {commit_sha}\n\nSee: "
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment