Closed
Description
It's possible to add a gate to a repo programmatically. It's used in the Open LLM Leaderboard for instance (see slack -internal-). It can be done like this:
from huggingface_hub.utils import build_hf_headers, get_session, hf_raise_for_status
headers = build_hf_headers()
r = get_session().put(
url=f"https://huggingface.co/api/datasets/{repo_id}/settings",
headers=headers,
json={"gated": "auto"},
)
hf_raise_for_status(r)
Value can be "auto"
, "manual"
or False
.
It would be nice to add it as a new method in HfApi
.