Ë
    Q^(hÕ  ã                   óD  — d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ d dlm	Z	 d dl
mZmZmZmZmZmZmZmZ d dlmZ d dlmZ d dlmZmZ dd	lmZmZ dd
lmZ ddlm Z m!Z!m"Z"m#Z#m$Z$m%Z% ddl&m'Z'  e"jP                  e)«      Z* G d„ d«      Z+dee,e	f   de-fd„Z.dee,e	f   de,de-fd„Z/dee,e	f   de-fd„Z0dee,e	f   de-fd„Z1dee,e	f   de-fd„Z2d"de,dee,e	df   dee,   fd„Z3dee,e	f   de-fd„Z4d#dee,e	f   dee,   de5fd„Z6 G d„ de«      Z7ed„ «       Z8 G d „ d!«      Z9y)$é    N)Úcontextmanager)ÚPath)ÚCallableÚDictÚIteratorÚListÚOptionalÚTupleÚ	TypedDictÚUnion)Úurlparse)Ú	constants)Úmetadata_loadÚmetadata_saveé   )ÚHfApiÚrepo_type_and_id_from_hf_id)ÚLFS_MULTIPART_UPLOAD_COMMAND)ÚSoftTemporaryDirectoryÚ	get_tokenÚloggingÚrun_subprocessÚtqdmÚvalidate_hf_hub_args)Ú_deprecate_methodc                   ó¾   — e Zd ZdZ	 ddedededej                  dee   f
d„Z	e
d	efd
„«       Ze
d	efd„«       Ze
d	efd„«       Ze
d	efd„«       Ze
d	efd„«       Zd„ Zy)ÚCommandInProgressz=
    Utility to follow commands launched asynchronously.
    NÚtitleÚis_done_methodÚstatus_methodÚprocessÚpost_methodc                 óf   — || _         || _        || _        || _        d| _        d| _        || _        y )NÚ )r   Ú_is_doneÚ_statusÚ_processÚ_stderrÚ_stdoutÚ_post_method)Úselfr   r   r    r!   r"   s         úX/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/huggingface_hub/repository.pyÚ__init__zCommandInProgress.__init__$   s6   € ð ˆŒ
Ø&ˆŒØ$ˆŒØˆŒØˆŒØˆŒØ'ˆÕó    Úreturnc                 óp   — | j                  «       }|r#| j                  �| j                  «        d| _        |S )z.
        Whether the process is done.
        N)r%   r*   )r+   Úresults     r,   Úis_donezCommandInProgress.is_done4   s6   € ð
 —‘“ˆá�d×'Ñ'Ð3Ø×ÑÔØ $ˆDÔàˆr.   c                 ó"   — | j                  «       S )zü
        The exit code/status of the current action. Will return `0` if the
        command has completed successfully, and a number between 1 and 255 if
        the process errored-out.

        Will return -1 if the command is still ongoing.
        )r&   ©r+   s    r,   ÚstatuszCommandInProgress.statusA   s   € ð �|‰|‹~Ðr.   c                 ó    — | j                   dkD  S )z2
        Whether the process errored-out.
        r   )r5   r4   s    r,   ÚfailedzCommandInProgress.failedL   s   € ð
 �{‰{˜Q‰Ðr.   c                 ó´   — | j                   j                  �7| xj                  | j                   j                  j                  «       z  c_        | j                  S )zC
        The current output message on the standard error.
        )r'   Ústderrr(   Úreadr4   s    r,   r9   zCommandInProgress.stderrS   ó?   € ð
 �=‰=×ÑÐ+Ø�LŠL˜DŸM™M×0Ñ0×5Ñ5Ó7Ñ7�LØ�|‰|Ðr.   c                 ó´   — | j                   j                  �7| xj                  | j                   j                  j                  «       z  c_        | j                  S )zD
        The current output message on the standard output.
        )r'   Ústdoutr)   r:   r4   s    r,   r=   zCommandInProgress.stdout\   r;   r.   c           	      óž   — | j                   }|dk(  rd}d| j                  › d|› d| j                  sdnd› d| j                  j                  › d	�	S )
NéÿÿÿÿÚrunningú[z command, status code: z, zin progress.z	finished.z PID: ú])r5   r   r2   r'   Úpid)r+   r5   s     r,   Ú__repr__zCommandInProgress.__repr__e   s`   € Ø—‘ˆà�RŠ<ØˆFð �—
‘
ˆ|Ð2°6°(ð ;Ø&*§l¢l‘¸ÐDð EØ—‘×!Ñ!Ð" !ð%ð	
r.   ©N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ústrr   Ú
subprocessÚPopenr	   r-   ÚpropertyÚboolr2   Úintr5   r7   r9   r=   rD   © r.   r,   r   r      sØ   „ ñð +/ñ(àð(ð !ð(ð  ð	(ð
 ×!Ñ!ð(ð ˜hÑ'ó(ð  ð
˜ò 
ó ð
ð ð˜ò ó ðð ð˜ò ó ðð ð˜ò ó ðð ð˜ò ó ðó

r.   r   Úfolderr/   c                 ó(  — t         j                  j                  t         j                  j                  | d«      «      }t	        j
                  dj                  «       | t        j                  t        j                  ¬«      }|xr |j                  dk(  S )a  
    Check if the folder is the root or part of a git repository

    Args:
        folder (`str`):
            The folder in which to run the command.

    Returns:
        `bool`: `True` if the repository is part of a repository, `False`
        otherwise.
    z.gitz
git branch)Úcwdr=   r9   r   )	ÚosÚpathÚexistsÚjoinrK   ÚrunÚsplitÚPIPEÚ
returncode)rQ   Úfolder_existsÚ
git_branchs      r,   Úis_git_repor^   r   sc   € ô —G‘G—N‘N¤2§7¡7§<¡<°¸Ó#?Ó@€MÜ—‘ × 2Ñ 2Ó 4¸&ÌÏÉÔak×apÑapÔq€JØÒ7˜Z×2Ñ2°aÑ7Ð7r.   Ú
remote_urlc                 óê   — t        | «      syt        d| «      j                  }t        j                  dd|«      }|j                  «       D �cg c]  }t        j                  dd|«      ‘Œ }}||v S c c}w )am  
    Check if the folder is a local clone of the remote_url

    Args:
        folder (`str` or `Path`):
            The folder in which to run the command.
        remote_url (`str`):
            The url of a git repository.

    Returns:
        `bool`: `True` if the repository is a local clone of the remote
        repository specified, `False` otherwise.
    Fzgit remote -vúhttps://.*@úhttps://)r^   r   r=   ÚreÚsubrY   )rQ   r_   ÚremotesÚremotes       r,   Úis_local_clonerg   ƒ   sl   € ô �vÔØä˜_¨fÓ5×<Ñ<€Gô —‘˜¨
°JÓ?€JØHOÏÉËÖX¸fŒr�v‰v�n j°&Õ9ÐX€GÐXØ˜Ð Ð ùò Ys   ÁA0Úfilenamec                 ó  — t        | «      j                  }t        | «      j                  } 	 t        dj	                  «       | gz   |«      }|j
                  j                  «       }t        |«      dk(  ryddddœ}|j	                  d«      D ]&  }|j                  «       D ]  }||v sŒd|v sŒd||<   Œ Œ( t        |j                  «       «      S # t        j                  $ r*}t        |«      sY d}~yt        |j                  «      ‚d}~ww xY w)	zù
    Check if the file passed is tracked with git-lfs.

    Args:
        filename (`str` or `Path`):
            The filename to check.

    Returns:
        `bool`: `True` if the file passed is tracked with git-lfs, `False`
        otherwise.
    zgit check-attr -aNFr   )ÚdiffÚmergeÚfilterú
ÚlfsT)r   ÚparentÚnamer   rY   r=   ÚstriprK   ÚCalledProcessErrorr^   ÚOSErrorr9   ÚlenÚkeysÚallÚvalues)rh   rQ   ÚpÚ
attributesÚexcÚfound_lfs_tagÚ	attributeÚtags           r,   Úis_tracked_with_lfsr~   œ   s  € ô �(‹^×"Ñ"€FÜ�H‹~×"Ñ"€Hð&ÜÐ.×4Ñ4Ó6¸(¸ÑCÀVÓLˆØ—X‘X—^‘^Ó%ˆ
ô ˆ:ƒ˜!ÒØà"¨U¸eÑD€Mà×%Ñ% dÓ+ò *ˆ	Ø ×%Ñ%Ó'ò 	*ˆCØ�iÒ E¨YÒ$6Ø%)�˜cÒ"ñ	*ð*ô
 ˆ}×#Ñ#Ó%Ó&Ð&øô! ×(Ñ(ò &Ü˜6Ô"Üä˜#Ÿ*™*Ó%Ð%ûð	&ús   ¬8C ÃD	ÃDÃ/DÄD	c                 ó(  — t        | «      j                  }t        | «      j                  } 	 t        dj	                  «       | gz   |d¬«      }t        |j                  «       }|S # t        j                  $ r}t        |j                  «      ‚d}~ww xY w)a  
    Check if file is git-ignored. Supports nested .gitignore files.

    Args:
        filename (`str` or `Path`):
            The filename to check.

    Returns:
        `bool`: `True` if the file passed is ignored by `git`, `False`
        otherwise.
    zgit check-ignoreF©ÚcheckN)r   ro   rp   r   rY   rN   r[   rK   rr   rs   r9   )rh   rQ   rx   Ú
is_ignoredrz   s        r,   Úis_git_ignoredrƒ   Á   s‡   € ô �(‹^×"Ñ"€FÜ�H‹~×"Ñ"€Hð"ÜÐ-×3Ñ3Ó5¸¸
ÑBÀFÐRWÔXˆä˜aŸl™lÓ+Ð+ˆ
ð Ðøô ×(Ñ(ò "Ü�c—j‘jÓ!Ð!ûð"ús   ¬6A$ Á$BÁ7BÂBc           	      ó
  — 	 t        | d«      5 }|j                  d«      }ddd«       t        h d£t        t	        dd«      «      dhz
  z  «      }t        j                  d|«      «      S # 1 sw Y   ŒKxY w# t        $ r Y yw xY w)	zØ
    Check if file is a binary file.

    Args:
        filename (`str` or `Path`):
            The filename to check.

    Returns:
        `bool`: `True` if the file passed is a binary file, `False` otherwise.
    Úrbi    N>   é   é   é	   é
   é   é   é   é    é   é   T)Úopenr:   Ú	bytearrayÚsetÚrangerN   Ú	translateÚUnicodeDecodeError)rh   ÚfÚcontentÚ
text_charss       r,   Úis_binary_filer™   Ú   sˆ   € ð	Ü�(˜DÓ!ð 	- QØ—f‘f˜^Ó,ˆG÷	-ô
 Ò8¼3¼uÀTÈ5Ó?QÓ;RÐVZÐU[Ñ;[Ñ[Ó\ˆ
Ü�G×%Ñ% d¨JÓ7Ó8Ð8÷	-ð 	-ûô ò Ùðús(   ‚A6 ŽA* A	A6 Á*A3Á/A6 Á6	BÂBÚpatternc                 óF  — 	 t        dj                  «       | gz   |«      }t        |j                  j	                  «       «      r+|j                  j	                  «       j                  d«      }|S g }	 |S # t
        j                  $ r}t        |j                  «      ‚d}~ww xY w)aQ  
    Returns a list of filenames that are to be staged.

    Args:
        pattern (`str` or `Path`):
            The pattern of filenames to check. Put `.` to get all files.
        folder (`str` or `Path`):
            The folder in which to run the command.

    Returns:
        `List[str]`: List of files that are to be staged.
    z#git ls-files --exclude-standard -morm   N)	r   rY   rt   r=   rq   rK   rr   ÚEnvironmentErrorr9   )rš   rQ   rx   Úfilesrz   s        r,   Úfiles_to_be_stagedrž   ñ   s�   € ð+ÜÐ@×FÑFÓHÈGÈ9ÑTÐV\Ó]ˆÜˆq�x‰x�~‰~ÓÔ Ø—H‘H—N‘NÓ$×*Ñ*¨4Ó0ˆEð €Lð	 ‰Eð €Løô ×(Ñ(ò +Ü˜sŸz™zÓ*Ð*ûð+ús   ‚A*A3 Á.A3 Á3B ÂBÂB c                 ó�   — 	 t        d| «       y# t        j                  $ r#}d|j                  v rt	        d«      ‚Y d}~yd}~ww xY w)a  
    Check if the current checked-out branch is tracked upstream.

    Args:
        folder (`str` or `Path`):
            The folder in which to run the command.

    Returns:
        `bool`: `True` if the current checked-out branch is tracked upstream,
        `False` otherwise.
    z4git rev-parse --symbolic-full-name --abbrev-ref @{u}TÚHEADzNo branch checked outNF)r   rK   rr   r9   rs   )rQ   rz   s     r,   Úis_tracked_upstreamr¡   
  sF   € ðÜÐMÈvÔVØøÜ×(Ñ(ò Ø�S—Z‘ZÑÜÐ1Ó2Ð2äûð	ús   ‚ �A¢A Á AÚupstreamc                 óØ   — 	 t        d|xs d› �| «      }t        |j                  j                  d«      «      dz
  S # t        j
                  $ r}t        |j                  «      ‚d}~ww xY w)a³  
        Check the number of commits that would be pushed upstream

        Args:
            folder (`str` or `Path`):
                The folder in which to run the command.
            upstream (`str`, *optional*):
    The name of the upstream repository with which the comparison should be
    made.

        Returns:
            `int`: Number of commits that would be pushed upstream were a `git
            push` to proceed.
    zgit cherry -v r$   rm   r   N)r   rt   r=   rY   rK   rr   rœ   r9   )rQ   r¢   r1   rz   s       r,   Úcommits_to_pushr¤      sc   € ð+Ü .°²¸RÐ0@Ð AÀ6ÓJˆÜ�6—=‘=×&Ñ& tÓ,Ó-°Ñ1Ð1øÜ×(Ñ(ò +Ü˜sŸz™zÓ*Ð*ûð+ús   ‚9< ¼A)ÁA$Á$A)c                   ó"   — e Zd ZU eed<   eed<   y)ÚPbarTÚbarÚ
past_bytesN)rF   rG   rH   r   Ú__annotations__rO   rP   r.   r,   r¦   r¦   6  s   … à	ƒIØ„Or.   r¦   c               #   ó6  K  — t         j                  «       t        j                  k\  r	 d–— ydt
        j                  fd„} t        j                  j                  dd«      }t        «       5 }t        j                  j                  |d«      t        j                  d<   t         j                  dt        j                  d   › �«       t        j                  «       }t        j                  | |fd¬	«      }|j                  «        	 d–— |j!                  «        |j                  «        |t        j                  d<   	 ddd«       y# t        $ r Y yw xY w# |j!                  «        |j                  «        |t        j                  d<   w xY w# 1 sw Y   yxY w­w)
zv
    This is a context manager that will log the Git LFS progress of cleaning,
    smudging, pulling and pushing.
    NÚstopping_eventc           
      ó2  ‡ ‡‡— i Šˆfd„Šdt         t           fˆˆ fd„}t        j                  j	                  t        j
                  d   «      s^‰ j                  «       r ‰«        yt        j                  d«       t        j                  j	                  t        j
                  d   «      sŒ^ |t        j
                  d   «      D ]¯  }	 |j                  «       \  }}}}|j                  «       › d|› �}|j                  d	«      \  }	}
t        |	«      }t        |
«      }‰j                  ||f«      }|€$t        |||d
ddd¬«      t        |	«      dœ‰||f<   Œ‘|d   j                  ||d   z
  «       ||d<   Œ± y# t        $ r}t        d|› �«      |‚d}~ww xY w)zl
        To be launched as a separate thread with an event meaning it should stop
        the tail.
        c                  óÊ   •— ‰j                  «       D ]O  } | d   j                  | d   j                  | d   z
  «       | d   j                  «        | d   j	                  «        ŒQ y )Nr§   r¨   )rw   ÚupdateÚtotalÚrefreshÚclose)ÚpbarÚpbarss    €r,   Úclose_pbarsz?_lfs_log_progress.<locals>.output_progress.<locals>.close_pbarsR  s^   ø€ ØŸ™›ò $�Ø�U‘×"Ñ" 4¨¡;×#4Ñ#4°t¸LÑ7IÑ#IÔJØ�U‘×#Ñ#Ô%Ø�U‘×!Ñ!Õ#ñ$r.   r/   c              3   óJ  •K  — t        | d«      5 }d}	 ‰j                  «       r ‰«        na|j                  «       }|�9t        |j	                  «       «      dk(  s||z  }|j                  d«      r|–— d}nt        j                  d«       Œy	 ddd«       y# 1 sw Y   yxY w­w)z¾
            Creates a generator to be iterated through, which will return each
            line one by one. Will stop tailing the file if the stopping_event is
            set.
            Úrr$   Nr   rm   r   )r�   Úis_setÚreadlinert   rq   ÚendswithÚtimeÚsleep)rh   ÚfileÚcurrent_lineÚline_bitr´   r«   s       €€r,   Ú	tail_filez=_lfs_log_progress.<locals>.output_progress.<locals>.tail_fileX  s¡   øè ø€ ô �h Ó$ð &¨Ø!�ØØ%×,Ñ,Ô.Ù#œØà#Ÿ}™}›�HØÐ+´C¸¿¹Ó8HÓ4IÈQÒ4NØ$¨Ñ0˜Ø'×0Ñ0°Ô6Ø".Ò.Ø+-™LäŸ
™
 1œð ð ÷&÷ &ñ &üs   ƒB#�A=BÂ	B#ÂB ÂB#ÚGIT_LFS_PROGRESSNé   z!Cannot unpack LFS progress line:
z file ú/ÚBTi   zhuggingface_hub.lfs_upload)ÚdescÚinitialr¯   ÚunitÚ
unit_scaleÚunit_divisorrp   )r§   r¨   r§   r¨   )r   rJ   rT   rU   rV   Úenvironr·   rº   r»   rY   Ú
ValueErrorÚ
capitalizerO   Úgetr   r®   )r«   r¿   ÚlineÚstateÚfile_progressÚbyte_progressrh   ÚerrorÚdescriptionÚcurrent_bytesÚtotal_bytesÚcurrent_bytes_intÚtotal_bytes_intr²   r´   r³   s   `             @@r,   Úoutput_progressz*_lfs_log_progress.<locals>.output_progressJ  s›  ú€ ð /1ˆô	$ð	&¤8¬C¡=ö 	&ô0 —'‘'—.‘.¤§¡Ð,>Ñ!?Ô@Ø×$Ñ$Ô&Ù”Øä�J‰J�qŒMô —'‘'—.‘.¤§¡Ð,>Ñ!?Õ@ñ œbŸj™jÐ);Ñ<Ó=ò 	7ˆDðYØ@DÇ
Á
ÃÑ=��} m°Xð #×-Ñ-Ó/Ð0°°x°jÐAˆKà)6×)<Ñ)<¸SÓ)AÑ&ˆM˜;Ü # MÓ 2ÐÜ! +Ó.ˆOà—9‘9˜e XÐ.Ó/ˆDØˆ|ô  Ø(Ø 1Ø-Ø Ø#'Ø%)Ø9ôô #& mÓ"4ñ,��u˜hÐ'Ò(ð �U‘×"Ñ"Ð#4°t¸LÑ7IÑ#IÔJØ%6��\Ò"ñ=	7øô ò Yä Ð#EÀdÀVÐ!LÓMÐSXÐXûðYús   Ã
E9Å9	FÆFÆFrÀ   r$   Úlfs_progresszFollowing progress in T)ÚtargetÚargsÚdaemon)ÚloggerÚgetEffectiveLevelr   ÚERRORÚ	ExceptionÚ	threadingÚEventrT   rÉ   rÌ   r   rU   rW   ÚdebugÚThreadÚstartr’   )r×   Úcurrent_lfs_progress_valueÚtmpdirÚ
exit_eventÚxs        r,   Ú_lfs_log_progressré   <  sM  è ø€ ô ×ÑÓ!¤W§]¡]Ò2ð	Ûð 	ðK7¬	¯©ó K7ôZ "$§¡§¡Ð0BÀBÓ!GÐä	Ó	!ð H VÜ)+¯©¯©°f¸nÓ)MŒ�
‰
Ð%Ñ&Ü�‰Ð-¬b¯j©jÐ9KÑ.LÐ-MÐNÔOä—_‘_Ó&ˆ
Ü×Ñ O¸:¸-ÐPTÔUˆØ	�‰Œ	ð	HÛà�N‰NÔØ�F‰FŒHà-GŒB�J‰JÐ)Ò*÷Hð Høôg ò 	ØØð	ûð| �N‰NÔØ�F‰FŒHà-GŒB�J‰JÐ)Ò*ú÷Hð HüsX   ‚&F©E ­?FÁ,BFÄEÄ	3FÄ=	FÅ	EÅFÅEÅFÅ5F
Æ
FÆFÆFc                   ót  — e Zd ZU dZee   ed<   e edd¬«      	 	 	 	 	 	 	 	 dDde	e
ef   dee
   d	ee
   d
e	ee
f   dee
   dee
   dee
   dedee   fd„«       «       Zede
fd„«       Zd„ ZedEde
d
e	ee
df   fd„«       ZdFdee
   dee
   fd„Zd„ Zde
fd„Zde
fd„Zde
fd„Zdee
   fd„ZdGde	e
ee
   f   defd„Zde	e
ee
   f   fd„Zd „ ZdHd!e
dee
   fd"„ZdHd!e
dee
   fd#„ZdGd$„ZdId%ed&efd'„Z dJd!e
d(efd)„Z!dKd*e
fd+„Z"	 	 	 dLd,ee
   d-ed.ede	e
e#e
ef   f   fd/„Z$dGde
d0efd1„Z%dEd2e
d3ee
   defd4„Z&dEd2e
d3ee
   defd5„Z'dFd2e
d6ee
   d3ee
   fd7„Z(defd8„Z)	 	 	 	 dMd*e
d-ed9ed.ede	de
e#e
ef   f   f
d:„Z*e+	 	 	 	 dNd*e
d;ee
   d<ed-ed.ef
d=„«       Z,dee-   fd>„Z.d?e-ddfd@„Z/edA„ «       Z0edB„ «       Z1dC„ Z2y)OÚ
RepositoryaR  
    Helper class to wrap the git and git-lfs commands.

    The aim is to facilitate interacting with huggingface.co hosted model or
    dataset repos, though not a lot here (if any) is actually specific to
    huggingface.co.

    <Tip warning={true}>

    [`Repository`] is deprecated in favor of the http-based alternatives implemented in
    [`HfApi`]. Given its large adoption in legacy code, the complete removal of
    [`Repository`] will only happen in release `v1.0`. For more details, please read
    https://huggingface.co/docs/huggingface_hub/concepts/git_vs_http.

    </Tip>
    Úcommand_queuez1.0z÷Please prefer the http-based alternatives instead. Given its large adoption in legacy code, the complete removal is only planned on next major release.
For more details, please read https://huggingface.co/docs/huggingface_hub/concepts/git_vs_http.)ÚversionÚmessageNÚ	local_dirÚ
clone_fromÚ	repo_typeÚtokenÚgit_userÚ	git_emailÚrevisionÚskip_lfs_filesÚclientc
                 óÌ  — t        |t        «      rt        |«      }t        j                  |d¬«       t        j
                  j                  t        j                  «       |«      | _        || _	        g | _
        || _        |	�|	n	t        «       | _        | j                  «        t        |t        «      r|| _        n|du rd| _        nt!        «       | _        |�| j#                  |¬«       n6t%        | j                  «      rt&        j)                  d«       nt+        d«      ‚| j                  �O|�|€K| j                  j-                  | j                  «      }
|€|
j/                  d«      }|€|
j/                  d	«      }|€|�| j1                  ||«       | j3                  «        | j5                  «        |�| j7                  |d¬
«       t9        j:                  | j<                  «       y)aÐ	  
        Instantiate a local clone of a git repo.

        If `clone_from` is set, the repo will be cloned from an existing remote repository.
        If the remote repo does not exist, a `EnvironmentError` exception will be thrown.
        Please create the remote repo first using [`create_repo`].

        `Repository` uses the local git credentials by default. If explicitly set, the `token`
        or the `git_user`/`git_email` pair will be used instead.

        Args:
            local_dir (`str` or `Path`):
                path (e.g. `'my_trained_model/'`) to the local directory, where
                the `Repository` will be initialized.
            clone_from (`str`, *optional*):
                Either a repository url or `repo_id`.
                Example:
                - `"https://huggingface.co/philschmid/playground-tests"`
                - `"philschmid/playground-tests"`
            repo_type (`str`, *optional*):
                To set when cloning a repo from a repo_id. Default is model.
            token (`bool` or `str`, *optional*):
                A valid authentication token (see https://huggingface.co/settings/token).
                If `None` or `True` and machine is logged in (through `huggingface-cli login`
                or [`~huggingface_hub.login`]), token will be retrieved from the cache.
                If `False`, token is not sent in the request header.
            git_user (`str`, *optional*):
                will override the `git config user.name` for committing and
                pushing files to the hub.
            git_email (`str`, *optional*):
                will override the `git config user.email` for committing and
                pushing files to the hub.
            revision (`str`, *optional*):
                Revision to checkout after initializing the repository. If the
                revision doesn't exist, a branch will be created with that
                revision name from the default branch's current HEAD.
            skip_lfs_files (`bool`, *optional*, defaults to `False`):
                whether to skip git-LFS files or not.
            client (`HfApi`, *optional*):
                Instance of [`HfApi`] to use when calling the HF Hub API. A new
                instance will be created if this is left to `None`.

        Raises:
            [`EnvironmentError`](https://docs.python.org/3/library/exceptions.html#EnvironmentError)
                If the remote repository set in `clone_from` does not exist.
        T)Úexist_okNF)Úrepo_urlz [Repository] is a valid git repozNIf not specifying `clone_from`, you need to pass Repository a valid git clone.ÚemailÚfullname©Úcreate_branch_ok)Ú
isinstancer   rJ   rT   ÚmakedirsrU   rW   Úgetcwdrï   Ú
_repo_typerì   rö   r   r÷   Úcheck_git_versionsÚhuggingface_tokenr   rð   r^   rÜ   râ   rÊ   ÚwhoamirÌ   Úgit_config_username_and_emailÚlfs_enable_largefilesÚgit_credential_helper_storeÚgit_checkoutÚatexitÚregisterÚwait_for_commands)r+   rï   rð   rñ   rò   ró   rô   rõ   rö   r÷   Úusers              r,   r-   zRepository.__init__¾  s“  € ôF �i¤Ô&Ü˜I›ˆIÜ
�‰�I¨Õ-ÜŸ™Ÿ™¤b§i¡i£k°9Ó=ˆŒØ#ˆŒØˆÔØ,ˆÔØ &Ð 2‘f¼»ˆŒà×ÑÔ!ä�eœSÔ!Ø49ˆDÕ"Ø�e‰^Ø%)ˆDÕ"ô &/£[ˆDÔ"àÐ!Ø�O‰O ZˆOÕ0ä˜4Ÿ>™>Ô*Ü—‘Ð?Õ@ä Ð!qÓrÐrà×!Ñ!Ð-°9Ð3DÈÐHXØ—;‘;×%Ñ% d×&<Ñ&<Ó=ˆDàÐ Ø ŸH™H WÓ-�	àÐØŸ8™8 JÓ/�àÐ 9Ð#8Ø×.Ñ.¨x¸ÔCà×"Ñ"Ô$Ø×(Ñ(Ô*àÐØ×Ñ˜h¸ÐÔ>ô 	�‰˜×.Ñ.Õ/r.   r/   c                 óÄ   — 	 t        d| j                  «      j                  j                  «       }|S # t        j
                  $ r}t        |j                  «      ‚d}~ww xY w)zz
        Returns the current checked out branch.

        Returns:
            `str`: Current checked out branch.
        zgit rev-parse --abbrev-ref HEADN©r   rï   r=   rq   rK   rr   rœ   r9   )r+   r1   rz   s      r,   Úcurrent_branchzRepository.current_branch3  sU   € ð	/Ü#Ð$EÀtÇ~Á~ÓV×]Ñ]×cÑcÓeˆFð ˆøô ×,Ñ,ò 	/Ü" 3§:¡:Ó.Ð.ûð	/ús   ‚.2 ²AÁAÁAc                 óV  — 	 t        d| j                  «      j                  j                  «       }	 t        d| j                  «      j                  j                  «       }t        j                  |dz   |z   «       y# t        $ r t        d«      ‚w xY w# t        $ r t        d«      ‚w xY w)zì
        Checks that `git` and `git-lfs` can be run.

        Raises:
            [`EnvironmentError`](https://docs.python.org/3/library/exceptions.html#EnvironmentError)
                If `git` or `git-lfs` are not installed.
        zgit --versionz9Looks like you do not have git installed, please install.zgit-lfs --versionz«Looks like you do not have git-lfs installed, please install. You can install from https://git-lfs.github.com/. Then run `git lfs install` (you only have to do this once).rm   N)r   rï   r=   rq   ÚFileNotFoundErrorrœ   rÜ   Úinfo)r+   Úgit_versionÚlfs_versions      r,   r  zRepository.check_git_versionsB  s¦   € ð	`Ü(¨¸$¿.¹.ÓI×PÑP×VÑVÓXˆKð	Ü(Ð)<¸d¿n¹nÓM×TÑT×ZÑZÓ\ˆKô 	�‰�K $Ñ&¨Ñ4Õ5øô !ò 	`Ü"Ð#^Ó_Ð_ð	`ûô
 !ò 	Ü"ðOóð ð	ús   ‚.A; ±.B Á;BÂB(rú   c                 óB  — t        |t        «      r|n|du rdn| j                  }|�|j                  d«      rt	        d«      ‚| j
                  j                  }||v s!d|vrºt        |j                  d«      «      dk  r�t        ||¬«      \  }}}|�|› d|› �n|}|�|| _
        |dz   }| j                  t        j                  v r |t        j                  | j                     z  }|�0t        |«      j                  }|j                  |› d	�|› d
|› d�«      }||z  }t!        j"                  dd|«      }		 t%        d| j&                  «       t        t)        j*                  | j&                  «      «      dk(  r–t,        j/                  d|	› d�«       t1        «       5  t(        j2                  j5                  «       }
| j6                  r|
j9                  ddi«       t%        | j6                  rdnd› d|› d�| j&                  |
¬«       ddd«       yt;        | j&                  «      s&t=        d| j&                  › d| j&                  › d�«      ‚t?        | j&                  |«      r&t,        j/                  | j&                  › d|	› d�«       yt%        d| j&                  d¬«      }d |	› d!|	› d"�}|j@                  dk(  r)t!        j"                  d#d$|jB                  «      }|d%|› �z  }t=        |«      ‚# 1 sw Y   yxY w# tD        jF                  $ r}t=        |jH                  «      ‚d}~ww xY w)&a›  
        Clone from a remote. If the folder already exists, will try to clone the
        repository within it.

        If this folder is a git repository with linked history, will try to
        update the repository.

        Args:
            repo_url (`str`):
                The URL from which to clone the repository
            token (`Union[str, bool]`, *optional*):
                Whether to use the authentication token. It can be:
                 - a string which is the token itself
                 - `False`, which would not use the authentication token
                 - `True`, which would fetch the authentication token from the
                   local folder and use it (you should be logged in for this to
                   work).
                - `None`, which would retrieve the value of
                  `self.huggingface_token`.

        <Tip>

        Raises the following error:

            - [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError)
              if an organization token (starts with "api_org") is passed. Use must use
              your own personal access token (see https://hf.co/settings/tokens).

            - [`EnvironmentError`](https://docs.python.org/3/library/exceptions.html#EnvironmentError)
              if you are trying to clone the repository in a non-empty folder, or if the
              `git` operations raise errors.

        </Tip>
        FNÚapi_orgzgYou must use your personal access token, not an Organization token (see https://hf.co/settings/tokens).ÚhttprÂ   rÁ   )Úhub_urlz://z://user:ú@z(https?)://.*@z\1://zgit lfs installr   zCloning z into local empty directory.ÚGIT_LFS_SKIP_SMUDGEÚ1z	git clonezgit lfs cloneú z .)ÚenvzPTried to clone a repository in a non-empty folder that isn't a git repository ('z7'). If you really want to do this, do it manually:
 cd z‹ && git init && git remote add origin && git pull origin main
 or clone repo to a new folder and move your existing files there afterwards.z is already a clone of z?. Make sure you pull the latest changes with `repo.git_pull()`.zgit remote get-url originr€   zTried to clone zn in an unrelated git repository.
If you believe this is an error, please add a remote with the following URL: ú.ra   rb   z'
Local path has its origin defined as: )%rÿ   rJ   r  Ú
startswithrÊ   r÷   Úendpointrt   rY   r   r  r   ÚREPO_TYPES_URL_PREFIXESr   ÚschemeÚreplacerc   rd   r   rï   rT   ÚlistdirrÜ   Úwarningré   rÉ   Úcopyrö   r®   r^   rœ   rg   r[   r=   rK   rr   r9   )r+   rú   rò   r  rñ   Ú	namespaceÚ	repo_nameÚrepo_idr#  Úclean_repo_urlr  ÚoutputÚ	error_msgÚclean_local_remote_urlrz   s                  r,   rð   zRepository.clone_fromY  s@  € ôL ˜%¤Ô%ñ ð ˜E‘>ñ à×+Ñ+ð 	ð Ð ×!1Ñ!1°)Ô!<Üð8óð ð
 —+‘+×&Ñ&ˆØ�hÑ 6°Ñ#9¼cÀ(Ç.Á.ÐQTÓBUÓ>VÐZ[Ò>[Ü.IÈ(Ð\cÔ.dÑ+ˆI�y )Ø4=Ð4I˜˜ 1 Y KÑ0ÈyˆGàÐ$Ø"+�”à ‘}ˆHà�‰¤)×"CÑ"CÑCØœI×=Ñ=¸d¿o¹oÑNÑN�àÐ ä! (Ó+×2Ñ2�Ø#×+Ñ+¨v¨h°c¨N¸v¸hÀhÈuÈgÐUVÐ<WÓX�à˜ÑˆHô Ÿ™Ð 1°8¸XÓFˆð5	/ÜÐ,¨d¯n©nÔ=ô ”2—:‘:˜dŸn™nÓ-Ó.°!Ò3Ü—‘ ¨.Ð)9Ð9UÐVÔWä&Ó(ñ ÜŸ*™*Ÿ/™/Ó+�Cà×*Ò*ØŸ
™
Ð$9¸3Ð#?Ô@ä"ð +/×*=Ò*=™;À?ÐSÐSTÐU]ÐT^Ð^`ÐaØŸ™Øõ÷ð ô  # 4§>¡>Ô2Ü*ð/Ø/3¯~©~Ð.>ð ?:Ø:>¿.¹.Ð9Ið J'ð'óð ô " $§.¡.°(Ô;Ü—N‘NØŸ>™>Ð*Ð*AÀ.ÐAQð R.ð .õô ,Ð,GÈÏÉÐ_dÔe�Fð *¨.Ð)9ð :=à=KÐ<LÈAðOð ð
 ×(Ñ(¨AÒ-Ü13·±¸È
ÐTZ×TaÑTaÓ1bÐ.Ø!Ð'OÐPfÐOgÐ%hÑh˜	Ü*¨9Ó5Ð5÷Wð ûôZ ×,Ñ,ò 	/Ü" 3§:¡:Ó.Ð.ûð	/úsF   Ä3A$K1 ÆA*K%ÈK1 È
A6K1 ÊA$K1 Ë%K.Ë*K1 Ë.K1 Ë1LÌLÌLc                 ó  — 	 |�(t        dj                  «       |gz   | j                  «       |�(t        d|› �j                  «       | j                  «       yy# t        j                  $ r}t        |j                  «      ‚d}~ww xY w)a  
        Sets git username and email (only in the current repo).

        Args:
            git_user (`str`, *optional*):
                The username to register through `git`.
            git_email (`str`, *optional*):
                The email to register through `git`.
        Nzgit config user.namezgit config user.email )r   rY   rï   rK   rr   rœ   r9   )r+   ró   rô   rz   s       r,   r  z(Repository.git_config_username_and_emailÙ  s{   € ð	/ØÐ#ÜÐ5×;Ñ;Ó=ÀÀ
ÑJÈDÏNÉNÔ[àÐ$ÜÐ!7¸	°{ÐC×IÑIÓKÈTÏ^É^Õ\ð %øä×,Ñ,ò 	/Ü" 3§:¡:Ó.Ð.ûð	/ús   ‚AA ÁBÁ*A?Á?Bc                 ó’   — 	 t        d| j                  «       y# t        j                  $ r}t	        |j
                  «      ‚d}~ww xY w)z;
        Sets the git credential helper to `store`
        z"git config credential.helper storeN)r   rï   rK   rr   rœ   r9   )r+   rz   s     r,   r  z&Repository.git_credential_helper_storeì  s;   € ð	/ÜÐ?ÀÇÁÕPøÜ×,Ñ,ò 	/Ü" 3§:¡:Ó.Ð.ûð	/ús   ‚ ™A¬AÁAc                 óÄ   — 	 t        d| j                  «      }|j                  j                  «       S # t        j
                  $ r}t        |j                  «      ‚d}~ww xY w)zy
        Get commit sha on top of HEAD.

        Returns:
            `str`: The current checked out commit SHA.
        zgit rev-parse HEADNr  )r+   rx   rz   s      r,   Úgit_head_hashzRepository.git_head_hashõ  sN   € ð	/ÜÐ3°T·^±^ÓDˆAØ—8‘8—>‘>Ó#Ð#øÜ×,Ñ,ò 	/Ü" 3§:¡:Ó.Ð.ûð	/ús   ‚/2 ²AÁAÁAc                 óò   — 	 t        d| j                  «      }|j                  j                  «       }t	        j
                  dd|«      S # t        j                  $ r}t        |j                  «      ‚d}~ww xY w)zp
        Get URL to origin remote.

        Returns:
            `str`: The URL of the `origin` remote.
        z"git config --get remote.origin.urlra   rb   N)
r   rï   r=   rq   rc   rd   rK   rr   rœ   r9   )r+   rx   Úurlrz   s       r,   Úgit_remote_urlzRepository.git_remote_url  s`   € ð	/ÜÐCÀTÇ^Á^ÓTˆAØ—(‘(—.‘.Ó"ˆCä—6‘6˜.¨*°cÓ:Ð:øÜ×,Ñ,ò 	/Ü" 3§:¡:Ó.Ð.ûð	/ús   ‚AA	 Á	A6ÁA1Á1A6c                 ó|   — | j                  «       }| j                  «       }|j                  d«      r|dd }|› d|› �S )zæ
        Get URL to last commit on HEAD. We assume it's been pushed, and the url
        scheme is the same one as for GitHub or HuggingFace.

        Returns:
            `str`: The URL to the current checked-out commit.
        rÂ   Nr?   z/commit/)r2  r5  r¹   )r+   Úshar4  s      r,   Úgit_head_commit_urlzRepository.git_head_commit_url  sH   € ð × Ñ Ó"ˆØ×!Ñ!Ó#ˆØ�<‰<˜ÔØ�c�r�(ˆCØ��h˜s˜eÐ$Ð$r.   c                 ó   — 	 t        d| j                  «      j                  j                  «       }t        |«      dk(  rg S |j                  d«      D �cg c]  }|j                  «       ‘Œ }}|D �cg c]  }d|j                  «       d   v sŒ|‘Œ }}|D �cg c]#  }|j                  «       d   j                  «       ‘Œ% }}|S # t        j
                  $ r}t        |j                  «      ‚d}~ww xY wc c}w c c}w c c}w )zê
        Returns a list of the files that are deleted in the working directory or
        index.

        Returns:
            `List[str]`: A list of files that have been deleted in the working
            directory or index.
        zgit status -sNr   rm   ÚDr?   ©
r   rï   r=   rq   rK   rr   rœ   r9   rt   rY   )r+   Ú
git_statusrz   r5   Úmodified_files_statusesÚdeleted_files_statusesÚdeleted_filess          r,   Úlist_deleted_fileszRepository.list_deleted_files  sû   € ð	/Ü'¨¸¿¹ÓH×OÑO×UÑUÓWˆJô ˆz‹?˜aÒØˆIð AK×@PÑ@PÐQUÓ@VÖ"W°f 6§<¡<¥>Ð"WÐÐ"Wð 8OÖ!k¨VÐRUÐY_×YeÑYeÓYgÐhiÑYjÒRj¢&Ð!kÐÐ!kð CYÖY¸˜Ÿ™›¨Ñ+×1Ñ1Õ3ÐYˆÐYàÐøô- ×,Ñ,ò 	/Ü" 3§:¡:Ó.Ð.ûð	/üò #Xùò "lùò Zs/   ‚.C ÁC1Á0C6ÂC6Â(C;ÃC.ÃC)Ã)C.Úpatternsrh   c                 óÚ   — t        |t        «      r|g}	 |D ]"  }t        d|rdnd› d|› �| j                  «       Œ$ y# t        j
                  $ r}t        |j                  «      ‚d}~ww xY w)a9  
        Tell git-lfs to track files according to a pattern.

        Setting the `filename` argument to `True` will treat the arguments as
        literal filenames, not as patterns. Any special glob characters in the
        filename will be escaped when writing to the `.gitattributes` file.

        Args:
            patterns (`Union[str, List[str]]`):
                The pattern, or list of patterns, to track with git-lfs.
            filename (`bool`, *optional*, defaults to `False`):
                Whether to use the patterns as literal filenames.
        zgit lfs track z
--filenamer$   r  N)rÿ   rJ   r   rï   rK   rr   rœ   r9   )r+   rA  rh   rš   rz   s        r,   Ú	lfs_trackzRepository.lfs_trackB  st   € ô �h¤Ô$Ø �zˆHð	/Ø#ò �ÜØ$±X¡\À2Ð$FÀaÈÀyÐQØ—N‘Nõñøô
 ×,Ñ,ò 	/Ü" 3§:¡:Ó.Ð.ûð	/ús   •'= ½A*ÁA%Á%A*c                 óê   — t        |t        «      r|g}	 |D ]*  }t        dj                  «       |gz   | j                  «       Œ, y# t
        j                  $ r}t        |j                  «      ‚d}~ww xY w)zÀ
        Tell git-lfs to untrack those files.

        Args:
            patterns (`Union[str, List[str]]`):
                The pattern, or list of patterns, to untrack with git-lfs.
        zgit lfs untrackN)	rÿ   rJ   r   rY   rï   rK   rr   rœ   r9   )r+   rA  rš   rz   s       r,   Úlfs_untrackzRepository.lfs_untrack[  so   € ô �h¤Ô$Ø �zˆHð	/Ø#ò V�ÜÐ0×6Ñ6Ó8¸G¸9ÑDÀdÇnÁnÕUñVøä×,Ñ,ò 	/Ü" 3§:¡:Ó.Ð.ûð	/ús   •/A ÁA2ÁA-Á-A2c                 óÚ   — 	 d}t        |› d�| j                  «       t        |› dt        › �| j                  «       y# t        j                  $ r}t        |j                  «      ‚d}~ww xY w)zI
        HF-specific. This enables upload support of files >5GB.
        z'git config lfs.customtransfer.multipartz.path huggingface-cliz.args N)r   rï   r   rK   rr   rœ   r9   )r+   Ú
lfs_configrz   s      r,   r  z Repository.lfs_enable_largefilesk  sh   € ð	/ØBˆJÜ˜j˜\Ð)>Ð?ÀÇÁÔPÜØ�,˜fÔ%AÐ$BÐCØ—‘õøô ×,Ñ,ò 	/Ü" 3§:¡:Ó.Ð.ûð	/ús   ‚:= ½A*ÁA%Á%A*rš   c                 ó  — g }| j                  «       }t        || j                  ¬«      D ]È  }||v rŒt        j                  j                  t        j                  «       | j                  |«      }t        |«      rŒQt        |«      rŒ]t        j                  j                  |«      dz  }|dk\  rt        j                  d«       t        |«      }|sŒ§| j                  |«       |j                  |«       ŒÊ | j                  |«       |S )aH  
        Automatically track binary files with git-lfs.

        Args:
            pattern (`str`, *optional*, defaults to "."):
                The pattern with which to track files that are binary.

        Returns:
            `List[str]`: List of filenames that are now tracked due to being
            binary files
        ©rQ   é   r‰   z¨Parsing a large file to check if binary or not. Tracking large files using `repository.auto_track_large_files` is recommended so as to not load the full file in memory.)r@  rž   rï   rT   rU   rW   r  r~   rƒ   ÚgetsizerÜ   r&  r™   rC  ÚappendrE  )r+   rš   Úfiles_to_be_tracked_with_lfsr?  rh   Úpath_to_fileÚ
size_in_mbÚ	is_binarys           r,   Úauto_track_binary_filesz"Repository.auto_track_binary_filesy  sÞ   € ð (*Ð$à×/Ñ/Ó1ˆä*¨7¸4¿>¹>ÔJò 	BˆHØ˜=Ñ(ØäŸ7™7Ÿ<™<¬¯	©	«°T·^±^ÀXÓNˆLä'¨Õ5¼ÈÕ9UÜŸW™WŸ_™_¨\Ó:¸kÑJ�
à Ò#Ü—N‘NðRôô +¨<Ó8�	âØ—N‘N 8Ô,Ø0×7Ñ7¸ÕAð)	Bð. 	×Ñ˜Ô'à+Ð+r.   c                 óÌ  — g }| j                  «       }t        || j                  ¬«      D ]¦  }||v rŒt        j                  j                  t        j                  «       | j                  |«      }t        j                  j                  |«      dz  }|dk\  sŒmt        |«      rŒyt        |«      rŒ…| j                  |«       |j                  |«       Œ¨ | j                  |«       |S )ap  
        Automatically track large files (files that weigh more than 10MBs) with
        git-lfs.

        Args:
            pattern (`str`, *optional*, defaults to "."):
                The pattern with which to track files that are above 10MBs.

        Returns:
            `List[str]`: List of filenames that are now tracked due to their
            size.
        rI  rJ  r‰   )r@  rž   rï   rT   rU   rW   r  rK  r~   rƒ   rC  rL  rE  )r+   rš   rM  r?  rh   rN  rO  s          r,   Úauto_track_large_filesz!Repository.auto_track_large_files¤  s½   € ð (*Ð$à×/Ñ/Ó1ˆä*¨7¸4¿>¹>ÔJò 		>ˆHØ˜=Ñ(ØäŸ7™7Ÿ<™<¬¯	©	«°T·^±^ÀXÓNˆLÜŸ™Ÿ™¨Ó6¸+ÑFˆJà˜RÓÔ(;¸LÕ(IÔR`ÐamÕRnØ—‘˜xÔ(Ø,×3Ñ3°HÕ=ð		>ð 	×Ñ˜Ô'à+Ð+r.   c                 ó  — 	 t        «       5  t        d|rdnd› �| j                  «      }t        j	                  |j
                  «       ddd«       y# 1 sw Y   yxY w# t        j                  $ r}t        |j                  «      ‚d}~ww xY w)aŸ  
        git lfs prune

        Args:
            recent (`bool`, *optional*, defaults to `False`):
                Whether to prune files even if they were referenced by recent
                commits. See the following
                [link](https://github.com/git-lfs/git-lfs/blob/f3d43f0428a84fc4f1e5405b76b5a73ec2437e65/docs/man/git-lfs-prune.1.ronn#recent-files)
                for more information.
        zgit lfs prune z--recentr$   N©
ré   r   rï   rÜ   r  r=   rK   rr   rœ   r9   )r+   Úrecentr1   rz   s       r,   Ú	lfs_prunezRepository.lfs_pruneÅ  sx   € ð	/Ü"Ó$ñ +Ü'¨.Áv¹ÐSUÐ8VÐ(WÐY]×YgÑYgÓh�Ü—‘˜FŸM™MÔ*÷+÷ +ñ +ûô ×,Ñ,ò 	/Ü" 3§:¡:Ó.Ð.ûð	/ús4   ‚
A Œ=AÁ	A ÁAÁA ÁA ÁBÁ1BÂBÚrebasern   c                 ó(  — |sdnd}|r|dz  }	 t        «       5  t        || j                  «      }t        j	                  |j
                  «       ddd«       y# 1 sw Y   yxY w# t        j                  $ r}t        |j                  «      ‚d}~ww xY w)a7  
        git pull

        Args:
            rebase (`bool`, *optional*, defaults to `False`):
                Whether to rebase the current branch on top of the upstream
                branch after fetching.
            lfs (`bool`, *optional*, defaults to `False`):
                Whether to fetch the LFS files too. This option only changes the
                behavior when a repository was cloned without fetching the LFS
                files; calling `repo.git_pull(lfs=True)` will then fetch the LFS
                file from the remote repository.
        zgit pullzgit lfs pullz	 --rebaseNrU  )r+   rX  rn   Úcommandr1   rz   s         r,   Úgit_pullzRepository.git_pull×  s€   € ñ %(‘*¨^ˆÙØ�{Ñ"ˆGð	/Ü"Ó$ñ +Ü'¨°·±Ó@�Ü—‘˜FŸM™MÔ*÷+÷ +ñ +ûô ×,Ñ,ò 	/Ü" 3§:¡:Ó.Ð.ûð	/ús4   �
A$ ™6AÁA$ ÁA!ÁA$ Á!A$ Á$BÁ7BÂBÚauto_lfs_trackc                 ó˜  — |rL| j                  |«      }|j                  | j                  |«      «       |rt        j	                  d|› d�«       	 t        dj                  «       |gz   | j                  «      }t        j                  d|j                  › d�«       y# t        j                  $ r}t        |j                  «      ‚d}~ww xY w)a7  
        git add

        Setting the `auto_lfs_track` parameter to `True` will automatically
        track files that are larger than 10MB with `git-lfs`.

        Args:
            pattern (`str`, *optional*, defaults to "."):
                The pattern with which to add files to staging.
            auto_lfs_track (`bool`, *optional*, defaults to `False`):
                Whether to automatically track large and binary files with
                git-lfs. Any file over 10MB in size, or in binary format, will
                be automatically tracked.
        z!Adding files tracked by Git LFS: z5. This may take a bit of time if the files are large.z
git add -vzAdding to index:
rm   N)rS  ÚextendrQ  rÜ   r&  r   rY   rï   r  r=   rK   rr   rœ   r9   )r+   rš   r\  Útracked_filesr1   rz   s         r,   Úgit_addzRepository.git_addï  s·   € ñ à ×7Ñ7¸Ó@ˆMð × Ñ  ×!=Ñ!=¸gÓ!FÔGáÜ—‘Ø7¸°ð G;ð ;ôð
	/Ü# L×$6Ñ$6Ó$8¸G¸9Ñ$DÀdÇnÁnÓUˆFÜ�K‰KÐ,¨V¯]©]¨O¸2Ð>Õ?øÜ×,Ñ,ò 	/Ü" 3§:¡:Ó.Ð.ûð	/ús   ÁAB ÂC	Â/CÃC	Úcommit_messagec                 óV  — 	 t        dj                  «       |gz   | j                  «      }t        j	                  d|j
                  › d�«       y# t        j                  $ rG}t        |j                  «      dkD  rt        |j                  «      ‚t        |j
                  «      ‚d}~ww xY w)z·
        git commit

        Args:
            commit_message (`str`, *optional*, defaults to "commit files to HF hub"):
                The message attributed to the commit.
        zgit commit -v -mzCommitted:
rm   r   N)r   rY   rï   rÜ   r  r=   rK   rr   rt   r9   rœ   )r+   ra  r1   rz   s       r,   Ú
git_commitzRepository.git_commit  s‰   € ð	3Ü#Ð$6×$<Ñ$<Ó$>À.ÐAQÑ$QÐSW×SaÑSaÓbˆFÜ�K‰K˜, v§}¡} o°RÐ8Õ9øÜ×,Ñ,ò 	3Ü�3—:‘:‹ Ò"Ü& s§z¡zÓ2Ð2ä& s§z¡zÓ2Ð2ûð		3ús   ‚AA ÁB(Á!AB#Â#B(r¢   ÚblockingÚauto_lfs_prunec                 óÐ  ‡— d}|r|d|› �z  }t        | j                  |«      }|dkD  r0t        j                  d|› d�«       |rt        j                  d«       	 t	        «       5  t        j                  |j                  «       t
        j                  t
        j                  d| j                  ¬«      Š|rx‰j                  «       \  }}‰j                  «       }‰j                  «        t        |«      rt        j                  |«       |r#t        j                  |‰j                  ||¬	«      ‚d
d
d
«       |sSˆfd„}
t#        dˆfd„|
‰|r| j$                  nd
¬«      }| j&                  j)                  |«       | j+                  «       |fS |r| j%                  «        | j+                  «       S # 1 sw Y   Œ€xY w# t
        j                  $ r}	t        |	j                   «      ‚d
}	~	ww xY w)a%  
        git push

        If used without setting `blocking`, will return url to commit on remote
        repo. If used with `blocking=True`, will return a tuple containing the
        url to commit and the command object to follow for information about the
        process.

        Args:
            upstream (`str`, *optional*):
                Upstream to which this should push. If not specified, will push
                to the lastly defined upstream or to the default one (`origin
                main`).
            blocking (`bool`, *optional*, defaults to `True`):
                Whether the function should return only when the push has
                finished. Setting this to `False` will return an
                `CommandInProgress` object which has an `is_done` property. This
                property will be set to `True` when the push is finished.
            auto_lfs_prune (`bool`, *optional*, defaults to `False`):
                Whether to automatically prune files once they have been pushed
                to the remote.
        zgit pushz --set-upstream r   zSeveral commits (z) will be pushed upstream.z$The progress bars may be unreliable.zutf-8)r9   r=   ÚencodingrS   )r,  r9   Nc                  ó.   •— ‰j                  «       } | €y| S )Nr?   ©Úpoll)r5   r!   s    €r,   r    z*Repository.git_push.<locals>.status_methodd  s   ø€ Ø Ÿ™›�Ø�>Øà!�Mr.   Úpushc                  ó(   •— ‰ j                  «       d uS rE   ri  )r!   s   €r,   ú<lambda>z%Repository.git_push.<locals>.<lambda>m  s   ø€  w§|¡|£~¸TÐ'A€ r.   )r   r    r!   r"   )r¤   rï   rÜ   r&  ré   rK   rL   rY   rZ   Úcommunicaterj  Úkillrt   rr   rÚ   rœ   r9   r   rW  rì   rL  r8  )r+   r¢   rd  re  rZ  Únumber_of_commitsr=   r9   Úreturn_coderz   r    Úcommand_in_progressr!   s               @r,   Úgit_pushzRepository.git_push"  s±  ø€ ð8 ˆáØÐ)¨(¨Ð4Ñ4ˆGä+¨D¯N©N¸HÓEÐà˜qÒ Ü�N‰NÐ.Ð/@Ð.AÐA[Ð\Ô]ÙÜ—‘ÐEÔFð	/Ü"Ó$ñ uÜ$×*Ñ*Ø—M‘M“OÜ%Ÿ?™?Ü%Ÿ?™?Ø$ØŸ™ô�ñ Ø%,×%8Ñ%8Ó%:‘N�F˜FØ")§,¡,£.�KØ—L‘L”Nä˜6”{ÜŸ™ vÔ.á"Ü(×;Ñ;¸KÈÏÉÐ^dÐmsÔtÐt÷%uñ. ô"ô #4ØÛAØ+ØÙ.<˜DŸNšNÀ$ô#Ðð ×Ñ×%Ñ%Ð&9Ô:à×+Ñ+Ó-Ð/BÐBÐBáØ�N‰NÔà×'Ñ'Ó)Ð)÷_uð uûô( ×,Ñ,ò 	/Ü" 3§:¡:Ó.Ð.ûð	/ús1   Á
F8 Á$C	F,Ä-F8 Æ,F5Æ1F8 Æ8G%ÇG Ç G%rþ   c                 ó<  — 	 t        d|› �| j                  «      }t        j                  d|› d| j                  › d�«       t        j                  |j
                  «       y	# t        j                  $ r§}|st        |j                  «      ‚	 t        d|› �| j                  «      }t        j                  d|› d|› d�«       t        j                  |j
                  «       n0# t        j                  $ r}t        |j                  «      ‚d	}~ww xY wY d	}~y	d	}~ww xY w)
a  
        git checkout a given revision

        Specifying `create_branch_ok` to `True` will create the branch to the
        given revision if that revision doesn't exist.

        Args:
            revision (`str`):
                The revision to checkout.
            create_branch_ok (`str`, *optional*, defaults to `False`):
                Whether creating a branch named with the `revision` passed at
                the current checked-out reference if `revision` isn't an
                existing revision is allowed.
        zgit checkout zChecked out z from r  zgit checkout -b z
Revision `z2` does not exist. Created and checked out branch `z`.N)
r   rï   rÜ   r&  r  r=   rK   rr   rœ   r9   )r+   rõ   rþ   r1   rz   s        r,   r	  zRepository.git_checkout|  só   € ð	7Ü# m°H°:Ð$>ÀÇÁÓOˆFÜ�N‰N˜\¨(¨°6¸$×:MÑ:MÐ9NÈaÐPÔQÜ�N‰N˜6Ÿ=™=Õ)øÜ×,Ñ,ò 	7Ù#Ü& s§z¡zÓ2Ð2ð7Ü+Ð.>¸x¸jÐ,IÈ4Ï>É>ÓZ�FÜ—N‘NØ$ X JÐ.`ÐaiÐ`jÐjlÐmôô —N‘N 6§=¡=Õ1øÜ!×4Ñ4ò 7Ü*¨3¯:©:Ó6Ð6ûð7úô 2ûð	7ús=   ‚AA! Á!DÁ4DÂAC!Ã DÃ!DÃ4D	Ä	DÄDÄDÚtag_namerf   c                 óÎ  — |r@	 t        d|› �| j                  «      j                  j                  «       }t        |«      dk7  S 	 t        d| j                  «      j                  j                  «       }|j                  d«      }||v S # t        j
                  $ r}t        |j                  «      ‚d}~ww xY w# t        j
                  $ r}t        |j                  «      ‚d}~ww xY w)aw  
        Check if a tag exists or not.

        Args:
            tag_name (`str`):
                The name of the tag to check.
            remote (`str`, *optional*):
                Whether to check if the tag exists on a remote. This parameter
                should be the identifier of the remote.

        Returns:
            `bool`: Whether the tag exists.
        zgit ls-remote origin refs/tags/Nr   zgit tagrm   r;  )r+   ru  rf   r1   rz   Úgit_tagss         r,   Ú
tag_existszRepository.tag_existsœ  sÓ   € ñ ð3Ü'Ð*IÈ(ÈÐ(TÐVZ×VdÑVdÓe×lÑl×rÑrÓt�ô �v“; !Ñ#Ð#ð3Ü)¨)°T·^±^ÓD×KÑK×QÑQÓS�ð  —~‘~ dÓ+ˆHØ˜xÐ'Ð'øô ×0Ñ0ò 3Ü& s§z¡zÓ2Ð2ûð3ûô ×0Ñ0ò 3Ü& s§z¡zÓ2Ð2ûð3ús/   „1B Á.B7 ÂB4ÂB/Â/B4Â7C$Ã
CÃC$c                 óú  — d}d}| j                  |«      sd}| j                  ||¬«      sd}|r3	 t        ddd|g| j                  «      j                  j	                  «        |r8|r6	 t        d|› d	|› �| j                  «      j                  j	                  «        yy# t
        j                  $ r}t        |j                  «      ‚d}~ww xY w# t
        j                  $ r}t        |j                  «      ‚d}~ww xY w)
a˜  
        Delete a tag, both local and remote, if it exists

        Args:
            tag_name (`str`):
                The tag name to delete.
            remote (`str`, *optional*):
                The remote on which to delete the tag.

        Returns:
             `bool`: `True` if deleted, `False` if the tag didn't exist.
                If remote is not passed, will just be updated locally
        TF)rf   Úgitr}   z-dNú	git push z
 --delete )	rx  r   rï   r=   rq   rK   rr   rœ   r9   )r+   ru  rf   Údelete_locallyÚdelete_remotelyrz   s         r,   Ú
delete_tagzRepository.delete_tagº  sê   € ð ˆØˆà�‰˜xÔ(Ø"ˆNà�‰˜x°ˆÔ7Ø#ˆOáð3Ü  u¨d°HÐ=¸t¿~¹~ÓN×UÑU×[Ñ[Ô]ñ ‘oð3Ü ¨6¨(°*¸X¸JÐGÈÏÉÓX×_Ñ_×eÑeÔgñ øô ×0Ñ0ò 3Ü& s§z¡zÓ2Ð2ûð3ûô ×0Ñ0ò 3Ü& s§z¡zÓ2Ð2ûð3ús/   °2B Á'4C ÂC
Â0CÃC
ÃC:Ã C5Ã5C:rî   c                 ó²  — |r	ddd|d|g}ndd|g}	 t        || j                  «      j                  j                  «        |r6	 t        d|› d|› �| j                  «      j                  j                  «        yy# t        j
                  $ r}t        |j                  «      ‚d}~ww xY w# t        j
                  $ r}t        |j                  «      ‚d}~ww xY w)a[  
        Add a tag at the current head and push it

        If remote is None, will just be updated locally

        If no message is provided, the tag will be lightweight. if a message is
        provided, the tag will be annotated.

        Args:
            tag_name (`str`):
                The name of the tag to be added.
            message (`str`, *optional*):
                The message that accompanies the tag. The tag will turn into an
                annotated tag if a message is passed.
            remote (`str`, *optional*):
                The remote on which to add the tag.
        rz  r}   z-az-mNr{  r  r  )r+   ru  rî   rf   Útag_argsrz   s         r,   Úadd_tagzRepository.add_tagß  sÍ   € ñ$ Ø˜u d¨H°d¸GÐD‰Hà˜u hÐ/ˆHð	/Ü˜8 T§^¡^Ó4×;Ñ;×AÑAÔCñ ð3Ü ¨6¨(°!°H°:Ð>ÀÇÁÓO×VÑV×\Ñ\Õ^ð øô ×,Ñ,ò 	/Ü" 3§:¡:Ó.Ð.ûð	/ûô ×0Ñ0ò 3Ü& s§z¡zÓ2Ð2ûð3ús/   ’.A9 Á4B) Á9B&ÂB!Â!B&Â)CÂ<CÃCc                 óÜ   — 	 t        d| j                  «      j                  j                  «       }t        |«      dk(  S # t        j
                  $ r}t        |j                  «      ‚d}~ww xY w)z¢
        Return whether or not the git status is clean or not

        Returns:
            `bool`: `True` if the git status is clean, `False` otherwise.
        zgit status --porcelainNr   )	r   rï   r=   rq   rK   rr   rœ   r9   rt   )r+   r<  rz   s      r,   Úis_repo_cleanzRepository.is_repo_clean  s_   € ð	/Ü'Ð(@À$Ç.Á.ÓQ×XÑX×^Ñ^Ó`ˆJô �:‹ !Ñ#Ð#øô ×,Ñ,ò 	/Ü" 3§:¡:Ó.Ð.ûð	/ús   ‚.> ¾A+ÁA&Á&A+Úclean_okc                 óÚ   — |r&| j                  «       rt        j                  d«       y| j                  d¬«       | j	                  |«       | j                  d| j                  › �||¬«      S )aF  
        Helper to add, commit, and push files to remote repository on the
        HuggingFace Hub. Will automatically track large files (>10MB).

        Args:
            commit_message (`str`):
                Message to use for the commit.
            blocking (`bool`, *optional*, defaults to `True`):
                Whether the function should return only when the `git push` has
                finished.
            clean_ok (`bool`, *optional*, defaults to `True`):
                If True, this function will return None if the repo is
                untouched. Default behavior is to fail because the git command
                fails.
            auto_lfs_prune (`bool`, *optional*, defaults to `False`):
                Whether to automatically prune files once they have been pushed
                to the remote.
        z*Repo currently clean. Ignoring push_to_hubNT©r\  úorigin ©r¢   rd  re  )rƒ  rÜ   r  r`  rc  rs  r  )r+   ra  rd  r„  re  s        r,   Úpush_to_hubzRepository.push_to_hub  si   € ñ2 ˜×*Ñ*Ô,Ü�K‰KÐDÔEØØ�‰ DˆÔ)Ø�‰˜Ô'Ø�}‰}Ø˜t×2Ñ2Ð3Ð4ØØ)ð ó 
ð 	
r.   ÚbranchÚtrack_large_filesc              #   ó0  K  — t        d| j                  ¬«      }t        |«      rFt        |«      dkD  rt        |dd «      dd dz   n
t        |«      }t        j                  d|› d�«       |�| j                  |d	¬
«       t        | j                  «      r(t        j                  d«       | j                  d	¬«       n#t        j                  d| j                  › d�«       t        j                  «       }t        j                  t        j                  j                  || j                  «      «       	 | –— | j!                  |¬«       	 | j#                  |«       	 | j'                  d| j                  › �||¬«       t        j                  |«       y# t$        $ r}	dt        |	«      vr|	‚Y d}	~	ŒUd}	~	ww xY w# t$        $ r }	dt        |	«      v rt%        d«      |	‚|	‚d}	~	ww xY w# | j!                  |¬«       	 | j#                  |«       n%# t$        $ r}	dt        |	«      vr|	‚Y d}	~	nd}	~	ww xY w	 | j'                  d| j                  › �||¬«       n,# t$        $ r }	dt        |	«      v rt%        d«      |	‚|	‚d}	~	ww xY wt        j                  |«       w xY w­w)a…  
        Context manager utility to handle committing to a repository. This
        automatically tracks large files (>10Mb) with git-lfs. Set the
        `track_large_files` argument to `False` if you wish to ignore that
        behavior.

        Args:
            commit_message (`str`):
                Message to use for the commit.
            branch (`str`, *optional*):
                The branch on which the commit will appear. This branch will be
                checked-out before any operation.
            track_large_files (`bool`, *optional*, defaults to `True`):
                Whether to automatically track large files or not. Will do so by
                default.
            blocking (`bool`, *optional*, defaults to `True`):
                Whether the function should return only when the `git push` has
                finished.
            auto_lfs_prune (`bool`, defaults to `True`):
                Whether to automatically prune files once they have been pushed
                to the remote.

        Examples:

        ```python
        >>> with Repository(
        ...     "text-files",
        ...     clone_from="<user>/text-files",
        ...     token=True,
        >>> ).commit("My first file :)"):
        ...     with open("file.txt", "w+") as f:
        ...         f.write(json.dumps({"hey": 8}))

        >>> import torch

        >>> model = torch.nn.Transformer()
        >>> with Repository(
        ...     "torch-model",
        ...     clone_from="<user>/torch-model",
        ...     token=True,
        >>> ).commit("My cool model :)"):
        ...     torch.save(model.state_dict(), "model.pt")
        ```

        r  rI  é   Nr?   z, ...]zPThere exists some updated files in the local repository that are not committed: z|. This may lead to errors if checking out a branch. These files and their modifications will be added to the current commit.Trý   zPulling changes ...)rX  z@The current branch has no upstream branch. Will push to 'origin ú'r†  znothing to commitr‡  rˆ  zcould not read UsernamezCCouldn't authenticate user for push. Did you set `token` to `True`?)rž   rï   rt   rJ   rÜ   rÑ   r	  r¡   r&  r[  r  rT   r  ÚchdirrU   rW   r`  rc  rs   rs  )
r+   ra  rŠ  r‹  rd  re  Úfiles_to_stageÚfiles_in_msgÚcurrent_working_directoryÚes
             r,   ÚcommitzRepository.commit3  sv  è ø€ ôn ,¨C¸¿¹ÔGˆäˆ~ÔÜFIÈ.ÓFYÐ\]ÒF]œ3˜~¨b¨qÐ1Ó2°3°BÐ7¸(ÒBÔcfÐguÓcvˆLÜ�L‰LðØ+˜nð -#ð#ôð ÐØ×Ñ˜f°tÐÔ<ä˜tŸ~™~Ô.Ü�N‰NÐ0Ô1Ø�M‰M ˆMÕ&ä�N‰NÐ]Ð^b×^qÑ^qÐ]rÐrsÐtÔuä$&§I¡I£KÐ!Ü
�‰”—‘—‘Ð7¸¿¹ÓHÔIð	0ØŠJà�L‰LÐ(9ˆLÔ:ðØ—‘ Ô/ðØ—‘Ø& t×':Ñ':Ð&;Ð<Ø%Ø#1ð ô ô �H‰HÐ.Õ/øô% ò à&¬c°!«fÑ4Ø�Gô 5ûðûô ò à,´°A³Ñ6Ü!Ð"gÓhÐnoÐoà�Gûðûð �L‰LÐ(9ˆLÔ:ðØ—‘ Õ/øÜò à&¬c°!«fÑ4Ø�Gô 5ûðúð
Ø—‘Ø& t×':Ñ':Ð&;Ð<Ø%Ø#1ð õ øô
 ò à,´°A³Ñ6Ü!Ð"gÓhÐnoÐoà�Gûðúô �H‰HÐ.Õ/üs´   ‚D/JÄ2G# Ä6JÅ	F Å!F7 Å<JÆ	F4ÆF/Æ*JÆ/F4Æ4JÆ7	G Ç GÇG Ç JÇ#JÇ7H	ÈJÈ		H+ÈH&È!JÈ&H+È+JÈ/!IÉJÉ	I:ÉI5É5I:É:JÊJc                 óÈ   — t         j                  j                  | j                  t        j
                  «      }t         j                  j                  |«      rt        |«      S y rE   )rT   rU   rW   rï   r   ÚREPOCARD_NAMEÚisfiler   )r+   Úfilepaths     r,   Úrepocard_metadata_loadz!Repository.repocard_metadata_loadœ  s>   € Ü—7‘7—<‘< §¡´	×0GÑ0GÓHˆÜ�7‰7�>‰>˜(Ô#Ü  Ó*Ð*Ør.   Údatac                 ó†   — t        t        j                  j                  | j                  t
        j                  «      |«      S rE   )r   rT   rU   rW   rï   r   r–  )r+   rš  s     r,   Úrepocard_metadata_savez!Repository.repocard_metadata_save¢  s)   € ÜœRŸW™WŸ\™\¨$¯.©.¼)×:QÑ:QÓRÐTXÓYÐYr.   c                 ó`   — | j                   D �cg c]  }|j                  dkD  sŒ|‘Œ c}S c c}w )z@
        Returns the asynchronous commands that failed.
        r   )rì   r5   ©r+   Úcs     r,   Úcommands_failedzRepository.commands_failed¥  s(   € ð
  ×-Ñ-Ö>�a°·±¸A³’Ò>Ð>ùÒ>s   �+¤+c                 óZ   — | j                   D �cg c]  }|j                  rŒ|‘Œ c}S c c}w )zS
        Returns the asynchronous commands that are currently in progress.
        )rì   r2   rž  s     r,   Úcommands_in_progresszRepository.commands_in_progress¬  s$   € ð
  ×-Ñ-Ö?�a°Q·Y³Y’Ò?Ð?ùÒ?s   �(¡(c                 óš  — d}| j                   D ][  }t        j                  d|j                  › d|j                  j
                  › d�«       t        j                  |j                  «       Œ] | j                  rS|dz  dk(  r#t        j                  d| j                  › d�«       |dz  }t        j                  d«       | j                  rŒRy	y	)
zr
        Blocking method: blocks all subsequent execution until all commands have
        been processed.
        r   zThe z command with PID z failed.r‰   zCWaiting for the following commands to finish before shutting down: r  r   N)r   rÜ   rÑ   r   r'   rC   r9   r¢  r&  rº   r»   )r+   ÚindexÚcommand_faileds      r,   r  zRepository.wait_for_commands³  s¹   € ð
 ˆØ"×2Ñ2ò 	0ˆNÜ�L‰L˜4 × 4Ñ 4Ð5Ð5GÈ×H_ÑH_×HcÑHcÐGdÐdlÐmÔnÜ�L‰L˜×.Ñ.Õ/ð	0ð ×'Ò'Ø�r‰z˜QŠÜ—‘ØYÐZ^×ZsÑZsÐYtÐtuÐvôð �Q‰JˆEä�J‰J�qŒMð ×'Õ'r.   )NNTNNNFNrE   )NN)F)r  )FF)r  F)úcommit files to HF hub)NTF)r¦  TTF)NTTF)3rF   rG   rH   rI   r   r   r©   r   r   r   rJ   r   r	   rN   r   r-   rM   r  r  rð   r  r  r2  r5  r8  r@  rC  rE  r  rQ  rS  rW  r[  r`  rc  r
   rs  r	  rx  r~  r�  rƒ  r‰  r   r”  r   r™  rœ  r   r¢  r  rP   r.   r,   rë   rë   ª  s  … ñð" Ð)Ñ*Ó*àÙØðQôð %)Ø#'Ø"&Ø"&Ø#'Ø"&Ø$Ø"&ñj0à˜˜d˜Ñ#ðj0ð ˜S‘Mðj0ð ˜C‘=ð	j0ð
 �T˜3�YÑðj0ð ˜3‘-ðj0ð ˜C‘=ðj0ð ˜3‘-ðj0ð ðj0ð ˜‘òj0óó ðj0ðX ð ò ó ðò6ð. ñ}/ 3ð }/¨u°T¸3À°_Ñ/Eò }/ó ð}/ñ~/°h¸s±mð /ÐW_Ð`cÑWdó /ò&/ð/˜só /ð/ ó /ð% Só %ð! D¨¡Ió !ñF/ %¨¨T°#©Y¨Ñ"7ð /À4ó /ð2/ E¨#¨t°C©y¨.Ñ$9ó /ò /ñ),¨sð ),¸TÀ#¹Yó ),ñV,¨cð ,¸DÀ¹Ió ,óB/ñ$/˜tð /°$ó /ñ0 /˜sð  /¸$ó  /ñD3¨ó 3ð& #'ØØ$ñ	X*à˜3‘-ðX*ð ðX*ð ð	X*ð
 
ˆs�E˜#Ð0Ð0Ñ1Ð1Ñ	2óX*ñt7 Sð 7¸Dó 7ñ@( 3ð (°¸±ð (Èó (ñ<# 3ð #°¸±ð #Èó #ñJ 3 ð  3¨h°s©mð  3ÈHÐUXÉMó  3ðD$˜tó $ð  7ØØØ$ñ"
àð"
ð ð"
ð ð	"
ð
 ð"
ð 
ˆt�S˜% Ð%6Ð 6Ñ7Ð7Ñ	8ó"
ðH ð !%Ø"&ØØ$ñf0àðf0ð ˜‘ðf0ð  ð	f0ð
 ðf0ð òf0ó ðf0ðP¨°©ó ðZ¨4ð Z°Dó Zð ñ?ó ð?ð ñ@ó ð@ór.   rë   )r  NrE   ):r
  rT   rc   rK   rà   rº   Ú
contextlibr   Úpathlibr   Útypingr   r   r   r   r	   r
   r   r   Úurllib.parser   Úhuggingface_hubr   Úhuggingface_hub.repocardr   r   Úhf_apir   r   rn   r   Úutilsr   r   r   r   r   r   Úutils._deprecationr   Ú
get_loggerrF   rÜ   r   rJ   rN   r^   rg   r~   rƒ   r™   rž   r¡   rO   r¤   r¦   ré   rë   rP   r.   r,   ú<module>r±     sš  ðÛ Û 	Û 	Û Û Û Ý %Ý ß T× TÓ TÝ !å %ß Aç 6Ý -÷÷ õ 2ð 
ˆ×	Ñ	˜HÓ	%€÷P
ñ P
ðf8˜˜c 4˜iÑ(ð 8¨Tó 8ð"!˜5  d Ñ+ð !¸ð !Àó !ð2"' %¨¨T¨	Ñ"2ð "'°tó "'ðJ˜U 3¨ 9Ñ-ð °$ó ð2˜U 3¨ 9Ñ-ð °$ó ñ. ð °5¸¸dÀD¸Ñ3Ið ÐUYÐZ]ÑU^ó ð2  c¨4 iÑ 0ð °Tó ñ,+˜E # t )Ñ,ð +¸À¹ð +ÐQTó +ô,ˆIô ð ñjHó ðjH÷Z[ò [r.   