Ë
    S^(hv  ã                   ó&  — d 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ZddlmZ ddlmZ ddlmZmZmZ ddlmZ ddlmZmZmZmZmZmZ  ej<                  e«      Z  ejB                  «       Z"d	„ Z#d
ee$ejJ                  f   ddfd„Z&dee$ejJ                  f   de'e$   fd„Z(dee$ejJ                  f   de'e$   fd„Z)dee$ejJ                  f   de'e$   fd„Z*dee$ejJ                  f   de'e$   fd„Z+ddœde$dee$ejJ                  f   de,de-fd„Z.	 	 	 	 	 	 	 	 	 d.dee$ejJ                  f   de$deee$ejJ                  f      de,dee,   dee/e$e$f      deee,e$f      dee$   d e,d!ee$   d"ee$   de$fd#„Z0	 	 	 	 	 	 	 	 	 d.d$e$dee$ejJ                  f   deee$ejJ                  f      de,dee,   dee/e$e$f      deee,e$f      dee$   d e,d!ee$   d%ee$   de-fd&„Z1d/d'ed(ee$ejJ                  f   d)ee/   de'e$   fd*„Z2d+„ Z3d,Z4d-„ Z5y)0z3Utilities to dynamically load objects from the Hub.é    N)ÚPath)Ú
ModuleType)ÚAnyÚOptionalÚUnion)Útry_to_load_from_cacheé   )ÚHF_MODULES_CACHEÚ TRANSFORMERS_DYNAMIC_MODULE_NAMEÚcached_fileÚextract_commit_hashÚis_offline_modeÚloggingc                  ó<  — t         t        j                  v ryt        j                  j                  t         «       t	        j
                  t         d¬«       t        t         «      dz  } | j                  «       s%| j                  «        t        j                  «        yy)z_
    Creates the cache directory for modules with an init, and adds it to the Python path.
    NT©Úexist_okú__init__.py)r
   ÚsysÚpathÚappendÚosÚmakedirsr   ÚexistsÚtouchÚ	importlibÚinvalidate_caches)Ú	init_paths    ú_/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/transformers/dynamic_module_utils.pyÚinit_hf_modulesr   0   sj   € ô
 œ3Ÿ8™8Ñ#Øä‡H�H‡O�OÔ$Ô%Ü‡K�KÔ ¨4Õ0ÜÔ%Ó&¨Ñ6€IØ×ÑÔØ�‰ÔÜ×#Ñ#Õ%ð ó    ÚnameÚreturnc                 óX  — t        «        t        t        «      | z  j                  «       }|j                  j                  «       st        |j                  «       t        j                  |d¬«       |dz  }|j                  «       s%|j                  «        t        j                  «        yy)z®
    Creates a dynamic module in the cache directory for modules.

    Args:
        name (`str` or `os.PathLike`):
            The name of the dynamic module to create.
    Tr   r   N)r   r   r
   ÚresolveÚparentr   Úcreate_dynamic_moduler   r   r   r   r   )r!   Údynamic_module_pathr   s      r   r&   r&   @   s‡   € ô ÔÜÔ 0Ó1°DÑ8×AÑAÓCÐà×%Ñ%×,Ñ,Ô.ÜÐ1×8Ñ8Ô9Ü‡K�KÐ#¨dÕ3Ø# mÑ3€IØ×ÑÔØ�‰Ôô 	×#Ñ#Õ%ð	 r    Úmodule_filec                 ó,  — t        | d¬«      5 }|j                  «       }ddd«       t        j                  dt        j                  ¬«      }|t        j                  d|t        j                  ¬«      z  }t        t        |«      «      S # 1 sw Y   ŒlxY w)zô
    Get the list of modules that are relatively imported in a module file.

    Args:
        module_file (`str` or `os.PathLike`): The module file to inspect.

    Returns:
        `list[str]`: The list of relative imports in the module.
    úutf-8©ÚencodingNz^\s*import\s+\.(\S+)\s*$)Úflagsz^\s*from\s+\.(\S+)\s+import)ÚopenÚreadÚreÚfindallÚ	MULTILINEÚlistÚset)r(   ÚfÚcontentÚrelative_importss       r   Úget_relative_importsr8   V   s{   € ô 
ˆk GÔ	,ð °Ø—&‘&“(ˆ÷ô —z‘zÐ"=¸wÌbÏlÉlÔ[ÐàœŸ
™
Ð#AÀ7ÔRT×R^ÑR^Ô_Ñ_Ðä”Ð$Ó%Ó&Ð&÷ð ús   ŽB
Â
Bc                 ól  — d}| g}g }|s›g }|D ]  }|j                  t        |«      «       Œ t        | «      j                  }|D �cg c]  }t	        ||z  «      ‘Œ }}|D �cg c]	  }||vsŒ|‘Œ }}|D �cg c]  }|› d�‘Œ	 }}t        |«      dk(  }|j                  |«       |sŒ›|S c c}w c c}w c c}w )aÛ  
    Get the list of all files that are needed for a given module. Note that this function recurses through the relative
    imports (if a imports b and b imports c, it will return module files for b and c).

    Args:
        module_file (`str` or `os.PathLike`): The module file to inspect.

    Returns:
        `list[str]`: The list of all relative imports a given module needs (recursively), which will give us the list
        of module files a given module needs.
    Fú.pyr   )Úextendr8   r   r%   ÚstrÚlen)	r(   Ú	no_changeÚfiles_to_checkÚall_relative_importsÚnew_importsr5   Úmodule_pathÚmÚnew_import_filess	            r   Úget_relative_import_filesrE   k   sÞ   € ð €IØ!�]€NØÐñ ØˆØò 	8ˆAØ×ÑÔ3°AÓ6Õ7ð	8ô ˜;Ó'×.Ñ.ˆØ:EÖF°QœC ¨a¡Õ0ÐFÐÐFØ'7ÖY !¸1ÐDXÒ;XšAÐYÐÐYØ-=Ö>¨˜Q˜C˜sš)Ð>ˆÐ>äÐ(Ó)¨QÑ.ˆ	Ø×#Ñ# NÔ3ò ð  Ðùò GùÚYùÚ>s   ÁB'Á!	B,Á+B,Á5B1Úfilenamec                 óÚ   ‡‡— t        | d¬«      5 }|j                  «       }ddd«       t        «       Šˆˆfd„Št        j                  «      } ‰|«       t        ‰«      S # 1 sw Y   ŒAxY w)a  
    Extracts all the libraries (not relative imports this time) that are imported in a file.

    Args:
        filename (`str` or `os.PathLike`): The module file to inspect.

    Returns:
        `list[str]`: The list of all packages required to use the input module.
    r*   r+   Nc                 ó  •— t        | t        j                  «      ry t        | t        j                  «      rj| j                  }t        j
                  |«      D ]E  }t        |t        j                  «      sŒt        |j                  dd«      j                  d«      sŒE y  nÄt        | t        j                  «      rD| j                  D ]4  }|j                  j                  d«      d   }|sŒ$‰j                  |«       Œ6 nft        | t        j                  «      rL| j                   dk(  r=| j"                  r1| j"                  j                  d«      d   }|r‰j                  |«       t        j$                  | «      D ]
  } ‰|«       Œ y )NÚidÚ Úis_flash_attnú.r   )Ú
isinstanceÚastÚTryÚIfÚtestÚwalkÚCallÚgetattrÚfuncÚ
startswithÚImportÚnamesr!   ÚsplitÚaddÚ
ImportFromÚlevelÚmoduleÚiter_child_nodes)ÚnoderQ   Úcondition_nodeÚaliasÚ
top_moduleÚchildÚimported_modulesÚrecursive_look_for_importss         €€r   re   z/get_imports.<locals>.recursive_look_for_importsš   s2  ø€ Ü�dœCŸG™GÔ$ØÜ˜œcŸf™fÔ%Ø—9‘9ˆDÜ"%§(¡(¨4£.ò �Ü˜n¬c¯h©hÕ7¼GÀN×DWÑDWÐY]Ð_aÓ<b×<mÑ<mØ#õ=ñ ñô ˜œcŸj™jÔ)àŸ™ò 5�Ø"ŸZ™Z×-Ñ-¨cÓ2°1Ñ5�
ÚØ$×(Ñ(¨Õ4ñ5ô ˜œcŸn™nÔ-à�z‰z˜QŠ 4§;¢;Ø!Ÿ[™[×.Ñ.¨sÓ3°AÑ6�
ÙØ$×(Ñ(¨Ô4ô ×)Ñ)¨$Ó/ò 	.ˆEÙ& uÕ-ñ	.r    )r.   r/   r4   rN   ÚparseÚsorted)rF   r5   r6   Útreerd   re   s       @@r   Úget_importsri   Œ   sc   ù€ ô 
ˆh Ô	)ð ¨QØ—&‘&“(ˆ÷ä“uÐõ.ô8 �9‰9�WÓ€DÙ˜tÔ$äÐ"Ó#Ð#÷Gð ús   �A!Á!A*c                 óŠ  — t        | «      }g }|D ]  }	 t        j                  |«       Œ t        |«      dkD  r0t        ddj                  |«      › dd	j                  |«      › d
�«      ‚t        | «      S # t        $ rE}t        j                  d|› d|› �«       dt        |«      v r|j                  |«       n‚ Y d}~Œ­d}~ww xY w)a.  
    Check if the current Python environment contains all the libraries that are imported in a file. Will raise if a
    library is missing.

    Args:
        filename (`str` or `os.PathLike`): The module file to check.

    Returns:
        `list[str]`: The list of relative imports in the file.
    z&Encountered exception while importing z: zNo module namedNr   z\This modeling file requires the following packages that were not found in your environment: z, z. Run `pip install ú ú`)ri   r   Úimport_moduleÚImportErrorÚloggerÚwarningr<   r   r=   Újoinr8   )rF   ÚimportsÚmissing_packagesÚimpÚ	exceptions        r   Úcheck_importsrv   ¼   sÞ   € ô ˜(Ó#€GØÐØò ˆð
	Ü×#Ñ# CÕ(ðô ÐÓ˜qÒ ÜØjØ�y‰yÐ)Ó*Ð+Ð+>¸s¿x¹xÐHXÓ?YÐ>ZÐZ[ð]ó
ð 	
ô
   Ó)Ð)øô! ò 	Ü�N‰NÐCÀCÀ5ÈÈ9È+ÐVÔWð !¤C¨	£NÑ2Ø ×'Ñ'¨Õ,àô -ûð	ús   ”A4Á4	CÁ=;B=Â=CF©Úforce_reloadÚ
class_namerB   rx   c          
      ó°  — t         j                  j                  |«      }|j                  d«      r|dd }|j	                  t         j                  j
                  d«      }t        t        «      |z  }t        5  |r4t        j                  j                  |d«       t        j                  «        t        j                  j                  |«      }t        j                  j!                  ||¬«      }|gt#        t%        t        t'        |«      «      «      z   }t)        j*                  dj-                  d„ |D «       «      «      j/                  «       }|€3t        j                  j1                  |«      }	|	t        j                  |<   n|}	t3        |	dd	«      |k7  r"|j4                  j7                  |	«       ||	_        t3        |	| «      cddd«       S # 1 sw Y   yxY w)
a  
    Import a module on the cache directory for modules and extract a class from it.

    Args:
        class_name (`str`): The name of the class to import.
        module_path (`str` or `os.PathLike`): The path to the module to import.
        force_reload (`bool`, *optional*, defaults to `False`):
            Whether to reload the dynamic module from file if it already exists in `sys.modules`.
            Otherwise, the module is only reloaded if the file has changed.

    Returns:
        `typing.Type`: The class looked for.
    r:   NéýÿÿÿrL   )Úlocationr    c              3   óT   K  — | ]   }t        |«      |j                  «       z   –— Œ" y ­w©N)ÚbytesÚ
read_bytes)Ú.0r5   s     r   ú	<genexpr>z&get_class_in_module.<locals>.<genexpr>   s    è ø€ Ò2cÐQR´5¸³8¸a¿l¹l»nÕ3LÑ2cùs   ‚&(Ú__transformers_module_hash__rJ   )r   r   ÚnormpathÚendswithÚreplaceÚsepr   r
   Ú_HF_REMOTE_CODE_LOCKr   ÚmodulesÚpopr   r   ÚgetÚutilÚspec_from_file_locationrg   ÚmaprE   ÚhashlibÚsha256rq   Ú	hexdigestÚmodule_from_specrT   ÚloaderÚexec_modulerƒ   )
ry   rB   rx   r!   r(   Úcached_moduleÚmodule_specÚmodule_filesÚmodule_hashr]   s
             r   Úget_class_in_moduler™   ß   sj  € ô& �7‰7×Ñ˜KÓ(€DØ‡}�}�UÔØ�C�RˆyˆØ�<‰<œŸ™Ÿ™ SÓ)€DÜÔ-Ó.°Ñ<€KÜ	ñ +ÙÜ�K‰K�O‰O˜D $Ô'Ü×'Ñ'Ô)Ü.1¯k©k¯o©o¸dÓ.CˆÜ—n‘n×<Ñ<¸TÈKÐ<ÓXˆð %0 =´6¼#¼dÔD]Ð^iÓDjÓ:kÓ3lÑ#lˆÜ"Ÿ>™>¨#¯(©(Ñ2cÐVbÔ2cÓ*cÓd×nÑnÓpˆð Ð Ü—^‘^×4Ñ4°[ÓAˆFà &ŒC�K‰K˜Òà"ˆFä�6Ð9¸2Ó>À+ÒMØ×Ñ×*Ñ*¨6Ô2Ø2=ˆFÔ/Ü�v˜zÓ*÷-+÷ +ò +ús   Á8E
GÇGÚpretrained_model_name_or_pathÚ	cache_dirÚforce_downloadÚresume_downloadÚproxiesÚtokenÚrevisionÚlocal_files_onlyÚ	repo_typeÚ_commit_hashc                 óÖ  — |j                  dd«      }|�)t        j                  dt        «       |�t	        d«      ‚|}t        «       r|st        j                  d«       d}t        | «      } t        j                  j                  | «      }|r t        j                  j                  | «      }n:| j                  dt        j                  j                  «      }t        | |||
|	¬«      }g }	 t!        | |||||||||	|
¬	«      }|s|k7  r|j#                  |«       t)        |«      }t*        t        j                  j                  z   |z   }t-        |«       t/        t0        «      |z  }|t        j                  j                  | «      k(  rò||z  j3                  «       r"t5        j6                  |t        ||z  «      «      s-t9        j:                  |||z  «       t=        j>                  «        |D ]Š  }|› d�}t        j                  jA                  | |«      }||z  j3                  «       r#t5        j6                  |t        ||z  «      «      rŒ^t9        j:                  |||z  «       t=        j>                  «        ŒŒ nÆtC        ||
«      }||z  }|t        j                  j                  z   |z   }t-        |«       ||z  j3                  «       s-t9        j:                  |||z  «       t=        j>                  «        |D ]E  }||› d�z  j3                  «       rŒtE        | |› d�||||||||¬«
       |j#                  |› d�«       ŒG tG        |«      dkD  rP|€NdjA                  |D �cg c]  }d|› �‘Œ	 c}«      }|	€dn|	› d�}d|› | › �}t        jI                  d|› d|› d�«       t        j                  jA                  ||«      S # t$        $ r t        j'                  d
|› d| › d�«       ‚ w xY wc c}w )aÎ	  
    Prepares Downloads a module from a local folder or a distant repo and returns its path inside the cached
    Transformers module.

    Args:
        pretrained_model_name_or_path (`str` or `os.PathLike`):
            This can be either:

            - a string, the *model id* of a pretrained model configuration hosted inside a model repo on
              huggingface.co.
            - a path to a *directory* containing a configuration file saved using the
              [`~PreTrainedTokenizer.save_pretrained`] method, e.g., `./my_model_directory/`.

        module_file (`str`):
            The name of the module file containing the class to look for.
        cache_dir (`str` or `os.PathLike`, *optional*):
            Path to a directory in which a downloaded pretrained model configuration should be cached if the standard
            cache should not be used.
        force_download (`bool`, *optional*, defaults to `False`):
            Whether or not to force to (re-)download the configuration files and override the cached versions if they
            exist.
        resume_download:
            Deprecated and ignored. All downloads are now resumed by default when possible.
            Will be removed in v5 of Transformers.
        proxies (`Dict[str, str]`, *optional*):
            A dictionary of proxy servers to use by protocol or endpoint, e.g., `{'http': 'foo.bar:3128',
            'http://hostname': 'foo.bar:4012'}.` The proxies are used on each request.
        token (`str` or *bool*, *optional*):
            The token to use as HTTP bearer authorization for remote files. If `True`, will use the token generated
            when running `huggingface-cli login` (stored in `~/.huggingface`).
        revision (`str`, *optional*, defaults to `"main"`):
            The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
            git-based system for storing models and other artifacts on huggingface.co, so `revision` can be any
            identifier allowed by git.
        local_files_only (`bool`, *optional*, defaults to `False`):
            If `True`, will only try to load the tokenizer configuration from local files.
        repo_type (`str`, *optional*):
            Specify the repo type (useful when downloading from a space for instance).

    <Tip>

    Passing `token=True` is required when you want to use a private model.

    </Tip>

    Returns:
        `str`: The path to the module inside the cache.
    Úuse_auth_tokenNúrThe `use_auth_token` argument is deprecated and will be removed in v5 of Transformers. Please use `token` instead.úV`token` and `use_auth_token` are both specified. Please set only the argument `token`.z+Offline mode: forcing local_files_only=TrueTú/)r›   r    r¢   )	r›   rœ   rž   r�   r¡   rŸ   r    r¢   r£   zCould not locate the z inside rL   r:   )r›   rœ   r�   rž   rŸ   r    r¡   r£   r   ú
z- rJ   zs/zhttps://huggingface.co/z9A new version of the following files was downloaded from z:
z–
. Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.)%rŠ   ÚwarningsÚwarnÚFutureWarningÚ
ValueErrorr   ro   Úinfor<   r   r   ÚisdirÚbasenamer†   r‡   r   r   r   ÚOSErrorÚerrorrv   r   r&   r   r
   r   ÚfilecmpÚcmpÚshutilÚcopyr   r   rq   r   Úget_cached_module_filer=   rp   )rš   r(   r›   rœ   r�   rž   rŸ   r    r¡   r¢   r£   Údeprecated_kwargsr¥   Úis_localÚ	submoduler•   Ú	new_filesÚresolved_module_fileÚmodules_neededÚfull_submoduleÚsubmodule_pathÚmodule_neededÚmodule_needed_fileÚcommit_hashr5   Úrepo_type_strÚurls                              r   r·   r·     sì  € ð| '×*Ñ*Ð+;¸TÓB€NØÐ!Ü�‰ð AÜô	
ð ÐÜÐuÓvÐvØˆäÔÑ!1Ü�‰ÐAÔBØÐô %(Ð(EÓ$FÐ!Ü�w‰w�}‰}Ð:Ó;€HÙÜ—G‘G×$Ñ$Ð%BÓC‰	à1×9Ñ9¸#¼r¿w¹w¿{¹{ÓKˆ	Ü.Ø)¨;À)ÐVbÐnwô
ˆð €Iðä*Ø)ØØØ)ØØ+Ø-ØØØØ%ô 
Ðñ ˜MÐ-AÒAØ×Ñ˜[Ô)ô #Ð#7Ó8€Nô 6¼¿¹¿¹ÑCÀiÑO€NÜ˜.Ô)ÜÔ*Ó+¨nÑ<€NØ”B—G‘G×$Ñ$Ð%BÓCÒCð  Ñ,×4Ñ4Ô6¼g¿k¹kØ ¤# n°{Ñ&BÓ"Cô?
ô �K‰KÐ,¨n¸{Ñ.JÔKÜ×'Ñ'Ô)Ø+ò 	.ˆMØ,˜o¨SÐ1ˆMÜ!#§¡§¡Ð.KÈ]Ó![ÐØ" ]Ñ2×:Ñ:Ô<ÄGÇKÁKØ"¤C¨¸Ñ(FÓ$GõEô —‘Ð.°ÀÑ0NÔOÜ×+Ñ+Õ-ñ	.ô *Ð*>ÀÓMˆð (¨+Ñ5ˆØ'¬"¯'©'¯+©+Ñ5¸ÑCˆÜ˜nÔ-à Ñ,×4Ñ4Ô6Ü�K‰KÐ,¨n¸{Ñ.JÔKÜ×'Ñ'Ô)à+ò 	8ˆMØ"¨ °cÐ%:Ñ:×BÑBÕDÜ&Ø1Ø$�o SÐ)Ø'Ø#1Ø$3Ø#ØØ%Ø%5Ø!,õð × Ñ  M ?°#Ð!6Õ7ð	8ô  ˆ9ƒ~˜Ò˜hÐ.Ø—I‘I°Ö;¨A  A 3šxÒ;Ó<ˆ	Ø'Ð/™¸	°{À"Ð5EˆØ'¨ Ð7TÐ6UÐVˆÜ�‰ØGÈÀuÈCÐPYÈ{ðAðAô	
ô �7‰7�<‰<˜¨Ó4Ð4øôG ò Ü�‰Ð,¨[¨M¸ÐB_ÐA`Ð`aÐbÔcØðüòt <s   Ã*.N< ÍO&Î<'O#Úclass_referenceÚcode_revisionc                 ó8  — |j                  dd«      }|�)t        j                  dt        «       |�t	        d«      ‚|}d| v r| j                  d«      \  }} n|}| j                  d«      \  }}|
€||k(  r|}
t        ||dz   ||||||
||	¬«
      }t        |||¬	«      S )
a>  
    Extracts a class from a module file, present in the local folder or repository of a model.

    <Tip warning={true}>

    Calling this function will execute the code in the module file found locally or downloaded from the Hub. It should
    therefore only be called on trusted repos.

    </Tip>



    Args:
        class_reference (`str`):
            The full name of the class to load, including its module and optionally its repo.
        pretrained_model_name_or_path (`str` or `os.PathLike`):
            This can be either:

            - a string, the *model id* of a pretrained model configuration hosted inside a model repo on
              huggingface.co.
            - a path to a *directory* containing a configuration file saved using the
              [`~PreTrainedTokenizer.save_pretrained`] method, e.g., `./my_model_directory/`.

            This is used when `class_reference` does not specify another repo.
        module_file (`str`):
            The name of the module file containing the class to look for.
        class_name (`str`):
            The name of the class to import in the module.
        cache_dir (`str` or `os.PathLike`, *optional*):
            Path to a directory in which a downloaded pretrained model configuration should be cached if the standard
            cache should not be used.
        force_download (`bool`, *optional*, defaults to `False`):
            Whether or not to force to (re-)download the configuration files and override the cached versions if they
            exist.
        resume_download:
            Deprecated and ignored. All downloads are now resumed by default when possible.
            Will be removed in v5 of Transformers.
        proxies (`Dict[str, str]`, *optional*):
            A dictionary of proxy servers to use by protocol or endpoint, e.g., `{'http': 'foo.bar:3128',
            'http://hostname': 'foo.bar:4012'}.` The proxies are used on each request.
        token (`str` or `bool`, *optional*):
            The token to use as HTTP bearer authorization for remote files. If `True`, will use the token generated
            when running `huggingface-cli login` (stored in `~/.huggingface`).
        revision (`str`, *optional*, defaults to `"main"`):
            The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
            git-based system for storing models and other artifacts on huggingface.co, so `revision` can be any
            identifier allowed by git.
        local_files_only (`bool`, *optional*, defaults to `False`):
            If `True`, will only try to load the tokenizer configuration from local files.
        repo_type (`str`, *optional*):
            Specify the repo type (useful when downloading from a space for instance).
        code_revision (`str`, *optional*, defaults to `"main"`):
            The specific revision to use for the code on the Hub, if the code leaves in a different repository than the
            rest of the model. It can be a branch name, a tag name, or a commit id, since we use a git-based system for
            storing models and other artifacts on huggingface.co, so `revision` can be any identifier allowed by git.

    <Tip>

    Passing `token=True` is required when you want to use a private model.

    </Tip>

    Returns:
        `typing.Type`: The class, dynamically imported from the module.

    Examples:

    ```python
    # Download module `modeling.py` from huggingface.co and cache then extract the class `MyBertModel` from this
    # module.
    cls = get_class_from_dynamic_module("modeling.MyBertModel", "sgugger/my-bert-model")

    # Download module `modeling.py` from a given repo and cache then extract the class `MyBertModel` from this
    # module.
    cls = get_class_from_dynamic_module("sgugger/my-bert-model--modeling.MyBertModel", "sgugger/another-bert-model")
    ```r¥   Nr¦   r§   z--rL   r:   )r›   rœ   r�   rž   rŸ   r    r¡   r¢   rw   )rŠ   rª   r«   r¬   r­   rY   r·   r™   )rÅ   rš   r›   rœ   r�   rž   rŸ   r    r¡   r¢   rÆ   Úkwargsr¥   Úrepo_idr(   ry   Úfinal_modules                    r   Úget_class_from_dynamic_modulerË   À  sÔ   € ðt —Z‘ZÐ 0°$Ó7€NØÐ!Ü�‰ð AÜô	
ð ÐÜÐuÓvÐvØˆð ˆÑØ#2×#8Ñ#8¸Ó#>Ñ ˆ‘à/ˆØ-×3Ñ3°CÓ8Ñ€K�àÐÐ!>À'Ò!IØ ˆä)ØØ�eÑØØ%Ø'ØØØØ)Øô€Lô ˜z¨<ÀnÔUÐUr    ÚobjÚfolderÚconfigc                 ó\  ‡ — ‰ j                   dk(  rt        j                  d‰ › d|› d�«       yˆ fd„}t        |t        t
        f«      r|D ]
  } ||«       Œ n
|� ||«       g }t        j                  ‰ j                      j                  }t        |«      t        |«      j                  z  }t        j                  ||«       |j                  |«       t        |«      D ]J  }t        |«      t        |«      j                  z  }t        j                  ||«       |j                  |«       ŒL |S )a  
    Save the modeling files corresponding to a custom model/configuration/tokenizer etc. in a given folder. Optionally
    adds the proper fields in a config.

    Args:
        obj (`Any`): The object for which to save the module files.
        folder (`str` or `os.PathLike`): The folder where to save.
        config (`PretrainedConfig` or dictionary, `optional`):
            A config in which to register the auto_map corresponding to this custom object.

    Returns:
        `List[str]`: The list of files saved.
    Ú__main__z We can't save the code defining z in z¢ as it's been defined in __main__. You should put this code in a separate module so we can include it in the saved folder and make it easier to share via the Hub.Nc                 óÖ  •— ‰
j                   j                  }|j                  d«      d   }|› d‰
j                   j                  › �}d|v r®d }d }‰
j                   j                  j	                  d«      rf|› d‰
j                   j                  › �}t        ‰
dd «      �Yt        ‰
d«      }|j                  }|j                  d«      d   }|› d|j                  › �}n|› d‰
j                   j                  › �}||f}t        | t        «      r'| j                  di «      }	||	‰
j                  <   |	| d<   y t        | dd «      �|| j                  ‰
j                  <   y ‰
j                  |i| _
        y )NrL   éÿÿÿÿÚ	TokenizerÚFastÚslow_tokenizer_classÚauto_map)Ú	__class__Ú
__module__rY   Ú__name__r…   rT   rM   Údictr‹   Ú_auto_classrÖ   )Ú_configÚmodule_nameÚlast_moduleÚ	full_namerÕ   Úfast_tokenizer_classÚslow_tokenizerÚslow_tok_module_nameÚlast_slow_tok_modulerÖ   rÌ   s             €r   Ú_set_auto_map_in_configz3custom_object_save.<locals>._set_auto_map_in_configS  sq  ø€ Ø—m‘m×.Ñ.ˆØ!×'Ñ'¨Ó,¨RÑ0ˆØ"�m 1 S§]¡]×%;Ñ%;Ð$<Ð=ˆ	à˜)Ñ#Ø#'Ð Ø#'Ð Ø�}‰}×%Ñ%×.Ñ.¨vÔ6à*5¨°a¸¿¹×8NÑ8NÐ7OÐ'PÐ$Ü˜3Ð 6¸Ó=ÐIÜ%,¨SÐ2HÓ%I�NØ+9×+DÑ+DÐ(Ø+?×+EÑ+EÀcÓ+JÈ2Ñ+NÐ(Ø.BÐ-CÀ1À^×E\ÑE\ÐD]Ð+^Ñ(ð +6¨°a¸¿¹×8NÑ8NÐ7OÐ'PÐ$à-Ð/CÐDˆIä�gœtÔ$Ø—{‘{ :¨rÓ2ˆHØ(1ˆH�S—_‘_Ñ%Ø"*ˆG�JÒÜ�W˜j¨$Ó/Ð;Ø09ˆG×Ñ˜SŸ_™_Ò-à #§¡°Ð;ˆGÕr    )rØ   ro   rp   rM   r3   Útupler   r‰   Ú__file__r   r!   rµ   r¶   r   rE   )	rÌ   rÍ   rÎ   rä   ÚcfgÚresultÚobject_fileÚ	dest_fileÚneeded_files	   `        r   Úcustom_object_saverì   =  s  ø€ ð ‡~�~˜Ò#Ü�‰Ø.¨s¨e°4¸°xð @ð ô	
ð
 	ô<ô@ �&œ4¤˜-Ô(Øò 	)ˆCÙ# CÕ(ñ	)à	Ð	Ù Ô'à€Fä—+‘+˜cŸn™nÑ-×6Ñ6€KÜ�V“¤ [Ó 1× 6Ñ 6Ñ7€IÜ
‡K�K�˜YÔ'Ø
‡M�M�)Ôô 1°Ó=ò !ˆÜ˜“L¤D¨Ó$5×$:Ñ$:Ñ;ˆ	Ü�‰�K Ô+Ø�‰�iÕ ð!ð
 €Mr    c                 ó   — t        d«      ‚)Nz¿Loading this model requires you to execute custom code contained in the model repository on your local machine. Please set the option `trust_remote_code=True` to permit loading of this model.)r­   )ÚsignumÚframes     r   Ú_raise_timeout_errorrð   ‰  s   € Ü
ð	cóð r    é   c                 óÜ  — | €ô|rd} nï|rßt         dkD  rÖd }	 t        j                  t        j                  t        «      }t        j                  t         «       | €>t        d|› d|› d�«      }|j                  «       dv rd} n|j                  «       dv rd} | €Œ>t        j                  d«       	 |�Ht        j                  t        j                  |«       t        j                  d«       n|rt        d d «       |r|s| st        d
|› d�«      ‚| S # t        $ r t        d|› d|› d	�«      ‚w xY w# |�:t        j                  t        j                  |«       t        j                  d«       w w xY w)NFr   zThe repository for z‚ contains custom code which must be executed to correctly load the model. You can inspect the repository content at https://hf.co/zƒ.
You can avoid this prompt in future by passing the argument `trust_remote_code=True`.

Do you wish to run the custom code? [y/N] )ÚyesÚyÚ1T)ÚnoÚnÚ0rJ   zS.
Please pass the argument `trust_remote_code=True` to allow custom code to be run.zLoading zÕ requires you to execute the configuration file in that repo on your local machine. Make sure you have read the code there to avoid malicious use, then set the option `trust_remote_code=True` to remove this error.)	ÚTIME_OUT_REMOTE_CODEÚsignalÚSIGALRMrð   ÚalarmÚinputÚlowerÚ	Exceptionr­   )Útrust_remote_codeÚ
model_nameÚhas_local_codeÚhas_remote_codeÚprev_sig_handlerÚanswers         r   Úresolve_trust_remote_coder  “  sˆ  € ØÐ ÙØ %ÑÙÔ!5¸Ò!9Ø#Ðð$Ü#)§=¡=´·±ÔAUÓ#VÐ Ü—‘Ô1Ô2Ø'Ð/Ü"Ø-¨j¨\ð :cØcmÐbnð oEðFó�Fð —|‘|“~Ð):Ñ:Ø,0Ñ)ØŸ™›Ð+?Ñ?Ø,1Ð)ð (Ñ/ô —‘˜Q•ð $Ð/Ü—M‘M¤&§.¡.Ð2BÔCÜ—L‘L •OÙä   tÔ,á™~Ñ6GÜØ�z�lð #Mð Mó
ð 	
ð Ðøô- ò ä Ø)¨*¨ð 6_Ø_iÐ^jð khðióð ðûð $Ð/Ü—M‘M¤&§.¡.Ð2BÔCÜ—L‘L •Oð 0ús   –B D ÂD ÄD*Ä*D- Ä->E+)	NFNNNNFNNr~   )6Ú__doc__rN   r³   r�   r   Úimportlib.utilr   r0   rµ   rú   r   Ú	threadingrª   Úpathlibr   Útypesr   Útypingr   r   r   Úhuggingface_hubr   Úutilsr
   r   r   r   r   r   Ú
get_loggerrÙ   ro   ÚLockrˆ   r   r<   ÚPathLiker&   r3   r8   rE   ri   rv   ÚboolÚtyper™   rÚ   r·   rË   rì   rð   rù   r  © r    r   ú<module>r     s¤  ðñ :ã 
Û Û Û Û Û 	Û 	Û Û Û 
Û Û Ý Ý ß 'Ñ 'å 2÷÷ ð 
ˆ×	Ñ	˜HÓ	%€Ø%�y—~‘~Ó'Ð ò&ð &  c¨2¯;©;Ð&6Ñ 7ð &¸Dó &ð,' e¨C°·±Ð,<Ñ&=ð 'À$ÀsÁ)ó 'ð* ¨5°°b·k±kÐ1AÑ+Bð  ÀtÈCÁyó  ðB-$˜%  R§[¡[Ð 0Ñ1ð -$°d¸3±ió -$ð` *˜E # r§{¡{Ð"2Ñ3ð  *¸¸S¹	ó  *ðN ò	.+Øð.+à�s˜BŸK™KÐ'Ñ(ð.+ð ð	.+ð
 
ó.+ðh 48Ø Ø&*Ø(,Ø(,Ø"Ø"Ø#Ø"&ñm5Ø#(¨¨b¯k©kÐ)9Ñ#:ðm5àðm5ð ˜˜c 2§;¡;Ð.Ñ/Ñ0ðm5ð ð	m5ð
 ˜d‘^ðm5ð �d˜3 ˜8‘nÑ%ðm5ð �E˜$ ˜)Ñ$Ñ%ðm5ð �s‰mðm5ð ðm5ð ˜‰}ðm5ð ˜3‘-ðm5ð 	óm5ðf 48Ø Ø&*Ø(,Ø(,Ø"Ø"Ø#Ø#'ñzVØðzVà#(¨¨b¯k©kÐ)9Ñ#:ðzVð ˜˜c 2§;¡;Ð.Ñ/Ñ0ðzVð ð	zVð
 ˜d‘^ðzVð �d˜3 ˜8‘nÑ%ðzVð �E˜$ ˜)Ñ$Ñ%ðzVð �s‰mðzVð ðzVð ˜‰}ðzVð ˜C‘=ðzVð 
ózVñzI˜Cð I¨¨s°B·K±KÐ/?Ñ)@ð IÈ(ÐSWÉ.ð IÐdhÐilÑdmó IòXð Ð ó+r    