
    RЦi7/                     B   S r SSK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
Jr  SSKJr  SSKJrJrJrJrJrJrJrJr  \" SS	9r\R1                  S
S9S\R2                  SS4S j5       r\" SS	9r\" SS	9r\R;                  \SS9  \R;                  \SS9   " S S\\R>                  5      r \RC                  SSS/S9\RD                  SSSSS4S\S\S\\\   \RF                  " SS	94   S\S \S!\\$\RF                  " S"S	94   S#\\\   \RF                  " S$S	94   SS4S% jj5       r%\RC                  S&S'/S9\RD                  SS4S\S\S \S(\\$\RF                  " S)S	94   SS4
S* jj5       r&\RC                  S+S,/S9S\RD                  4S-\S.\S \S\SS4
S/ jj5       r'\RC                  S0S1S2/S9SSS\RD                  4S\S3\\\    \RF                  " S4S	94   S\\\$   \RF                  " S5S	94   S \S\SS4S6 jj5       r(\RC                  S7/ S8QS9\RD                  SSSSS4S\S9\\)\   \RT                  " S:S	94   S\S;\S<\\\   \RF                  " S=S	94   S>\\\   \RF                  " S?S	94   S@\\$\RF                  " SAS	94   S \SS4SB jj5       r+\RC                  SSCSD/S9SS\RD                  S4S\S\\\RT                  " SES	94   S;\S \S\S!\\$\RF                  " SFS	94   SS4SG jj5       r,\RC                  S&SH/S9S\RD                  4S\S\\\RT                  " SIS	94   S \S\SS4
SJ jj5       r-\RC                  SSKSL/S9SSS\RD                  4S\S\\\RT                  " SMS	94   SN\\\   \RF                  " SOSPSQS	94   S;\S \S\SS4SR jj5       r.\RC                  SSST/S9S\RD                  4S\S \S\SS4SU jj5       r/\RC                  S&SV/S9SS\RD                  4S\S\\\RT                  " SWS	94   SX\\$\RF                  " SYSZS[S	94   S \S\SS4S\ jj5       r0g)]ae  Contains commands to interact with repositories on the Hugging Face Hub.

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

    # create a private model repo on the Hub
    hf repos create my-cool-model --private

    # delete files from a repo on the Hub
    hf repos delete-files my-model file.txt
    N)	AnnotatedOptional)CLIErrorHfHubHTTPErrorRepositoryNotFoundErrorRevisionNotFoundError)ANSI   )
PrivateOpt	RepoIdArgRepoTypeRepoTypeOptRevisionOptTokenOpt
get_hf_apityper_factoryzManage repos on the Hub.)helpT)invoke_without_commandctxreturnc                 ~    U R                   S:X  a-  [        [        R                  " S5      [        R
                  S9  g g )Nrepoz>FutureWarning: `hf repo` is deprecated in favor of `hf repos`.)file)	info_nameprintr	   yellowsysstderr)r   s    X/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/huggingface_hub/cli/repos.py_repos_callbackr    3   s/    
}}KKXY	
     z"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)GatedChoicesB   automanualfalse N)__name__
__module____qualname____firstlineno__r(   r)   r*   __static_attributes__r+   r!   r   r&   r&   B   s    DFEr!   r&   createzhf repos create my-modelz8hf repos create my-dataset --repo-type dataset --private)examplesF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.c           
          [        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)zCreate a new repo on the Hub.r7   )r3   r4   r6   r7   r8   r9   r5   Successfully created  on the Hub.zYour repo is now available at N)r   create_repovaluer   r	   boldr3   )	r3   r4   r5   r6   r7   r8   r9   apirepo_urls	            r   repo_createrC   H   sy    @ 5
!C//+  H 
!$))H,<,<"=!>l
KL	*499X+>*?
@Ar!   deletezhf repos delete my-model
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)z>Delete a repo from the Hub. This is an irreversible operation.r;   )r3   r4   rE   Successfully deleted r=   N)r   delete_repor?   r   r	   r@   )r3   r4   r7   rE   rA   s        r   repo_deleterI   v   sJ     5
!COO//  
 
!$))G"4!5\
BCr!   movez;hf repos move old-namespace/my-model new-namespace/my-model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)z8Move a repository from a namespace to another namespace.r;   )rK   rL   r4   zSuccessfully moved z to r=   N)r   	move_repor?   r   r	   r@   )rK   rL   r7   r4   rA   s        r   	repo_moverO      sZ     5
!CMM//  
 
		' 234		%8H7I
VWr!   settingsz$hf repos settings my-model --privatez'hf repos settings my-model --gated auto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)z$Update the settings of a repository.r;   N)r3   rQ   r6   r4   z%Successfully updated the settings of r=   )r   update_repo_settingsr?   r   r	   r@   )r3   rQ   r6   r7   r4   rA   s         r   repo_settingsrT      sW    2 5
!C#u{{//	   
1$))G2D1E\
RSr!   zdelete-files)z'hf repos delete-files my-model file.txtz'hf repos delete-files my-model "*.json"z&hf repos delete-files my-model folder/patternszXGlob patterns to match files to delete. Based on fnmatch, '*' matches files recursively.revisioncommit_messagez9The summary / title / first line of the generated commit.commit_descriptionz(The description of the generated commit.	create_prz7Whether to create a new Pull Request for these changes.c           
      r    [        US9nUR                  UU UR                  UUUUS9n	[        SU	 S35        g)z$Delete files from a repo on the Hub.r;   )delete_patternsr3   r4   rV   rW   rX   rY   z+Files correctly deleted from repo. Commit: .N)r   delete_filesr?   r   )
r3   rU   r4   rV   rW   rX   rY   r7   rA   urls
             r   repo_delete_filesr_      sQ    N 5
!C


 //%-  C 
7uA
>?r!   z#hf repos branch create my-model devz5hf repos branch create my-model dev --revision abc123z!The name of the branch to create.z?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)z*Create a new branch for a repo on the Hub.r;   )r3   r$   rV   r4   r8   r<    branch on  N)r   create_branchr?   r   r	   r@   )r3   r$   rV   r7   r4   r8   rA   s          r   branch_createrd      sp    4 5
!C//   
!$))F"3!4K	?PPQRVR[R[\cRdQe
fgr!   z#hf repos branch delete my-model devz!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)z'Delete a branch from a repo on the Hub.r;   )r3   r$   r4   rG   ra   rb   N)r   delete_branchr?   r   r	   r@   )r3   r$   r7   r4   rA   s        r   branch_deleterg     sj     5
!C//  
 
!$))F"3!4K	?PPQRVR[R[\cRdQe
fgr!   z!hf repos tag create my-model v1.0z4hf repos tag create my-model v1.0 -m "First release"zThe name of the tag to create.messagez-mz	--messagez%The description of the tag to create.c           
      P   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! [         a%  n[        UR                  5        SU  S35      UeSnAf[         a  n[        S	U S35      UeSnAf[         a3  nUR                  R                  S
:X  a  [        SU SU  S35      Uee SnAff = f)zCreate a tag for a repo.r;   zYou are about to create tag  on rb   )r3   r"   tag_messagerV   r4    '' not found.Nz
Revision 'i  Tag 'z' already exists on ''.Tag z created on )r?   r   r   r	   r@   
create_tagr   r   
capitalizer   r   responsestatus_code)	r3   r"   rh   rV   r7   r4   repo_type_strrA   es	            r   
tag_createrw   /  s   8 OOM
5
!C	(3(8]O1TYYW^M_L`
ab	wWcpq 
D3 TYYw-?,@
AB # V-2245RyMNTUU  CH:\:;B ::!!S(U3%'<WIRHIqPs0   B 
D%( CD%C%%D%2.D  D%listzhf repos tag list my-modelc                    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! [         a%  n[	        UR                  5        SU  S35      UeSnAff = f)zList tags for a repo.r;   )r3   r4   rl   rm   Nr   zNo tags found)codez	Tags for rb   :)r?   r   list_repo_refsr   r   rr   lentagsr   typerExitr	   r@   r#   )r3   r7   r4   ru   rA   refsrv   ts           r   tag_listr   [  s     OOM
5
!CV!!'!K 499~ojja  	Im_Adii&8%9
;<YYaff  # V-2245RyMNTUUVs   B- -
C7 CCz!hf repos tag delete my-model v1.0zThe name of the tag to delete.yesz-yz--yesz"Answer Yes to prompt automaticallyc           
      j   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! [         a%  n[        UR                  5        S	U  S
35      UeSnAf[         a  n[        SU SU  S35      UeSnAff = f)zDelete a tag for a repo.zYou are about to delete tag rj   rb   zProceed? [Y/n] ) yr   Abortr;   )r3   r"   r4   rl   rm   Nrn   z' not found on 'ro   rp   z deleted on )r?   r   r	   r@   inputlowerr   r   r   
delete_tagr   r   rr   r   )	r3   r"   r   r7   r4   ru   choicerA   rv   s	            r   
tag_deleter   p  s   * OOM	(3(8]O1TYYW^M_L`
ab()//1))'N**,
5
!CHw=I
 
D3 TYYw-?,@
AB	 # V-2245RyMNTUU  Hse#3G9B?@aGHs$   C# #
D2- DD2D--D2)1__doc__enumr   typingr   r   r   huggingface_hub.errorsr   r   r   r   huggingface_hub.utilsr	   
_cli_utilsr   r   r   r   r   r   r   r   	repos_clicallbackContextr    tag_cli
branch_cli	add_typerstrEnumr&   commandmodelOptionboolrC   rI   rO   rT   rx   Argumentr_   rd   rg   rw   r   r   r+   r!   r   <module>r      s    
 &  k k &	 	 	 9:	 40
 
4 
 1
 A
B HI
 	  G%  ( 	  JX  .3		  "B   &^^ 	 	 	-$B$B$B X	
	$B $B $B @	
	$B" ! C	
	#$B. 
/$B$BN 8'A&BC &^^ 	DDD D P	
		D 
D DD* 6%b$cd %^^	XXX X 	X
 
X eX  .1   	 	%^^TT7	
	T <	
	T T T  
!TT8     &^^  	 	 	9)@)@S	k	
	)@ )@ )@ L	
	)@  ";	
	!)@, J	
	-)@8 9)@: 
;)@)@X -?   !%^^ 	!hh4	
	h h h h R	
	h" 
#hh< H(M'NO %^^hh4	
	h h h 
h Ph* 	+>  , 	 %^^%"C"C	1	
	
"C 8	
	"C  !"C" #"C$ %"C& 
'"C"CJ 	#?"@A %^^  
	 B( 	%H$IJ  	%^^#"C"C	1	
	
"C 
5	
	
"C  !"C" #"C$ 
%"C K"Cr!   