Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/hub/datasets-gated.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,21 @@ Alternatively, you can programmatically login using `login()` in a notebook or a
You can also provide the `token` parameter to most loading methods in the libraries (`from_pretrained`, `hf_hub_download`, `load_dataset`, etc.), directly from your scripts.

For more details about how to login, check out the [login guide](/docs/huggingface_hub/quick-start#login).

### Restricting Access for EU Users

For gated datasets, you can add an additional layer of access control to specifically restrict users from European Union countries. This is useful if your dataset's license or terms of use prohibit its distribution in the EU.

To enable this, add the `extra_gated_eu_disallowed: true` property to your dataset card's metadata.

**Important:** This feature will only activate if your dataset is already gated. If `gated: false` or the property is not set, this restriction will not apply.

```yaml
---
license: mit
gated: true
extra_gated_eu_disallowed: true
---
```

The system identifies a user's location based on their IP address.
18 changes: 18 additions & 0 deletions docs/hub/models-gated.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,21 @@ Alternatively, you can programmatically login using `login()` in a notebook or a
You can also provide the `token` parameter to most loading methods in the libraries (`from_pretrained`, `hf_hub_download`, `load_dataset`, etc.), directly from your scripts.

For more details about how to login, check out the [login guide](https://huggingface.co/docs/huggingface_hub/quick-start#login).

### Restricting Access for EU Users

For gated models, you can add an additional layer of access control to specifically restrict users from European Union countries. This is useful if your model's license or terms of use prohibit its distribution in the EU.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For gated models, you can add an additional layer of access control to specifically restrict users from European Union countries. This is useful if your model's license or terms of use prohibit its distribution in the EU.
Gated repositories can be configured with an additional layer of access control to disallow access from European Union countries. This is useful if your license or terms of use prohibit distribution in the EU.

Not specific to models, I think (even though the rest of file does mention models everywhere).

Copy link
Contributor Author

@Charlie-Boyer Charlie-Boyer Aug 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the model doc, we have another one for datasets https://huggingface.co/docs/hub/en/datasets-gated
maybe I should add this info here also, wdyt @Vaibhavs10 ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, you're right! Sure, we can do that here or in a follow-up PR, as you wish.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added it


To enable this, add the `extra_gated_eu_disallowed: true` property to your model card's metadata.

**Important:** This feature will only activate if your model is already gated. If `gated: false` or the property is not set, this restriction will not apply.

```yaml
---
license: mit
gated: true
extra_gated_eu_disallowed: true
---
```

The system identifies a user's location based on their IP address.