Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure create_repo respect organization privacy settings #2679

Merged
merged 5 commits into from
Nov 27, 2024

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Nov 25, 2024

see slack thread (private)

Enterprise Hub allows organizations to force all repositories to be private. Since create_repo assumes that a repo is public when private=True is not explicitly passed, an error is thrown by the server

403 Forbidden: org-name forbids the creation of public models.

This is because private: False is passed by default (since #1001 😕). This PR updates this by making None the default value for private and send the value to the server only when explicitly set by the user. This should make the life of Enterprise Hub users much easier (today they need to explicitly pass private=True in their calls).

Note: tests are currently failing (need an update in staging org settings).
Note 2: we'll have to update many (most?) .push_to_hub signature in the HF ecosystem to also pass None whenever appropriate. I'll open PRs once that's merged.


TIL: better listen to the boss #1001 (comment)

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Contributor

@hanouticelina hanouticelina left a comment

Choose a reason for hiding this comment

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

left some nit suggestions on the private argument docstring – otherwise lgtm! thanks!

src/huggingface_hub/_commit_scheduler.py Outdated Show resolved Hide resolved
src/huggingface_hub/_tensorboard_logger.py Outdated Show resolved Hide resolved
src/huggingface_hub/hf_api.py Outdated Show resolved Hide resolved
src/huggingface_hub/hf_api.py Outdated Show resolved Hide resolved
src/huggingface_hub/hub_mixin.py Outdated Show resolved Hide resolved
src/huggingface_hub/keras_mixin.py Outdated Show resolved Hide resolved
@Wauplin Wauplin marked this pull request as ready for review November 27, 2024 11:12
@Wauplin
Copy link
Contributor Author

Wauplin commented Nov 27, 2024

Thanks for the suggestion :)
CI should be fixed by now (I've updated some mocked tests + server-side update is live). Will merge once it's green

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants