Skip to content

Instantly share code, notes, and snippets.

View severo's full-sized avatar

Sylvain Lesage severo

View GitHub Profile
@severo
severo / set_gated.py
Created August 12, 2022 16:00
A function to set the gated parameter on a HF repository
from huggingface_hub.hf_api import ( # type: ignore
REPO_TYPES,
REPO_TYPES_URL_PREFIXES,
HfApi,
_raise_for_status,
)
def update_repo_settings(
hf_api: HfApi,
repo_id: str,