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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

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.

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.

2 participants