
    _iv,              $       >   S r SSK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	  SSK
Jr  SSK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  \	R2                  " \5      rSS\R8                  SSSSSSSS
SSS
4S\S\\\   \R<                  " SS94   S\\\   \R<                  " SS94   S\S\S\S\\\\      \R@                  " SS94   S\\\\      \R@                  " SS94   S\\\\      \R@                  " SS94   S\\\   \R@                  " SS94   S\\\   \R@                  " SS94   S\\!\R@                  " SS94   S \\\"   \R@                  " S!S94   S"\S#\\!\R@                  " S$S94   S%S4 S& jjr#S\S\\   S\\   S\\\      S%\$\\\\\      4   4
S' jr%g)(a  Contains command to upload a repo or file with the CLI.

Usage:
    # Upload file (implicit)
    hf upload my-cool-model ./my-cool-model.safetensors

    # Upload file (explicit)
    hf upload my-cool-model ./my-cool-model.safetensors  model.safetensors

    # Upload directory (implicit). If `my-cool-model/` is a directory it will be uploaded, otherwise an exception is raised.
    hf upload my-cool-model

    # Upload directory (explicit)
    hf upload my-cool-model ./models/my-cool-model .

    # Upload filtered directory (example: tensorboard logs except for the last run)
    hf upload my-cool-model ./model/training /logs --include "*.tfevents.*" --exclude "*20230905*"

    # Upload with wildcard
    hf upload my-cool-model "./model/training/*.safetensors"

    # Upload private dataset
    hf upload Wauplin/my-cool-dataset ./data . --repo-type=dataset --private

    # Upload with token
    hf upload Wauplin/my-cool-model --token=hf_****

    # Sync local Space with Hub (upload new files, delete removed files)
    hf upload Wauplin/space-example --repo-type=space --exclude="/logs/*" --delete="*" --commit-message="Sync local Space with Hub"

    # Schedule commits every 30 minutes
    hf upload Wauplin/my-cool-model --every=30
    N)	AnnotatedOptional)logging)CommitScheduler)RevisionNotFoundError)disable_progress_barsenable_progress_bars   )
PrivateOpt	RepoIdArgRepoTypeRepoTypeOptRevisionOptTokenOpt
get_hf_apiFrepo_id
local_pathzkLocal path to the file or folder to upload. Wildcard patterns are supported. Defaults to current directory.)helppath_in_repoz\Path of the file or folder in the repo. Defaults to the relative path of the file or folder.	repo_typerevisionprivateincludez'Glob patterns to match files to upload.excludez.Glob patterns to exclude from files to upload.deletezDGlob patterns for file to be deleted from the repo while committing.commit_messagez9The summary / title / first line of the generated commit.commit_descriptionz(The description of the generated commit.	create_prz0Whether to upload content as a new Pull Request.everyzMf set, a background job is scheduled to create commits every `every` minutes.tokenquietzADisable progress bars and warnings; print only the returned path.returnc                   ^ ^^^^^	^
^^^^^^^ Tb  TS::  a  [         R                  " SSS9eUR                  m[        US9m[	        T XUS9u  mmmS[
        4UU
U	UUUUUU UUUUU4S	 jjnU(       aY  [        5         [        R                  " 5          [        R                  " S
5        [        U" 5       5        SSS5        [        5         g[        U" 5       5        [        R                  " 5         g! , (       d  f       N?= f)zLUpload a file or a folder to the Hub. Recommended for single-commit uploads.Nr   z --every must be a positive valuer   )
param_hint)r    )r   r   r   r   r"   c                    > [         R                  R                  T5      (       a  Tb:  [        T5      S:  a+  [	        T[
        5      (       a  [        R                  " S5        Tb%  [        T5      S:  a  [        R                  " S5        T
b%  [        T
5      S:  a  [        R                  " S5        TGb)  [         R                  R                  T5      (       aL  [         R                  R                  T5      n TR                  T5      (       a  TS [        T5      *  OTnT/n/ nOqTn Tn[	        T[
        5      (       a  T=(       d    / O[	        T[        5      (       a  T/O/ nT=(       d    / nT
b%  [        T
5      S:  a  [        R                  " S5        [        U TTTUUUTTTS9
n[        ST SUR                   S	35          [        R                  " S5        M  [         R                  R                  T5      (       d3  [         R                  R%                  T5      (       d  ['        ST S35      eTR)                  TTS
TTS:X  a  SOS S9R                  nTb  T	(       d   TR+                  UTTS9  [         R                  R                  T5      (       a  TR5                  TTUTTTTT	S9$ TR7                  TTUTTTTT	[	        T[
        5      (       a  TO[	        T[        5      (       a  T/OS TT
S9$ ! [          a    UR#                  5          gf = f! [,         a.    [.        R1                  ST S35        TR3                  UTTS
S9   Nf = f)Nr   z3Ignoring --include since a single file is uploaded.z3Ignoring --exclude since a single file is uploaded.z2Ignoring --delete since a single file is uploaded.z8Ignoring --delete when uploading with scheduled commits.)
folder_pathr   r   r   allow_patternsignore_patternsr   r   r   hf_apizScheduling commits every z minutes to .Td   zStopped scheduled commits.zNo such file or directory: 'z'.spacegradio)r   r   exist_okr   	space_sdk)r   r   r   zBranch 'z' not found. Creating it...)r   r   branchr.   )path_or_fileobjr   r   r   r   r   r   r   )r&   r   r   r   r   r   r   r   r'   r(   delete_patterns)ospathisfilelen
isinstancelistwarningswarndirnameendswithstrr   printr   timesleepKeyboardInterruptstopisdirFileNotFoundErrorcreate_repo	repo_infor   loggerinfocreate_branchupload_fileupload_folder)r&   pir'   r(   	schedulercreatedapir   r   r   r   r   r   r   r   repo_type_strresolved_includeresolved_local_pathresolved_path_in_repor   s         V/var/www/html/land-ocr/venv/lib/python3.13/site-packages/huggingface_hub/cli/upload.py
run_uploadupload.<locals>.run_upload   sd   77>>-..+4D0E0IjYikoNpNpST"s7|a'7ST!c&kAoRS ww~~122 ggoo.AB -556IJJ **ES1D-E,EF. 
 #6!6791* ""2D99 %* ""2C88 ++  #*-R%#f+/MM"\]'''!- /I -eWLARAR@SSTUV4JJsO  ww~~122277==I\;];]#&BCVBWWY$Z[[//#"/7":h " 
 ' 	 	lgQYZ 77>>-..?? 32'!-#5# # 	 	   +.#)1 .55 ! .44 ''#"# ! 
 	
Q % 4 34* ) lhxj0KLM!!']S[fj!kls$   K: 'L :LL5MMignore)typerBadParametervaluer   _resolve_upload_pathsr=   r   r9   catch_warningssimplefilterr>   r	   r   set_verbosity_warning)r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   rU   rO   rP   rQ   rR   rS   s   `   `` ``````   @@@@@rT   uploadr_   C   s    J UaZ  !CPWXXOOM
5
!C DYJSZD@.0@m
 m
 m
 m
^ $$&!!(+*, ' 	jl%%' '&s   'C22
D c                 6  ^ U R                  S5      S   nUnTbB  [        U4S jS 5       5      (       a(  Ub  [        S5      eUb  US:w  a  [        S5      eSTS/4$ Tc(  [        R                  R                  U5      (       a  XDU4$ Tc)  [        R                  R                  U5      (       a  USU4$ Tc  [        SU S	35      eUcF  [        R                  R                  T5      (       a"  T[        R                  R                  T5      U4$ Uc  TSU4$ TX%4$ )
N/c              3   ,   >#    U  H	  oT;   v   M     g 7f)N ).0cr   s     rT   	<genexpr>(_resolve_upload_paths.<locals>.<genexpr>  s     %O!:os   )*?[z9Cannot set --include when local_path contains a wildcard.r*   z<Cannot set path_in_repo when local_path contains a wildcard.'zB' is not a local file or folder. Please set local_path explicitly.)splitany
ValueErrorr3   r4   r5   rC   basename)r   r   r   r   	repo_namerQ   s    `    rT   r[   r[     s'    c"2&I#%O%O"O"OXYY#(;[\\J%%bggnnY77%555bggmmI66#///1YK'ijkkz : :277++J79III3 000|55    )&__doc__r3   r?   r9   typingr   r   rX   huggingface_hubr   !huggingface_hub._commit_schedulerr   huggingface_hub.errorsr   huggingface_hub.utilsr   r	   
_cli_utilsr   r   r   r   r   r   r   
get_logger__name__rG   modelr=   Argumentr8   Optionboolfloatr_   tupler[   rd   rr   rT   <module>r      s   D 
   &  # = 8 M g g g 
		H	% 	 	%^^  	 	 	 	 	 	 	 	CH(H(~	
	H( o	
	H( H( H(  !H(" c:	
	#H(. cA	
	/H(: cW	
	;H(F L	
	GH(R ";	
	SH(^ C	
	_H(j `	
	kH(v wH(x T	
	yH(D 
EH(V66!)#6>Fsm6V^_cdg_hVi6
3Xd3i(()6rr   