
    ,h                         S r SSKrSSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSKJr  SS	KJr  S
SKJr  \R"                  " \5      r " S S\5      r " S S5      rg)a&  Contains commands to interact with repositories on the Hugging Face Hub.

Usage:
    # create a new dataset repo on the Hub
    huggingface-cli repo create my-cool-dataset --repo-type=dataset

    # create a private model repo on the Hub
    huggingface-cli repo create my-cool-model --private
    N)_SubParsersAction)Optional)BaseHuggingfaceCLICommand)ANSI)SPACES_SDK_TYPES)HfApi)logging   )show_deprecation_warningc                   ,    \ rS rSr\S\4S j5       rSrg)RepoCommands(   parserc                    U R                  SSS9nUR                  SS9nUR                  SSS9nUR                  S[        SS	9  UR                  S
[        SS	9  UR                  S[        S[        S9  UR                  SSSS9  UR                  S[        SS	9  UR                  SSSS9  UR                  S[        SS	9  UR                  S[        SS	9  UR                  SSSSS9  UR                  S[        SS	9  UR                  S  S!9  g )"Nrepoz={create} Commands to interact with your huggingface.co repos.)helpz%huggingface.co repos related commandscreatez#Create a new repo on huggingface.corepo_idzThe ID of the repo to create to (e.g. `username/repo-name`). The username is optional and will be set to your username if not provided.)typer   z--repo-typezWOptional: set to "dataset" or "space" if creating a dataset or space, default is model.z--space_sdkzOOptional: Hugging Face Spaces SDK type. Required when --type is set to "space".)r   r   choicesz	--private
store_truezhWhether to create a private repository. Defaults to public unless the organization's default is private.)actionr   z--tokenzLHugging Face token. Will default to the locally saved token if not provided.z
--exist-okz-Do not raise an error if repo already exists.z--resource-group-idzoResource group in which to create the repo. Resource groups is only available for Enterprise Hub organizations.z--typez&[Deprecated]: use --repo-type instead.z-yz--yesz[Deprecated] no effect.z--organizationzE[Deprecated] Pass the organization namespace directly in the repo_id.c                     [        U 5      $ )N)RepoCreateCommand)argss    U/var/www/html/shao/venv/lib/python3.13/site-packages/huggingface_hub/commands/repo.py<lambda>2RepoCommands.register_subcommand.<locals>.<lambda>`   s
    :KD:Q    )func)
add_parseradd_subparsersadd_argumentstrr   set_defaults)r   repo_parserrepo_subparsersrepo_create_parsers       r   register_subcommand RepoCommands.register_subcommand)   s   ''5t'u%44:a4b,77Gl7m'' [ 	( 	

 	''j 	( 	

 	''b$	 	( 	
 	''{ 	( 	

 	''_ 	( 	

 	''@ 	( 	

 	''! C 	( 	

 	''9 	( 	

 	''*	 	( 	
 	''3-t 	( 	
 	''-Q'Rr    N)__name__
__module____qualname____firstlineno__staticmethodr   r)   __static_attributes__r+   r   r   r   r   (   s    6S$5 6S 6Sr   r   c                   <    \ rS rSrS\R
                  4S jrS rSrg)r   c   r   c                    UR                   U l         UR                  =(       d    UR                  U l        UR                  U l        UR                  U l        UR
                  U l        UR                  U l        UR                  U l        UR                  U l        UR                  U l	        UR                  b  [        [        R                  " S5      5        U R                  b  [        [        R                  " S5      5        U R
                  (       a  [        [        R                  " S5      5        [        5       U l        g )NzcThe --type argument is deprecated and will be removed in a future version. Use --repo-type instead.zThe --organization argument is deprecated and will be removed in a future version. Pass the organization namespace directly in the repo_id.zfThe --yes argument is deprecated and will be removed in a future version. It does not have any effect.)r   	repo_typer   	space_sdkorganizationyesprivatetokenexist_okresource_group_idprintr   yellowr   _api)selfr   s     r   __init__RepoCreateCommand.__init__d   s     LL(,(C$))(,+/+<+<!\\$(JJ
"mm040F0F99 y
 ( b
 88| G	r   c           
      R   [        SS5        U R                  bZ  SU R                  ;   a*  [        [        R
                  " S5      5        [        S5        U R                   SU R                   3U l        U R                  R                  U R                  U R                  U R                  U R                  U R                  U R                  U R                  S9n[        S[        R                  " UR                  5       S35        [        S	[        R                  " U5       35        g )
Nzhuggingface-cli repozhf repo/zCYou cannot pass both --organization and a repo_id with a namespace.r
   )r   r5   r9   r:   r;   r<   r6   zSuccessfully created z on the Hub.zYour repo is now available at )r   r7   r   r=   r   redexitr?   create_repor5   r9   r:   r;   r<   r6   bold)r@   repo_urls     r   runRepoCreateCommand.run   s     !7C(dll"dhhdefQ"//0$,,@DL99((LLnnLL**]]"44nn ) 
 	%dii0@0@&A%B,OP.tyy/B.CDEr   )
r?   r;   r7   r9   r   r5   r<   r6   r:   r8   N)	r,   r-   r.   r/   argparse	NamespacerA   rJ   r1   r+   r   r   r   r   c   s    X// @Fr   r   )__doc__rL   r   typingr   huggingface_hub.commandsr   #huggingface_hub.commands._cli_utilsr   huggingface_hub.constantsr   huggingface_hub.hf_apir   huggingface_hub.utilsr	   
_cli_utilsr   
get_loggerr,   loggerr   r   r+   r   r   <module>rX      sU     &  > 4 6 ( ) 0 
		H	%8S, 8Sv4F 4Fr   