You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Feature] Add update_repo_settings function to HfApi #2447 (#2502)
* [Feature] Update Repo Settings
* resolve merge conflicts
* fix merge issue
* merge issues
* Add `update_repo_settings` function to HfApi
* Add `update_repo_settings` function to HfApi
* Enhance HfApi with `update_repo_settings` function
* Enhance HfApi with `update_repo_settings` function
* Enhance HfApi with `update_repo_settings` function
* Enhance HfApi with `update_repo_settings` function
* Enhance HfApi with `update_repo_settings` function
* Apply suggestions from code review
---------
Co-authored-by: Lucain <lucain@huggingface.co>
Co-authored-by: Lucain Pouget <lucainp@gmail.com>
To give more control over how repos are used, the Hub allows repo authors to enable **access requests** for their repos. User must agree to share their contact information (username and email address) with the repo authors to access the files when enabled. A repo with access requests enabled is called a **gated repo**.
161
+
162
+
You can set a repo as gated using [`update_repo_settings`]:
163
+
164
+
```py
165
+
>>>from huggingface_hub import HfApi
166
+
167
+
>>> api = HfApi()
168
+
>>> api.update_repo_settings(repo_id=repo_id, gated="auto") # Set automatic gating for a model
169
+
```
170
+
158
171
### Rename your repository
159
172
160
173
You can rename your repository on the Hub using [`move_repo`]. Using this method, you can also move the repo from a user to
0 commit comments