Ë
    øÿæioƒ  ã                   ó6  — U 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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 d dlmZmZ d dlmZ d dlmZmZ d dlZd dlmZ  G d	„ d
«      Z	 d dlmZ g d¢Z  ejB                  d«      Z" ejB                  d«      Z#dZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+da,e-dz  e.d<   e j^                  d„ «       Z0d„ Z1d„ Z2d„ Z3d„ Z4d„ Z5d„ Z6d„ Z7d „ Z8d!„ Z9	 	 dDd$„Z:d%„ Z;d&„ Z<d'„ Z=d(„ Z>d)e-fd*„Z?d+e-ej€                  z  d)dfd,„ZA	 	 	 	 dEd.„ZBdFd/„ZCd0d-d#d"d#d1œd2„ZDd3„ ZE	 	 dGd4e-d5e-d6e-dz  d7eFd)df
d8„ZGd9e-d)eFfd:„ZH ed;eI¬<«      d9e-d=e-d>ed?eFd)eJe-ef   f
d@„«       ZK	 	 	 	 	 	 dHd4e-d=e-dz  d>ed7eFdAeFdBe-dz  d?eFd)eJe-ef   fdC„ZLy# e$ r eZY �Œ"w xY w)Ié    N)ÚPath)ÚAny)Ú
deprecated)Ú	HTTPErrorÚURLError)Úurlparse)ÚRequestÚurlopen)ÚMAP_LOCATIONc                   ó8   — e Zd Zd	d„Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	y)
Ú	_FaketqdmNc                 ó.   — || _         || _        d| _        y ©Nr   )ÚtotalÚdisableÚn)Úselfr   r   ÚunitÚargsÚkwargss         ú^/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/torch/hub.pyÚ__init__z_Faketqdm.__init__   s   € ØˆŒ
ØˆŒØˆ�ó    c                 óˆ  — | j                   ry | xj                  |z  c_        | j                  €/t        j                  j                  d| j                  d›d�«       nGt        j                  j                  dd| j                  z  t        | j                  «      z  d›d�«       t        j                  j                  «        y )NÚz.1fz byteséd   Ú%)r   r   r   ÚsysÚstderrÚwriteÚfloatÚflush)r   r   s     r   Úupdatez_Faketqdm.update    sˆ   € Ø�<Š<Øà�Š�!‰�Ø�:‰:ÐÜ�J‰J×Ñ˜r $§&¡&¨ ¨VÐ4Õ5ä�J‰J×Ñ˜r #¨¯©¡,´°t·z±zÓ1BÑ"BÀ3Ð!GÀqÐIÔJÜ�
‰
×ÑÕr   c                  ó   — y ©N© )r   r   r   s      r   Úset_descriptionz_Faketqdm.set_description,   s   € Ør   c                 óH   — t         j                  j                  |› d�«       y ©NÚ
)r   r   r    )r   Úss     r   r    z_Faketqdm.write/   s   € Ü�
‰
×Ñ˜A˜3˜b˜Õ"r   c                 ó   — d| _         y ©NT)r   ©r   s    r   Úclosez_Faketqdm.close2   s	   € Øˆ�r   c                 ó   — | S r%   r&   r.   s    r   Ú	__enter__z_Faketqdm.__enter__5   s   € Øˆr   c                 ó\   — | j                   ry t        j                  j                  d«       y r)   )r   r   r   r    )r   Úexc_typeÚexc_valÚexc_tbs       r   Ú__exit__z_Faketqdm.__exit__8   s   € Ø�<Š<Øä�
‰
×Ñ˜Õr   )NFN)
Ú__name__Ú
__module__Ú__qualname__r   r#   r'   r    r/   r1   r6   r&   r   r   r   r      s%   „ óò	òò#òòór   r   )Útqdm)Údownload_url_to_fileÚget_dirÚhelpÚlistÚloadÚload_state_dict_from_urlÚset_dirz-([a-f0-9]*)\.z[/\\])ÚfacebookresearchÚfacebookincubatorÚpytorchÚfairinternalÚGITHUB_TOKENÚ
TORCH_HOMEÚXDG_CACHE_HOMEz~/.cacheÚdependenciesz
hubconf.pyi   Ú_hub_dirc              #   óÜ   K  — t         j                  j                  d| «       	 d –— t         j                  j                  | «       y # t         j                  j                  | «       w xY w­wr   )r   ÚpathÚinsertÚremove©rL   s    r   Ú_add_to_sys_pathrP   b   s@   è ø€ ä‡H�H‡O�O�A�tÔðÛä�‰�‰˜ÕøŒ�‰�‰˜Õüs   ‚!A,¤A ¨ A,Á!A)Á)A,c                 óL  — dd l }ddlm} |j                  j	                  | |«      }|€t        d|› �«      ‚|j                  j                  |«      }t        |j                  |«      s!t        dt        |j                  «      › �«      ‚|j                  j                  |«       |S )Nr   )ÚLoaderzfailed to load spec from zexpected Loader, got )Úimportlib.utilÚimportlib.abcrR   ÚutilÚspec_from_file_locationÚAssertionErrorÚmodule_from_specÚ
isinstanceÚloaderÚtypeÚexec_module)ÚnamerL   Ú	importlibrR   ÚspecÚmodules         r   Ú_import_modulera   l   sŒ   € ÛÝ$à�>‰>×1Ñ1°$¸Ó=€DØ€|ÜÐ8¸¸Ð?Ó@Ð@Ø�^‰^×,Ñ,¨TÓ2€FÜ�d—k‘k 6Ô*ÜÐ4´T¸$¿+¹+Ó5FÐ4GÐHÓIÐIØ‡K�K×Ñ˜FÔ#Ø€Mr   c                 óØ   — t         j                  j                  | «      rKt         j                  j                  | «      rt        j                  | «       y t        j                  | «       y y r%   )ÚosrL   ÚexistsÚisfilerN   ÚshutilÚrmtreerO   s    r   Ú_remove_if_existsrh   z   s>   € Ü	‡w�w‡~�~�dÔÜ�7‰7�>‰>˜$ÔÜ�I‰I�d�Oä�M‰M˜$Õð	 r   c                 ó–  — t        |«      j                  d¬«      }| j                  «       D �]  }t        j                  j                  |j                  «      }|j                  d«      rt        d|j                  › �«      ‚t        |«      dk\  r3|d   dk(  r+|d   j                  «       rt        d|j                  › �«      ‚d	t        j                  t        |«      v rt        d
|j                  › �«      ‚||z  j                  d¬«      }|j                  |«      st        d|j                  › �«      ‚| j                  ||«       �Œ y)zï
    Safely extract a zip file, preventing zipslip attacks.

    Args:
        zip_file: ZipFile object to extract
        extract_to: Directory to extract to

    Raises:
        ValueError: If any archive entry contains unsafe paths
    F)Ústrict)Ú/Ú\z!Archive entry has absolute path: é   é   Ú:r   z..z,Archive entry contains directory traversal: z(Archive entry escapes target directory: N)r   ÚresolveÚinfolistrc   rL   ÚnormpathÚfilenameÚ
startswithÚ
ValueErrorÚlenÚisalphaÚreÚsplitÚ_PATH_SEP_PATTERNÚis_relative_toÚextract)Úzip_fileÚ
extract_toÚmemberrs   Úouts        r   Ú_safe_extract_zipr�   ‚   s3  € ô �jÓ!×)Ñ)°Ð)Ó7€Jà×#Ñ#×%ˆä—7‘7×#Ñ# F§O¡OÓ4ˆð ×Ñ˜{Ô+ÜÐ@ÀÇÁÐ@QÐRÓSÐSäˆx‹=˜AÒ (¨1¡+°Ò"4¸À!¹×9LÑ9LÔ9NÜÐ@ÀÇÁÐ@QÐRÓSÐSà”2—8‘8Ô-¨xÓ8Ñ8ÜØ>¸v¿¹Ð>OÐPóð ð
 ˜HÑ$×-Ñ-°UÐ-Ó;ˆà×!Ñ! *Ô-ÜØ:¸6¿?¹?Ð:KÐLóð ð
 	×Ñ˜ Ö,ñ3 &r   c                 ó   — d| › d|› d|› �S )Núhttps://github.com/rk   z	/zipball/r&   )Ú
repo_ownerÚ	repo_nameÚrefs      r   Ú_git_archive_linkr‡   ¬   s   € à   ¨A¨i¨[¸	À#ÀÐGÐGr   c                 ó6   — |t        | «      vry t        | |«      S r%   )ÚdirÚgetattr)r`   Ú	func_names     r   Ú_load_attr_from_modulerŒ   ±   s   € àœ˜F›Ñ#ØÜ�6˜9Ó%Ð%r   c                  óè   — t         j                  j                  t        j                  t        t         j                  j                  t        j                  t        t        «      d«      «      «      } | S )NÚtorch)rc   rL   Ú
expanduserÚgetenvÚENV_TORCH_HOMEÚjoinÚENV_XDG_CACHE_HOMEÚDEFAULT_CACHE_DIR)Ú
torch_homes    r   Ú_get_torch_homer–   ¸   sL   € Ü—‘×#Ñ#Ü
�	‰	ÜÜ�G‰G�L‰LœŸ™Ô#5Ô7HÓIÈ7ÓSó	
ó€Jð Ðr   c                 óè  — d| v r| j                  d«      \  }}n| d }}|j                  d«      \  }}|€	 t        d|› d|› d�«      5  d}d d d «       |||fS # 1 sw Y   ŒxY w# t        $ r}|j                  dk(  rd}n‚ Y d }~Œ2d }~wt        $ ra}dD ]8  }t
        j                  j                  t        «       › d|› d	|› d	|› �«      sŒ6|} n |€t        d
t        «       › d�«      |‚Y d }~Œšd }~ww xY w)Nro   rk   rƒ   z/tree/main/Úmaini”  Úmaster)r˜   r™   Ú_z\It looks like there is no internet connection and the repo could not be found in the cache (Ú))
ry   r
   r   Úcoder   rc   rL   rd   r<   ÚRuntimeError)ÚgithubÚ	repo_infor†   r„   r…   ÚeÚpossible_refs          r   Ú_parse_repo_infor¢   Â   s!  € Ø
ˆf�}ØŸ™ cÓ*‰ˆ	‘3à �3ˆ	Ø%ŸO™O¨CÓ0Ñ€J�	à
€{ð	ÜÐ.¨z¨l¸!¸I¸;ÀkÐRÕSØ�÷ Tð( �y #Ð%Ð%÷) TÐSûäò 	Ø�v‰v˜Š}Ø‘àô ûô ò 	ã 2�Ü—7‘7—>‘>Ü“y�k  : ,¨a°	¨{¸!¸L¸>ÐJõð '�CÙð !3ð ˆ{Ü"ð=Ü=D»Y¸KÀqðJóð ðô ûð	úsA   µA# ÁAÁ
A# ÁA ÁA# Á#	C1Á,BÂC1Â7C,ÃC,Ã,C1c                 ó´   — t        | «      5 }|j                  «       j                  |j                  j	                  d«      «      cd d d «       S # 1 sw Y   y xY w)Nzutf-8)r
   ÚreadÚdecodeÚheadersÚget_content_charset)ÚurlÚrs     r   Ú	_read_urlrª   å   s6   € Ü	�Œ˜Ø�v‰v‹x�‰˜qŸy™y×<Ñ<¸WÓEÓF÷ 
�Šús   Œ8AÁAc           
      óü  — ddi}t         j                  j                  t        «      }|�d|› �|d<   d| › d|› d�d| › d|› d�fD ]g  }d	}	 |d
z  }|› d|› �}	 t	        j
                  t        t        ||¬«      «      «      }|sŒ?|D ]$  }	|	d   |k(  s|	d   d   j                  |«      sŒ#  y  Œc t        d|› d| › d|› d�«      ‚# t        $ r/ |d= t	        j
                  t        t        ||¬«      «      «      }Y Œzw xY w)NÚAcceptzapplication/vnd.github.v3+jsonztoken ÚAuthorizationzhttps://api.github.com/repos/rk   z	/branchesz/tagsr   rn   z?per_page=100&page=©r¦   r]   ÚcommitÚshazCannot find z in https://github.com/zX. If it's a commit from a forked repo, please call hub.load() with forked repo directly.)rc   ÚenvironÚgetÚENV_GITHUB_TOKENÚjsonÚloadsrª   r	   r   rt   ru   )
r„   r…   r†   r¦   ÚtokenÚ
url_prefixÚpager¨   ÚresponseÚbrs
             r   Ú_validate_not_a_forked_repor»   ê   sL  € àÐ9Ð:€GÜ�J‰J�N‰NÔ+Ó,€EØÐØ%+¨E¨7Ð#3ˆ�Ñ à
'¨
 |°1°Y°K¸yÐIØ
'¨
 |°1°Y°K¸uÐEóˆ
ð ˆØØ�A‰IˆDØ�LÐ 3°D°6Ð:ˆCðPÜŸ:™:¤i´¸ÀWÔ0MÓ&NÓO�ñ ØÛ�Ø�f‘: Ò$¨¨8©°UÑ(;×(FÑ(FÀsÕ(KÚð ð ðô* Ø
�s�eÐ2°:°,¸aÀ	¸{ð Kað 	aóð øô ò Pà˜OÐ,ÜŸ:™:¤i´¸ÀWÔ0MÓ&NÓO’ðPús   Á)CÃ5C;Ã:C;TFc                 óÂ  — t        «       }t        j                  |d¬«       t        | «      \  }}}|j	                  dd«      }	dj                  |||	g«      }
t        j                  j                  ||
«      }t        |||
|¬«       | xr t        j                  j                  |«      }|r'|r#t        j                  j                  d|› d�«       |S |st        |||«       t        j                  j                  ||	dz   «      }t        |«       	 t        |||«      }t        j                  j                  d	|› d
|› d�«       t!        ||d¬«       t+        j,                  |«      5 }|j/                  «       d   j0                  }t        j                  j                  ||«      }t        |«       t3        ||«       d d d «       t        |«       t        |«       t5        j6                  |«       |S # t"        $ rW}|j$                  dk(  r=t'        j(                  d|› d�d¬«       d|› �}t        |||¬«      }t!        ||d¬«       n‚ Y d }~Œûd }~ww xY w# 1 sw Y   ŒšxY w)NT©Úexist_okrk   rš   )Ú
trust_repozUsing cache found in r*   z.zipúDownloading: "ú" to F©Úprogressi,  zThe ref a   is ambiguous. Perhaps it is both a tag and a branch in the repo? Torchhub will now assume that it's a branch. You can disambiguate tags and branches by explicitly passing refs/heads/branch_name or refs/tags/tag_name as the ref. That might require using skip_validation=True.rm   ©Ú
stacklevelzrefs/heads/)r†   r   )r<   rc   Úmakedirsr¢   Úreplacer’   rL   Ú_check_repo_is_trustedrd   r   r   r    r»   rh   r‡   Ústdoutr;   r   rœ   ÚwarningsÚwarnÚzipfileÚZipFilerq   rs   r�   rf   Úmove)rž   Úforce_reloadr¿   ÚverboseÚskip_validationÚhub_dirr„   r…   r†   Únormalized_brÚowner_name_branchÚrepo_dirÚ	use_cacheÚcached_filer¨   ÚerrÚdisambiguated_branch_refÚcached_zipfileÚextraced_repo_nameÚextracted_repos                       r   Ú_get_cache_or_reloadrÝ     s6  € ô ‹i€GÜ‡K�K� $Õ'ä!1°&Ó!9Ñ€J�	˜3ð
 —K‘K  SÓ)€Mð
 Ÿ™ *¨i¸Ð!GÓHÐÜ�w‰w�|‰|˜GÐ%6Ó7€HäØØØØõ	ð "Ð!Ò?¤r§w¡w§~¡~°hÓ'?€IáÙÜ�J‰J×ÑÐ4°X°J¸bÐAÔBðZ €OñU Ü'¨
°I¸sÔCä—g‘g—l‘l 7¨M¸FÑ,BÓCˆÜ˜+Ô&ð	Ü# J°	¸3Ó?ˆCÜ�J‰J×Ñ˜~¨c¨U°%¸°}ÀBÐGÔHÜ   k¸EÕBô, �_‰_˜[Ô)¨^Ø!/×!8Ñ!8Ó!:¸1Ñ!=×!FÑ!FÐÜŸW™WŸ\™\¨'Ð3EÓFˆNÜ˜nÔ-ä˜n¨gÔ6÷ *ô 	˜+Ô&Ü˜(Ô#Ü�‰�N HÔ-à€OøôA ò 	Ø�x‰x˜3Šô
 —‘Ø˜s˜eð $dð dð  !õð .9¸¸Ð+>Ð(Ü'Ø 	Ð/Gô�ô % S¨+ÀÖFàô Gûð#	ú÷* *Ð)ús'   ÄAG2 Å'AIÇ2	IÇ;AIÉIÉIc                 óø  — t        «       }t        j                  j                  |d«      }t        j                  j	                  |«      st        |«      j                  «        t        |«      5 }t        d„ |D «       «      }d d d «       t        t        j                  |«      «      d   }dj                  | |g«      }	|	v xs ||v xs | t        v }
|du s|dk(  r]|
s[t        d|	› d�«      }|j                  «       d	v r|
r8t        d
«       n,|j                  «       dv rt        d«      ‚t!        d|› d�«      ‚|
s*t        |d«      5 }|j#                  |	dz   «       d d d «       y y # 1 sw Y   ŒäxY w# 1 sw Y   y xY w)NÚtrusted_listc              3   ó<   K  — | ]  }|j                  «       –— Œ y ­wr%   )Ústrip)Ú.0Úlines     r   Ú	<genexpr>z)_check_repo_is_trusted.<locals>.<genexpr>j  s   è ø€ Ð<±t¨t˜dŸj™jŸl±tùs   ‚rn   rš   FÚcheckzThe repository z± does not belong to the list of trusted repositories and as such cannot be downloaded. Do you trust this repository and wish to add it to the trusted list of repositories (y/N)?)ÚyÚyesz"The repository is already trusted.)r   ÚnoÚ zUntrusted repository.zUnrecognized response Ú.Úar*   )r<   rc   rL   r’   rd   r   ÚtouchÚopenÚtupleÚnextÚwalkÚ_TRUSTED_REPO_OWNERSÚinputÚlowerÚprintÚ	Exceptionru   r    )r„   r…   rÔ   r¿   rÒ   ÚfilepathÚfileÚtrusted_reposÚtrusted_repos_legacyÚ
owner_nameÚ
is_trustedr¹   s               r   rÈ   rÈ   ^  sq  € ô ‹i€GÜ�w‰w�|‰|˜G ^Ó4€Hä�7‰7�>‰>˜(Ô#ÜˆX‹×ÑÔÜ	ˆhŒ˜4ÜÑ<±tÓ<Ó<ˆ÷ 
ô
  ¤§¡¨Ó 0Ó1°!Ñ4Ðà—‘˜: yÐ1Ó2€Jà�mÐ#ò 	.ØÐ 4Ð4ò	.àÔ-Ð-ð ð 	�eÑ ¨wÒ!6¹zÜØ˜j˜\ð *ið ió
ˆð �>‰>Ó˜|Ñ+ÙÜÐ:Õ;Ø�^‰^Ó Ñ0ÜÐ3Ó4Ð4äÐ5°h°Z¸qÐAÓBÐBñ Ü�(˜CÔ  DØ�J‰J�z DÑ(Ô)÷ !Ð ð ÷9 
ˆú÷: !Ð ús   Á.E$ÅE0Å$E-Å0E9c                 óD   — dd l }|j                  j                  | «      d uS r   )rS   rU   Ú	find_spec)r]   r^   s     r   Ú_check_module_existsrþ   Š  s   € Ûà�>‰>×#Ñ# DÓ)°Ð5Ð5r   c                 ó¨   — t        | t        «      }|�;|D �cg c]  }t        |«      rŒ|‘Œ }}|rt        ddj	                  |«      › �«      ‚y y c c}w )NzMissing dependencies: z, )rŒ   ÚVAR_DEPENDENCYrþ   r�   r’   )ÚmrI   ÚpkgÚmissing_depss       r   Ú_check_dependenciesr  �  s^   € Ü)¨!¬^Ó<€LàÐÙ'3ÓU¡| Ô;OÐPSÕ;Tš |ˆÐUÙÜÐ!7¸¿	¹	À,Ó8OÐ7PÐQÓRÐRð ð  ùÚUs
   —A¨Ac                 ó¢   — t        |t        «      st        d«      ‚t        | «       t	        | |«      }|�t        |«      st        d|› d�«      ‚|S )Nz8Invalid input: model should be a string of function namezCannot find callable z in hubconf)rY   Ústrru   r  rŒ   Úcallabler�   )r  ÚmodelÚfuncs      r   Ú_load_entry_from_hubconfr
  ™  sS   € Ü�eœSÔ!ÜÐSÓTÐTô ˜Ôä! ! UÓ+€Dà€|œ8 Dœ>ÜÐ2°5°'¸ÐEÓFÐFà€Kr   Úreturnc                  óÂ   — t        j                  d«      rt        j                  dd¬«       t        �t        S t         j
                  j                  t        «       d«      S )a¸  
    Get the Torch Hub cache directory used for storing downloaded models & weights.

    If :func:`~torch.hub.set_dir` is not called, default path is ``$TORCH_HOME/hub`` where
    environment variable ``$TORCH_HOME`` defaults to ``$XDG_CACHE_HOME/torch``.
    ``$XDG_CACHE_HOME`` follows the X Design Group specification of the Linux
    filesystem layout, with a default value ``~/.cache`` if the environment
    variable is not set.
    Ú	TORCH_HUBz:TORCH_HUB is deprecated, please use env TORCH_HOME insteadrm   rÄ   Úhub)rc   r�   rÊ   rË   rJ   rL   r’   r–   r&   r   r   r<   r<   «  sG   € ô 
‡y�y�ÔÜ�‰ØHÐUVõ	
ô ÐÜˆÜ�7‰7�<‰<œÓ)¨5Ó1Ð1r   Údc                 óB   — t         j                  j                  | «      ay)z²
    Optionally set the Torch Hub directory used to save downloaded models & weights.

    Args:
        d (str): path to a local folder to save downloaded models & weights.
    N)rc   rL   r�   rJ   )r  s    r   rA   rA   À  s   € ô �w‰w×!Ñ! !Ó$�Hr   rå   c           	      óT  — t        | ||||¬«      }t        |«      5  t        j                  j	                  |t
        «      }t        t
        |«      }ddd«       t        «      D �cg c]*  }t        t        ||«      «      r|j                  d«      s|‘Œ, }	}|	S # 1 sw Y   ŒIxY wc c}w )aè  
    List all callable entrypoints available in the repo specified by ``github``.

    Args:
        github (str): a string with format "repo_owner/repo_name[:ref]" with an optional
            ref (tag or branch). If ``ref`` is not specified, the default branch is assumed to be ``main`` if
            it exists, and otherwise ``master``.
            Example: 'pytorch/vision:0.10'
        force_reload (bool, optional): whether to discard the existing cache and force a fresh download.
            Default is ``False``.
        skip_validation (bool, optional): if ``False``, torchhub will check that the branch or commit
            specified by the ``github`` argument properly belongs to the repo owner. This will make
            requests to the GitHub API; you can specify a non-default GitHub token by setting the
            ``GITHUB_TOKEN`` environment variable. Default is ``False``.
        trust_repo (bool or str): ``"check"``, ``True`` or ``False``.
            This parameter was introduced in v1.12 and helps ensuring that users
            only run code from repos that they trust.

            - If ``False``, a prompt will ask the user whether the repo should
              be trusted.
            - If ``True``, the repo will be added to the trusted list and loaded
              without requiring explicit confirmation.
            - If ``"check"``, the repo will be checked against the list of
              trusted repos in the cache. If it is not present in that list, the
              behaviour will fall back onto the ``trust_repo=False`` option.

            Default is ``"check"``.
        verbose (bool, optional): If ``False``, mute messages about hitting
            local caches. Note that the message about first download cannot be
            muted. Default is ``True``.

    Returns:
        list: The available callables entrypoint

    Example:
        >>> # xdoctest: +REQUIRES(env:TORCH_DOCTEST_HUB)
        >>> entrypoints = torch.hub.list("pytorch/vision", force_reload=True)
    ©rÐ   rÑ   Nrš   )rÝ   rP   rc   rL   r’   ÚMODULE_HUBCONFra   r‰   r  rŠ   rt   )
rž   rÏ   rÑ   r¿   rÐ   rÕ   Úhubconf_pathÚ
hub_moduleÚfÚentrypointss
             r   r>   r>   Ë  s¢   € ôZ $ØØØØØ'ô€Hô 
˜(Õ	#Ü—w‘w—|‘| H¬nÓ=ˆÜ#¤N°LÓAˆ
÷ 
$ô �Z”óá ˆAÜ”G˜J¨Ó*Ô+°A·L±LÀÔ4Eò 	
Ø ð ð ð Ð÷ 
$Ð	#üò
s   œ5BÁ&/B%ÂB"c                 óú   — t        | ||d|¬«      }t        |«      5  t        j                  j	                  |t
        «      }t        t
        |«      }ddd«       t        |«      }|j                  S # 1 sw Y   Œ!xY w)a  
    Show the docstring of entrypoint ``model``.

    Args:
        github (str): a string with format <repo_owner/repo_name[:ref]> with an optional
            ref (a tag or a branch). If ``ref`` is not specified, the default branch is assumed
            to be ``main`` if it exists, and otherwise ``master``.
            Example: 'pytorch/vision:0.10'
        model (str): a string of entrypoint name defined in repo's ``hubconf.py``
        force_reload (bool, optional): whether to discard the existing cache and force a fresh download.
            Default is ``False``.
        skip_validation (bool, optional): if ``False``, torchhub will check that the ref
            specified by the ``github`` argument properly belongs to the repo owner. This will make
            requests to the GitHub API; you can specify a non-default GitHub token by setting the
            ``GITHUB_TOKEN`` environment variable. Default is ``False``.
        trust_repo (bool or str): ``"check"``, ``True`` or ``False``.
            This parameter was introduced in v1.12 and helps ensuring that users
            only run code from repos that they trust.

            - If ``False``, a prompt will ask the user whether the repo should
              be trusted.
            - If ``True``, the repo will be added to the trusted list and loaded
              without requiring explicit confirmation.
            - If ``"check"``, the repo will be checked against the list of
              trusted repos in the cache. If it is not present in that list, the
              behaviour will fall back onto the ``trust_repo=False`` option.

            Default is ``"check"``.
    Example:
        >>> # xdoctest: +REQUIRES(env:TORCH_DOCTEST_HUB)
        >>> print(torch.hub.help("pytorch/vision", "resnet18", force_reload=True))
    Tr  N)	rÝ   rP   rc   rL   r’   r  ra   r
  Ú__doc__)	rž   r  rÏ   rÑ   r¿   rÕ   r  r  Úentrys	            r   r=   r=     sn   € ôB $ØØØØØ'ô€Hô 
˜(Õ	#Ü—w‘w—|‘| H¬nÓ=ˆÜ#¤N°LÓAˆ
÷ 
$ô % Z°Ó7€Eà�=‰=Ð÷ 
$Ð	#ús   œ5A1Á1A:rž   )Úsourcer¿   rÏ   rÐ   rÑ   c                ó–   — |j                  «       }|dvrt        d|› d�«      ‚|dk(  rt        | ||||¬«      } t        | |g|¢­i |¤Ž}|S )a”  
    Load a model from a github repo or a local directory.

    Note: Loading a model is the typical use case, but this can also be used to
    for loading other objects such as tokenizers, loss functions, etc.

    If ``source`` is 'github', ``repo_or_dir`` is expected to be
    of the form ``repo_owner/repo_name[:ref]`` with an optional
    ref (a tag or a branch).

    If ``source`` is 'local', ``repo_or_dir`` is expected to be a
    path to a local directory.

    Args:
        repo_or_dir (str): If ``source`` is 'github',
            this should correspond to a github repo with format ``repo_owner/repo_name[:ref]`` with
            an optional ref (tag or branch), for example 'pytorch/vision:0.10'. If ``ref`` is not specified,
            the default branch is assumed to be ``main`` if it exists, and otherwise ``master``.
            If ``source`` is 'local'  then it should be a path to a local directory.
        model (str): the name of a callable (entrypoint) defined in the
            repo/dir's ``hubconf.py``.
        *args (optional): the corresponding args for callable ``model``.
        source (str, optional): 'github' or 'local'. Specifies how
            ``repo_or_dir`` is to be interpreted. Default is 'github'.
        trust_repo (bool or str): ``"check"``, ``True`` or ``False``.
            This parameter was introduced in v1.12 and helps ensuring that users
            only run code from repos that they trust.

            - If ``False``, a prompt will ask the user whether the repo should
              be trusted.
            - If ``True``, the repo will be added to the trusted list and loaded
              without requiring explicit confirmation.
            - If ``"check"``, the repo will be checked against the list of
              trusted repos in the cache. If it is not present in that list, the
              behaviour will fall back onto the ``trust_repo=False`` option.

            Default is ``"check"``.
        force_reload (bool, optional): whether to force a fresh download of
            the github repo unconditionally. Does not have any effect if
            ``source = 'local'``. Default is ``False``.
        verbose (bool, optional): If ``False``, mute messages about hitting
            local caches. Note that the message about first download cannot be
            muted. Does not have any effect if ``source = 'local'``.
            Default is ``True``.
        skip_validation (bool, optional): if ``False``, torchhub will check that the branch or commit
            specified by the ``github`` argument properly belongs to the repo owner. This will make
            requests to the GitHub API; you can specify a non-default GitHub token by setting the
            ``GITHUB_TOKEN`` environment variable. Default is ``False``.
        **kwargs (optional): the corresponding kwargs for callable ``model``.

    Returns:
        The output of the ``model`` callable when called with the given
        ``*args`` and ``**kwargs``.

    Example:
        >>> # xdoctest: +REQUIRES(env:TORCH_DOCTEST_HUB)
        >>> # from a github repo
        >>> repo = "pytorch/vision"
        >>> model = torch.hub.load(
        ...     repo, "resnet50", weights="ResNet50_Weights.IMAGENET1K_V1"
        ... )
        >>> # from a local directory
        >>> path = "/some/local/path/pytorch/vision"
        >>> # xdoctest: +SKIP
        >>> model = torch.hub.load(path, "resnet50", weights="ResNet50_Weights.DEFAULT")
    )rž   ÚlocalzUnknown source: "z&". Allowed values: "github" | "local".rž   r  )ró   ru   rÝ   Ú_load_local)	Úrepo_or_dirr  r  r¿   rÏ   rÐ   rÑ   r   r   s	            r   r?   r?   @  ss   € ðZ �\‰\‹^€FàÐ(Ñ(ÜØ ˜xÐ'MÐNó
ð 	
ð �ÒÜ*ØØØØØ+ô
ˆô ˜ UÐ<¨TÒ<°VÑ<€EØ€Lr   c                 óØ   — t        | «      5  t        j                  j                  | t        «      }t        t        |«      }t        ||«      } ||i |¤Ž}ddd«       |S # 1 sw Y   |S xY w)a  
    Load a model from a local directory with a ``hubconf.py``.

    Args:
        hubconf_dir (str): path to a local directory that contains a
            ``hubconf.py``.
        model (str): name of an entrypoint defined in the directory's
            ``hubconf.py``.
        *args (optional): the corresponding args for callable ``model``.
        **kwargs (optional): the corresponding kwargs for callable ``model``.

    Returns:
        a single model with corresponding pretrained weights.

    Example:
        >>> # xdoctest: +SKIP("stub local path")
        >>> path = "/some/local/path/pytorch/vision"
        >>> model = _load_local(
        ...     path,
        ...     "resnet50",
        ...     weights="ResNet50_Weights.IMAGENET1K_V1",
        ... )
    N)rP   rc   rL   r’   r  ra   r
  )Úhubconf_dirr  r   r   r  r  r  s          r   r  r  ¡  s`   € ô0 
˜+Õ	&Ü—w‘w—|‘| K´Ó@ˆÜ#¤N°LÓAˆ
ä(¨°UÓ;ˆÙ�tÐ&˜vÑ&ˆ÷ 
'ð €L÷ 
'ð €Lús   ŒA	AÁA)r¨   ÚdstÚhash_prefixrÃ   c                 óÜ  — t         j                  j                  |«      }t        t        j
                  «      D ]7  }|dz   t        j                  «       j                  z   dz   }	 t        |d«      } n t        t        j                  d«      ‚t        | ddi¬«      }	 t        |«      5 }|j                  «       }	t!        |	d«      r|	j#                  d	«      }
n|	j%                  d	«      }
d
}|
�t'        |
«      dkD  rt)        |
d   «      }|�t+        j,                  «       nd
}t/        || ddd¬«      5 }	 |j1                  t2        «      }t'        |«      dk(  rn?|j5                  |«       |�|j7                  |«       |j7                  t'        |«      «       Œc	 d
d
d
«       |j9                  «        |�5|�3|j;                  «       }|d
t'        |«       |k7  rt=        d|› d|› d�«      ‚d
d
d
«       t?        j@                  |jB                  |«       |j9                  «        t         j                  jE                  |jB                  «      r t        jF                  |jB                  «       y
y
# t        $ r Y �Œ;w xY w# 1 sw Y   ŒâxY w# 1 sw Y   ŒŸxY w# |j9                  «        t         j                  jE                  |jB                  «      r t        jF                  |jB                  «       w w xY w)aå  Download object at the given URL to a local path.

    Args:
        url (str): URL of the object to download
        dst (str): Full path where object will be saved, e.g. ``/tmp/temporary_file``
        hash_prefix (str, optional): If not None, the SHA256 downloaded file should start with ``hash_prefix``.
            Default: None
        progress (bool, optional): whether or not to display a progress bar to stderr
            Default: True

    Example:
        >>> # xdoctest: +REQUIRES(env:TORCH_DOCTEST_HUB)
        >>> # xdoctest: +REQUIRES(POSIX)
        >>> torch.hub.download_url_to_file(
        ...     "https://s3.amazonaws.com/pytorch/models/resnet18-5c106cde.pth",
        ...     "/tmp/temporary_file",
        ... )

    rê   z.partialzw+bz#No usable temporary file name foundz
User-Agentz	torch.hubr®   Ú
getheaderszContent-LengthNr   ÚBTi   )r   r   r   Ú
unit_scaleÚunit_divisorzinvalid hash value (expected "z", got "z"))$rc   rL   r�   ÚrangeÚtempfileÚTMP_MAXÚuuidÚuuid4Úhexrí   ÚFileExistsErrorÚerrnoÚEEXISTr	   r
   ÚinfoÚhasattrr%  Úget_allrv   ÚintÚhashlibÚsha256r:   r¤   ÚREAD_DATA_CHUNKr    r#   r/   Ú	hexdigestr�   rf   rÎ   r]   rd   rN   )r¨   r"  r#  rÃ   rš   Útmp_dstr  ÚreqÚuÚmetaÚcontent_lengthÚ	file_sizer7  ÚpbarÚbufferÚdigests                   r   r;   r;   Ã  s~  € ô< �'‰'×
Ñ
˜SÓ
!€CÜ”8×#Ñ#Ö$ˆØ˜‘)œdŸj™j›l×.Ñ.Ñ.°Ñ;ˆð	Ü�W˜eÓ$ˆAñ 	ð %ô œeŸl™lÐ,QÓRÐRÜ
�# ¨kÐ:Ô
;€Cð'Ü�SŒ\˜QØ—6‘6“8ˆDÜ�t˜\Ô*Ø!%§¡Ð1AÓ!B‘à!%§¡Ð.>Ó!?�ØˆIØÐ)¬c°.Ó.AÀAÒ.EÜ ¨qÑ 1Ó2�	à)4Ð)@”W—^‘^Ô%ÀdˆFÜØØ$˜ØØØ!õð ØØŸV™V¤OÓ4�FÜ˜6“{ aÒ'ØØ—G‘G˜F”OØÐ)ØŸ™ fÔ-Ø—K‘K¤ F£Ô,ð ð ÷ð  �G‰GŒIØÐ! kÐ&=Ø×)Ñ)Ó+�ØÐ,œC Ó,Ð-°Ò<Ü&Ø8¸¸ÀXÈfÈXÐUWÐXóð ÷? ôD 	�‰�A—F‘F˜CÔ à	�‰Œ	Ü�7‰7�>‰>˜!Ÿ&™&Ô!Ü�I‰I�a—f‘fÕð "øôY ò 	Úð	ú÷$ð ú÷ ˆ\ûðH 	
�‰Œ	Ü�7‰7�>‰>˜!Ÿ&™&Ô!Ü�I‰I�a—f‘fÕð "úsR   Á$I(ÂJ Â(B	JÄ1A%I8ÆAJÇ&(J É(	I5É4I5É8J	É=JÊJÊ	J ÊAK+rs   c                 óê   — t        j                  | «      rRt        j                  | «      5 }|j                  «       }d d d «       t	        «      dk(  xr |d   j                  «        S y# 1 sw Y   Œ.xY w)Nrn   r   F)rÌ   Ú
is_zipfilerÍ   rq   rv   Úis_dir)rs   Úzfrq   s      r   Ú_is_legacy_zip_formatrG    s^   € Ü×Ñ˜(Ô#Ü�_‰_˜XÔ&¨"Ø—{‘{“}ˆH÷ 'ä�8‹} Ñ!Ò>¨(°1©+×*<Ñ*<Ó*>Ð&>Ð>Ø÷ 'Ð&ús   «A)Á)A2zºFalling back to the old format < 1.6. This support will be deprecated in favor of default zipfile format introduced in 1.6. Please redo torch.save() to save it in the new zipfile format.)ÚcategoryÚ	model_dirÚmap_locationÚweights_onlyc                 óN  — t        j                  | «      5 }|j                  «       }t        |«      dk7  rt	        d«      ‚t        ||«       |d   j                  }t        j                  j                  ||«      }d d d «       t        j                  ||¬«      S # 1 sw Y   Œ!xY w)Nrn   z0Only one file(not dir) is allowed in the zipfiler   ©rJ  rK  )rÌ   rÍ   rq   rv   r�   r�   rs   rc   rL   r’   rŽ   r?   )rs   rI  rJ  rK  r  ÚmembersÚextraced_nameÚextracted_files           r   Ú_legacy_zip_loadrQ  !  sŠ   € ô 
�‰˜Ô	" aØ—*‘*“,ˆÜˆw‹<˜1ÒÜÐQÓRÐRä˜!˜YÔ'Ø ™
×+Ñ+ˆÜŸ™Ÿ™ i°Ó?ˆ÷ 
#ô �:‰:Ø \Àôð ÷ 
#Ð	"ús   –A%BÂB$Ú
check_hashÚ	file_namec                 óö  — t        j                  d«      rt        j                  dd¬«       |€*t	        «       }t         j
                  j                  |d«      }t        j                  |d¬«       t        | «      }t         j
                  j                  |j
                  «      }	|�|}	t         j
                  j                  ||	«      }
t         j
                  j                  |
«      sct        j                  j                  d	| › d
|
› d�«       d}|r*t        j                  |	«      }|r|j!                  d«      nd}t#        | |
||¬«       t%        |
«      rt'        |
|||«      S t)        j*                  |
||¬«      S )aq  Loads the Torch serialized object at the given URL.

    If downloaded file is a zip file, it will be automatically
    decompressed.

    If the object is already present in `model_dir`, it's deserialized and
    returned.
    The default value of ``model_dir`` is ``<hub_dir>/checkpoints`` where
    ``hub_dir`` is the directory returned by :func:`~torch.hub.get_dir`.

    Args:
        url (str): URL of the object to download
        model_dir (str, optional): directory in which to save the object
        map_location (optional): a function or a dict specifying how to remap storage locations (see torch.load)
        progress (bool, optional): whether or not to display a progress bar to stderr.
            Default: True
        check_hash(bool, optional): If True, the filename part of the URL should follow the naming convention
            ``filename-<sha256>.ext`` where ``<sha256>`` is the first eight or more
            digits of the SHA256 hash of the contents of the file. The hash is used to
            ensure unique names and to verify the contents of the file.
            Default: False
        file_name (str, optional): name for the downloaded file. Filename from ``url`` will be used if not set.
        weights_only(bool, optional): If True, only weights will be loaded and no complex pickled objects.
            Recommended for untrusted sources. See :func:`~torch.load` for more details.

    Example:
        >>> # xdoctest: +REQUIRES(env:TORCH_DOCTEST_HUB)
        >>> state_dict = torch.hub.load_state_dict_from_url(
        ...     "https://s3.amazonaws.com/pytorch/models/resnet18-5c106cde.pth"
        ... )

    ÚTORCH_MODEL_ZOOz@TORCH_MODEL_ZOO is deprecated, please use env TORCH_HOME insteadrm   rÄ   NÚcheckpointsTr½   rÀ   rÁ   r*   rn   rÂ   rM  )rc   r�   rÊ   rË   r<   rL   r’   rÆ   r   Úbasenamerd   r   rÉ   r    Ú
HASH_REGEXÚsearchÚgroupr;   rG  rQ  rŽ   r?   )r¨   rI  rJ  rÃ   rR  rS  rK  rÒ   Úpartsrs   r×   r#  r©   s                r   r@   r@   =  s)  € ôT 
‡y�yÐ"Ô#Ü�‰ØNØõ	
ð
 ÐÜ“)ˆÜ—G‘G—L‘L ¨-Ó8ˆ	ä‡K�K�	 DÕ)ä�S‹M€EÜ�w‰w×Ñ §
¡
Ó+€HØÐØˆÜ—'‘'—,‘,˜y¨(Ó3€KÜ�7‰7�>‰>˜+Ô&Ü�
‰
×Ñ˜>¨#¨¨e°K°=ÀÐCÔDØˆÙÜ×!Ñ! (Ó+ˆAÙ()˜!Ÿ'™' !œ*¨tˆKÜ˜S +¨{ÀXÕNä˜[Ô)Ü ¨Y¸ÀlÓSÐSÜ�:‰:�k°È<ÔXÐXr   )TF)FFrå   T)FFrå   r-   )NNTFNF)MÚ
contextlibr0  r6  r´   rc   rx   rf   r   r*  r,  rÊ   rÌ   Úpathlibr   Útypingr   Útyping_extensionsr   Úurllib.errorr   r   Úurllib.parser   Úurllib.requestr	   r
   rŽ   Útorch.serializationr   r   r:   ÚImportErrorÚ__all__ÚcompilerX  rz   rñ   r³   r‘   r“   r”   r   r  r8  rJ   r  Ú__annotations__ÚcontextmanagerrP   ra   rh   r�   r‡   rŒ   r–   r¢   rª   r»   rÝ   rÈ   rþ   r  r
  r<   ÚPathLikerA   r>   r=   r?   r  Úboolr;   rG  ÚFutureWarningÚdictrQ  r@   r&   r   r   Ú<module>rm     sà  ðä Û Û Û Û 	Û 	Û Û 
Û Û Û Û Ý Ý Ý (ß ,Ý !ß +ã Ý ,÷#ñ #ðLÝò€ð ˆR�Z‰ZÐ)Ó*€
Ø�B—J‘J˜xÓ(Ð ðÐ ð "Ð Ø€Ø%Ð ØÐ Ø€Ø€Ø€Ø€ˆ#�‰*Ó ð ×Ññó ðòò ò'-òTHò
&òò &òFGò
ðJ ØóPòf)*òX6òSòð$2�ó 2ð*%ˆs�R—[‘[Ñ ð % Tó %ð ØØØó@óF/ðl ØØØØô^òBðJ #Øñ	PØ	ðPà	ðPð �t‘ðPð ð	Pð
 
óPðl Cð ¨Dó ñ ðEð ô	ðØðàðð ðð ð	ð
 
ˆ#ˆsˆ(�^òóðð0 !Ø!%ØØØ ØñEYØ	ðEYà�T‰zðEYð ðEYð ð	EYð
 ðEYð �T‰zðEYð ðEYð 
ˆ#ˆsˆ(�^ôEYøðy ò ØƒDðús   Á/F ÆFÆF