ó
    .Vðió‡  ã                   ó&  • % S SK r S SKrS SKrS SKrS SKrS SKrS SKrS SKrS SKrS SK	r	S SK
r
S SKrS SKJr  S SKJr  S SKJr  S SKJrJr  S SKJr  S SKJrJr  S SKrS SKJr   " S	 S
5      r S SKJr  / SQr \RB                  " S5      r"Sr#Sr$Sr%Sr&Sr'Sr(Sr)Sr*Sq+\,S-  \-S'   \ R\                  S 5       r/S r0S r1S r2S r3S r4S r5S r6S r7  SAS" jr8 SBS# jr9S$ r:S% r;S& r<S'\,4S( jr=S)\,\R|                  -  S'S4S* jr?    SCS+ jr@SDS, jrAS-SS!S S!S..S/ jrBS0 rC  SES1\,S2\,S3\,S-  S4\DS'S4
S5 jjrES6\,S'\D4S7 jrF\" S8\GS99S6\,S:\,S;\S<\DS'\H\,\4   4
S= j5       rI      SFS1\,S:\,S-  S;\S4\DS>\DS?\,S-  S<\DS'\H\,\4   4S@ jjrJg! \ a    \r GNf = f)Gé    N)ÚPath)ÚAny)Ú
deprecated)Ú	HTTPErrorÚURLError)Úurlparse)ÚRequestÚurlopen)ÚMAP_LOCATIONc                   óB   • \ rS rSrSS jrS rS rS rS rS r	S	 r
S
rg)Ú	_Faketqdmé   Nc                 ó*   • Xl         X l        SU l        g ©Nr   )ÚtotalÚdisableÚn)Úselfr   r   ÚunitÚargsÚkwargss         ÚND:\a\ltx-desktop-ci\ltx-desktop-ci\python-embed\Lib\site-packages\torch\hub.pyÚ__init__Ú_Faketqdm.__init__   s   € ØŒ
ØŒØˆ�ó    c                 ó”  • U R                   (       a  g U =R                  U-  sl        U R                  c/  [        R                  R                  SU R                  S S35        OG[        R                  R                  SSU R                  -  [        U R                  5      -  S S35        [        R                  R                  5         g )NÚz.1fz byteséd   Ú%)r   r   r   ÚsysÚstderrÚwriteÚfloatÚflush)r   r   s     r   ÚupdateÚ_Faketqdm.update    sˆ   € Ø�<�<Øà�Š�!‰�Ø�:‰:ÑÜ�J‰J×Ñ˜r $§&¡&¨ ¨VÐ4Õ5ä�J‰J×Ñ˜r #¨¯©¡,´°t·z±zÓ1BÑ"BÀ3Ð!GÀqÐIÔJÜ�
‰
×ÑÕr   c                 ó   • g ©N© )r   r   r   s      r   Úset_descriptionÚ_Faketqdm.set_description,   s   € Ør   c                 óH   • [         R                  R                  U S35        g ©NÚ
)r    r!   r"   )r   Úss     r   r"   Ú_Faketqdm.write/   s   € Ü�
‰
×Ñ˜A˜3˜b˜Õ"r   c                 ó   • SU l         g ©NT)r   ©r   s    r   ÚcloseÚ_Faketqdm.close2   s	   € Øˆ�r   c                 ó   • U $ r(   r)   r3   s    r   Ú	__enter__Ú_Faketqdm.__enter__5   s   € Øˆr   c                 óf   • U R                   (       a  g [        R                  R                  S5        g r-   )r   r    r!   r"   )r   Úexc_typeÚexc_valÚexc_tbs       r   Ú__exit__Ú_Faketqdm.__exit__8   s   € Ø�<�<Øä�
‰
×Ñ˜Õr   )r   r   r   )NFN)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   r%   r*   r"   r4   r7   r=   Ú__static_attributes__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]*)\.)ÚfacebookresearchÚfacebookincubatorÚpytorchÚfairinternalÚGITHUB_TOKENÚ
TORCH_HOMEÚXDG_CACHE_HOMEz~/.cacheÚdependenciesz
hubconf.pyi   Ú_hub_dirc              #   óÜ   #   • [         R                  R                  SU 5         S v •  [         R                  R                  U 5        g ! [         R                  R                  U 5        f = f7fr   )r    ÚpathÚinsertÚremove©rV   s    r   Ú_add_to_sys_pathrZ   a   s?   é € ä‡H�H‡O�O�A�tÔðÛä�‰�‰˜ÕøŒ�‰�‰˜Õüs   ‚!A,¤A ¨ A,Á!A)Á)A,c                 ó   • SS K nSSKJn  UR                  R	                  X5      nUc   eUR                  R                  U5      n[        UR                  U5      (       d   eUR                  R                  U5        U$ )Nr   )ÚLoader)	Úimportlib.utilÚimportlib.abcr\   ÚutilÚspec_from_file_locationÚmodule_from_specÚ
isinstanceÚloaderÚexec_module)ÚnamerV   Ú	importlibr\   ÚspecÚmodules         r   Ú_import_moduleri   k   sj   € ÛÝ$à�>‰>×1Ñ1°$Ó=€DØÑÐÐØ�^‰^×,Ñ,¨TÓ2€FÜ�d—k‘k 6×*Ñ*Ð*Ð*Ø‡K�K×Ñ˜FÔ#Ø€Mr   c                 óð   • [         R                  R                  U 5      (       aR  [         R                  R                  U 5      (       a  [         R                  " U 5        g [
        R                  " U 5        g g r(   )ÚosrV   ÚexistsÚisfilerX   ÚshutilÚrmtreerY   s    r   Ú_remove_if_existsrp   w   sD   € Ü	‡w�w‡~�~�d×ÑÜ�7‰7�>‰>˜$×ÑÜ�IŠI�d�Oä�MŠM˜$Õð	 r   c                 ó   • SU  SU SU 3$ )Núhttps://github.com/Ú/z	/zipball/r)   )Ú
repo_ownerÚ	repo_nameÚrefs      r   Ú_git_archive_linkrw      s   € à   ¨A¨i¨[¸	À#ÀÐGÐGr   c                 ó8   • U[        U 5      ;  a  g [        X5      $ r(   )ÚdirÚgetattr)rh   Ú	func_names     r   Ú_load_attr_from_moduler|   „   s   € àœ˜F›Ó#ØÜ�6Ó%Ð%r   c                  óì   • [         R                  R                  [         R                  " [        [         R                  R                  [         R                  " [        [        5      S5      5      5      n U $ )NÚtorch)rk   rV   Ú
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                 ó  • SU ;   a  U R                  S5      u  pOU S p!UR                  S5      u  p4Uc   [        SU SU S35         SnS S S 5        X4U4$ ! , (       d  f       N= f! [         a  nUR                  S:X  a  Sn S nAN6e S nAf[         ai  nS H>  n[
        R                  R                  [        5        SU S	U S	U 35      (       d  M<  Un  O   Uc  [        S
[        5        S35      Ue S nAN¨S nAff = f)NÚ:rs   rr   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 (Ú))
Úsplitr
   r   Úcoder   rk   rV   rl   rF   ÚRuntimeError)ÚgithubÚ	repo_inforv   rt   ru   ÚeÚpossible_refs          r   Ú_parse_repo_infor”   •   s  € Ø
ˆfƒ}ØŸ™ cÓ*‰ˆ	�3à �3Ø%ŸO™O¨CÓ0Ñ€Jà
�{ð	ÜÐ.¨z¨l¸!¸I¸;ÀkÐRÕSØ�÷ Tð(  #Ð%Ð%÷) TÕSûäó 	Ø�v‰v˜‹}Ø•àûÜó 	ã 2�Ü—7‘7—>‘>Ü“y�k  : ,¨a°	¨{¸!¸L¸>ÐJ÷ó ð '�CÙñ !3ð ‰{Ü"ð=Ü=D»Y¸KÀqðJóð ðô ûð	úsM   µA' ÁAÁ
A' Á
A$Á A' Á$A' Á'
C?Á1B	ÂB	Â	C?Â:C:Ã!C:Ã:C?c                 ó¾   • [        U 5       nUR                  5       R                  UR                  R	                  S5      5      sS S S 5        $ ! , (       d  f       g = f)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                 ó  • SS0n[         R                  R                  [        5      nUb  SU 3US'   SU  SU S3SU  SU S34 Hs  nS	n US
-  nU SU 3n [        R
                  " [        [        XsS95      5      nU(       d  MB  U H+  n	U	S   U:X  d  U	S   S   R                  U5      (       d  M*      g    Mo     [        SU SU  SU S35      e! [         a,    US	 [        R
                  " [        [        XsS95      5      n Nˆf = f)NÚAcceptzapplication/vnd.github.v3+jsonztoken ÚAuthorizationzhttps://api.github.com/repos/rs   z	/branchesz/tagsr   é   z?per_page=100&page=©r˜   re   Ú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.)rk   ÚenvironÚgetÚENV_GITHUB_TOKENÚjsonÚloadsrœ   r	   r   Ú
startswithÚ
ValueError)
rt   ru   rv   r˜   ÚtokenÚ
url_prefixÚpagerš   ÚresponseÚbrs
             r   Ú_validate_not_a_forked_repor°   ½   sK  € àÐ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´¸Ñ0MÓ&NÓO�ö ÙÛ�Ø�f‘: Ó$¨¨8©°UÑ(;×(FÑ(FÀs×(KÓ(KÚñ ñ ñô* Ø
�s�eÐ2°:°,¸aÀ	¸{ð Kað 	aóð øô ó Pà˜OÐ,ÜŸ:š:¤i´¸Ñ0MÓ&NÓO’ðPús   Á&CÃ3DÄDTFc                 óÜ  • [        5       n[        R                  " USS9  [        U 5      u  pxn	U	R	                  SS5      n
SR                  XxU
/5      n[        R                  R                  Xk5      n[        UUUUUS9  U(       + =(       a    [        R                  R                  U5      nU(       a,  U(       a#  [        R                  R                  SU S35        U$ U(       d  [        XxU	5        [        R                  R                  XjS-   5      n[        U5         [        XxU	5      n[        R                  R                  S	U S
U S35        [!        XþSS9  [*        R,                  " U5       nUR/                  5       S   R0                  n[        R                  R                  UU5      n[        U5        UR3                  U5        S S S 5        [        U5        [        U5        [4        R6                  " WU5        U$ ! ["         aM  nUR$                  S:X  a7  [&        R(                  " SU	 S3SS9  SU	 3n[        XxUS9n[!        XþSS9   S nANøe S nAff = f! , (       d  f       N—= f)NT©Úexist_okrs   r‹   )Ú
trust_repoÚ
calling_fnz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.é   ©Ú
stacklevelzrefs/heads/)rv   r   )rF   rk   Úmakedirsr”   Úreplacer‚   rV   Ú_check_repo_is_trustedrl   r    r!   r"   r°   rp   rw   ÚstdoutrE   r   rŽ   ÚwarningsÚwarnÚzipfileÚZipFileÚinfolistÚfilenameÚ
extractallrn   Úmove)r�   Úforce_reloadr´   rµ   ÚverboseÚskip_validationÚhub_dirrt   ru   rv   Ú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×   Þ   s$  € ô ‹i€GÜ‡K‚K� $Ò'ä!1°&Ó!9Ñ€J˜3ð
 —K‘K  SÓ)€Mð
 Ÿ™ *¸Ð!GÓHÐÜ�w‰w�|‰|˜GÓ7€HäØØØØØòð "Ô!×?¤r§w¡w§~¡~°hÓ'?€IæÞÜ�J‰J×ÑÐ4°X°J¸bÐAÔBðZ €OöU Ü'¨
¸sÔCä—g‘g—l‘l 7¸FÑ,BÓCˆÜ˜+Ô&ð	Ü# J¸3Ó?ˆCÜ�J‰J×Ñ˜~¨c¨U°%¸°}ÀBÐGÔHÜ  ¸EÒBô, �_Š_˜[Ô)¨^Ø!/×!8Ñ!8Ó!:¸1Ñ!=×!FÑ!FÐÜŸW™WŸ\™\¨'Ð3EÓFˆNÜ˜nÔ-à×%Ñ% gÔ.÷ *ô 	˜+Ô&Ü˜(Ô#Ü�Š�N HÔ-à€OøôA ó 	Ø�x‰x˜3‹ô
 —’Ø˜s˜eð $dð dð  !òð .9¸¸Ð+>Ð(Ü'ØÐ/Gñ�ô % SÀ×Fàûð'	ú÷* *Õ)ús,   Ä <H Å2AIÈ
IÈAIÉIÉIÉ
I+c           	      ó®  • [        5       n[        R                  R                  US5      n[        R                  R	                  U5      (       d  [        U5      R                  5         [        U5       n[        S U 5       5      nS S S 5        [        [        R                  " U5      5      S   n	SR                  X/5      n
U
W;   =(       d    X);   =(       d	    U [        ;   nUc'  U(       d  [        R                  " SU SU SU S3S	S
9  g USL d  US:X  ak  U(       dd  [        SU
 S35      nUR                  5       S;   a  U(       a  [!        S5        O.UR                  5       S;   a  [#        S5      e[%        SU S35      eU(       d*  [        US5       nUR'                  U
S-   5        S S S 5        g g ! , (       d  f       GN5= f! , (       d  f       g = f)NÚtrusted_listc              3   ó@   #   • U  H  oR                  5       v •  M     g 7fr(   )Ústrip)Ú.0Úlines     r   Ú	<genexpr>Ú)_check_repo_is_trusted.<locals>.<genexpr>@  s   é € Ð<²t¨tŸj™jŸl˜l²tùs   ‚r    r‹   z³You are about to download and run code from an untrusted repository. In a future release, this won't be allowed. To add the repository to your trusted list, change the command to zj(..., trust_repo=False) and a command prompt will appear asking for an explicit confirmation of trust, or zi(..., trust_repo=True), which will assume that the prompt is to be answered with 'yes'. You can also use z“(..., trust_repo='check') which will only prompt for confirmation if the repo is not already trusted. This will eventually be the default behaviourrº   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.   )rF   rk   rV   r‚   rl   r   ÚtouchÚopenÚtupleÚnextÚwalkÚ_TRUSTED_REPO_OWNERSrÁ   rÂ   ÚinputÚlowerÚprintÚ	Exceptionrª   r"   )rt   ru   rÎ   r´   rµ   rÌ   ÚfilepathÚfileÚtrusted_reposÚtrusted_repos_legacyÚ
owner_nameÚ
is_trustedr®   s                r   r¿   r¿   3  s¾  € ô ‹i€GÜ�w‰w�|‰|˜G ^Ó4€Hä�7‰7�>‰>˜(×#Ñ#ÜˆX‹×ÑÔÜ	ˆhŒ˜4ÜÑ<±tÓ<Ó<ˆ÷ 
ô
  ¤§¢¨Ó 0Ó1°!Ñ4Ðà—‘˜:Ð1Ó2€Jà�mÑ#÷ 	.ØÑ4÷	.àÔ-Ñ-ð ð ÑÞÜ�MŠMðaØakÐ`lð mà �\ð "+Ø+5¨,ð 7qð	rð òð 	à�eÒ ¨wÓ!6¾zÜØ˜j˜\ð *ið ió
ˆð �>‰>Ó˜|Ó+ÞÜÐ:Ô;øØ�^‰^Ó Ó0ÜÐ3Ó4Ð4äÐ5°h°Z¸qÐAÓBÐBö Ü�(˜CÔ  DØ�J‰J�z DÑ(Ô)÷ !Ð ð ÷U 
Žú÷V !Õ ús   Á3F4ÆGÆ4
GÇ
Gc                 óD   • SS K nUR                  R                  U 5      S L$ r   )r]   r_   Ú	find_spec)re   rf   s     r   Ú_check_module_existsrù   n  s   € Ûà�>‰>×#Ñ# DÓ)°Ð5Ð5r   c                 óÆ   • [        U [        5      nUbI  U Vs/ s H  n[        U5      (       a  M  UPM     nnU(       a  [        SSR	                  U5       35      eg g s  snf )NzMissing dependencies: z, )r|   ÚVAR_DEPENDENCYrù   r�   r‚   )ÚmrS   ÚpkgÚmissing_depss       r   Ú_check_dependenciesrÿ   t  s^   € Ü)¨!¬^Ó<€LàÑÙ'3ÓU¢| Ô;OÐPS×;TŸ¡|ˆÐUÞÜÐ!7¸¿	¹	À,Ó8OÐ7PÐQÓRÐRð ð  ùÚUs
   ˜A°Ac                 ó¶   • [        U[        5      (       d  [        S5      e[        U 5        [	        X5      nUb  [        U5      (       d  [        SU S35      eU$ )Nz8Invalid input: model should be a string of function namezCannot find callable z in hubconf)rb   Ústrrª   rÿ   r|   Úcallabler�   )rü   ÚmodelÚfuncs      r   Ú_load_entry_from_hubconfr  }  sV   € Ü�eœS×!Ñ!ÜÐSÓTÐTô ˜Ôä! !Ó+€Dà�|œ8 DŸ>™>ÜÐ2°5°'¸ÐEÓFÐFà€Kr   Úreturnc                  óÌ   • [         R                  " S5      (       a  [        R                  " SSS9  [        b  [        $ [         R
                  R                  [        5       S5      $ )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 insteadrº   r»   Úhub)rk   r€   rÁ   rÂ   rT   rV   r‚   r†   r)   r   r   rF   rF   �  sJ   € ô 
‡y‚y�×ÑÜ�ŠØHÐUVò	
ô ÑÜˆÜ�7‰7�<‰<œÓ)¨5Ó1Ð1r   Údc                 óB   • [         R                  R                  U 5      qg)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)rk   rV   r   rT   )r
  s    r   rK   rK   ¤  s   € ô �w‰w×!Ñ! !Ó$�Hr   c           	      óz  • [        U UUSUUS9n[        U5         [        R                  R	                  U[
        5      n[        [
        U5      nSSS5        [        W5       Vs/ s H8  n[        [        Xx5      5      (       d  M  UR                  S5      (       a  M6  UPM:     n	nU	$ ! , (       d  f       N^= fs  snf )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, str or None): ``"check"``, ``True``, ``False`` or ``None``.
        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.
        - If ``None``: this will raise a warning, inviting the user to set
          ``trust_repo`` to either ``False``, ``True`` or ``"check"``. This
          is only present for backward compatibility and will be removed in
          v2.0.

        Default is ``None`` and will eventually change to ``"check"`` in v2.0.
    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)
rH   ©rÊ   rË   Nr‹   )r×   rZ   rk   rV   r‚   ÚMODULE_HUBCONFri   ry   r  rz   r©   )
r�   rÉ   rË   r´   rÊ   rÏ   Úhubconf_pathÚ
hub_moduleÚfÚentrypointss
             r   rH   rH   ¯  s©   € ôb $ØØØØØØ'ñ€Hô 
˜(Õ	#Ü—w‘w—|‘| H¬nÓ=ˆÜ#¤N°LÓAˆ
÷ 
$ô �Z”óâ ˆAÜ”G˜JÓ*×+ó 	
à45·L±LÀ×4E÷ 	
Ù ð ð ð Ð÷ 
$Õ	#üò
s   š5B'Á$B8ÂB8ÂB8Â'
B5c           	      ó   • [        U UUSSUS9n[        U5         [        R                  R	                  U[
        5      n[        [
        U5      nSSS5        [        WU5      nUR                  $ ! , (       d  f       N&= f)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, str or None): ``"check"``, ``True``, ``False`` or ``None``.
        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.
        - If ``None``: this will raise a warning, inviting the user to set
          ``trust_repo`` to either ``False``, ``True`` or ``"check"``. This
          is only present for backward compatibility and will be removed in
          v2.0.

        Default is ``None`` and will eventually change to ``"check"`` in v2.0.
Example:
    >>> # xdoctest: +REQUIRES(env:TORCH_DOCTEST_HUB)
    >>> print(torch.hub.help("pytorch/vision", "resnet18", force_reload=True))
rG   Tr  N)	r×   rZ   rk   rV   r‚   r  ri   r  Ú__doc__)	r�   r  rÉ   rË   r´   rÏ   r  r  Úentrys	            r   rG   rG   ÷  sq   € ôJ $ØØØØØØ'ñ€Hô 
˜(Õ	#Ü—w‘w—|‘| H¬nÓ=ˆÜ#¤N°LÓAˆ
÷ 
$ô % Z°Ó7€Eà�=‰=Ð÷ 
$Õ	#ús   š5A/Á/
A=r�   )Úsourcer´   rÉ   rÊ   rË   c          	      ó–   • UR                  5       nUS;  a  [        SU S35      eUS:X  a  [        U UUSUUS9n [        X/UQ70 UD6nU$ )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, str or None): ``"check"``, ``True``, ``False`` or ``None``.
        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.
        - If ``None``: this will raise a warning, inviting the user to set
          ``trust_repo`` to either ``False``, ``True`` or ``"check"``. This
          is only present for backward compatibility and will be removed in
          v2.0.

        Default is ``None`` and will eventually change to ``"check"`` in v2.0.
    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�   rI   r  )rî   rª   r×   Ú_load_local)	Úrepo_or_dirr  r  r´   rÉ   rÊ   rË   r   r   s	            r   rI   rI   .  st   € ðb �\‰\‹^€FàÐ(Ó(ÜØ ˜xÐ'MÐNó
ð 	
ð �ÓÜ*ØØØØØØ+ñ
ˆô ˜Ð<¨TÒ<°VÑ<€EØ€Lr   c                 óà   • [        U 5         [        R                  R                  U [        5      n[        [        U5      n[        XQ5      nU" U0 UD6nSSS5        U$ ! , (       d  f       U$ = f)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)rZ   rk   rV   r‚   r  ri   r  )Úhubconf_dirr  r   r   r  r  r  s          r   r  r  ”  sa   € ô0 
˜+Õ	&Ü—w‘w—|‘| K´Ó@ˆÜ#¤N°LÓAˆ
ä(¨Ó;ˆÙ�tÐ&˜vÑ&ˆ÷ 
'ð €L÷ 
'Ô	&ð €Lús   ŒAAÁ
A-rš   ÚdstÚhash_prefixr¹   c           	      ó*  • [         R                  R                  U5      n[        [        R
                  5       H8  nUS-   [        R                  " 5       R                  -   S-   n [        US5      n  O   [        [        R                  S5      e[        U SS0S9n [        U5       nUR                  5       n	[!        U	S5      (       a  U	R#                  S	5      n
OU	R%                  S	5      n
S
nU
b  ['        U
5      S:”  a  [)        U
S   5      nUb  [*        R,                  " 5       OS
n[/        UU(       + SSSS9 n UR1                  [2        5      n['        U5      S:X  a  OAUR5                  U5        Ub  UR7                  U5        UR7                  ['        U5      5        Mf  S
S
S
5        UR9                  5         Ub7  Ub4  UR;                  5       nUS
['        U5       U:w  a  [=        SU SU S35      eS
S
S
5        [>        R@                  " URB                  U5        UR9                  5         [         R                  RE                  URB                  5      (       a!  [         RF                  " URB                  5        g
g
! [         a     GMR  f = f! , (       d  f       Nó= f! , (       d  f       N²= f! UR9                  5         [         R                  RE                  URB                  5      (       a!  [         RF                  " URB                  5        f f = f)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"))$rk   rV   r   ÚrangeÚtempfileÚTMP_MAXÚuuidÚuuid4Úhexrè   ÚFileExistsErrorÚerrnoÚEEXISTr	   r
   ÚinfoÚhasattrr   Úget_allÚlenÚintÚhashlibÚsha256rD   r–   ÚREAD_DATA_CHUNKr"   r%   r4   Ú	hexdigestr�   rn   rÈ   re   rl   rX   )rš   r  r  r¹   r‹   Útmp_dstr  ÚreqÚuÚmetaÚcontent_lengthÚ	file_sizer3  ÚpbarÚbufferÚdigests                   r   rE   rE   ¶  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=ÂJ1 Â'BJ Ä:A(JÆ"AJ Ç4)J1 É=
JÊJÊ
J	ÊJ Ê 
J.Ê*J1 Ê1A!LrÆ   c                 ó  • [         R                  " U 5      (       a\  [         R                  " U 5       nUR                  5       nS S S 5        [	        W5      S:H  =(       a    US   R                  5       (       + $ g! , (       d  f       N<= f)Nr    r   F)rÃ   Ú
is_zipfilerÄ   rÅ   r0  Úis_dir)rÆ   ÚzfrÅ   s      r   Ú_is_legacy_zip_formatrC    sa   € Ü×Ò˜(×#Ñ#Ü�_Š_˜XÔ&¨"Ø—{‘{“}ˆH÷ 'ä�8‹} Ñ!×>¨(°1©+×*<Ñ*<Ó*>Ô&>Ð>Ø÷ 'Õ&ús   ²A9Á9
B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                 ó^  • [         R                  " U 5       nUR                  5       n[        U5      S:w  a  [	        S5      eUR                  U5        US   R                  n[        R                  R                  X5      nS S S 5        [        R                  " WX#S9$ ! , (       d  f       N#= f)Nr    z0Only one file(not dir) is allowed in the zipfiler   ©rF  rG  )rÃ   rÄ   rÅ   r0  r�   rÇ   rÆ   rk   rV   r‚   r~   rI   )rÆ   rE  rF  rG  r  ÚmembersÚextraced_nameÚextracted_files           r   Ú_legacy_zip_loadrM    sˆ   € ô 
�Š˜Ô	" aØ—*‘*“,ˆÜˆw‹<˜1ÓÜÐQÓRÐRØ	�‰�YÔØ ™
×+Ñ+ˆÜŸ™Ÿ™ iÓ?ˆ÷ 
#ô �:Š:Ø \ñð ÷ 
#Õ	"ús   —A*BÂ
B,Ú
check_hashÚ	file_namec                 ó  • [         R                  " S5      (       a  [        R                  " SSS9  Uc*  [	        5       n[         R
                  R                  US5      n[         R                  " USS9  [        U 5      n[         R
                  R                  UR
                  5      n	Ub  Un	[         R
                  R                  X5      n
[         R
                  R                  U
5      (       dh  [        R                  R                  S	U  S
U
 S35        SnU(       a/  [        R                  U	5      nU(       a  UR!                  S5      OSn[#        X
X³S9  [%        U
5      (       a  ['        X¡X&5      $ [(        R*                  " X¢US9$ )a	  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 insteadrº   r»   NÚcheckpointsTr²   r¶   r·   r.   r    r¸   rI  )rk   r€   rÁ   rÂ   rF   rV   r‚   r½   r   Úbasenamerl   r    rÀ   r"   Ú
HASH_REGEXÚsearchÚgrouprE   rC  rM  r~   rI   )rš   rE  rF  r¹   rN  rO  rG  rÌ   ÚpartsrÆ   rÑ   r  r›   s                r   rJ   rJ   /  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¨{ÒNä˜[×)Ñ)Ü ¸ÓSÐSÜ�:Š:�kÈ<ÑXÐXr   )TF)rI   )FFNT)FFNr2   )NNTFNF)KÚ
contextlibr+  r2  r§   rk   Úrern   r    r%  r'  rÁ   rÃ   Úpathlibr   Útypingr   Útyping_extensionsr   Úurllib.errorr   r   Úurllib.parser   Úurllib.requestr	   r
   r~   Útorch.serializationr   r   rD   ÚImportErrorÚ__all__ÚcompilerT  rì   r¦   r�   rƒ   r„   rû   r  r4  rT   r  Ú__annotations__ÚcontextmanagerrZ   ri   rp   rw   r|   r†   r”   rœ   r°   r×   r¿   rù   rÿ   r  rF   ÚPathLikerK   rH   rG   rI   r  ÚboolrE   rC  ÚFutureWarningÚdictrM  rJ   r)   r   r   Ú<module>rj     sÌ  ðä Û Û Û Û 	Û 	Û Û 
Û Û Û Û Ý Ý Ý (ß ,Ý !ß +ã Ý ,÷#ñ #ðLÝò€ð �ZŠZÐ)Ó*€
ðÐ ð "Ð Ø€Ø%Ð ØÐ Ø€Ø€Ø€Ø€ˆ#�‰*Ó ð ×Ññó ðò	ò òHò
&òò &òFGò
ðL ØôRðt ô8*òv6òSòð$2�ô 2ð*%ˆs�R—[‘[Ñ ð % Tô %ð ØØØôEôP4ðv ØØØØõcòLðJ #Øñ	PØ	ðPà	ðPð �t‘ðPð ð	Pð
 
õPðl Cð ¨Dô ñ ðEð ñ	ðØðàðð ðð ð	ð
 
ˆ#ˆsˆ(�^óóðð. !Ø!%ØØØ ØñEYØ	ðEYà�T‰zðEYð ðEYð ð	EYð
 ðEYð �T‰zðEYð ðEYð 
ˆ#ˆsˆ(�^öEYøð] ó ØƒDðús   Á/F ÆFÆF