Skip to content

Addgated_mode for create repo#1730

Merged
wangxingjun778 merged 5 commits into
modelscope:masterfrom
wangxingjun778:fix/set_visibility
Jun 5, 2026
Merged

Addgated_mode for create repo#1730
wangxingjun778 merged 5 commits into
modelscope:masterfrom
wangxingjun778:fix/set_visibility

Conversation

@wangxingjun778

@wangxingjun778 wangxingjun778 commented Jun 2, 2026

Copy link
Copy Markdown
Member

Add gated_mode for create_repo (model, dataset), add param for CLI

wangxingjun778 and others added 3 commits December 10, 2025 10:25
Add ProtectedMode enum (1=protected/application-based, 2=off/normal)
to constants.py. Pass protected_mode parameter through create_model,
create_dataset, create_repo, set_repo_visibility, and CLI ms create.
Only effective when visibility is private; warns and ignores otherwise.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for a protected_mode parameter when creating or updating the visibility of private model and dataset repositories, including a new CLI argument --protected_mode. The feedback suggests preserving the existing ProtectedMode of a repository when updating its visibility rather than defaulting to 'off' (2) when the parameter is not explicitly provided, and refactoring the fallback logic directly into the payload dictionaries.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread modelscope/hub/api.py Outdated
Comment thread modelscope/hub/api.py
Comment thread modelscope/hub/api.py
@yingdachen

Copy link
Copy Markdown
Member

protected mode指的是申请制?

@wangxingjun778

Copy link
Copy Markdown
Member Author

protected mode指的是申请制?

是的,protected_mode=1 -- 申请制, protected_mode=2 -- 正常private repo;

@wangxingjun778 wangxingjun778 changed the title Add protected_mode for create repo Addgated_mode for create repo Jun 2, 2026
@wangxingjun778 wangxingjun778 merged commit 63ff6ec into modelscope:master Jun 5, 2026
1 of 2 checks passed
Yunnglin pushed a commit that referenced this pull request Jun 9, 2026
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