
    5pjN              *       
   S r SSKrSSKJr  SSKrSSKJrJr  SSKJ	r	  SSK
JrJrJrJr  SSK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JrJrJrJrJ r J!r!J"r"J#r#J$r$J%r%J&r&  SSK'J(r(  SSK)J*r*  SSK+J,r,J-r-  SSK.J/r/J0r0  \&" SS9r1\1Re                  SS9S\Rf                  SS4S j5       r4 " S S\5\Rl                  5      r7 " S S\5\Rl                  5      r8\\9S-  \-" SSS94   r:\\9S-  \-" SSS94   r;\\5S-  \-" SS\	" \5      S 94   r<\\S-  \-" S!S"S94   r=\\>S-  \-" S#S$S94   r?\&" S%S9r@\&" S&S9rA\1R                  \@S'S(9  \1R                  \AS)S(9  \1R                  S*/ S+QS,9SSS\S-S4S.\\5S-  \-" S/S94   S0\\7S-  \-" S1S2S3S94   S4\S5\S6\\9\-" S7S8S94   S9\ SS4S: jj5       rD\1R                  S;/ S<QS,9\R                  SSSSSSS-SSSSSSSSSS4S=\S0\S>\\5S-  \-" S?S@SAS94   SB\\5S-  \-" SCSDS94   SE\SF\:SG\;S9\ SH\\9\-" SIS94   SJ\\5S-  \-" SKS94   SL\\S-  \-" SMSNS94   SO\<SP\=SQ\?SR\SS\ST\SU\SV\!SS4(SW jj5       rF\1R                  SX/ SYQS,9S\R                  SSSSS-SSSSSSSS4SZ\S[\\5S-  \," S\S94   S0\SE\SF\:SG\;S9\ SH\\9\-" SIS94   SO\<SP\=SQ\?SR\SS\ST\SU\SV\!SS4"S] jj5       rG\1R                  S^S_/S,9\R                  SS-S-4S=\S0\S9\ S`\\9\-" SaS94   Sb\\9\-" ScSdSeS94   SS4Sf jj5       rH\1R                  SgSh/S,9S\R                  4SZ\S[\S9\ S0\SS4
Si jj5       rI\1R                  Sj/ SkQS,9SSSSS\R                  4S=\Sl\\8S-  \-" SmS94   SE\SF\:SG\;S9\ S0\SS4Sn jj5       rJ\1R                  So/ SpQS,9\R                  SSSS-S4S=\Sq\\K\5   \," SrS94   S0\Ss\St\\5S-  \-" SuS94   Sv\\5S-  \-" SwS94   Sx\\9\-" SyS94   S9\ SS4Sz jj5       rL\1R                  S{/ S|QS}9" \(" S~5      5        \AR                  S;SS/S,9SS\R                  S-4S=\S)\\5\," SS94   Ss\S9\ S0\SH\\9\-" SS94   SS4S jj5       rM\AR                  S^S/S,9S\R                  4S=\S)\\5\," SS94   S9\ S0\SS4
S jj5       rN\@R                  S;SS/S,9SSS\R                  4S=\S'\\5\," SS94   S\\5S-  \-" SSSS94   Ss\S9\ S0\SS4S jj5       rO\@R                  S*S/S,9S\R                  4S=\S9\ S0\SS4S jj5       rP\@R                  S^S/S,9S-S\R                  4S=\S'\\5\," SS94   Sb\\9\-" ScSdSS94   S9\ S0\SS4S jj5       rQg)zHContains commands to interact with repositories on the Hugging Face Hub.    N)	Annotated)SpaceHardwareSpaceStorage)
SoftChoice)CLIErrorHfHubHTTPErrorRepositoryNotFoundErrorRevisionNotFoundError)REPO_REGIONS   )run_city_game)REPO_LIST_DEFAULT_LIMIT
EnvFileOptEnvOptLimitOpt
PrivateOpt	RepoIdArgRepoTypeRepoTypeOptRevisionOpt	SearchOptSecretsFileOpt
SecretsOptTokenOpt
VolumesOptenv_map_to_key_value_list
get_hf_apiparse_env_mapparse_volumestyper_factory)make_cp)format_size)ArgumentOption)OutputFormatoutzManage repos on the Hub.)helpT)invoke_without_commandctxreturnc                 R    U R                   S:X  a  [        R                  " S5        g g )Nrepoz/`hf repo` is deprecated in favor of `hf repos`.)	info_namer&   warning)r)   s    U/var/www/html/pdf-tiff/venv/lib/python3.13/site-packages/huggingface_hub/cli/repos.py_repos_callbackr0   9   s     
}}EF     c                   $    \ rS rSrSrSrSrSrSrg)RepoTypeAll?   modeldatasetspacebucket N)	__name__
__module____qualname____firstlineno__r5   r6   r7   r8   __static_attributes__r9   r1   r/   r3   r3   ?   s    EGEFr1   r3   c                        \ rS rSrSrSrSrSrg)GatedChoicesF   automanualfalser9   N)r:   r;   r<   r=   rB   rC   rD   r>   r9   r1   r/   r@   r@   F   s    DFEr1   r@   z--publiczDWhether to make the repo public. Ignored if the repo already exists.z--protectedzVWhether to make the Space protected (Spaces only). Ignored if the repo already exists.z--flavorzOSpace hardware flavor (e.g. 'cpu-basic', 't4-medium', 'l4x4'). Only for Spaces.)r'   
click_typez	--storagezq(Deprecated, use volumes instead) Space persistent storage tier ('small', 'medium', or 'large'). Only for Spaces.z--sleep-timez[Seconds of inactivity before the Space is put to sleep. Use -1 to disable. Only for Spaces.z"Manage tags for a repo on the Hub.z&Manage branches for a repo on the Hub.tag)namebranchz	list | ls)zhf repos lszhf repos ls --explorez,hf repos ls --namespace my-org --search bert)examplesF	namespacezKOrganization name. If not provided, lists repos for the authenticated user.	repo_typez--typez--repo-typez=Filter by repository type (model, dataset, space, or bucket).searchlimitexplorez	--explorez-Explore your repos as an interactive 3D city.tokenc                 ^   [        US9n[        UR                  U S95      nUb-  U Vs/ s H   oR                  UR                  :X  d  M  UPM"     nnUbA  UR                  5       n	U Vs/ s H$  oUR                  R                  5       ;   d  M"  UPM&     nn[        U5      n
U(       a9  [        R                  [        R                  :X  a  [        U5        g[        S5      eUS:  a  USU nU Vs/ s Hc  nUR                  UR                  UR                  R                  S5      UR                   [#        UR$                  SS9UR&                  S	 S
3S.PMe     nn[        R(                  " USSSS.S9  US:  a$  X:  a  [        R*                  " SU SU
 S35        gggs  snf s  snf s  snf )zEList all repos (models, datasets, spaces, buckets) with storage info.rO   )rJ   Nz5Repository exploration is only available in terminal.r   z%Y-%m-%dT)human_readablez.1f%)idtypeupdated
visibilitystorage
%_of_totalrT   right)rX   rY   )id_key
alignmentszShowing z of z$ repos. Use `--limit 0` to list all.)r   listlist_user_reposrU   valuelowerrT   lenr&   moder%   humanr   r   
updated_atstrftimerW   r"   rX   storage_percenttablehint)rJ   rK   rL   rM   rN   rO   apireposrsearch_lowertotalitemss               r/   	repo_listro   {   s   @ 5
!C$$y$9:E!?EqVVy%>E?||~!BEqQTTZZ\%AEBJE88|)))% NOOqyfu 
 A $$FF||,,Z8,,"199TB..s315	
  
 
 IIeDPW-XYqyU]8E7$ug-QRS #y5 @ C
s   F 
F )!F%F%0A*F*create)zhf repos create my-modelz8hf repos create my-dataset --repo-type dataset --privatezrhf repos create my-space --type space --sdk gradio --flavor t4-medium --secrets HF_TOKEN -e THEME=dark --protectedzOhf repos create my-jupyterlab --type space --template SpacesExamples/jupyterlabzkhf repos create my-space --type space --sdk gradio -v hf://org/my-model:/models -v hf://buckets/org/b:/dataz$hf repos create my-model --region usrepo_idsdkz--sdkz--space-sdkzEHugging Face Spaces SDK type. Required when --type is set to 'space'.templatez
--templatezCreate a Space from an official template. Pass a template repo id (e.g. 'SpacesExamples/jupyterlab') or its short name (e.g. 'JupyterLab'). List available templates with `hf spaces templates`. Spaces only.privatepublic	protected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.regionz--regionzbCloud region in which to create the repo. Can be one of 'us' or 'eu'. Requires Team plan or above.hardwarerX   
sleep_timesecretssecrets_fileenvenv_filevolumec                 H   [        US9nUR                  U UR                  U(       a  SOU(       a  SO
U(       a  SOSUUU	U
UUUU[        [	        X5      5      [        [	        UU5      5      [        U5      US9n[        R                  " SUR                  [        U5      S9  g)	zCreate a new repo on the Hub.rQ   rt   ru   rv   N)rq   rK   rW   rO   rw   rx   ry   	space_sdkspace_hardwarespace_storagespace_sleep_timespace_secretsspace_variablesspace_volumesspace_templatezRepo created)rq   url)
r   create_repor_   r   r   r   r&   resultrq   str)rq   rK   rr   rs   rt   ru   rv   rO   rw   rx   ry   rz   rX   r{   r|   r}   r~   r   r   ri   repo_urls                        r/   repo_creater      s    D 5
!C// '9XT][cg+#/g0TU1-X2NO#F+  H" JJ~x'7'7S]Kr1   	duplicate)z/hf repos duplicate openai/gdpval --type datasetzzhf repos duplicate multimodalart/dreambooth-training my-dreambooth --type space --flavor l4x4 --secrets HF_TOKEN --privateznhf repos duplicate org/my-space my-space --type space -v hf://org/my-model:/models -v hf://buckets/org/b:/datafrom_idto_idz_Destination repo ID (e.g. `myorg/my-copy`). Defaults to your namespace with the same repo name.c                 B   [        US9nUR                  U UUR                  U(       a  SOU(       a  SO
U(       a  SOSUUUU	U
[        [	        X5      5      [        [	        X5      5      [        U5      S9n[        R                  " SU UR                  [        U5      S9  g)	z7Duplicate a repo on the Hub (model, dataset, or Space).rQ   rt   ru   rv   N)r   r   rK   rW   rO   rw   r   r   r   r   r   r   zRepo duplicated)r   r   r   )
r   duplicate_repor_   r   r   r   r&   r   rq   r   )r   r   rK   rt   ru   rv   rO   rw   rz   rX   r{   r|   r}   r~   r   r   ri   r   s                     r/   repo_duplicater     s    J 5
!C!!// '9XT][cg#/g0TU1-2NO#F+ " H JJ '9I9IsS[}]r1   deletezhf repos delete my-model
missing_okz=If set to True, do not raise an error if repo does not exist.yesz-yz--yesz#Answer Yes to prompt automatically.c                     [         R                  " SUR                   SU  S3US9  [        US9nUR	                  U UR                  US9  [         R
                  " SU S9  g	)
z>Delete a repo from the Hub. This is an irreversible operation.z$You are about to permanently delete  'z'. Proceed?r   rQ   )rq   rK   r   zRepo deletedrq   N)r&   confirmr_   r   delete_repor   )rq   rK   rO   r   r   ri   s         r/   repo_deleter   J  sa    * KK6y6Gr'R]^dgh
5
!COO//  
 JJ~w/r1   movez;hf repos move old-namespace/my-model new-namespace/my-modelc                 v    [        US9nUR                  U UUR                  S9  [        R                  " SXS9  g)z8Move a repository from a namespace to another namespace.rQ   )r   r   rK   z
Repo moved)r   r   N)r   	move_repor_   r&   r   )r   r   rO   rK   ri   s        r/   	repo_mover   i  s<     5
!CMM//  
 JJ|W:r1   settings)z$hf repos settings my-model --privatez'hf repos settings my-model --gated autoz8hf repos settings my-space --repo-type space --protectedgatedz$The gated status for the repository.c                     [        US9nUR                  U Uc  SO U[        R                  L a  SOUR                  U(       a  SOU(       a  SO
U(       a  SOSUR                  S9  [
        R                  " SU S	9  g)
z$Update the settings of a repository.rQ   NFrt   ru   rv   )rq   r   rW   rK   zRepo settings updatedr   )r   update_repo_settingsr@   rD   r_   r&   r   )rq   r   rt   ru   rv   rO   rK   ri   s           r/   repo_settingsr   z  sl    . 5
!C}t5L<N<N3N%TYT_T_ '9XT][cg//	   JJ&8r1   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           
      ~    [        US9nUR                  UU UR                  UUUUS9n	[        R                  " SX	S9  g)z$Delete files from a repo on the Hub.rQ   )delete_patternsrq   rK   r   r   r   r   zFiles deleted)rq   
commit_urlN)r   delete_filesr_   r&   r   )
rq   r   rK   r   r   r   r   rO   ri   r   s
             r/   repo_delete_filesr     sM    N 5
!C


 //%-  C JJ@r1   cp)	z:hf repos cp hf://username/my-model/config.json config.jsonz<hf repos cp hf://datasets/username/my-dataset/data.csv data/z0hf repos cp hf://username/my-model/config.json -zFhf repos cp model.safetensors hf://username/my-model/model.safetensorsz4hf repos cp config.json hf://username/my-model/logs/z0hf repos cp - hf://username/my-model/config.jsonzWhf repos cp hf://username/source-model/config.json hf://username/dest-model/config.jsonzghf repos cp hf://datasets/username/my-dataset/processed/ hf://datasets/username/dest-dataset/processed/zJhf repos cp hf://username/my-model/logs/ hf://username/archive-model/logs/)rG   rI   rj   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  [        R                  " SXR                  U S9  g)z*Create a new branch for a repo on the Hub.rQ   )rq   rH   r   rK   rw   zBranch createdrH   rK   rq   N)r   create_branchr_   r&   r   )rq   rH   r   rO   rK   rw   ri   s          r/   branch_creater     sL    4 5
!C//   JJ//SZ[r1   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  [        R                  " SXR                  U S9  g)z'Delete a branch from a repo on the Hub.rQ   )rq   rH   rK   zBranch deletedr   N)r   delete_branchr_   r&   r   )rq   rH   rO   rK   ri   s        r/   branch_deleter     sF     5
!C//  
 JJ//SZ[r1   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                    UR                   n[        US9n UR                  XX#US9  [        R                  " SXU S9  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.rQ   )rq   rF   tag_messager   rK   r   ' not found.Nz
Revision 'i  Tag 'z' already exists on ''.zTag createdrF   rK   rq   )r_   r   
create_tagr	   r   
capitalizer
   r   responsestatus_coder&   r   )	rq   rF   r   r   rO   rK   repo_type_strri   es	            r/   
tag_creater     s    8 OOM
5
!C	wWcpq JJ}#P # V-2245RyMNTUU  CH:\:;B ::!!S(U3%'<WIRHIqPs-   ? 
C	 A))C6BC.CCzhf repos tag list my-modelc                 b   UR                   n[        US9n UR                  XS9nUR                   Vs/ s H&  owR                  UR                  UR                  S.PM(     nn[        R                  " U5        g! [         a%  n[	        UR                  5        SU  S35      UeSnAff = fs  snf )zList tags for a repo.rQ   )rq   rK   r   r   N)rG   target_commitref)r_   r   list_repo_refsr	   r   r   tagsrG   r   r   r&   rg   )	rq   rO   rK   r   ri   refsr   trn   s	            r/   tag_listr   I  s     OOM
5
!CV!!'!K X\W`W`aW`RSffqquuMW`EaIIe # V-2245RyMNTUUVas   A: -B,:
B) B$$B)z!hf repos tag delete my-model v1.0zThe name of the tag to delete.z"Answer Yes to prompt automaticallyc                    UR                   n[        R                  " SU SU SU  35        [        R                  " SUS9  [	        US9n UR                  XUS9  [        R                  " SXU S9  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 z on  zProceed?r   rQ   )rq   rF   rK   r   r   Nr   z' not found on 'r   zTag deletedr   )r_   r&   textr   r   
delete_tagr	   r   r   r
   r   )rq   rF   r   rO   rK   r   ri   r   s           r/   
tag_deleter   Z  s    * OOMHH+C5]O1WINOKK
$
5
!CHw=I
 JJ}#P	 # V-2245RyMNTUU  Hse#3G9B?@aGHs$   A2 2
C< BC)B<<C)R__doc__enumtypingr   clickhuggingface_hubr   r   huggingface_hub.cli._cli_utilsr   huggingface_hub.errorsr   r   r	   r
   huggingface_hub.hf_apir   
_city_gamer   
_cli_utilsr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    _cpr!   _file_listingr"   
_frameworkr#   r$   _outputr%   r&   	repos_cligroup_callbackContextr0   r   Enumr3   r@   bool	PublicOptProtectedOptSpaceHardwareOptSpaceStorageOptintSpaceSleepTimeOpttag_cli
branch_cli	add_groupcommandro   r5   r   r   r   r   r   r]   r   r   r   r   r   r   r9   r1   r/   <module>r      s   O    7 5 k k / %     *  & ( & 9:	 6G G4 G 7G
#tyy 3		  4K
S	 4K
e $J
^m,  4
 A $J
j  A
B HI
 	  G%  ( 	  JX  .    	 	- 	+6Td
^	
	6T dP	
	6T 6T  !6T" {!PQ	S#6T* +6T, 
-6T6Tr   
 &^^ 	 	" 	 	 	!%#$(#'iILILIL 
d
X	
	
IL d
6	
	
IL, -IL. /IL0 1IL2 3IL4 @	
	5IL@ !d
 C	
	AILL tu	
	MILZ [IL\ ]IL^ "_IL` aILb !cILd 
eILf gILh iILj 
kIL
ILX    	%^^" 	!%#$(#'5,^,^d
r	
	,^ ,^ ,^ ,^ ,^ ,^ @	
	,^& ',^( ),^* "+,^, -,^. !/,^0 
1,^2 3,^4 5,^6 
7,^,^^ 8'A&BC &^^ 	 	#000 0 P	
		0 
6	
	
0$ 
%0 D0< 6%b$cd %^^	;;; ; 	;
 
; e;     	"%^^99t7	
	9 9 9 9 9 9 
992     &^^  	 	 	9)A)AS	k	
	)A )A )A d
L	
	)A  "d
;	
	!)A, J	
	-)A8 9)A: 
;)A)AZ 
  	    
'!& -?   !%^^ 	!\\4	
	\ \ \ \ R	
	\" 
#\\< H(M'NO %^^\\4	
	\ \ \ 
\ P\* 	+>  , 	 %^^%!Q!Q	1	
	
!Q d
8	
	!Q  !!Q" #!Q$ %!Q& 
'!Q!QH 	(D'EF %^^  
	 G  	%H$IJ  	%^^#QQ	1	
	
Q 
5	
	
Q  !Q" #Q$ 
%Q KQr1   