
    Y jC?              &       
   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	J
r
Jr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  SSKJr  \" S	S
9r \ RC                  SS9S\RD                  SS4S j5       r#\" SS
9r$\" SS
9r%\ RM                  \$SS9  \ RM                  \%SS9   " S S\'\RP                  5      r)\\*S-  \RV                  " SSS
94   r,\\*S-  \RV                  " SSS
94   r-\\S-  \RV                  " SSS
94   r.\\S-  \RV                  " SSS
94   r/\\0S-  \RV                  " SS S
94   r1\ Re                  S!/ S"QS#9\Rf                  SSSSSS$SSSSSSSSS4S%\S&\S'\\'S-  \RV                  " S(S
94   S)\S*\,S+\-S,\S-\\*\RV                  " S.S
94   S/\\'S-  \RV                  " S0S
94   S1\.S2\/S3\1S4\S5\S6\S7\S8\SS4$S9 jj5       r4\ Re                  S:/ S;QS#9S\Rf                  SSSSS$SSSSSSSS4S<\S=\\'S-  \Rj                  " S>S
94   S&\S)\S*\,S+\-S,\S-\\*\RV                  " S.S
94   S1\.S2\/S3\1S4\S5\S6\S7\S8\SS4"S? jj5       r6\ Re                  S@SA/S#9\Rf                  SS$S$4S%\S&\S,\SB\\*\RV                  " SCS
94   SD\\*\RV                  " SESFSGS
94   SS4SH jj5       r7\ Re                  SISJ/S#9S\Rf                  4S<\S=\S,\S&\SS4
SK jj5       r8\ Re                  SL/ SMQS#9SSSSS\Rf                  4S%\SN\\)S-  \RV                  " SOS
94   S)\S*\,S+\-S,\S&\SS4SP jj5       r9\ Re                  SQ/ SRQS#9\Rf                  SSSS$S4S%\SS\\:\'   \Rj                  " STS
94   S&\SU\SV\\'S-  \RV                  " SWS
94   SX\\'S-  \RV                  " SYS
94   SZ\\*\RV                  " S[S
94   S,\SS4S\ jj5       r;\%Re                  S!S]S^/S#9SS\Rf                  S$4S%\S\\'\Rj                  " S_S
94   SU\S,\S&\S-\\*\RV                  " S`S
94   SS4Sa jj5       r<\%Re                  S@Sb/S#9S\Rf                  4S%\S\\'\Rj                  " ScS
94   S,\S&\SS4
Sd jj5       r=\$Re                  S!SeSf/S#9SSS\Rf                  4S%\S\\'\Rj                  " SgS
94   Sh\\'S-  \RV                  " SiSjSkS
94   SU\S,\S&\SS4Sl jj5       r>\$Re                  SmSn/S#9S\Rf                  4S%\S,\S&\SS4So jj5       r?\$Re                  S@Sp/S#9S$S\Rf                  4S%\S\\'\Rj                  " SqS
94   SD\\*\RV                  " SESFSrS
94   S,\S&\SS4Ss jj5       r@g)tae  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)SpaceHardwareSpaceStorage)CLIErrorHfHubHTTPErrorRepositoryNotFoundErrorRevisionNotFoundError   )
EnvFileOptEnvOpt
PrivateOpt	RepoIdArgRepoTypeRepoTypeOptRevisionOptSecretsFileOpt
SecretsOptTokenOpt
VolumesOptenv_map_to_key_value_list
get_hf_apiparse_env_mapparse_volumestyper_factory)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    j/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/huggingface_hub/cli/repos.py_repos_callbackr%   ;   s     
}}EF     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)GatedChoicesG   automanualfalse N)__name__
__module____qualname____firstlineno__r-   r.   r/   __static_attributes__r0   r&   r$   r+   r+   G   s    DFEr&   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.z	--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.create)zhf repos create my-modelz8hf repos create my-dataset --repo-type dataset --privatezxhf repos create my-space --type space --space-sdk gradio --flavor t4-medium --secrets HF_TOKEN -e THEME=dark --protectedzihf repos create my-space --type space --space-sdk gradio -v hf://gpt2:/models -v hf://buckets/org/b:/data)examplesFrepo_id	repo_type	space_sdkzEHugging Face Spaces SDK type. Required when --type is set to 'space'.privatepublic	protected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.hardwarestorage
sleep_timesecretssecrets_fileenvenv_filevolumec                 B   [        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[        [	        X5      5      [        [	        X5      5      [        U5      S9n[        R                  " SUR                  [        U5      S9  g)	zCreate a new repo on the Hub.r>   r;   r<   r=   N)r8   r9   
visibilityr>   r?   r@   r:   space_hardwarespace_storagespace_sleep_timespace_secretsspace_variablesspace_volumeszRepo created)r8   url)
r   create_repovaluer   r   r   r   resultr8   str)r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   apirepo_urls                      r$   repo_createrY   u   s    X 5
!C// '9XT][cg+#/g0TU1-2NO#F+  H JJ~x'7'7S]Kr&   	duplicate)z/hf repos duplicate openai/gdpval --type datasetzzhf repos duplicate multimodalart/dreambooth-training my-dreambooth --type space --flavor l4x4 --secrets HF_TOKEN --privatezfhf repos duplicate org/my-space my-space --type space -v hf://gpt2:/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).rJ   r;   r<   r=   N)r[   r\   r9   rK   r>   r?   rL   rM   rN   rO   rP   rQ   zRepo duplicated)r[   r\   rR   )
r   duplicate_reporT   r   r   r   r   rU   r8   rV   )r[   r\   r9   r;   r<   r=   r>   r?   rA   rB   rC   rD   rE   rF   rG   rH   rW   rX   s                     r$   repo_duplicater_      s    J 5
!C!!// '9XT][cg#/g0TU1-2NO#F+ " H JJ '9I9IsS[}]r&   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?rb   rJ   )r8   r9   ra   zRepo deletedr8   N)r   confirmrT   r   delete_reporU   )r8   r9   r>   ra   rb   rW   s         r$   repo_deleteri      sa    * KK6y6Gr'R]^dgh
5
!COO//  
 JJ~w/r&   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.rJ   )r[   r\   r9   z
Repo moved)r[   r\   N)r   	move_reporT   r   rU   )r[   r\   r>   r9   rW   s        r$   	repo_moverm   
  s<     5
!CMM//  
 JJ|W:r&   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.rJ   NFr;   r<   r=   )r8   ro   rK   r9   zRepo settings updatedrf   )r   update_repo_settingsr+   r/   rT   r   rU   )r8   ro   r;   r<   r=   r>   r9   rW   s           r$   repo_settingsrr     sl    . 5
!C}t5L<N<N3N%TYT_T_ '9XT][cg//	   JJ&8r&   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.rJ   )delete_patternsr8   r9   rt   ru   rv   rw   zFiles deleted)r8   
commit_urlN)r   delete_filesrT   r   rU   )
r8   rs   r9   rt   ru   rv   rw   r>   rW   rR   s
             r$   repo_delete_filesr|   <  sM    N 5
!C


 //%-  C JJ@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  [        R                  " SXR                  U S9  g)z*Create a new branch for a repo on the Hub.rJ   )r8   r)   rt   r9   r?   zBranch createdr)   r9   r8   N)r   create_branchrT   r   rU   )r8   r)   rt   r>   r9   r?   rW   s          r$   branch_creater   p  sL    4 5
!C//   JJ//SZ[r&   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.rJ   )r8   r)   r9   zBranch deletedr~   N)r   delete_branchrT   r   rU   )r8   r)   r>   r9   rW   s        r$   branch_deleter     sF     5
!C//  
 JJ//SZ[r&   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.rJ   )r8   r'   tag_messagert   r9   rd   ' not found.Nz
Revision 'i  Tag 'z' already exists on ''.zTag createdr'   r9   r8   )rT   r   
create_tagr   r   
capitalizer	   r   responsestatus_coder   rU   )	r8   r'   r   rt   r>   r9   repo_type_strrW   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	list | lsz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.rJ   )r8   r9   rd   r   N)r(   target_commitref)rT   r   list_repo_refsr   r   r   tagsr(   r   r   r   table)	r8   r>   r9   r   rW   refsr   titemss	            r$   tag_listr     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?re   rJ   )r8   r'   r9   rd   r   Nr   z' not found on 'r   zTag deletedr   )rT   r   textrg   r   
delete_tagr   r   r   r	   rU   )r8   r'   rb   r>   r9   r   rW   r   s           r$   
tag_deleter     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)A__doc__enumtypingr   typerhuggingface_hubr   r   huggingface_hub.errorsr   r   r   r	   
_cli_utilsr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   _outputr   	repos_clicallbackContextr%   tag_cli
branch_cli	add_typerrV   Enumr+   boolOption	PublicOptProtectedOptSpaceHardwareOptSpaceStorageOptintSpaceSleepTimeOptcommandmodelrY   Argumentr_   ri   rm   rr   listr|   r   r   r   r   r   r0   r&   r$   <module>r      s
      7 k k    $  9:	 40G G4 G 1G
 A
B HI
 	  G%  ( 	  JX  .3		  4K	LLS	 4K	LLe D	LL^  4	LL A $J	LLj     &^^ 	" 	 	!%#$(#'A3L3L3L d
X	
	3L 3L 3L 3L 3L @	
	3L& !d
 C	
	'3L2 33L4 53L6 "73L8 93L: !;3L< 
=3L> ?3L@ A3LB 
C3L3Ll    	%^^" 	!%#$(#'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X -?   !%^^ 	!\\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r&   