
    _i%                        S r SSKrSSKJrJr  SSKrSSKJrJrJ	r	  SSK
JrJr  SSKJrJrJrJrJrJrJrJr  \R,                  " \5      r\" SS	9r\" S
S	9r\" SS	9r\R9                  \SS9  \R9                  \SS9   " S S\\R<                  5      r\RA                  SSS	9\RB                  SSSSS4S\S\S\\\   \RD                  " SS	94   S\S\S\\#\RD                  " SS	94   S\\\   \RD                  " SS	94   SS4S jj5       r$\RA                  S S!S	9\RB                  SS4S\S\S\S"\\#\RD                  " S#S	94   SS4
S$ jj5       r%\RA                  S%S&S	9S\RB                  4S'\S(\S\S\SS4
S) jj5       r&\RA                  S*S+S	9SSS\RB                  4S\S,\\\   \RD                  " S-S	94   S\\\#   \RD                  " S.S	94   S\S\SS4S/ jj5       r'\RA                  SS0S	9SS\RB                  S4S\S\\\RP                  " S1S	94   S2\S\S\S\\#\RD                  " S3S	94   SS4S4 jj5       r)\RA                  S S5S	9S\RB                  4S\S\\\RP                  " S6S	94   S\S\SS4
S7 jj5       r*\RA                  SS8S	9SSS\RB                  4S\S\\\RP                  " S9S	94   S:\\\   \RD                  " S;S<S=S	94   S2\S\S\SS4S> jj5       r+\RA                  S?S@S	9S\RB                  4S\S\S\SS4SA jj5       r,\RA                  S SBS	9SS\RB                  4S\S\\\RP                  " SCS	94   SD\\#\RD                  " SESFSGS	94   S\S\SS4SH jj5       r-g)Ia  Contains commands to interact with repositories on the Hugging Face Hub.

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

    # create a private model repo on the Hub
    hf repo create my-cool-model --private
    N)	AnnotatedOptional)HfHubHTTPErrorRepositoryNotFoundErrorRevisionNotFoundError)ANSIlogging   )
PrivateOpt	RepoIdArgRepoTypeRepoTypeOptRevisionOptTokenOpt
get_hf_apityper_factoryzManage repos on the Hub.)helpz"Manage tags for a repo on the Hub.z&Manage branches for a repo on the Hub.tag)namebranchc                        \ rS rSrSrSrSrSrg)GatedChoices5   automanualfalse N)__name__
__module____qualname____firstlineno__r   r   r   __static_attributes__r       T/var/www/html/land-ocr/venv/lib/python3.13/site-packages/huggingface_hub/cli/repo.pyr   r   5   s    DFEr#   r   createzCreate a new repo on the Hub.Frepo_id	repo_type	space_sdkzEHugging Face Spaces SDK type. Required when --type is set to 'space'.privatetokenexist_okz-Do not raise an error if repo already exists.resource_group_idzoResource group in which to create the repo. Resource groups is only available for Enterprise Hub organizations.returnc           
          [        US9nUR                  U UR                  UUUUUS9n[        S[        R
                  " UR                  5       S35        [        S[        R
                  " U5       35        g )Nr*   )r&   r'   r)   r*   r+   r,   r(   Successfully created  on the Hub.zYour repo is now available at )r   create_repovalueprintr   boldr&   )	r&   r'   r(   r)   r*   r+   r,   apirepo_urls	            r$   repo_creater8   ;   sx    2 5
!C//+  H 
!$))H,<,<"=!>l
KL	*499X+>*?
@Ar#   deletez>Delete a repo from the Hub. this is an irreversible operation.
missing_okz=If set to True, do not raise an error if repo does not exist.c                     [        US9nUR                  U UR                  US9  [        S[        R
                  " U 5       S35        g )Nr/   )r&   r'   r:   Successfully deleted r1   )r   delete_repor3   r4   r   r5   )r&   r'   r*   r:   r6   s        r$   repo_deleter>   b   sJ     5
!COO//  
 
!$))G"4!5\
BCr#   movez8Move a repository from a namespace to another namespace.from_idto_idc                     [        US9nUR                  U UUR                  S9  [        S[        R
                  " U 5       S[        R
                  " U5       S35        g )Nr/   )r@   rA   r'   zSuccessfully moved z to r1   )r   	move_repor3   r4   r   r5   )r@   rA   r*   r'   r6   s        r$   	repo_moverD   w   sZ     5
!CMM//  
 
		' 234		%8H7I
VWr#   settingsz$Update the settings of a repository.gatedz$The gated status for the repository.z)Whether the repository should be private.c                     [        US9nUR                  U U(       a  UR                  OS UUR                  S9  [        S[        R
                  " U 5       S35        g )Nr/   )r&   rF   r)   r'   z%Successfully updated the settings of r1   )r   update_repo_settingsr3   r4   r   r5   )r&   rF   r)   r*   r'   r6   s         r$   repo_settingsrI      sW    $ 5
!C#u{{//	   
1$))G2D1E\
RSr#   z*Create a new branch for a repo on the Hub.z!The name of the branch to create.revisionz?If set to True, do not raise an error if branch already exists.c           
          [        US9nUR                  U UUUR                  US9  [        S[        R
                  " U5       SUR                   S[        R
                  " U 5       35        g )Nr/   )r&   r   rJ   r'   r+   r0    branch on  )r   create_branchr3   r4   r   r5   )r&   r   rJ   r*   r'   r+   r6   s          r$   branch_createrO      sp    & 5
!C//   
!$))F"3!4K	?PPQRVR[R[\cRdQe
fgr#   z'Delete a branch from a repo on the Hub.z!The name of the branch to delete.c           
          [        US9nUR                  U UUR                  S9  [        S[        R
                  " U5       SUR                   S[        R
                  " U 5       35        g )Nr/   )r&   r   r'   r<   rL   rM   )r   delete_branchr3   r4   r   r5   )r&   r   r*   r'   r6   s        r$   branch_deleterR      sj     5
!C//  
 
!$))F"3!4K	?PPQRVR[R[\cRdQe
fgr#   zCreate a tag for a repo.zThe name of the tag to create.messagez-mz	--messagez%The description of the tag to create.c           
      d   UR                   n[        US9n[        S[        R                  " U5       SU S[        R                  " U 5       35         UR                  XX#US9  [        S[        R                  " U5       S[        R                  " U 5       35        g ! [         aH    [        UR                  5        S[        R                  " U 5       S35        [        R                  " SS9e[         aA    [        S	[        R                  " [        U5      5       S35        [        R                  " SS9e[         an  nUR                  R                  S
:X  aM  [        S[        R                  " U5       S[        R                  " U 5       35        [        R                  " SS9eUeS nAff = f)Nr/   zYou are about to create tag  on rM   )r&   r   tag_messagerJ   r'    not found.r
   codez	Revision i  Tag z already exists on z created on )r3   r   r4   r   r5   
create_tagr   
capitalizetyperExitr   strr   responsestatus_code)	r&   r   rS   rJ   r*   r'   repo_type_strr6   es	            r$   
tag_createrd      s`   * OOM
5
!C	(3(8]O1TYYW^M_L`
abwWcpq 
D3 TYYw-?,@
AB # !))+,Adii.@-AMNjja    !	$))CM23;?@jja   ::!!S(D3((;DIIg<N;OPQ**!$$	s   B B#F/A)F**F/listzList tags for a repo.c                    UR                   n[        US9n UR                  XS9n[        UR                  5      S:X  a  [	        S5        [        R                  " SS9e[	        S	U S[        R                  " U 5       S
35        UR                   H  n[	        UR                   5        M     g ! [         aH    [	        UR                  5        S[        R                  " U 5       S35        [        R                  " SS9e[         aW  n[	        U5        [	        [        R                  " UR                  R                  5      5        [        R                  " SS9eS nAff = f)Nr/   )r&   r'   rM   rW   r
   rX   r   zNo tags foundz	Tags for :)r3   r   list_repo_refsr   r4   r\   r   r5   r]   r^   r   redr`   textlentagsr   )r&   r*   r'   rb   r6   refsrc   ts           r$   tag_listro      s    OOM
5
!C!!!'!K 499~ojja  	Im_Adii&8%9
;<YYaff  # !))+,Adii.@-AMNjja   !adhhqzz'(jja  !s   B- -AEAEEzDelete a tag for a repo.zThe name of the tag to delete.yesz-yz--yesz"Answer Yes to prompt automaticallyc           
         UR                   n[        S[        R                  " U5       SU S[        R                  " U 5       35        U(       d?  [	        S5      R                  5       nUS;  a   [        S5        [        R                  " 5       e[        US9n UR                  XUS9  [        S[        R                  " U5       S[        R                  " U 5       35        g ! [         aH    [        UR                  5        S[        R                  " U 5       S	35        [        R                  " S
S9e[         aN    [        S[        R                  " U5       S[        R                  " U 5       35        [        R                  " S
S9ef = f)NzYou are about to delete tag rU   rM   zProceed? [Y/n] ) yrp   Abortr/   )r&   r   r'   rW   r
   rX   rZ   z not found on z deleted on )r3   r4   r   r5   inputlowerr]   r^   r   
delete_tagr   r\   r   )r&   r   rp   r*   r'   rb   choicer6   s           r$   
tag_deletery     sA   ( OOM	(3(8]O1TYYW^M_L`
ab()//1))'N**,
5
!C!w=I 
D3 TYYw-?,@
AB # !))+,Adii.@-AMNjja    !TYYs^$N499W3E2FGHjja  !s   C# #B(F).__doc__enumtypingr   r   r]   huggingface_hub.errorsr   r   r   huggingface_hub.utilsr   r	   
_cli_utilsr   r   r   r   r   r   r   r   
get_loggerr   loggerrepo_clitag_cli
branch_cli	add_typerr_   Enumr   commandmodelOptionboolr8   r>   rD   rI   ArgumentrO   rR   rd   ro   ry   r   r#   r$   <module>r      s?    &  a a /	 	 	 
		H	%89
A
B HI
   7  '   :H  -3		  
(!@A &^^ 	 	 	-#B#B#B X	
	#B #B #B @	
	#B" ! C	
	##B. 
/#B B#BL 
(!ab &^^ 	DDD D P	
		D 
D cD( 
&YZ %^^	XXX X 	X
 
X [X 
*#IJ 	 	%^^TT7	
	T <	
	T T T  
!T KT6 H#OP !%^^ 	!hh4	
	h h h h R	
	h" 
#h Qh: H#LM %^^hh4	
	h h h 
h Nh( 	 :;  	 %^^%$C$C	1	
	
$C 8	
	$C  !$C" #$C$ %$C& 
'$C <$CN 	56 %^^  
	 70 	 :;  	%^^##C#C	1	
	
#C 
5	
	
#C  !#C" ##C$ 
%#C <#Cr#   