
    rh                         d Z ddlZddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ dd	lmZ d
dlmZ  ej"                  e      Z G d de      Z G d d      Zy)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                   "    e Zd Zedefd       Zy)RepoCommandsparserc                 n   | j                  dd      }|j                  d      }|j                  dd      }|j                  dt        d	       |j                  d
t        d	       |j                  dt        dt               |j                  ddd       |j                  dt        d	       |j                  ddd       |j                  dt        d	       |j                  dt        d	       |j                  dddd       |j                  dt        d	       |j                  d  !       y )"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                     t        |       S )N)RepoCreateCommand)argss    p/var/www/html/ai-insurance-compliance-backend/venv/lib/python3.12/site-packages/huggingface_hub/commands/repo.py<lambda>z2RepoCommands.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_subcommandz 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__staticmethodr   r'    r   r   r   r   (   s    6S$5 6S 6Sr   r   c                   2    e Zd Zdej                  fdZd Zy)r   r   c                 l   |j                   | _         |j                  xs |j                  | _        |j                  | _        |j                  | _        |j
                  | _        |j                  | _        |j                  | _        |j                  | _        |j                  | _	        |j                  t        t        j                  d             | j                  t        t        j                  d             | j
                  rt        t        j                  d             t               | _        y )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__zRepoCreateCommand.__init__d   s     LL(,(C$))(,+/+<+<!\\$(JJ
"mm040F0F99 y
 ( b
 88| G	r   c           	      L   t        dd       | j                  Wd| j                  v r)t        t	        j
                  d             t        d       | j                   d| j                   | _        | j                  j                  | j                  | j                  | j                  | j                  | j                  | j                  | j                        }t        dt	        j                  |j                         d       t        d	t	        j                  |              y )
Nzhuggingface-cli repozhf repo/zCYou cannot pass both --organization and a repo_id with a namespace.r
   )r   r/   r3   r4   r5   r6   r0   zSuccessfully created z on the Hub.zYour repo is now available at )r   r1   r   r7   r   redexitr9   create_repor/   r3   r4   r5   r6   r0   bold)r:   repo_urls     r   runz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   N)r(   r)   r*   argparse	Namespacer;   rC   r,   r   r   r   r   c   s    X// @Fr   r   )__doc__rD   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>rP      sW     &  > 4 6 ( ) 0 
		H	%8S, 8Sv4F 4Fr   