
    RЦiG!                         S r SSKrSSKJr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  S	S
KJrJrJrJr  / SQr\R6                  " \5      rS\R<                  SSSSSSSSSS4S\S\\\\       \RB                  " SS94   S\S\S\\\\       \RD                  " SS94   S\\\\       \RD                  " SS94   S\\\    \RD                  " SS94   S\\\    \RD                  " SS94   S\\#\RD                  " SS94   S\\#\RD                  " SS94   S \S!\\#\RD                  " S"S94   S#\\$\RD                  " S$S94   S%S4S& jjr%g)'a  Contains command to download files from the Hub with the CLI.

Usage:
    hf download --help

    # Download file
    hf download gpt2 config.json

    # Download entire repo
    hf download fffiloni/zeroscope --repo-type=space --revision=refs/pr/78

    # Download repo with filters
    hf download gpt2 --include="*.safetensors"

    # Download with token
    hf download Wauplin/private-model --token=hf_***

    # Download quietly (no progress bar, no warnings, only the returned path)
    hf download gpt2 config.json --quiet

    # Download to local dir
    hf download gpt2 --local-dir=./models/gpt2

    # Download a subfolder
    hf download HuggingFaceM4/FineVision art/ --repo-type=dataset
    N)	AnnotatedOptionalUnion)logging)snapshot_download)CLIError)DryRunFileInfohf_hub_download)_format_sizedisable_progress_barsenable_progress_barstabulate   )	RepoIdArgRepoTypeOptRevisionOptTokenOpt)z,hf download meta-llama/Llama-3.2-1B-InstructzGhf download meta-llama/Llama-3.2-1B-Instruct config.json tokenizer.jsonzXhf download meta-llama/Llama-3.2-1B-Instruct --include "*.safetensors" --exclude "*.bin"zGhf download meta-llama/Llama-3.2-1B-Instruct --local-dir ./models/llamaz=hf download HuggingFaceM4/FineVision art/ --repo-type datasetF   repo_id	filenamesz>Files to download (e.g. `config.json`, `data/metadata.jsonl`).)help	repo_typerevisionincludez;Glob patterns to include from files to download. eg: *.jsonexcludez0Glob patterns to exclude from files to download.	cache_dirzDirectory where to save files.	local_dirzIf set, the downloaded file will be placed under this directory. Check out https://huggingface.co/docs/huggingface_hub/guides/download#download-files-to-a-local-folder for more details.force_downloadzFIf True, the files will be downloaded even if they are already cached.dry_runzAIf True, perform a dry run without actually downloading the file.tokenquietzWIf True, progress bars are disabled and only the path to the download files is printed.max_workerszEMaximum number of workers to use for downloading files. Default is 8.returnc                   ^ ^^^^^^^^^	^
^ S[         [        [        [        [           4   4UU	UUUUUUU UUU
4S jjnS[         [        [        [        [           4   SS4S jnU(       aV  [	        5         [
        R                  " 5          [
        R                  " S5        U" U" 5       5        SSS5        [        5         gU" U" 5       5        [        R                  " 5         g! , (       d  f       N<= f)zDownload files from the Hub.r#   c                    > T
b  T
O/ n U  Vs/ s H  oR                  S5      (       d  M  UPM     nnU Vs/ s H  oR                  S5       S3PM     nnU  Vs/ s H  oR                  S5      (       a  M  UPM     nn[        U5      S:  aT  Tb'  [        T5      S:  a  [        SUS    SUS    S35      eT	b'  [        T	5      S:  a  [        SUS    SUS    S35      e[        U5      S:  aP  Tb%  [        T5      S:  a  [        R
                  " S	5        T	b%  [        T	5      S:  a  [        R
                  " S
5        [        U5      S:X  a.  [        U5      S:X  a  [        TTR                  TUS   TTTTSTS9
$ [        U5      S:X  a  [        U5      S:X  a  TnT	nOXC-   nS n[        TTR                  TUUTTTTSTTS9$ s  snf s  snf s  snf )N/z/**r   z$Cannot combine subfolder argument ('z,') with `--include`. Please use `--include "z*"` instead.z,') with `--exclude`. Please use `--include "z*"` with `--exclude` instead.z?Ignoring `--include` since filenames have being explicitly set.z?Ignoring `--exclude` since filenames have being explicitly set.r   zhuggingface-cli)
r   r   r   filenamer   r   r    r   library_namer   )r   r   r   allow_patternsignore_patternsr   r   r    r   r(   r"   r   )	endswithrstriplenr   warningswarnr
   valuer   )filenames_listf
subfolderssubfolder_patternsregular_filenamesr)   r*   r   r   r   r   r   r   r   r"   r   r   r   r    s          [/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/huggingface_hub/cli/download.pyrun_downloaddownload.<locals>.run_download   s   &/&; "0CA::c?a
C=GHZ#s3ZH(6N1jjoQN !"Q&"s7|a'7::a=/ J..8m_LJ  "s7|a'7::a=/ J..8m_<Y[   !A%"s7|a'7_`"s7|a'7_`  !Q&3/A+Ba+G"#//!*1-#-#.   !Q&3/A+Ba+G$N%O /CN"O oo)+)*#
 	
e DHNs   GGG	G6GresultNc                     [        U [        5      (       a  [        U 5        g [        U [        5      (       a  U /n [        S[	        U  Vs/ s H  oR
                  (       d  M  UPM     sn5       S[	        U 5       S[        [        S U  5       5      5       S35        SS/n/ n[        U S S	9 HF  nUR                  UR                  UR
                  (       a  [        UR                  5      OS
/5        MH     [        [        X2S95        g s  snf )Nz[dry-run] Will download z files (out of z) totalling c              3   ^   #    U  H#  oR                   (       d  M  UR                  v   M%     g 7fN)will_download	file_size).0rs     r6   	<genexpr>2download.<locals>._print_result.<locals>.<genexpr>   sK       M}  ci  ^_  m|  m|  NY  NO  NY  NY  cis   --.FilezBytes to downloadc                     U R                   $ r<   )r'   )xs    r6   <lambda>1download.<locals>._print_result.<locals>.<lambda>   s        )key-)headers)
isinstancestrprintr	   r-   r=   r   sumsortedappendr'   r>   r   )r9   r@   columnsitemsinfos        r6   _print_resultdownload.<locals>._print_result   s   fc""&M fn--XF&sv+Qv!Av+Q'R&SSbcfgmcnboo{  }I  JM  M}  ci  M}  J}  }~  |  @  A	
 ./-/6';<DLL$--I[I[dnn)Eadef =hu./ ,Rs   	D!Dignore)r   rN   r	   listr   r.   catch_warningssimplefilterr   r   set_verbosity_warning)r   r   r   r   r   r   r   r   r   r   r    r!   r"   r7   rV   s   ``````````` `  r6   downloadr]   D   s    |D
%^T.5I IJ D
 D
 D
L0eCn9M$MN 0SW 0" $$&!!(+,.) ' 	ln%%%' '&s   $C%%
C3)&__doc__r.   typingr   r   r   typerhuggingface_hubr   "huggingface_hub._snapshot_downloadr   huggingface_hub.errorsr   huggingface_hub.file_downloadr	   r
   huggingface_hub.utilsr   r   r   r   
_cli_utilsr   r   r   r   DOWNLOAD_EXAMPLES
get_logger__name__loggermodelrY   rN   ArgumentOptionboolintr]    rI   r6   <module>rq      sQ  6  - -  # @ + I e e E E  
		H	% 	(..  	 	 	 	 	 	 	 	
u](](cQ	
	]( ]( ]( cN	
	](  cC	
	!](, 1	
	-](8  M	
	9](D Y	
	E](P T	
	Q](\ ]](^ j	
	_](j X	
	k](v 
w](rI   