Manage access requests for gated repositories on the HuggingFace Hub.
Gated repos require users to request access before downloading. As a repo admin you can view pending requests and accept, reject, or cancel them.
See: https://huggingface.co/docs/hub/models-gated
Example
# List pending requests for a gated model
{:ok, requests} = HuggingfaceClient.list_pending_access_requests("my-org/gated-model",
access_token: "hf_admin_token"
)
# Accept a specific user's request
:ok = HuggingfaceClient.accept_access_request("my-org/gated-model",
user: "alice",
access_token: "hf_admin_token"
)
Summary
Functions
Accepts a user's access request for a gated repository.
Cancels a user's accepted access (moves them back to pending).
Grants access to a user directly (bypassing the request flow).
Lists accepted access requests for a gated repository.
Lists pending access requests for a gated repository.
Lists rejected access requests for a gated repository.
Rejects a user's access request for a gated repository.
Revokes a user's access to a gated repository.
Functions
@spec accept( String.t(), keyword() ) :: :ok | {:error, Exception.t()}
Accepts a user's access request for a gated repository.
Options
:user— username of the user to accept (required):type— repo type (default::model):access_token
@spec cancel( String.t(), keyword() ) :: :ok | {:error, Exception.t()}
Cancels a user's accepted access (moves them back to pending).
@spec grant_access( String.t(), keyword() ) :: :ok | {:error, Exception.t()}
Grants access to a user directly (bypassing the request flow).
Options
:user— username (required):type— repo type (default::model)
@spec list_accepted( String.t(), keyword() ) :: {:ok, [map()]} | {:error, Exception.t()}
Lists accepted access requests for a gated repository.
@spec list_pending( String.t(), keyword() ) :: {:ok, [map()]} | {:error, Exception.t()}
Lists pending access requests for a gated repository.
@spec list_rejected( String.t(), keyword() ) :: {:ok, [map()]} | {:error, Exception.t()}
Lists rejected access requests for a gated repository.
@spec reject( String.t(), keyword() ) :: :ok | {:error, Exception.t()}
Rejects a user's access request for a gated repository.
@spec revoke_access( String.t(), keyword() ) :: :ok | {:error, Exception.t()}
Revokes a user's access to a gated repository.