ó
    pyüi†P  ã            ,       óú  • S SK r S SKJr  S SKJ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JrJr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"  SSK#J$r$J%r%J&r&J'r'  SSK(J)r)  SSK(J
r*  \&RV                  " \,5      r-Sr.\SSSSSSS\R^                  SSSSSSSSSSS.S\0S\0S-  S\0S-  S\0\-  S-  S\0\-  S-  S\0S-  S\0S-  S\1\0-  S-  S\2S\3S\3\0-  S-  S\3S\4\0   \0-  S-  S\4\0   \0-  S-  S \5S!\6\   S-  S"\1\0\04   S-  S#\0S-  S$\S   S%\04(S& jj5       r7\SSSSSSS\R^                  SSSSSSSSSS'S.S\0S\0S-  S\0S-  S\0\-  S-  S\0\-  S-  S\0S-  S\0S-  S\1\0-  S-  S\2S\3S\3\0-  S-  S\3S\4\0   \0-  S-  S\4\0   \0-  S-  S \5S!\6\   S-  S"\1\0\04   S-  S#\0S-  S$\S'   S%\4\   4(S( jj5       r7\SSSSSSS\R^                  SSSSSSSSSSS.S\0S\0S-  S\0S-  S\0\-  S-  S\0\-  S-  S\0S-  S\0S-  S\1\0-  S-  S\2S\3S\3\0-  S-  S\3S\4\0   \0-  S-  S\4\0   \0-  S-  S \5S!\6\   S-  S"\1\0\04   S-  S#\0S-  S$\3S%\0\4\   -  4(S) jj5       r7\'SSSSSSS\R^                  SSSSSSSSSSS.S\0S\0S-  S\0S-  S\0\-  S-  S\0\-  S-  S\0S-  S\0S-  S\1\0-  S-  S\2S\3S\3\0-  S-  S\3S\4\0   \0-  S-  S\4\0   \0-  S-  S \5S!\6\   S-  S"\1\0\04   S-  S#\0S-  S$\3S%\0\4\   -  4(S* jj5       r7g)+é    N)ÚIterable)ÚPath)ÚLiteralÚoverload)Útqdm)Ú
thread_mapé   )Ú	constants)ÚDryRunErrorÚGatedRepoErrorÚHfHubHTTPErrorÚLocalEntryNotFoundErrorÚRepositoryNotFoundErrorÚRevisionNotFoundError)ÚREGEX_COMMIT_HASHÚDryRunFileInfoÚhf_hub_downloadÚrepo_folder_name)ÚDatasetInfoÚHfApiÚ
KernelInfoÚ	ModelInfoÚRepoFileÚ	SpaceInfo)ÚOfflineModeIsEnabledÚfilter_repo_objectsÚloggingÚvalidate_hf_hub_args)Ú_create_progress_bariè  Fé   )Ú	repo_typeÚrevisionÚ	cache_dirÚ	local_dirÚlibrary_nameÚlibrary_versionÚ
user_agentÚetag_timeoutÚforce_downloadÚtokenÚlocal_files_onlyÚallow_patternsÚignore_patternsÚmax_workersÚ
tqdm_classÚheadersÚendpointÚdry_runÚrepo_idr!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   Úreturnc                ó   • g ©N© ©r3   r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   s                      Ú_/home/mande/repo/quber/.venv/lib/python3.13/site-packages/huggingface_hub/_snapshot_download.pyÚsnapshot_downloadr:      s   € ð, ó    Tc                ó   • g r6   r7   r8   s                      r9   r:   r:   8   s   € ð, r;   c                ó   • g r6   r7   r8   s                      r9   r:   r:   Q   s   € ð, "%r;   c                ó8  ^ ^^^^^^^^	^
^^^^"^#^$^%• Tc  [         R                  mUc  [         R                  n[        T[        5      (       a  [        T5      mTc  SmT[         R                  ;  a(  [        ST S[        [         R                  5       35      e[        R                  R                  T[        T TS95      n[        TTTTTT
S9nSnSnU(       d   UR                  T TUS9nUGc  T(       a  [+        S5      UeSm$[,        R.                  " U5      (       a  Um$Oi[        R                  R                  US	U5      n[        R                  R1                  U5      (       a$  [3        U5       nUR5                  5       m$SSS5        T$bJ  TcG  [        R                  R                  US
T$5      n[        R                  R1                  U5      (       a  U$ Tbs  [	        T5      mTR7                  5       (       aS  [9        TR;                  5       5      (       a5  [<        R?                  ST SU S35        [        TRA                  5       5      $ U(       a  [C        S5      e[        U[$        5      (       a  [C        S5      Ue[        U[D        [F        45      (       d/  [        U[(        5      (       a  URH                  RJ                  S:X  a  Ue[C        SURL                  RN                   SU S35      UeURP                  c   S5       e[S        USS5      nUb  U Vs/ s H  nURT                  PM     snO/ nUSL =(       d'    [W        U5      S:H  =(       d    [W        U5      [X        :„  nU(       a.  [<        R[                  S5        S UR]                  T SUTS9 5       n[_        UUUS9nU(       d  [a        U5      nS[W        U5       S3nOSnT(       a  SU-   nURP                  m$[        R                  R                  US
T$5      nUT$:w  az  [        R                  R                  US	U5      n [        Rb                  " [        R                  Re                  U5      SS 9  [3        US!5       nURg                  T$5        SSS5        / m%U=(       d    [j        n[m        U[<        Ro                  5       S$S%SSS&SS'9m# " U#4S( jS)5      m"S*[
        S+S4U"UU$UUUU	UUUUU UU%U
U4S, jjn![q        U!UUUUS-9  T#Rs                  S.5        T(       a  [u        S/ T% 5       5      (       d   eT%$ Tb(  [        [        R                  Rw                  T5      5      $ U$ ! [        R                   a    e [        R                   [        R"                  [$        4 a  nUn SnAGN¬SnAf[&         a    e [(         a  nUn SnAGNËSnAff = f! , (       d  f       GNB= fs  snf ! , (       d  f       GN^= f! [h         a'  n [<        R?                  S"U SU  S#35         Sn A GN�Sn A ff = f)0a  Download repo files.

Download a whole snapshot of a repo's files at the specified revision. This is useful when you want all files from
a repo, because you don't know which ones you will need a priori. All files are nested inside a folder in order
to keep their actual filename relative to that folder. You can also filter which files to download using
`allow_patterns` and `ignore_patterns`.

If `local_dir` is provided, the file structure from the repo will be replicated in this location. When using this
option, the `cache_dir` will not be used and a `.cache/huggingface/` folder will be created at the root of `local_dir`
to store some metadata related to the downloaded files. While this mechanism is not as robust as the main
cache-system, it's optimized for regularly pulling the latest version of a repository.

An alternative would be to clone the repo but this requires git and git-lfs to be installed and properly
configured. It is also not possible to filter which files to download when cloning a repository using git.

Args:
    repo_id (`str`):
        A user or an organization name and a repo name separated by a `/`.
    repo_type (`str`, *optional*):
        Set to `"dataset"`, `"space"` or `"kernel"` if downloading from a dataset, space or kernel repo,
        `None` or `"model"` if downloading from a model. Default is `None`.
    revision (`str`, *optional*):
        An optional Git revision id which can be a branch name, a tag, or a
        commit hash.
    cache_dir (`str`, `Path`, *optional*):
        Path to the folder where cached files are stored.
    local_dir (`str` or `Path`, *optional*):
        If provided, the downloaded files will be placed under this directory.
    library_name (`str`, *optional*):
        The name of the library to which the object corresponds.
    library_version (`str`, *optional*):
        The version of the library.
    user_agent (`str`, `dict`, *optional*):
        The user-agent info in the form of a dictionary or a string.
    etag_timeout (`float`, *optional*, defaults to `10`):
        When fetching ETag, how many seconds to wait for the server to send
        data before giving up which is passed to `httpx.request`.
    force_download (`bool`, *optional*, defaults to `False`):
        Whether the file should be downloaded even if it already exists in the local cache.
    token (`str`, `bool`, *optional*):
        A token to be used for the download.
            - If `True`, the token is read from the HuggingFace config
              folder.
            - If a string, it's used as the authentication token.
    headers (`dict`, *optional*):
        Additional headers to include in the request. Those headers take precedence over the others.
    local_files_only (`bool`, *optional*, defaults to `False`):
        If `True`, avoid downloading the file and return the path to the
        local cached file if it exists.
    allow_patterns (`list[str]` or `str`, *optional*):
        If provided, only files matching at least one pattern are downloaded.
    ignore_patterns (`list[str]` or `str`, *optional*):
        If provided, files matching any of the patterns are not downloaded.
    max_workers (`int`, *optional*):
        Number of concurrent threads to download files (1 thread = 1 file download).
        Defaults to 8.
    tqdm_class (`tqdm`, *optional*):
        If provided, overwrites the default behavior for the progress bar. Passed
        argument must inherit from `tqdm.auto.tqdm` or at least mimic its behavior.
        Note that the `tqdm_class` is not passed to each individual download.
        Defaults to the custom HF progress bar that can be disabled by setting
        `HF_HUB_DISABLE_PROGRESS_BARS` environment variable.
    dry_run (`bool`, *optional*, defaults to `False`):
        If `True`, perform a dry run without actually downloading the files. Returns a list of
        [`DryRunFileInfo`] objects containing information about what would be downloaded.

Returns:
    `str` or list of [`DryRunFileInfo`]:
        - If `dry_run=False`: Local snapshot path.
        - If `dry_run=True`: A list of [`DryRunFileInfo`] objects containing download information.

Raises:
    [`~utils.RepositoryNotFoundError`]
        If the repository to download from cannot be found. This may be because it doesn't exist,
        or because it is set to `private` and you do not have access.
    [`~utils.RevisionNotFoundError`]
        If the revision to download from cannot be found.
    [`EnvironmentError`](https://docs.python.org/3/library/exceptions.html#EnvironmentError)
        If `token=True` and the token cannot be found.
    [`OSError`](https://docs.python.org/3/library/exceptions.html#OSError) if
        ETag cannot be determined.
    [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError)
        if some parameter value is invalid.
NÚmodelzInvalid repo type: z. Accepted repo types are: )r3   r!   )r%   r&   r'   r1   r0   r*   )r3   r!   r"   z€Dry run cannot be performed as the repository cannot be accessed. Please check your internet connection or authentication token.ÚrefsÚ	snapshotszReturning existing local_dir `z<` as remote repo cannot be accessed in `snapshot_download` (z).zÜCannot find an appropriate cached snapshot folder for the specified revision on the local disk and outgoing traffic has been disabled. To enable repo look-ups and downloads online, pass 'local_files_only=False' as input.zäCannot find an appropriate cached snapshot folder for the specified revision on the local disk and outgoing traffic has been disabled. To enable repo look-ups and downloads online, set 'HF_HUB_OFFLINE=0' as environment variable.i‘  zGot: z: zÔ
An error happened while trying to locate the files on the Hub and we cannot find the appropriate snapshot folder for the specified revision on the local disk. Please check your internet connection and try again.z8Repo info returned from server must have a revision sha.Úsiblingsr   zaNumber of files in the repo is unreliable. Using `list_repo_tree` to ensure all files are listed.c              3   óh   #   • U  H(  n[        U[        5      (       d  M  UR                  v •  M*     g 7fr6   )Ú
isinstancer   Ú	rfilename)Ú.0Úfs     r9   Ú	<genexpr>Ú$snapshot_download.<locals>.<genexpr>]  s'   é € ð 
âp�Ü˜!œX×&ó ˆA�KŽKÚpùs   ‚2Ÿ2T)r3   Ú	recursiver"   r!   )Úitemsr,   r-   z	Fetching z fileszFetching ... filesz
[dry-run] )Úexist_okÚwz+Ignored error while writing commit hash to Ú.z!huggingface_hub.snapshot_downloadz!Downloading (incomplete total...)ÚB)ÚclsÚ	log_levelÚnameÚdescÚtotalÚinitialÚunitÚ
unit_scalec                   óZ   >• \ rS rSrSrU 4S jrS rS rSS\\	-  S-  SS4U 4S	 jjjr
S
rg)Ú*snapshot_download.<locals>._AggregatedTqdmi’  zÝFake tqdm object to aggregate progress into the parent `bytes_progress` bar.

In practice the `_AggregatedTqdm` object won't be displayed, it's just used to update
the `bytes_progress` bar from each thread/file download.
c                 óÐ   >• UR                  SS 5      nUb%  T=R                  U-  sl        TR                  5         UR                  SS5      nU(       a  TR                  U5        g g )NrT   rU   r   )ÚpoprT   ÚrefreshÚupdate)ÚselfÚargsÚkwargsrT   rU   Úbytes_progresss        €r9   Ú__init__Ú3snapshot_download.<locals>._AggregatedTqdm.__init__™  s^   ø€ à—J‘J˜w¨Ó-ˆEØÑ Ø×$Ò$¨Ñ-Õ$Ø×&Ñ&Ô(ð —j‘j ¨AÓ.ˆGÞØ×%Ñ% gÕ.ð r;   c                 ó   • U $ r6   r7   )r^   s    r9   Ú	__enter__Ú4snapshot_download.<locals>._AggregatedTqdm.__enter__¥  s   € ØˆKr;   c                 ó   • g r6   r7   )r^   Úexc_typeÚ	exc_valueÚ	tracebacks       r9   Ú__exit__Ú3snapshot_download.<locals>._AggregatedTqdm.__exit__¨  s   € Ør;   ÚnNr4   c                 ó(   >• TR                  U5        g r6   )r]   )r^   rm   ra   s     €r9   r]   Ú1snapshot_download.<locals>._AggregatedTqdm.update«  s   ø€ Ø×!Ñ! !Õ$r;   r7   )r	   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rb   re   rk   ÚintÚfloatr]   Ú__static_attributes__)ra   s   €r9   Ú_AggregatedTqdmrY   ’  s8   ø† ñ	õ
	/ò	ò	ñ	%˜C %™K¨$Ñ.ð 	%°t÷ 	%ó 	%r;   rx   Ú	repo_filer4   c                 óX   >• TR                  [        T4U TTTTTT	T
TTTTTTTS.65        g )N)Úfilenamer!   r"   r1   r#   r$   r%   r&   r'   r(   r)   r*   r0   r/   r2   )Úappendr   )ry   rx   r#   Úcommit_hashr2   r1   r(   r)   r0   r%   r&   r$   r3   r!   Úresultsr*   r'   s    €€€€€€€€€€€€€€€€r9   Ú_inner_hf_hub_downloadÚ1snapshot_download.<locals>._inner_hf_hub_download±  sL   ø€ Ø�‰ÜØðà"Ø#Ø$Ø!Ø#Ø#Ø)Ø /Ø%Ø)Ø-ØØØ*Øò!õ	
r;   )rS   r.   r/   zDownload completec              3   óB   #   • U  H  n[        U[        5      v •  M     g 7fr6   )rD   r   )rF   Úrs     r9   rH   rI   Ò  s   é € ÐBº'°Q”:˜a¤×0Ð0º'ùs   ‚)<r
   ÚHF_HUB_CACHEÚDEFAULT_REVISIONrD   r   ÚstrÚREPO_TYPES_WITH_KERNELÚ
ValueErrorÚosÚpathÚjoinr   r   Ú	repo_infoÚhttpxÚ
ProxyErrorÚConnectErrorÚTimeoutExceptionr   r   r   r   r   ÚmatchÚexistsÚopenÚreadÚis_dirÚanyÚiterdirÚloggerÚwarningÚresolver   r   r   ÚresponseÚstatus_codeÚ	__class__rp   ÚshaÚgetattrrE   ÚlenÚLARGE_REPO_THRESHOLDÚinfoÚlist_repo_treer   ÚlistÚmakedirsÚdirnameÚwriteÚOSErrorÚhf_tqdmr   ÚgetEffectiveLevelr   Úset_descriptionÚallÚrealpath)&r3   r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   Ústorage_folderÚapir‹   Úapi_call_errorÚerrorÚref_pathrG   Úsnapshot_folderrB   Ú
repo_filesÚunreliable_nb_filesÚfiltered_repo_filesÚ	tqdm_descÚer   rx   ra   r}   r~   s&   `` ````````     ```               @@@@r9   r:   r:   j   sÉ  ÿÿø€ ðV ÑÜ×*Ñ*ˆ	ØÑÜ×-Ñ-ˆÜ�)œT×"Ñ"Ü˜	“Nˆ	àÑØˆ	Øœ	×8Ñ8Ó8ÜØ! ) Ð,GÌÌI×LlÑLlÓHmÐGnÐoó
ð 	
ô —W‘W—\‘\ )Ô-=ÀgÐYbÑ-cÓd€Nä
Ø!Ø'ØØØØñ€Cð JN€IØ'+€NÞð	àŸ™¨gÀÐU]˜Ð^ˆIð> ÒÞÜð Sóà!ð"ð
 ˆÜ×"Ò" 8×,Ñ,Ø"‰Kä—w‘w—|‘| N°F¸HÓEˆHÜ�w‰w�~‰~˜h×'Ñ'ä˜(”^ qØ"#§&¡&£(�K÷ $ð Ñ" yÑ'8Ü Ÿg™gŸl™l¨>¸;ÈÓTˆOÜ�w‰w�~‰~˜o×.Ñ.ð 'Ð&ð Ñ Ü˜Y›ˆIØ×Ñ×!Ñ!¤c¨)×*;Ñ*;Ó*=×&>Ñ&>Ü—‘Ø4°Y°KÐ?{ð  }Kð  |Lð  LNð  Oôô ˜9×,Ñ,Ó.Ó/Ð/æÜ)ð5óð ô
 ˜Ô(<×=Ñ=Ü)ð>óð "ð	"ô
 ˜Ô)@Ä.Ð(Q×RÑRÜ�~¤~×6Ñ6¸>×;RÑ;R×;^Ñ;^ÐbeÓ;eð !Ð ô *Ø˜×0Ñ0×9Ñ9Ð:¸"¸^Ð<Lð"ð"óð
 "ð"ð �=‰=Ñ$Ð`Ð&`Ó`Ð$ô
 �y *¨dÓ3€HØCKÑCW±hÓ ?²h° §¤±hÒ ?Ð]_€JØ" dÐ*×h¬c°(«m¸qÑ.@×hÄCÈÃMÔThÑDhÐÞÜ�‰Øoô	
ñ
à×'Ñ'°À4ÐRZÐfoÐ'Ñpó
ˆ
ô *=ØØ%Ø'ñ*Ðö Ü"Ð#6Ó7ÐØ¤Ð$7Ó 8Ð9¸Ð@‰	à(ˆ	ÞØ  9Ñ,ˆ	à—-‘-€KÜ—g‘g—l‘l >°;ÀÓL€Oð �;ÓÜ—7‘7—<‘< °¸ÓAˆð	[Ü�KŠKœŸ™Ÿ™¨Ó1¸DÒAÜ�h Ô$¨Ø—‘˜Ô$÷ %ð
 +-€Gð ×&œw€Jô
 *ØÜ×*Ñ*Ó,Ø0Ø0ØØØØñ	€N÷%ô %ð>
¬#ð 
°$÷ 
÷ 
ö 
ô, ØØØØØòð ×"Ñ"Ð#6Ô7æÜÑB¹'ÓB×BÑBÐBÐBØˆàÑÜ”2—7‘7×#Ñ# IÓ.Ó/Ð/ØÐøôE ×Ñó 	àÜ×"Ñ"¤E×$:Ñ$:Ô<PÐQó 	ð #ˆNÝûÜ$ó 	àÜó 	ð #ˆNÝûð	ú÷B $–^üòl !@÷F %Ö$ûäó 	[Ü�N‰NÐHÈÈ
ÐRTÐUVÐTWÐWXÐY×ZÒZûð	[úsl   ÃU Å3V?ÌWÐ/>W( Ñ-WÑ?W( Õ=V<ÖVÖV<Ö/V7Ö7V<Ö?
W×
W%× W( ×%W( ×(
X×2XØX)8rˆ   Úcollections.abcr   Úpathlibr   Útypingr   r   rŒ   Ú	tqdm.autor   Ú	base_tqdmÚtqdm.contrib.concurrentr   Ú r
   Úerrorsr   r   r   r   r   r   Úfile_downloadr   r   r   r   Úhf_apir   r   r   r   r   r   Úutilsr   r   r   r   Ú
utils.tqdmr   r¨   Ú
get_loggerrp   r—   r    ÚDEFAULT_ETAG_TIMEOUTr…   Údictrv   Úboolr£   ru   Útyper:   r7   r;   r9   Ú<module>rÉ      s‘  ðÛ 	Ý $Ý ß $ã Ý 'Ý .å ÷÷ ÷ `Ó _ß R× Rß [Ó [Ý ,Ý 'ð 
×	Ò	˜HÓ	%€àÐ ð 
ð !ØØ#'Ø#'Ø#Ø"&Ø$(Ø#×8Ñ8Ø Ø#Ø"Ø-1Ø.2ØØ)-Ø%)ØØ#ò)Øðð �T‰zðð �D‰jð	ð
 �T‰z˜DÑ ðð �T‰z˜DÑ ðð ˜‘*ðð ˜4‘Zðð �s‘
˜TÑ!ðð ðð ðð �#‰:˜Ñðð ðð ˜‘I ‘O dÑ*ðð ˜#‘Y ‘_ tÑ+ðð  ð!ð" �Y‘ $Ñ&ð#ð$ �#�s�(‰^˜dÑ"ð%ð& �D‰jð'ð( �U‰^ð)ð* 	ô+ó 
ðð0 
ð !ØØ#'Ø#'Ø#Ø"&Ø$(Ø#×8Ñ8Ø Ø#Ø"Ø-1Ø.2ØØ)-Ø%)ØØ!ò)Øðð �T‰zðð �D‰jð	ð
 �T‰z˜DÑ ðð �T‰z˜DÑ ðð ˜‘*ðð ˜4‘Zðð �s‘
˜TÑ!ðð ðð ðð �#‰:˜Ñðð ðð ˜‘I ‘O dÑ*ðð ˜#‘Y ‘_ tÑ+ðð  ð!ð" �Y‘ $Ñ&ð#ð$ �#�s�(‰^˜dÑ"ð%ð& �D‰jð'ð( �T‰]ð)ð* 
ˆ.Ñô+ó 
ðð0 
ð !ØØ#'Ø#'Ø#Ø"&Ø$(Ø#×8Ñ8Ø Ø#Ø"Ø-1Ø.2ØØ)-Ø%)ØØò)%Øð%ð �T‰zð%ð �D‰jð	%ð
 �T‰z˜DÑ ð%ð �T‰z˜DÑ ð%ð ˜‘*ð%ð ˜4‘Zð%ð �s‘
˜TÑ!ð%ð ð%ð ð%ð �#‰:˜Ñð%ð ð%ð ˜‘I ‘O dÑ*ð%ð ˜#‘Y ‘_ tÑ+ð%ð  ð!%ð" �Y‘ $Ñ&ð#%ð$ �#�s�(‰^˜dÑ"ð%%ð& �D‰jð'%ð( ð)%ð* 	ˆ4�ÑÑô+%ó 
ð%ð0 ð !ØØ#'Ø#'Ø#Ø"&Ø$(Ø#×8Ñ8Ø Ø#Ø"Ø-1Ø.2ØØ)-Ø%)ØØò)lØðlð �T‰zðlð �D‰jð	lð
 �T‰z˜DÑ ðlð �T‰z˜DÑ ðlð ˜‘*ðlð ˜4‘Zðlð �s‘
˜TÑ!ðlð ðlð ðlð �#‰:˜Ñðlð ðlð ˜‘I ‘O dÑ*ðlð ˜#‘Y ‘_ tÑ+ðlð  ð!lð" �Y‘ $Ñ&ð#lð$ �#�s�(‰^˜dÑ"ð%lð& �D‰jð'lð( ð)lð* 	ˆ4�ÑÑô+ló ñlr;   