+
    QV-jQ¢  ã            	       óê  € R t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHtH	t	 ^ RI
Ht ^ RIHtHt ^ RIHt ^ RIHtHt ^ RIHtHtHtHtHtHt ^ R	IHt ^R
IHt ^RIH t  ^RI!H"t" ^RI#H$t$H%t%H&t& ^RI'H(t(H)t)H*t*H+t+H,t,H-t-H.t.H/t/H0t0H1t1 ^RI'H2t3 ^RI4H5t5 ]'       d   ^RI6H7t7 ].Pp                  ! ]94      t:]R2,          t;Rt<Rt=Rt>] ! R R4      4       t?] ! R R4      4       t@] ! R R4      4       tAR R ltB]]A]@]?3,          tCR R ltD]1RRR^R RR!R/R" R# ll4       tE]1RRR^/R$ R% ll4       tF]1RRR RR!R/R& R' ll4       tGR( R) ltH]1R3R* R+ ll4       tI ! R, R-]4      tJ]1R4R. R/ ll4       tKR5R0 R1 lltLR# )6z<
Type definitions and utilities for the `create_commit` API
N)Údefaultdict)ÚIterableÚIterator)Úcontextmanager)Ú	dataclassÚfield)Úgroupby)ÚPathÚPurePosixPath)ÚTYPE_CHECKINGÚAnyÚBinaryIOÚLiteralÚ
NamedTupleÚUnion)Ú
thread_map)Ú	constants)ÚEntryNotFoundError)Ú
hf_hub_url)Ú
UploadInfoÚ
lfs_uploadÚpost_lfs_batch_info)
ÚFORBIDDEN_FOLDERSÚare_progress_bars_disabledÚchunk_iterableÚget_sessionÚhf_raise_for_statusÚhttp_backoffÚloggingÚshaÚtqdm_stream_fileÚvalidate_hf_hub_args)Útqdm)Úis_xet_available)ÚRepoFileiô  é   c                   ó:   a € ] tR t^:t o RtRtR tV 3R ltRtV t	R# )ÚCommitOperationDeletea{  
Data structure holding necessary info to delete a file or a folder from a repository
on the Hub.

Args:
    path_in_repo (`str`):
        Relative filepath in the repo, for example: `"checkpoints/1fec34a/weights.bin"`
        for a file or `"checkpoints/1fec34a/"` for a folder.
    is_folder (`bool` or `Literal["auto"]`, *optional*)
        Whether the Delete Operation applies to a folder or not. If "auto", the path
        type (file or folder) is guessed automatically by looking if path ends with
        a "/" (folder) or not (file). To explicitly set the path type, you can set
        `is_folder=True` or `is_folder=False`.
Úautoc                ó  € \        V P                  4      V n        V P                  R 8X  d!   V P                  P                  R4      V n        \	        V P                  \
        4      '       g   \        RV P                   R24      hR# )r(   Ú/zNWrong value for `is_folder`. Must be one of [`True`, `False`, `'auto'`]. Got 'z'.N)Ú_validate_path_in_repoÚpath_in_repoÚ	is_folderÚendswithÚ
isinstanceÚboolÚ
ValueError©Úselfs   &Úl/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/huggingface_hub/_commit_api.pyÚ__post_init__Ú#CommitOperationDelete.__post_init__N   sq   € Ü2°4×3DÑ3DÓEˆÔà�>‰>˜VÔ#Ø!×.Ñ.×7Ñ7¸Ó<ˆDŒNÜ˜$Ÿ.™.¬$×/Ò/ÜØ`Ðae×aoÑaoÐ`pÐprÐsóð ñ 0ó    c                óP   <€ V ^8„  d   Qh/ S[ ;R&   S[S[R,          ,          ;R&   # )é   r,   r(   r-   )Ústrr0   r   )ÚformatÚ__classdict__s   "€r4   Ú__annotate__Ú"CommitOperationDelete.__annotate__:   s(   ø‡ ‚ ñ" Ññ# ñ$ ‘g˜f•oÕ%Ñ.ò% r7   )r-   r,   N)
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r-   r5   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__©r<   s   @r4   r'   r'   :   s   ø‡ € ñð  )/€Iò÷) ƒ r7   r'   c                   óN   a € ] tR t^Yt o RtRtRtRtRtRt	Rt
R tV 3R ltRtV tR# )ÚCommitOperationCopya  
Data structure holding necessary info to copy a file in a repository on the Hub.

Both LFS files and regular files are supported. LFS files are copied server-side while regular files are
downloaded and re-uploaded as part of the commit.

Cross-repository copies are supported by setting `src_repo_id` and `src_repo_type`. For cross-repo LFS copies,
the LFS objects are duplicated to the destination repository before the commit is created. This is handled
automatically by [`create_commit`]. Note that cross-repository copies only work within the same
[storage region](https://huggingface.co/docs/hub/storage-regions); copying across regions is not supported.

Note: you can combine a [`CommitOperationCopy`] and a [`CommitOperationDelete`] to rename an LFS file on the Hub.

Args:
    src_path_in_repo (`str`):
        Relative filepath in the repo of the file to be copied, e.g. `"checkpoints/1fec34a/weights.bin"`.
    path_in_repo (`str`):
        Relative filepath in the repo where to copy the file, e.g. `"checkpoints/1fec34a/weights_copy.bin"`.
    src_revision (`str`, *optional*):
        The git revision of the file to be copied. Can be any valid git revision.
        Default to the target commit revision.
    src_repo_id (`str`, *optional*):
        The source repository to copy from (e.g. `"username/source-model"`).
        Default to the destination repository (intra-repo copy).
    src_repo_type (`str`, *optional*):
        The type of the source repository (`"model"`, `"dataset"` or `"space"`).
        Required when `src_repo_id` is set.
NFc                ó  € \        V P                  4      V n        \        V P                  4      V n        V P                  e   V P                  f   \        R4      hV P                  e   V P                  f   \        R4      hR # R # )Nz6`src_repo_type` is required when `src_repo_id` is set.z6`src_repo_id` is required when `src_repo_type` is set.)r+   Úsrc_path_in_repor,   Úsrc_repo_idÚsrc_repo_typer1   r2   s   &r4   r5   Ú!CommitOperationCopy.__post_init__†   sw   € Ü 6°t×7LÑ7LÓ MˆÔÜ2°4×3DÑ3DÓEˆÔØ×ÑÒ'¨D×,>Ñ,>Ò,FÜÐUÓVÐVØ×ÑÒ)¨d×.>Ñ.>Ò.FÜÐUÓVÐVñ /GÑ)r7   c                óÀ   <€ V ^8„  d   Qh/ S[ ;R&   S[ ;R&   S[ R,          ;R&   S[ R,          ;R&   S[ R,          ;R&   S[ R,          ;R&   S[ R,          ;R&   S[;R	&   # )
r9   rK   r,   NÚsrc_revisionrL   rM   Ú_src_oidÚ	_dest_oidÚ_is_duplicated)r:   r0   )r;   r<   s   "€r4   r=   Ú CommitOperationCopy.__annotate__Y   s�   ø‡ ‚ ñ> Ññ? ñ@ ÑñA ñB ˜•*Ñ#ñC ñD �t•Ñ"ñE ñF ˜•:Ñ$ñG ñL �D�jÑñM ñR �T�zÑ ñS ñV Ñ òW r7   )r,   rK   )r?   r@   rA   rB   rC   rP   rL   rM   rQ   rR   rS   r5   rD   rE   rF   rG   s   @r4   rI   rI   Y   s<   ø‡ € ñð>  $€LØ"€KØ $€Mð  €Hð !€Ià €NòW÷[ ƒ r7   rI   c                   ó  a € ] tR t^�t o Rt]! RRR7      t]! RRRR7      t]! RRRR7      t]! RRRR7      t	]! RRRR7      t
]! RRRR7      tV 3R lR lt]RV 3R lR	 ll4       tV 3R
 lR lt]V 3R lR l4       tV 3R ltRtV tR# )ÚCommitOperationAddas  
Data structure holding necessary info to upload a file to a repository on the Hub.

Args:
    path_in_repo (`str`):
        Relative filepath in the repo, for example: `"checkpoints/1fec34a/weights.bin"`
    path_or_fileobj (`str`, `Path`, `bytes`, or `BinaryIO`):
        Either:
        - a path to a local file (as `str` or `pathlib.Path`) to upload
        - a buffer of bytes (`bytes`) holding the content of the file to upload
        - a "file object" (subclass of `io.BufferedIOBase`), typically obtained
            with `open(path, "rb")`. It must support `seek()` and `tell()` methods.

Raises:
    [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError)
        If `path_or_fileobj` is not one of `str`, `Path`, `bytes` or `io.BufferedIOBase`.
    [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError)
        If `path_or_fileobj` is a `str` or `Path` but not a path to an existing file.
    [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError)
        If `path_or_fileobj` is a `io.BufferedIOBase` but it doesn't support both
        `seek()` and `tell()`.
F)ÚinitÚreprN)rW   rX   Údefaultc                ó   <€ V ^8„  d   QhRR/# ©r9   ÚreturnN© )r;   r<   s   "€r4   r=   ÚCommitOperationAdd.__annotate__¿   s   ø€ ÷ !Mñ !M˜tñ !Mr7   c                óè  € \        V P                  4      V n        \        V P                  \        4      '       d   \        V P                  4      V n        \        V P                  \
        4      '       d|   \        P                  P                  \        P                  P                  V P                  4      4      p\        P                  P                  V4      '       g   \        RV R24      hM;\        V P                  \        P                  \        34      '       g   \        R4      h\        V P                  \        P                  4      '       dF    V P                  P                  4        V P                  P!                  ^ \        P"                  4       \        V P                  \
        4      '       d(   \(        P*                  ! V P                  4      V n        R# \        V P                  \        4      '       d(   \(        P.                  ! V P                  4      V n        R# \(        P0                  ! V P                  4      V n        R#   \$        \&        3 d   p\        R4      ThRp?ii ; i)z6Validates `path_or_fileobj` and compute `upload_info`.zProvided path: 'z(' is not a file on the local file systemz�path_or_fileobj must be either an instance of str, bytes or io.BufferedIOBase. If you passed a file-like object, make sure it is in binary mode.zNpath_or_fileobj is a file-like object but does not implement seek() and tell()N)r+   r,   r/   Úpath_or_fileobjr	   r:   ÚosÚpathÚnormpathÚ
expanduserÚisfiler1   ÚioÚBufferedIOBaseÚbytesÚtellÚseekÚSEEK_CURÚOSErrorÚAttributeErrorr   Ú	from_pathÚupload_infoÚ
from_bytesÚfrom_fileobj)r3   r`   Úexcs   &  r4   r5   Ú CommitOperationAdd.__post_init__¿   sÁ  € ä2°4×3DÑ3DÓEˆÔô �d×*Ñ*¬D×1Ò1Ü#& t×';Ñ';Ó#<ˆDÔ Ü�d×*Ñ*¬C×0Ò0Ü Ÿg™g×.Ñ.¬r¯w©w×/AÑ/AÀ$×BVÑBVÓ/WÓXˆOÜ—7‘7—>‘> /×2Ò2Ü Ð#3°OÐ3DÐDlÐ!mÓnÐnð 3ä˜D×0Ñ0´2×3DÑ3DÄeÐ2L×MÒMäð#óð ô
 �d×*Ñ*¬B×,=Ñ,=×>Ò>ðØ×$Ñ$×)Ñ)Ô+Ø×$Ñ$×)Ñ)¨!¬R¯[©[Ô9ô �d×*Ñ*¬C×0Ò0Ü)×3Ò3°D×4HÑ4HÓIˆDÖÜ˜×,Ñ,¬e×4Ò4Ü)×4Ò4°T×5IÑ5IÓJˆDÖä)×6Ò6°t×7KÑ7KÓLˆDÖøô œ^Ð,ô Ü Ødóàðûðús   ÅAI ÉI1É I,É,I1c                ó6   <€ V ^8„  d   QhRS[ RS[S[,          /# )r9   Ú	with_tqdmr\   )r0   r   r   )r;   r<   s   "€r4   r=   r^   ã   s    ø€ ÷ /=ñ /=¡ð /=±(¹8Õ2Dñ /=r7   c              #  ó$  "  € \        V P                  \        4      '       g!   \        V P                  \        4      '       db   V'       d-   \	        V P                  4      ;_uu_ 4       pVx € RRR4       R# \        V P                  R4      ;_uu_ 4       pVx € RRR4       R# \        V P                  \        4      '       d%   \        P                  ! V P                  4      x € R# \        V P                  \        P                  4      '       dU   V P                  P                  4       pV P                  x € V P                  P                  V\        P                  4       R# R#   + '       g   i     R# ; i  + '       g   i     R# ; i5i)u²  
A context manager that yields a file-like object allowing to read the underlying
data behind `path_or_fileobj`.

Args:
    with_tqdm (`bool`, *optional*, defaults to `False`):
        If True, iterating over the file object will display a progress bar. Only
        works if the file-like object is a path to a file. Pure bytes and buffers
        are not supported.

Example:

```python
>>> operation = CommitOperationAdd(
...        path_in_repo="remote/dir/weights.h5",
...        path_or_fileobj="./local/weights.h5",
... )
CommitOperationAdd(path_in_repo='remote/dir/weights.h5', path_or_fileobj='./local/weights.h5')

>>> with operation.as_file() as file:
...     content = file.read()

>>> with operation.as_file(with_tqdm=True) as file:
...     while True:
...         data = file.read(1024)
...         if not data:
...              break
config.json: 100%|â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆ| 8.19k/8.19k [00:02<00:00, 3.72kB/s]

>>> with operation.as_file(with_tqdm=True) as file:
...     httpx.put(..., data=file)
config.json: 100%|â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆ| 8.19k/8.19k [00:02<00:00, 3.72kB/s]
```
NÚrb)r/   r`   r:   r	   r    Úopenrh   rf   ÚBytesIOrg   ri   rj   ÚSEEK_SET)r3   ru   ÚfileÚprev_poss   &&  r4   Úas_fileÚCommitOperationAdd.as_fileâ   s  é € ôH �d×*Ñ*¬C×0Ò0´J¸t×?SÑ?SÔUY×4ZÒ4ZßÜ% d×&:Ñ&:×;Ô;¸tØ’J÷ <Ñ;ô ˜$×.Ñ.°×5Ô5¸Ø’J÷ 6Ñ5ä˜×,Ñ,¬e×4Ò4Ü—*’*˜T×1Ñ1Ó2Ô2Ü˜×,Ñ,¬b×.?Ñ.?×@Ò@Ø×+Ñ+×0Ñ0Ó2ˆHØ×&Ñ&Ò&Ø× Ñ ×%Ñ% h´·±Ö<ñ A÷ <×;Ð;ú÷ 6×5Ð5üs=   ‚AFÁFÁ(E(Á-(FÂE<ÂCFÅ(E9	Å3	FÅ<F	Æ	Fc                ó    <€ V ^8„  d   QhRS[ /# )r9   r\   )rh   )r;   r<   s   "€r4   r=   r^     s   ø€ ÷ 1ñ 1™Eñ 1r7   c                ó¸   € V P                  4       ;_uu_ 4       p\        P                  ! VP                  4       4      uuRRR4       #   + '       g   i     R# ; i)zC
The base64-encoded content of `path_or_fileobj`

Returns: `bytes`
N)r}   Úbase64Ú	b64encodeÚread©r3   r{   s   & r4   Ú
b64contentÚCommitOperationAdd.b64content  s1   € ð �\‰\�^Œ^˜tÜ×#Ò# D§I¡I£KÓ0÷ �^�^‹^ús   ™$AÁA	c                ó.   <€ V ^8„  d   QhRS[ R,          /# r[   ©r:   )r;   r<   s   "€r4   r=   r^     s   ø€ ÷ 1ñ 1™C $�Jñ 1r7   c                óB  € V P                   f   R# V P                   R8X  d%   V P                  P                  P                  4       # V P	                  4       ;_uu_ 4       p\
        P                  ! VP                  4       4      uuRRR4       #   + '       g   i     R# ; i)aŠ  Return the OID of the local file.

This OID is then compared to `self._remote_oid` to check if the file has changed compared to the remote one.
If the file did not change, we won't upload it again to prevent empty commits.

For LFS files, the OID corresponds to the SHA256 of the file content (used a LFS ref).
For regular files, the OID corresponds to the SHA1 of the file content.
Note: this is slightly different to git OID computation since the oid of an LFS file is usually the git-SHA1 of the
      pointer file content (not the actual file content). However, using the SHA256 is enough to detect changes
      and more convenient client-side.
NÚlfs)Ú_upload_modero   Úsha256Úhexr}   r   Úgit_hashrƒ   r„   s   & r4   Ú
_local_oidÚCommitOperationAdd._local_oid  si   € ð ×ÑÒ$ÙØ×Ñ %Ô'Ø×#Ñ#×*Ñ*×.Ñ.Ó0Ð0ð —‘—” 4Ü—|’| D§I¡I£KÓ0÷  ——“ús   Á$BÂB	c                óÔ   <€ V ^8„  d   Qh/ S[ ;R&   S[ S[,          S[,          S[,          ;R&   S[;R&   S[R,          ;R&   S[R,          ;R&   S[ R,          ;R&   S[;R&   S[;R	&   # )
r9   r,   r`   ro   Nr‹   Ú_should_ignoreÚ_remote_oidÚ_is_uploadedÚ_is_committed)r:   r	   rh   r   r   Ú
UploadModer0   )r;   r<   s   "€r4   r=   r^   �   s’   ø‡ ‚ ñ2 Ññ3 ñ4 ™4•Z¡%Õ'©(Õ2Ñ2ñ5 ñ6 Ñ;ñ7 ñ@ ˜tÕ#ÑQñA ñH ˜4•KÑMñI ñP �t•ÑIñQ ñV ÑEñW ñ\ ÑFò] r7   )r,   r`   ro   )F)r?   r@   rA   rB   rC   r   ro   r‹   r’   r“   r”   r•   r5   r   r}   r…   Úpropertyr�   rD   rE   rF   rG   s   @r4   rV   rV   �   sµ   ø‡ € ññ2 $¨°UÔ;€Kñ
 ',°¸UÈDÔ&Q€Lñ #(¨U¸ÈÔ"M€Nñ $¨°UÀDÔI€Kñ  E°¸uÔE€Lñ   U°ÀÔF€M÷!Mð !MðF ÷/=ñ /=ó ð/=÷b1ð 1ð ÷1ó ð1÷_ ƒ r7   rV   c                ó0   € V ^8„  d   QhR\         R\         /# )r9   r,   r\   rˆ   )r;   s   "r4   r=   r=   5  s   € ÷ ñ ¬ð ´ñ r7   c                 óê  a€ V P                  R 4      '       d
   V R,          p V R8X  g   V R8X  g   V P                  R4      '       d   \        RV  R24      hV P                  R4      '       d
   V R,          p \         Fs  o\        ;QJ d.    V3R	 lV P	                  R 4       4       F  '       g   K   R
M#	  RM! V3R	 lV P	                  R 4       4       4      '       g   Kc  \        RS RV  R24      h	  V # )r*   :é   NNÚ.z..z../z,Invalid `path_in_repo` in CommitOperation: 'Ú'z./:r9   NNc              3   ó,   <"  € T F	  qS8H  x € K  	  R # 5i©Nr]   )Ú.0ÚpartÚ	forbiddens   & €r4   Ú	<genexpr>Ú)_validate_path_in_repo.<locals>.<genexpr>>  s   øé € ÐEÑ-D T�yÖ Ó-Dùs   ƒTFzHInvalid `path_in_repo` in CommitOperation: cannot update files under a 'z/' folder (path: 'z').)Ú
startswithr1   r   ÚanyÚsplit)r,   r¡   s   &@r4   r+   r+   5  sß   ø€ à×Ñ˜s×#Ò#Ø# BÕ'ˆØ�sÔ˜l¨dÔ2°l×6MÑ6MÈe×6TÒ6TÜÐGÈÀ~ÐUVÐWÓXÐXØ×Ñ˜t×$Ò$Ø# BÕ'ˆß&ˆ	ß‹3ÔE¨\×-?Ñ-?ÀÔ-DÓE�3�3Š3ÔE¨\×-?Ñ-?ÀÔ-DÓE×EÔEÜØZÐ[dÐZeð fØ!�N #ð'óð ñ 'ð Ðr7   c                ó>   € V ^8„  d   QhR\         \        ,          RR/# )r9   Ú
operationsr\   N)ÚlistÚCommitOperation)r;   s   "r4   r=   r=   I  s   € ÷ +ñ +´´_Õ0Eð +È$ñ +r7   c                ón  € \        \        4      pV  EF  pVP                  p\        V\        4      '       dv   W,          ^ 8”  d   \
        P                  ! RV R24       W;;,          ^,          uu&   \        V4      P                   F!  pV\        V4      ;;,          ^,          uu&   K#  	  \        V\        4      '       g   K³  V\        \        V4      4      ,          ^ 8”  g   KÕ  VP                  '       d   \
        P                  ! RV R24       EK  \
        P                  ! RV R24       EK!  	  R# )ab  
Warn user when a list of operations is expected to overwrite itself in a single
commit.

Rules:
- If a filepath is updated by multiple `CommitOperationAdd` operations, a warning
  message is triggered.
- If a filepath is updated at least once by a `CommitOperationAdd` and then deleted
  by a `CommitOperationDelete`, a warning is triggered.
- If a `CommitOperationDelete` deletes a filepath that is then updated by a
  `CommitOperationAdd`, no warning is triggered. This is usually useless (no need to
  delete before upload) but can happen if a user deletes an entire folder and then
  add new files to it.
zBAbout to update multiple times the same file in the same commit: 'z9'. This can cause undesired inconsistencies in your repo.z_About to delete a folder containing files that have just been updated within the same commit: 'zLAbout to delete a file that have just been updated within the same commit: 'N)r   Úintr,   r/   rV   ÚwarningsÚwarnr
   Úparentsr:   r'   r-   )r¨   Únb_additions_per_pathÚ	operationr,   Úparents   &    r4   Ú_warn_on_overwriting_operationsr³   I  s  € ô -8¼Ó,<ÐÜˆ	Ø ×-Ñ-ˆÜ�iÔ!3×4Ò4Ø$Õ2°QÔ6Ü—’ðØ%˜ð '"ð"ôð
 "×/°1Õ4Ó/Ü'¨Ó5×=Ô=�ð &¤c¨&£k×2°aÕ7Õ2ñ >ô �iÔ!6×7Ô7Ø$¤S¬°|Ó)DÓ%EÕFÈÖJØ×&×&Ð&Ü—M’Mð=Ø=I¸Nð KIðI÷ô —M’Mð*Ø*6¨ð 89ð9÷ó/  r7   ÚendpointÚnum_threadsÚrevisionÚ	create_prc                óÚ   € V ^8„  d   QhR\         \        ,          R\        R\        R\        \        \        3,          R\        R,          R\        R\        R,          R	\
        R,          /# )
r9   Ú	additionsÚ	repo_typeÚrepo_idÚheadersr´   Nrµ   r¶   r·   )r©   rV   r:   Údictr¬   r0   )r;   s   "r4   r=   r=   x  s~   € ÷ N
ñ N
äÔ&Õ'ðN
ô ðN
ô ð	N
ô
 ”#”s�(�^ðN
ô �D�jðN
ô ðN
ô �D�jðN
ô �d�{ñN
r7   c                óô  € . p. p	/ p
\        V \        R7       EFˆ  pV Uu. uF  qÌNK  	  ppRR.p\        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      p\        4       '       d0   V'       g   VP	                  R4       M\
        P                  R4       \        V Uu. uF  qÌP                  NK  	  upVVVVVR	VR
7      w  pppV'       dd   RP                  V Uu. uF9  pRVP                  R4       RVP                  R/ 4      P                  R4       2NK;  	  up4      p\        RV 24      hVR8X  d   RV9   d   VP                  V4       EKH  V	P                  V4       V F)  pWÊVP                  P                  P                  4       &   K+  	  EK‹  	  \        V	4      ^ 8”  d   \!        V	V
VVVR7       \        V4      ^ 8”  d   \#        VVVVVVVR7       R	# R	# u upi u upi u upi )zC
Negotiates per-file transfer (LFS vs Xet) and uploads in batches.
)Ú
chunk_sizeÚbasicÚ	multipartc              3   ój   "  € T F)  p\        VP                  \        P                  4      x € K+  	  R # 5irž   )r/   r`   rf   rg   )rŸ   Úops   & r4   r¢   Ú _upload_files.<locals>.<genexpr>Ž  s)   é € Ð"jÑ_iÐY[¤:¨b×.@Ñ.@Ä"×BSÑBS×#TÐ#TÓ_iùs   ‚13TFÚxetzcUploading files as a binary IO buffer is not supported by Xet Storage. Falling back to HTTP upload.N)Úupload_infosr»   rº   r¶   r´   r¼   ÚtokenÚ	transfersÚ
z$Encountered error for file with OID Úoidz: `ÚerrorÚmessagezLFS batch API returned errors:
)ÚactionsÚ	oid2addopr¼   r´   rµ   )r¹   rº   r»   r¼   r´   r¶   r·   )r   ÚUPLOAD_BATCH_MAX_NUM_FILESr¥   r#   ÚappendÚloggerÚwarningr   ro   ÚjoinÚgetr1   ÚextendrŒ   r�   ÚlenÚ_upload_lfs_filesÚ_upload_xet_files)r¹   rº   r»   r¼   r´   rµ   r¶   r·   Úxet_additionsÚlfs_actionsÚlfs_oid2addopÚchunkrÃ   Ú
chunk_listrÈ   Úhas_buffered_io_dataÚactions_chunkÚerrors_chunkÚchosen_transferÚerrrÌ   s   $$$$$$$$             r4   Ú_upload_filesrã   w  s  € ð /1€MØ(*€KØ35€Mä 	Ô6P×QÐQˆÙ#(Ó)¡5˜R’b¡5ˆ
Ð)à '¨Ð5ˆ	ß"›sÑ"jÑ_iÓ"jŸsŸsšsÑ"jÑ_iÓ"jÓjÐÜ×Òß'Ø× Ñ  Õ'ä—‘ð3ôô
 8KÙ3=Ó>±:¨RŸ.œ.±:Ñ>ØØØØØØØô	8
Ñ4ˆ�| _÷ Ø—i‘iñ  ,óá+˜ð ;¸3¿7¹7À5»>Ð:JÈ#ÈcÏgÉgÐV]Ð_aÓNb×NfÑNfÐgpÓNqÐMrÓsÙ+ñóˆGô Ð?À¸yÐIÓJÐJð ˜eÔ#¨°)Ô);Ø× Ñ  ×,à×Ñ˜}Ô-Û �Ø=?˜bŸn™n×3Ñ3×7Ñ7Ó9Ó:ô !ñO RôT ˆ;Ó˜!ÔÜØØ#ØØØ#õ	
ô ˆ=Ó˜AÔÜØ#ØØØØØØ÷	
ñ ùòe *ùò ?ùòs    
G+Â,G0
Ã*?G5
c          
      óÞ   € V ^8„  d   QhR\         \        \        \        3,          ,          R\        \        \        3,          R\        \        \        3,          R\        R,          R\
        /# )r9   rÍ   rÎ   r¼   r´   Nrµ   )r©   r½   r:   r   rV   r¬   )r;   s   "r4   r=   r=   Ê  sg   € ÷ P
ñ P
ä”$”sœC�x•.Õ!ðP
ô ”CÔ+Ð+Õ,ðP
ô ”#”s�(�^ð	P
ô
 �D�jðP
ô ñP
r7   c                óÞ  aaa€ . pV  FZ  pVP                  R4      f4   \        P                  RSVR,          ,          P                   R24       KI  VP	                  V4       K\  	  R VVV3R llp\        V4      ^8X  d'   \        P                  R4       V! V^ ,          4       R# \        P                  R	\        V4       R
V R24       \        VVR\        V4       R2V\        R7       R# )aS  
Uploads the content of `additions` to the Hub using the large file storage protocol.

Relevant external documentation:
    - LFS Batch API: https://github.com/git-lfs/git-lfs/blob/main/docs/api/batch.md

Args:
    actions (`list[dict[str, Any]]`):
        LFS batch actions returned by the server.
    oid2addop (`dict[str, CommitOperationAdd]`):
        A dictionary mapping the OID of the file to the corresponding `CommitOperationAdd` object.
    headers (`dict[str, str]`):
        Headers to use for the request, including authorization headers and user agent.
    endpoint (`str`, *optional*):
        The endpoint to use for the request. Defaults to `constants.ENDPOINT`.
    num_threads (`int`, *optional*):
        The number of concurrent threads to use when uploading. Defaults to 5.

Raises:
    [`EnvironmentError`](https://docs.python.org/3/library/exceptions.html#EnvironmentError)
        If an upload failed for any reason
    [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError)
        Type of the repo to upload to: `"model"`, `"dataset"` or `"space"`.
    repo_id (`str`):
        A namespace (user or an organization) and a repo name separated
        by a `/`.
    headers (`dict[str, str]`):
        Headers to use for the request, including authorization headers and user agent.
    num_threads (`int`, *optional*):
        The number of concurrent threads to use when uploading. Defaults to 5.
    revision (`str`, *optional*):
        The git revision to upload to.

Raises:
    [`EnvironmentError`](https://docs.python.org/3/library/exceptions.html#EnvironmentError)
        If an upload failed for any reason
    [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError)
        If the server returns malformed responses
    [`HfHubHTTPError`]
        If the LFS batch endpoint returned an HTTP error.
rÍ   NzContent of file rÊ   z/ is already present upstream - skipping upload.c                ó   € V ^8„  d   QhRR/# r[   r]   )r;   s   "r4   r=   Ú'_upload_lfs_files.<locals>.__annotate__  s   € ÷ iñ i¨Tñ ir7   c                 ó    <€  SV R ,          ,          p\        WSSR7       R#   \         d    p\        RXP                   R24      ThRp?ii ; i)rÊ   )r±   Úlfs_batch_actionr¼   r´   zError while uploading 'z' to the Hub.N)r   Ú	ExceptionÚRuntimeErrorr,   )Úbatch_actionr±   rr   r´   r¼   rÎ   s   &  €€€r4   Ú_wrapped_lfs_uploadÚ._upload_lfs_files.<locals>._wrapped_lfs_upload  sX   ø€ ð	iØ! ,¨uÕ"5Õ6ˆIÜ ÐSZÐem×nøÜô 	iÜÐ!8¸×9OÑ9OÐ8PÐP]Ð^Ó_ÐehÐhûð	iús   ƒ# £A®AÁAzUploading 1 LFS file to the Hubz
Uploading z" LFS files to the Hub using up to z threads concurrentlyzUpload z
 LFS files)ÚdescÚmax_workersÚ
tqdm_class)rÔ   rÑ   Údebugr,   rÐ   rÖ   r   Úhf_tqdm)rÍ   rÎ   r¼   r´   rµ   Úfiltered_actionsÚactionrí   s   $ddd$   r4   r×   r×   É  sç   ú€ ðf ÐÛˆØ�:‰:�iÓ Ò(Ü�L‰LØ" 9¨V°E­]Õ#;×#HÑ#HÐ"IÐIxÐyöð ×#Ñ# FÖ+ñ ÷iò iô ÐÓ Ô!Ü�‰Ð6Ô7ÙÐ,¨QÕ/Ö0ä�‰ØœÐ-Ó.Ð/Ð/QÐR]ÐQ^Ð^sÐtô	
ô 	ØØØœ3Ð/Ó0Ð1°Ð<Ø#Ü÷	
r7   c                óÎ   € V ^8„  d   QhR\         \        ,          R\        R\        R\        \        \        3,          R\        R,          R\        R,          R\        R,          /# )	r9   r¹   rº   r»   r¼   r´   Nr¶   r·   )r©   rV   r:   r½   r0   )r;   s   "r4   r=   r=     ss   € ÷ uñ uäÔ&Õ'ðuô ðuô ð	uô
 ”#”s�(�^ðuô �D�jðuô �D�jðuô �d�{ñur7   c                ó0  € \        V 4      ^ 8X  d   R# ^RIHpHpHp	Hp
Hp ^RIHp V
! VP                  VVVVR7      pV'       d
   VR,          pV! V4      pV	! 4       pRp \        4       '       g   V! 4       pVP                  pMRpV  Uu. uF'  p\        VP                  \        4      '       g   K%  VNK)  	  ppV  Uu. uF-  p\        VP                  \        \         34      '       g   K+  VNK/  	  ppVP#                  VVVVR7      ;_uu_ 4       pV FK  pVP%                  \        VP                  4      VP&                  P(                  P+                  4       R7       KM  	  V FB  pVP-                  VP                  VP&                  P(                  P+                  4       R7       KD  	  RRR4       Te   TP1                  4        R# R# u upi u upi   + '       g   i     L2; i  \.         d
    T! 4        h i ; i  Te   TP1                  4        i i ; i)aÒ
  
Uploads the content of `additions` to the Hub using the xet storage protocol.
This chunks the files and deduplicates the chunks before uploading them to xetcas storage.

Args:
    additions (`` of `CommitOperationAdd`):
        The files to be uploaded.
    repo_type (`str`):
        Type of the repo (e.g. `"model"`, `"dataset"`, `"space"`).
    repo_id (`str`):
        A namespace (user or an organization) and a repo name separated
        by a `/`.
    headers (`dict[str, str]`):
        Headers to use for the request, including authorization headers and user agent.
    endpoint: (`str`, *optional*):
        The endpoint to use for the xetcas service. Defaults to `constants.ENDPOINT`.
    revision (`str`, *optional*):
        The git revision to upload to.
    create_pr (`bool`, *optional*):
        Whether or not to create a Pull Request with that commit.

Raises:
    [`EnvironmentError`](https://docs.python.org/3/library/exceptions.html#EnvironmentError)
        If an upload failed for any reason.
    [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError)
        If the server returns malformed responses or if the user is unauthorized to upload to xet storage.
    [`HfHubHTTPError`]
        If the LFS batch endpoint returned an HTTP error.

**How it works:**
    The file upload system uses Xet storage, which is a content-addressable storage system that breaks files into chunks
    for efficient storage and transfer.

    ``session.new_upload_commit()`` manages uploading files by:
        - Registering upload tasks and starting upload immediately in the background
        - Breaking files into smaller chunks for efficient storage
        - Avoiding duplicate storage by recognizing identical chunks across files
        - Connecting to a storage server (CAS server) that manages these chunks

    Authentication works transparently: the upload commit accepts a ``token_refresh_url``
    that is used to refresh the short-lived xet write token as needed.

    The upload process works like this:
    1. Upload tasks run in parallel:
        1.1. Read the file content from a path, bytes array, or a stream.
        1.2. Split the file content into smaller chunks based on content patterns: each chunk gets a unique ID based on what's in it.
        1.3. For each chunk:
            - Check if it already exists in storage.
            - Skip uploading chunks that already exist.
        1.4. Group chunks into larger blocks for efficient transfer.
        1.5. Upload these blocks to the storage server.
        1.6. Assemble the file manifest locally and send it to the server for validation.
    2. Return reference files that contain information about the uploaded files, which can be used later to download them.
N)ÚXetTokenTypeÚabort_xet_sessionÚget_xet_sessionÚxet_connection_info_refresh_urlÚxet_headers_without_auth)ÚXetProgressReporter)Ú
token_typer»   rº   r¶   r´   z?create_pr=1)Útoken_refresh_urlÚtoken_refresh_headersÚcustom_headersÚprogress_callback)rŒ   )rÖ   Ú
utils._xetrø   rù   rú   rû   rü   Úutils._xet_progress_reportingrý   ÚWRITEr   Úupdate_progressr/   r`   rh   r:   r	   Únew_upload_commitÚstart_upload_filero   rŒ   r�   Ústart_upload_bytesÚKeyboardInterruptÚclose)r¹   rº   r»   r¼   r´   r¶   r·   rø   rù   rú   rû   rü   rý   Úrefresh_urlÚxet_headersÚsessionÚprogressr  rÃ   Úall_bytes_opsÚall_paths_opsÚcommits   $$$$$$$               r4   rØ   rØ     sÞ  € ôB ˆ9ƒ~˜ÔÙ÷õ õ Cá1Ø×%Ñ%ØØØØô€K÷ Ø�~Õ%ˆá*¨7Ó3€KáÓ€GØ€HðÜ)×+Ò+Ù*Ó,ˆHØ (× 8Ñ 8Ñà $Ðá&/ÓY¡i ´:¸b×>PÑ>PÔRW×3XŸ˜¡iˆÐYÙ&/Ó_¡i ´:¸b×>PÑ>PÔSVÔX\ÐR]×3^Ÿ˜¡iˆÐ_à×&Ñ&Ø)Ø")Ø&Ø/ð	 '÷ 
ô 
ð
 Û#�Ø×(Ñ(¬¨R×-?Ñ-?Ó)@ÈÏÉ×I^ÑI^×IbÑIbÓIdÐ(Öeñ $ã#�Ø×)Ñ)¨"×*<Ñ*<ÀRÇ^Á^×EZÑEZ×E^ÑE^ÓE`Ð)Öañ $÷
ð ÒØ�N‰NÖñ  ùò# ZùÚ_÷
÷ 
ûô ô ÙÔØðûð ÒØ�N‰NÕð  úsg   Á!*G' Â"G
Â2G
Â8G' Â>(GÃ+GÃ1G' ÄBGÆ*G' Ç

G' ÇG$	ÇG' Ç#G> Ç$G' Ç'G;Ç;G> Ç>Hc                ó$   € V ^8„  d   QhR\         /# )r9   Úpreupload_info)r½   )r;   s   "r4   r=   r=   –  s   € ÷ ñ ¬Tñ r7   c                 ón  € V P                  R 4      p\        V\        4      '       g   \        R4      hV F|  p\        V\        4      '       d[   \        VP                  R4      \
        4      '       d6   \        VP                  R4      \
        4      '       d   VR,          R9   d   Ks  \        R4      h	  V # )Úfilesz&preupload_info is improperly formattedrb   Ú
uploadModez'preupload_info is improperly formatted:©rŠ   Úregular)rÔ   r/   r©   r1   r½   r:   )r  r  Ú	file_infos   &  r4   Ú_validate_preupload_infor  –  s�   € Ø×Ñ˜wÓ'€EÜ�eœT×"Ò"ÜÐAÓBÐBÛˆ	ä�y¤$×'Ò'Ü˜9Ÿ=™=¨Ó0´#×6Ò6Ü˜9Ÿ=™=¨Ó6¼×<Ò<Ø˜<Õ(Ð,>Ö>äÐFÓGÐGñ ð Ðr7   c                óÐ   € V ^8„  d   QhR\         \        ,          R\        R\        R\        \        \        3,          R\        R\        R,          R\        R	\        R,          R
R/	# )r9   r¹   rº   r»   r¼   r¶   r´   Nr·   Úgitignore_contentr\   )r   rV   r:   r½   r0   )r;   s   "r4   r=   r=   ¦  sƒ   € ÷ R.ñ R.ÜÔ*Õ+ðR.äðR.ô ðR.ô ”#”s�(�^ð	R.ô
 ðR.ô �D�jðR.ô ðR.ô ˜T•zðR.ð 
ñR.r7   c                óp  € Ve   TM\         P                  p/ p/ p	/ p
\        V R4       EFv  pRV Uu. uF`  pRVP                  R\        P
                  ! VP                  P                  4      P                  R4      RVP                  P                  /NKb  	  up/pVe   W}R&   \        R	V R
V RV RV 2TTV'       d   RR/MRR7      p\        V4       \        VP                  4       4      pVP                  ! R/ VR,           Uu/ uF  pVR,          VR,          bK  	  upB  V	P                  ! R/ VR,           Uu/ uF  pVR,          VR,          bK  	  upB  V
P                  ! R/ VR,           Uu/ uF  pVR,          VP                  R4      bK  	  upB  EKy  	  V  FK  pVVP                  ,          Vn        V	VP                  ,          Vn        V
VP                  ,          Vn        KM  	  V  F'  pVP                  P                  ^ 8X  g   K   RVn        K)  	  R# u upi u upi u upi u upi )a‡  
Requests the Hub "preupload" endpoint to determine whether each input file should be uploaded as a regular git blob,
as a git LFS blob, or as a XET file. Input `additions` are mutated in-place with the upload mode.

Args:
    additions (`Iterable` of :class:`CommitOperationAdd`):
        Iterable of :class:`CommitOperationAdd` describing the files to
        upload to the Hub.
    repo_type (`str`):
        Type of the repo to upload to: `"model"`, `"dataset"` or `"space"`.
    repo_id (`str`):
        A namespace (user or an organization) and a repo name separated
        by a `/`.
    headers (`dict[str, str]`):
        Headers to use for the request, including authorization headers and user agent.
    revision (`str`):
        The git revision to upload the files to. Can be any valid git revision.
    gitignore_content (`str`, *optional*):
        The content of the `.gitignore` file to know which files should be ignored. The order of priority
        is to first check if `gitignore_content` is passed, then check if the `.gitignore` file is present
        in the list of files to commit and finally default to the `.gitignore` file already hosted on the Hub
        (if any).
Raises:
    [`~utils.HfHubHTTPError`]
        If the Hub API returned an error.
    [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError)
        If the Hub API response is improperly formatted.
Nr%   r  rb   ÚsampleÚasciiÚsizeÚ	gitIgnoreÚPOSTz/api/ús/z/preupload/r·   Ú1)Újsonr¼   Úparamsr  ÚshouldIgnorerÊ   r  r]   )r   ÚENDPOINTr   r,   r�   r‚   ro   r  Údecoder!  r   r   r  r&  ÚupdaterÔ   r‹   r’   r“   )r¹   rº   r»   r¼   r¶   r´   r·   r  Úupload_modesÚshould_ignore_infoÚoid_inforÜ   rÃ   ÚpayloadÚrespr  r{   Úadditions   &&&&&&&&          r4   Ú_fetch_upload_modesr2  ¥  s*  € ðN $Ò/‰x´Y×5GÑ5G€Hð +-€LØ*,ÐØ&(€Hä 	¨3×/ˆàñ  óñ  �Bð	 ˜BŸO™OØœf×.Ò.¨r¯~©~×/DÑ/DÓE×LÑLÈWÓUØ˜BŸN™N×/Ñ/óñ
  ñð	
ˆð Ò(Ø#4�KÑ äØØˆj˜˜i˜[¨¨7¨)°;¸x¸jÐIØØß)2�K Ñ%¸ô
ˆô 	˜DÔ!Ü1°$·)±)³+Ó>ˆØ×ÒÑeÈNÐ[bÖLcÓdÑLcÀD˜t F�|¨T°,Õ-?Ò?ÑLcÑdÒeØ×!Ò!ÑmÐTbÐcjÖTkÓ$lÑTkÈD T¨&¥\°4¸Õ3GÒ%GÑTkÑ$lÒmØ�ŠÑ^À^ÐT[ÖE\Ó]ÑE\¸T˜4 �<¨¯©°%«Ò8ÑE\Ñ]Õ^ñ3 0ó8 ˆØ ,¨X×-BÑ-BÕ CˆÔØ"4°X×5JÑ5JÕ"KˆÔØ'¨×(=Ñ(=Õ>ˆÖñ ó ˆØ×Ñ×$Ñ$¨Ö)Ø$-ˆHÖ!ó ùòCùò* eùÚ$lùÚ]s   ²A&H$ÄH)Å H.Å8"H3c                   ó,   a € ] tR tRt o V 3R ltRtV tR# )Ú_CopySourceiû  c                ót   <€ V ^8„  d   Qh/ S[ R,          ;R&   S[ R,          ;R&   S[ ;R&   S[ R,          ;R&   # )r9   NrL   rM   rb   r¶   rˆ   )r;   r<   s   "€r4   r=   Ú_CopySource.__annotate__û  s@   ø‡ ‚ Ù�t•Ññ á˜•:Ññ ñ �Iñ ñ �D�jÑò	 r7   r]   N)r?   r@   rA   rB   rD   rE   rF   rG   s   @r4   r4  r4  û  s   ø‡ ‡ „ r7   r4  c                óî   € V ^8„  d   QhR\         \        ,          R\        R\        R\        \        \        3,          R\        R\        R,          R\        \        \
        R	\        3,          3,          /# )
r9   Úcopiesrº   r»   r¼   r¶   r´   Nr\   r$   )r   rI   r:   r½   r4  r   rh   )r;   s   "r4   r=   r=     s}   € ÷ nñ nÜÔ(Õ)ðnäðnô ðnô ”#”s�(�^ð	nô
 ðnô �D�jðnô 
Œ+”u˜Z¬Ð.Õ/Ð
/Õ0ñnr7   c                óÒ  € ^RI HpHp V! WSR7      p\        V 4      p / p	/ p
V  Uu. uF  q»P                  NK  	  pp\        V\        4       FW  pVP                  V\        V4      VVR7      pV F0  p\        W÷4      '       d   K  VP                  W¯P                  V3&   K2  	  KY  	  V P                  R R7       \        V R R7       EF  w  w  pppp\        V4      pVRJpT;'       g    TpT;'       g    TpT;'       g    V'       d   RMTpV Uu. uF  q»P                  NK  	  pp\        V\        4       Fë  pVP                  V\        V4      VVR7      pV FÄ  p\        VV4      '       d   \        R	4      h\        VVVP                  V4      pVP                   '       d   VV	V&   MO\#        VVVVVP                  R
7      p\%        4       P'                  VVR7      p\)        V4       VP*                  V	V&   V'       d   K©  VP                  V
VP                  V3&   KÆ  	  Kí  	  V Fª  p \        VVV P                  V4      p!V!V	9  d1   V'       d	   RV RV 2MRp"\-        RV P                   RV V" R24      hV
P'                  V P                  V34      V n        V'       d   K~  V
P'                  V P                  V P0                  34      V n        K¬  	  EK  	  V	# u upi u upi )a  
Fetch information about the files to copy.

For LFS files, we only need their metadata (file size and sha256) while for regular files
we need to download the raw content from the Hub.

Args:
    copies (`Iterable` of :class:`CommitOperationCopy`):
        Iterable of :class:`CommitOperationCopy` describing the files to
        copy on the Hub.
    repo_type (`str`):
        Type of the repo to upload to: `"model"`, `"dataset"` or `"space"`.
    repo_id (`str`):
        A namespace (user or an organization) and a repo name separated
        by a `/`.
    headers (`dict[str, str]`):
        Headers to use for the request, including authorization headers and user agent.
    revision (`str`):
        The git revision to upload the files to. Can be any valid git revision.

Returns: `dict[_CopySource, Union[RepoFile, bytes]]]`
    Key is `(src_repo_id, src_repo_type, path, revision)`. For intra-repo copies,
    `src_repo_id` and `src_repo_type` are `None`.
    Value is the raw content as bytes (for regular files) or the file information as a RepoFile (for LFS files).

Raises:
    [`~utils.HfHubHTTPError`]
        If the Hub API returned an error.
    [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError)
        If the Hub API response is improperly formatted.
)ÚHfApiÚ
RepoFolder)r´   r¼   )r»   Úpathsr¶   rº   c                 ó„   € V P                   ;'       g    R V P                  ;'       g    R V P                  ;'       g    R 3# )Ú ©rL   rM   rP   ©rÃ   s   &r4   Ú<lambda>Ú&_fetch_files_to_copy.<locals>.<lambda>?  s2   €  §¡× 4Ð 4°"°b×6FÑ6F×6LÐ6LÈ"ÈbÏoÉo×NcÐNcÐacÑdr7   )Úkeyc                 óH   € V P                   V P                  V P                  3# rž   r?  r@  s   &r4   rA  rB  A  s   €  §¡°×0@Ñ0@À"Ç/Á/ÑRr7   NÚmainz$Copying a folder is not implemented.)r´   rº   r»   r¶   Úfilename)r¼   z from r$  r>  zCannot copy z at revision z: file is missing on repo.)Úhf_apir:  r;  r©   r,   r   ÚFETCH_LFS_BATCH_SIZEÚget_paths_infor/   Úblob_idrb   Úsortr   rK   ÚNotImplementedErrorr4  rŠ   r   r   rÔ   r   Úcontentr   rR   rP   rQ   )#r8  rº   r»   r¼   r¶   r´   r:  r;  rG  Úfiles_to_copyr.  rÃ   Ú
dest_pathsÚbatchÚdest_repo_filesr{   Úsrc_repo_id_keyÚsrc_repo_type_keyÚsrc_revision_keyÚgroupr¨   Úis_cross_repoÚeff_repo_idÚeff_repo_typeÚeff_revisionÚ	src_pathsÚpaths_batchÚsrc_repo_filesÚsrc_repo_fileÚsourceÚurlÚresponser±   rC  Úsource_descs#   &&&&&&                             r4   Ú_fetch_files_to_copyrb    sþ  € ÷P *á˜HÔ6€FÜ�&‹\€FØAC€MØ9;€Hñ -3Ó3©F b—/”/©F€JÐ3Ü 
Ô,@ÖAˆØ ×/Ñ/ØÜ�u“+ØØð	 0ó 
ˆó $ˆDÜ˜d×/Ô/Ø26·,±,�Ÿ)™) XÐ.Ó/ó $ñ Bð ‡K�KÑd€KÔeÜIPØÑR÷Jð JÑEÑ>ˆÐ+Ð-=Àô ˜%“[ˆ
Ø'¨tÐ3ˆØ%×0Ð0¨ˆØ)×6Ð6¨YˆØ'×RÐR·m©FÈˆá3=Ó>±:¨R×(Ô(±:ˆ	Ð>Ü)¨)Ô5IÖJˆKØ#×2Ñ2Ø#Ü˜;Ó'Ø%Ø'ð	 3ó ˆNó "0�Ü˜m¨Z×8Ò8Ü-Ð.TÓUÐUÜ$ _Ð6GÈ×I[ÑI[Ð]mÓn�Ø ×$×$Ð$Ø,9�M &Ò)ä$Ø!)Ø"/Ø +Ø!-Ø!.×!3Ñ!3ô�Cô  +›}×0Ñ0°¸gÐ0ÓF�HÜ'¨Ô1Ø,4×,<Ñ,<�M &Ñ)ß$‘}ØGT×G\ÑG\�H˜m×0Ñ0Ð2BÐCÓDó% "0ñ Kó6 $ˆIÜ˜oÐ/@À)×B\ÑB\Ð^nÓoˆCØ˜-Ô'ßIV  } o°R¸°}ÑEÐ\^�Ü(Ø" 9×#=Ñ#=Ð">¸mØ#�n [ MÐ1KðMóð ð #+§,¡,°	×0FÑ0FÈÐ/QÓ"RˆIÔß ‘=Ø%-§\¡\°9×3MÑ3MÈy×OeÑOeÐ2fÓ%g�	Ö"ô $ñKJðb Ðùò 4ùò. ?s   ¥KÄK$c                ó  € V ^8„  d   QhR\         \        ,          R\        \        \        R\
        3,          3,          R\        R\        R,          R\        R,          R\         \        \        \        3,          ,          /# )	r9   r¨   rN  r$   Úcommit_messageÚcommit_descriptionNÚparent_commitr\   )r   rª   r½   r4  r   rh   r:   r   )r;   s   "r4   r=   r=   t  s‚   € ÷ ebñ ebÜœÕ)ðebäœ¤U¨:´uÐ+<Õ%=Ð=Õ>ðebô ðebô ˜d�
ð	ebô
 ˜•:ðebô Œd”3œ�8�nÕñebr7   c              #  óœ  "  € Ve   TMRpRVRV/pVe   WER&   RRRV/x € ^ pV  EF~  p\        V\        4      '       dA   VP                  '       d/   \        P	                  R	VP
                   R
24       V^,          pKZ  \        V\        4      '       dH   VP                  R8X  d7   RRRRVP                  4       P                  4       RVP
                  RR//x € K·  \        V\        4      '       de   VP                  R8X  dT   RRRRVP
                  RRRVP                  P                  P                  4       RVP                  P                  //x € EK1  \        V\        4      '       d,   RVP                  '       d   RMRRRVP
                  //x € EKr  \        V\        4      '       dÞ   \!        VP"                  VP$                  VP&                  VP(                  4      pW,          p	\        V	\*        4      '       d>   RRRR\,        P.                  ! V	4      P                  4       RVP
                  RR//x € EK  V	P0                  '       d0   RRRRVP
                  RRRV	P0                  P                  //x € EKZ  \3        R4      h\3        RV R\5        VRR4       24      h	  V^ 8”  d   \        P7                  RV R24       R# R# 5i)a+  
Builds the payload to POST to the `/commit` API of the Hub.

Payload is returned as an iterator so that it can be streamed as a ndjson in the
POST request.

For more information, see:
    - https://github.com/huggingface/huggingface_hub/issues/1085#issuecomment-1265208073
    - http://ndjson.org/
Nr>  ÚsummaryÚdescriptionÚparentCommitrC  ÚheaderÚvaluezSkipping file 'z(' in commit (ignored by gitignore file).r  r{   rM  rb   Úencodingr�   rŠ   ÚlfsFileÚalgorŒ   rÊ   r!  ÚdeletedFolderÚdeletedFilez_Malformed files_to_copy (should be raw file content as bytes or RepoFile objects with LFS info.z(Unknown operation to commit. Operation: z. Upload mode: r‹   zSkipped z/ file(s) in commit (ignored by gitignore file).)r/   rV   r’   rÑ   rò   r,   r‹   r…   r*  ro   rŒ   r�   r!  r'   r-   rI   r4  rL   rM   rK   rP   rh   r�   r‚   rŠ   r1   ÚgetattrÚinfo)
r¨   rN  rd  re  rf  Úheader_valueÚnb_ignored_filesr±   r^  Úfile_to_copys
   &&&&&     r4   Ú_prepare_commit_payloadrw  t  sé  é € ð" 0BÒ/MÑ+ÐSUÐð ˜~¨}Ð>PÐQ€LØÒ Ø'4�^Ñ$Ø�(˜G \Ð
2Ò2àÐô  ˆ	ä�iÔ!3×4Ò4¸×9Q×9QÐ9QÜ�L‰L˜?¨9×+AÑ+AÐ*BÐBjÐkÔlØ Õ!ÐÙô �iÔ!3×4Ò4¸×9OÑ9OÐS\Ô9\à�vØØ˜y×3Ñ3Ó5×<Ñ<Ó>Ø˜I×2Ñ2Ø ððô ô ˜	Ô#5×6Ò6¸9×;QÑ;QÐUZÔ;Zà�yØØ˜I×2Ñ2Ø˜HØ˜9×0Ñ0×7Ñ7×;Ñ;Ó=Ø˜I×1Ñ1×6Ñ6ð	ðõ ô ˜	Ô#8×9Ò9à¨)×*=×*=Ð*=‘À=Ø˜& )×"8Ñ"8Ð9ðõ ô
 ˜	Ô#6×7Ò7Ü Ø×%Ñ%Ø×'Ñ'Ø×*Ñ*Ø×&Ñ&ó	ˆFð )Õ0ˆLÜ˜,¬×.Ò.à˜6ØØ!¤6×#3Ò#3°LÓ#A×#HÑ#HÓ#JØ 	× 6Ñ 6Ø" Hððõ ð ×!×!Ð!à˜9ØØ 	× 6Ñ 6Ø Ø˜|×/Ñ/×6Ñ6ððõ ô !Øuóð ô
 Ø:¸9¸+ð FÜ˜I ~°tÓ<Ð=ð?óð ñG  ðP ˜!ÔÜ�‰�hÐ/Ð0Ð0_Ð`Öañ ùs   ‚AKÁD-KÅ?CKÉA<Kr  )NFNrž   )NN)MrC   r�   rf   ra   r­   Úcollectionsr   Úcollections.abcr   r   Ú
contextlibr   Údataclassesr   r   Ú	itertoolsr   Úpathlibr	   r
   Útypingr   r   r   r   r   r   Útqdm.contrib.concurrentr   r>  r   Úerrorsr   Úfile_downloadr   rŠ   r   r   r   Úutilsr   r   r   r   r   r   r   r   r    r!   r"   ró   Úutils._runtimer#   rG  r$   Ú
get_loggerr?   rÑ   r–   rH  ÚDUPLICATE_LFS_BATCH_SIZErÏ   r'   rI   rV   r+   rª   r³   rã   r×   rØ   r  r2  r4  rb  rw  r]   r7   r4   Ú<module>r†     sý  ðñó Û 	Û 	Û Ý #ß .Ý %ß (Ý ß 'ß K× Kå .å Ý &Ý %ß <Ñ <÷÷ ÷ õ #Ý ,÷ Ý ð 
×	Ò	˜HÓ	%€ð Ð%Õ&€
ð Ð ØÐ à Ð ð ÷ð ó ðð< ÷2Wð 2Wó ð2Wðj ÷b1ð b1ó ðb1õJð" Ð*Ð,?ÐAVÐVÕW€õ+ð\ ðN
ð  ðN
ð ðN
ð  ðN
ð "öN
ó ðN
ðb ðP
ð
  ðP
ð öP
ó ðP
ðf ðuð  ðuð  ðuð "öuó ðuõpð öR.ó ðR.ôj�*ô ð önó ðn÷bebñ ebr7   