
    Ցi3                     	   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(/S9S\RD                  SSS4S)\S*\\\   \RL                  " S+S	94   S\S\S \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                  " S0S	94   SS4
S1 jj5       r(\RC                  S2S3/S9S\RD                  4S)\S*\S \S\SS4
S4 jj5       r)\RC                  S5S6S7/S9SSS\RD                  4S\S8\\\    \RF                  " S9S	94   S\\\$   \RF                  " S:S	94   S \S\SS4S; jj5       r*\RC                  S</ S=QS9\RD                  SSSSS4S\S>\\+\   \RL                  " S?S	94   S\S@\SA\\\   \RF                  " SBS	94   SC\\\   \RF                  " SDS	94   SE\\$\RF                  " SFS	94   S \SS4SG jj5       r,\RC                  SSHSI/S9SS\RD                  S4S\S\\\RL                  " SJS	94   S@\S \S\S!\\$\RF                  " SKS	94   SS4SL jj5       r-\RC                  S-SM/S9S\RD                  4S\S\\\RL                  " SNS	94   S \S\SS4
SO jj5       r.\RC                  SSPSQ/S9SSS\RD                  4S\S\\\RL                  " SRS	94   SS\\\   \RF                  " STSUSVS	94   S@\S \S\SS4SW jj5       r/\RC                  SXSY/S9S\RD                  4S\S \S\SS4SZ jj5       r0\RC                  S-S[/S9SS\RD                  4S\S\\\RL                  " S\S	94   S]\\$\RF                  " S^S_S`S	94   S \S\SS4Sa jj5       r1g)bae  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    Y/var/www/html/banglarbhumi/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.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_createrD   H   sy    @ 5
!C//+  H 
!$))H,<,<"=!>l
KL	*499X+>*?
@Ar!   	duplicatez/hf repos duplicate openai/gdpval --type datasetzYhf repos duplicate multimodalart/dreambooth-training my-dreambooth --type space --privatefrom_idto_idz_Destination repo ID (e.g. `myorg/my-copy`). Defaults to your namespace with the same repo name.c           	         [        US9nUR                  U UUR                  UUUS9n[        S[        R
                  " U 5       S[        R
                  " UR                  5       S35        [        S[        R
                  " U5       35        g)z7Duplicate a repo on the Hub (model, dataset, or Space).r;   )rF   rG   r4   r6   r7   r8   zSuccessfully duplicated  to r=   r>   N)r   duplicate_repor@   r   r	   rA   r3   )rF   rG   r4   r6   r7   r8   rB   rC   s           r   repo_duplicaterK   v   s    4 5
!C!!// " H 
$TYYw%7$8TYYxGWGW=X<YYe
fg	*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   rM   Successfully deleted r=   N)r   delete_repor@   r   r	   rA   )r3   r4   r7   rM   rB   s        r   repo_deleterQ      sJ     5
!COO//  
 
!$))G"4!5\
BCr!   movez;hf repos move old-namespace/my-model new-namespace/my-modelc                     [        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;   )rF   rG   r4   zSuccessfully moved rI   r=   N)r   	move_repor@   r   r	   rA   )rF   rG   r7   r4   rB   s        r   	repo_moverU      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   rW   r6   r4   z%Successfully updated the settings of r=   )r   update_repo_settingsr@   r   r	   rA   )r3   rW   r6   r7   r4   rB   s         r   repo_settingsrZ      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   r\   r]   r^   r_   z+Files correctly deleted from repo. Commit: .N)r   delete_filesr@   r   )
r3   r[   r4   r\   r]   r^   r_   r7   rB   urls
             r   repo_delete_filesre      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$   r\   r4   r8   r<    branch on  N)r   create_branchr@   r   r	   rA   )r3   r$   r\   r7   r4   r8   rB   s          r   branch_createrj     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   rO   rg   rh   N)r   delete_branchr@   r   r	   rA   )r3   r$   r7   r4   rB   s        r   branch_deleterm   @  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 rh   )r3   r"   tag_messager\   r4    '' not found.Nz
Revision 'i  Tag 'z' already exists on ''.Tag z created on )r@   r   r   r	   rA   
create_tagr   r   
capitalizer   r   responsestatus_code)	r3   r"   rn   r\   r7   r4   repo_type_strrB   es	            r   
tag_creater}   V  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   rr   rs   Nr   zNo tags found)codez	Tags for rh   :)r@   r   list_repo_refsr   r   rx   lentagsr   typerExitr	   rA   r#   )r3   r7   r4   r{   rB   refsr|   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 rp   rh   zProceed? [Y/n] ) yr   Abortr;   )r3   r"   r4   rr   rs   Nrt   z' not found on 'ru   rv   z deleted on )r@   r   r	   rA   inputlowerr   r   r   
delete_tagr   r   rx   r   )	r3   r"   r   r7   r4   r{   choicerB   r|   s	            r   
tag_deleter     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)2__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boolrD   ArgumentrK   rQ   rU   rZ   r~   re   rj   rm   r}   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 9c   	%^^ 	!BBr	
	B B B B @	
	B" 
#BB@ 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!   