+
    ~j                        R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIHtHt ^ RIHt ^RIHtHtHtHtHt ^RIH t H!t! ]PD                  ! ]#4      t$R	 R
 lt%]PL                  ! 4       t'R t(R R lt)R R lt*R R lt+R R lt,R R lt-RR/R R llt.R R lt/R%R R llt0R%R R llt1R&R  R! llt2R" t3^t4R'R# lt5R(R$ lt6R# ))z3Utilities to dynamically load objects from the Hub.N)Path)
ModuleType)Any)is_offline_modetry_to_load_from_cache)version)HF_MODULES_CACHE TRANSFORMERS_DYNAMIC_MODULE_NAMEcached_fileextract_commit_hashlogging)VersionComparisonsplit_package_versionc                0    V ^8  d   QhR\         R\         /# )   namereturn)str)formats   "v/Users/mitch_tango/dev/rabbit-r1-livekit/agent/.venv/lib/python3.14/site-packages/transformers/dynamic_module_utils.py__annotate__r   1   s            c                v   V P                  RR4      P                  RR4      pV'       d#   V^ ,          P                  4       '       d   RV 2p\        P                  ! V4      '       d   \        P                  RV RV  R24       V# VP                  4       '       g   \        P                  RV RV  R	24       V# )
a  
Tries to sanitize a module name so that it can be used as a Python module.

The following transformations are applied:

1. Replace `.` in module names with `_dot_`.
2. Replace `-` in module names with `_hyphen_`.
3. If the module name starts with a digit, prepend it with `_`.
4. Warn if the sanitized name is a Python reserved keyword or not a valid identifier.

If the input name is already a valid identifier, it is returned unchanged.
._dot_-_hyphen__zThe module name z (originally z\) is a reserved keyword in Python. Please rename the original module to avoid import issues.z]) is not a valid Python identifier. Please rename the original module to avoid import issues.)replaceisdigitkeyword	iskeywordloggerwarningisidentifier)r   new_names   & r   _sanitize_module_namer&   1   s    " ||C)11#zBHHQK''))xj>""xjdV <H H	
 O ""$$xjdV <H H	
 Or   c                 `   \         \        P                  9   d   R# \        P                  P                  \         4       \        P
                  ! \         RR7       \        \         4      R,          p V P                  4       '       g(   V P                  4        \        P                  ! 4        R# R# )zW
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    r   init_hf_modulesr5   U   sm    
 388#HHOO$%KK 40%&6I##% r   c                R    V ^8  d   QhR\         \        P                  ,          RR/# )r   r   r   N)r   r.   PathLike)r   s   "r   r   r   e   s#     & &bkk 1 &d &r   c                   \        4        \        \        4      V ,          P                  4       pVP                  P                  4       '       g   \        VP                  4       \        P                  ! VRR7       VR,          pVP                  4       '       g(   VP                  4        \        P                  ! 4        R# R# )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)r5   r   r   resolveparentr0   create_dynamic_moduler.   r/   r1   r2   r3   )r   dynamic_module_pathr4   s   &  r   r;   r;   e   s      01D8AAC%%,,..1889KK#d3#m3I 	##%	 r   c                p    V ^8  d   QhR\         \        P                  ,          R\        \         ,          /# r   module_filer   r   r.   r7   list)r   s   "r   r   r   {   s'     ' 'cBKK&7 'DI 'r   c                V   \        V RR7      ;_uu_ 4       pVP                  4       pRRR4       \        P                  ! RX\        P                  R7      pV\        P                  ! RV\        P                  R7      ,          p\        \        V4      4      #   + '       g   i     Ly; i)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	MULTILINErA   set)r?   fcontentrelative_importss   &   r   get_relative_importsrP   {   sw     
kG	,	,&&( 
- zz"=wbll[

#A7RTR^R^__$%&& 
-	,s   BB(	c                p    V ^8  d   QhR\         \        P                  ,          R\        \         ,          /# r>   r@   )r   s   "r   r   r      s'        3+<  c  r   c                f   RpV .p. pV'       g   . pV F  pVP                  \        V4      4       K  	  \        V 4      P                  pV Uu. uF  p\	        Wg,          4       R2NK  	  ppV Uu. uF  qUV9  g   K  VNK  	  pp\        V4      ^ 8H  pVP                  V4       K  V# u upi u upi )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.py)extendrP   r   r:   r   len)	r?   	no_changefiles_to_checkall_relative_importsnew_importsrM   module_pathmnew_import_filess	   &        r   get_relative_import_filesr]      s     I!]N A3A67   ;'..BMN+Qs;?34C8+N%5W%5BV9V!!%5W'1,	##N3 OWs   B)1B.>B.c                p    V ^8  d   QhR\         \        P                  ,          R\        \         ,          /# r   filenamer   r@   )r   s   "r   r   r      s'     4$ 4$#+ 4$S	 4$r   c                  aaa \        V RR7      ;_uu_ 4       pVP                  4       pRRR4       \        4       o^ RIoVVV3R lo\        P
                  ! X4      pS! V4       \        S4      #   + '       g   i     LO; i)z
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.
rC   rD   Nc                 (  < \        V \        P                  4      '       d   R # \        V \        P                  4      '       d   V P                  p\        P
                  ! V4       F  p\        V\        P                  4      '       g   K%  \        VP                  RR4      pVP                  R4      '       d   VP                  R4      '       g)   \        S	P                  P                  V4      '       g   K   R # 	  M\        V \        P                  4      '       dR   V P                   F@  pVP                   P#                  R4      ^ ,          pV'       g   K/  SP%                  V4       KB  	  M~\        V \        P&                  4      '       d_   V P(                  ^ 8X  dN   V P*                  '       d<   V P*                  P#                  R4      ^ ,          pV'       d   SP%                  V4       \        P,                  ! V 4       F  pS! V4       K  	  R # )Nid 	availableis_flash_attnr   )
isinstanceastTryIftestwalkCallgetattrfuncendswith
startswithhasattrutilsimport_utilsImportnamesr   splitadd
ImportFromlevelmoduleiter_child_nodes)
noderk   condition_nodecheck_functionalias
top_modulechildimported_modulesrecursive_look_for_importstransformerss
   &      r   r   /get_imports.<locals>.recursive_look_for_imports   sd   dCGG$$cff%%99D"%((4.nchh77%,^-@-@$%KN&//<<*55oFF"<#5#5#B#BNSS  #1 cjj))"ZZ--c215
:$((4 $ cnn--zzQ4;;;![[..s3A6
$((4 ))$/E&u- 0r   )rG   rH   rL   transformers.utilsrh   parsesorted)r`   rM   rN   treer   r   r   s   &   @@@r   get_importsr      sc     
h	)	)Q&&( 
*u.B 99WDt$"##U 
*	)s   A11B	c                p    V ^8  d   QhR\         \        P                  ,          R\        \         ,          /# r_   r@   )r   s   "r   r   r      s'      *  *C"++-  *$s)  *r   c                   \        V 4      p. pV F  p \        P                  ! V4       K  	  \        V4      ^ 8  d1   \        RRP                  V4       RRP                  V4       R	24      h\        V 4      #   \         dI   p\        P                  RT RT 24       R\        T4      9   d   TP                  T4        Rp?K  h Rp?ii ; i)
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 namedNz\This modeling file requires the following packages that were not found in your environment: z, z. Run `pip install  `)r   r2   import_moduleImportErrorr"   r#   r   r-   rU   joinrP   )r`   importsmissing_packagesimp	exceptions   &    r   check_importsr      s     (#G
	##C(  q jyy)*++>sxxHX?Y>ZZ[]
 	

  ))!  	NNCC59+VW !C	N2 '',,	s   A99C<CCCforce_reloadFc                r    V ^8  d   QhR\         R\         \        P                  ,          R\        R\        /# )r   
class_namerZ   r   r   )r   r.   r7   booltype)r   s   "r   r   r   
  s9     -+ -+-+r{{"-+ 	-+
 
-+r   c                  \         P                  P                  V4      pVP                  R4      pVP	                  \         P                  P
                  R4      p\        \        4      V,          p\        ;_uu_ 4        V'       d6   \        P                  P                  VR4       \        P                  ! 4        \        P                  P                  V4      p\        P                  P!                  W4R7      pV.\#        \%        \        \'        V4      4      4      ,           p\(        P*                  ! RP-                  R V 4       4      4      P/                  4       pVf4   \        P                  P1                  V4      p	V	\        P                  V&   MTp	\3        V	RR4      V8w  d"   VP4                  P7                  V	4       Wn        \3        W4      uuRRR4       #   + '       g   i     R# ; i)	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.
rS   r   N)locationr   c              3   b   "   T F%  p\        V4      VP                  4       ,           x  K'  	  R # 5iN)bytes
read_bytes).0rM   s   & r   	<genexpr>&get_class_in_module.<locals>.<genexpr>*  s%     2cVbQR58alln3L3LVbs   -/__transformers_module_hash__rd   )r.   r,   normpathremovesuffixr   sepr   r   _HF_REMOTE_CODE_LOCKr+   modulespopr2   r3   getutilspec_from_file_locationr   mapr]   hashlibsha256r   	hexdigestmodule_from_specrn   loaderexec_moduler   )
r   rZ   r   r   r?   cached_modulemodule_specmodule_filesmodule_hashr{   s
   &&$       r   get_class_in_moduler   
  sZ   & 77K(DU#D<<S)D-.<K		KKOOD$''')+.;;??4+@nn<<T<X %0=6#dD]^iDj:k3l#l">>#((2cVb2c*cdnnp  ^^44[AF &CKK"F692>+M**622=/v*- 
			s   ?EG!!G2	c          
          V ^8  d   QhR\         \        P                  ,          R\         \        P                  ,          R\         \        P                  ,          R\        \         ,          R\         /# )r   pretrained_model_name_or_pathr?   resolved_module_filemodules_neededr   r@   )r   s   "r   r   r   :  sY     !. !.#&#4!.r{{"!. +!. I	!.
 	!.r   c                D  a \        V 4      P                  4       o\        V4      P                  p\        V4      P                  4       pR V3R llpV! V4      V3.pV F=  pSV,          V R2,          P                  4       pVP                  V! V4      V34       K?  	  \        P
                  ! 4       p	\        VR R7       FD  w  rV	P                  V
P                  R4      4       V	P                  VP                  4       4       KF  	  V	P                  4       R,          # )zm
Computes a stable hash from the bytes of the local source file and its direct relative-import source files.
c                0    V ^8  d   QhR\         R\        /# )r   source_file_pathr   )r   r   )r   s   "r   r   6_compute_local_source_files_hash.<locals>.__annotate__H  s     / / / /r   c                    <  V P                  S4      P                  4       #   \         d    T P                  4       u # i ; ir   )relative_toas_posix
ValueError)r   
model_paths   &r   _resolve_relative_source_pathG_compute_local_source_files_hash.<locals>._resolve_relative_source_pathH  s@    	/#//
;DDFF 	/#,,..	/s   " A A rS   c                     V ^ ,          # )     )entrys   &r   <lambda>2_compute_local_source_files_hash.<locals>.<lambda>W  s	    ERSHr   )keyrC   :N   N)r   r9   r:   r-   r   r   r   updateencoder   r   )r   r?   r   r   module_parentr   files_to_hashmodule_neededmodule_needed_pathsource_files_hashrelative_path	file_pathr   s   &&&&        @r    _compute_local_source_files_hashr   :  s    34<<>J%,,M 45==?/ / 
'';	<>RSM ((=8m_C;PPYY[;<NOQcde (  ($*=>T$U   !5!5g!>?  !5!5!78 %V &&(--r   c                |   V ^8  d   QhR\         \        P                  ,          R\         R\         \        P                  ,          R,          R\        R\        \         \         3,          R,          R\        \         ,          R,          R\         R,          R	\        R
\         R,          R\         R,          R\         /# )r   r   r?   	cache_dirNforce_downloadproxiestokenrevisionlocal_files_only	repo_type_commit_hashr   )r   r.   r7   r   dict)r   s   "r   r   r   ^  s     g5 g5#&#4g5g5 R[[ 4'g5 	g5
 #s(^d"g5 #:g5 Djg5 g5 Tzg5 *g5 	g5r   c
                
   \        4       '       d    V'       g   \        P                  R4       Rp\        V 4      p \        P
                  P                  V 4      pRpV'       gU   \        P
                  P                  P                  \        \        V P                  R4      4      4      p\        WW)VR7      p. p \        V VVVVVVVVV	R7
      pV'       g   W8w  d   VP                  V4       \!        T4      pT'       d   \        \        P
                  P#                  \        P
                  P%                  T 4      4      4      p\'        YTT4      pT'       d-   \        P
                  P                  P                  TT.4      pMTp\(        \        P
                  P                  ,           X,           p\+        T4       \-        \.        4      T,          pT'       Edk   TT,          P1                  4       '       d.   \2        P4                  ! T\        TT,          4      4      '       gX   TT,          P6                  P9                  RRR
7       \:        P<                  ! TTT,          4       \>        P@                  ! 4        T F  p\-        T4      P6                  T R2,          p\        P
                  P                  T T4      pTT,          P1                  4       '       d0   \2        P4                  ! T\        TT,          4      4      '       d   K  \:        P<                  ! TTT,          4       \>        P@                  ! 4        K  	  EMK\C        Y4      pTT,          pT\        P
                  P                  ,           T,           p\        P
                  P                  TT4      p\+        \-        T4      P6                  4       TT,          P1                  4       '       g4   \:        P<                  ! TTT,          4       \>        P@                  ! 4        T F{  pTT,          P6                  T R2,          P1                  4       '       d   K6  \E        T \-        T4      P6                  T,           R2TTTTTTTR7	       TP                  T R24       K}  	  \G        T4      ^ 8  dW   TfS   RP                  T Uu. uF  pRT 2NK
  	  up4      pTf   RMT R2pRT T  2p\        PI                  RT RT R24       \        P
                  P                  TT4      #   \         d    \        P                  RT RT  R	24       h i ; iu upi )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.
    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 `hf auth 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.
z+Offline mode: forcing local_files_only=TrueTN/)r   r   r   )r   r   r   r   r   r   r   r   zCould not locate the z inside r   )parentsr)   rS   )r   r   r   r   r   r   r   
z- rd   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   r"   infor   r.   r,   isdirr   r   r   r&   rw   r   r
   r-   OSErrorr   basenamer   r   r	   r;   r   r   r0   filecmpcmpr:   mkdirshutilcopyfiler2   r3   r   get_cached_module_filerU   r#   )r   r?   r   r   r   r   r   r   r   r   deprecated_kwargsis_localr   	submodule	new_filesr   r   local_model_namelocal_source_files_hashfull_submodulesubmodule_pathr   module_needed_filecommit_hashfull_submodule_module_file_pathrM   repo_type_strurls   &&&&&&&&&&,                 r   r   r   ^  sm   t !1AB %((E$F!ww}}:;HMGGKK$$S)>@]@c@cdg@h%ij	.))nw
 I*))-% 
 MA[) ##78N01A1A"''BRBRSpBq1rs"B)8Ln#
 ((*:<S)TUI/I 6CiON.)*+n<Nx ,4466gkk #n{&B"C?
 ?
 k)1177t7TOO0.;2NO'')+M -44-7LLM!#.K]!["]2::<<GKK"C(F$GE E  2N]4RS++- , **>M (+5'"''++5C*,'',,~{*S'd#BCJJK,4466OO0.;2NO'')+M#k199}oS<QQYY[[&1K(//-?@D'#1#%%5!,
   M?#!67 , 9~h.II;AA3x;<	'/	{"5E'7T6UVGuCPY{AA	
 77<<44[  +K=A^@__`abH <s   ;4T 8U)Uc                |   V ^8  d   QhR\         R\         \        P                  ,          R\         \        P                  ,          R,          R\        R\        \         \         3,          R,          R\        \         ,          R,          R\         R,          R	\        R
\         R,          R\         R,          R\
        /# )r   class_referencer   r   Nr   r   r   r   r   r   code_revisionr   )r   r.   r7   r   r   r   )r   s   "r   r   r     s     kV kVkV#&#4kV R[[ 4'kV 	kV
 #s(^d"kV #:kV DjkV kV TzkV :kV 
kVr   c
                    RV 9   d   V P                  R4      w  rMTpV P                  R4      w  rV	f	   W8X  d   Tp	\        VVR,           VVVVV	VVR7	      p\        WVR7      # )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.
    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 `hf auth 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")
```z--r   rS   )r   r   r   r   r   r   r   )r   )rw   r   r   )r  r   r   r   r   r   r   r   r   r  kwargsrepo_idr?   r   final_modules   &&&&&&&&&&,    r   get_class_from_dynamic_moduler	    s    n #2#8#8#> /-33C8K!>!I )e%)
L znUUr   c          	          V ^8  d   QhR\         R\        \        P                  ,          R\        R,          R\
        \        ,          /# )r   objfolderconfigNr   )r   r   r.   r7   r   rA   )r   s   "r   r   r   v  sB     I IC Ir{{): ID4K I[_`c[d Ir   c                  a  S P                   R8X  d   \        P                  RS  RV R24       R# V 3R lp\        V\        \
        34      '       d   V F  pV! V4       K  	  MVe	   V! V4       . p\        P                  S P                   ,          P                  p\        V4      \        V4      P                  ,          p\        P                  ! Wg4       VP                  V4       \        V4       FO  p\        V4      \        V4      P                  ,          p\        P                  ! W4       VP                  V4       KQ  	  V# )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                 
  < S
P                   P                  pVP                  R 4      R,          pV R S
P                   P                   2pRV9   d   RpRpS
P                   P                  P	                  R4      '       dm   V R S
P                   P                   2p\        S
RR4      eB   \        S
R4      pVP                  pVP                  R 4      R,          pV R VP                   2pMV R S
P                   P                   2pWE3p\        V \        4      '       d'   V P                  R/ 4      p	W9S
P                  &   WR&   R# \        V RR4      e   W0P                  S
P                  &   R# S
P                  V/V n
        R# )r   	TokenizerNFastslow_tokenizer_classauto_map)	__class__
__module__rw   __name__rp   rn   rg   r   r   _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_config3custom_object_save.<locals>._set_auto_map_in_config  so   mm..!'',R0"m1S]]%;%;$<=	)##' #' }}%%..v66*5a8N8N7O'P$3 6=I%,S2H%IN+9+D+D(+?+E+Ec+J2+N(.B-C1^E\E\D]+^( +6a8N8N7O'P$-DIgt$${{:r2H(1S__%"*JWj$/;09S__- #;Gr   )r  r"   r#   rg   rA   tupler+   r   __file__r   r   r   r   r-   r]   )	r  r  r  r"  cfgresultobject_file	dest_fileneeded_files	   f&&      r   custom_object_saver+  v  s
    ~~#.se4x @ 	

 	<@ &4-((C#C( 		'F++cnn-66KV[ 1 6 67I
OOK+
MM) 1=LD$5$:$:;	/i  >
 Mr   c                     \        R 4      h)zLoading 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                2   Vfg   Ve   RV RV RV R2pMU\         P                  P                  V4      '       d(   RV R\         P                  P                  V4       R2pM	RV RV R2pV Ef   V'       d   Rp EMV'       d   \        ^ 8  d   Rp \
        P
                  ! \
        P                  \        4      p\
        P                  ! \        4       V fF   \        V R	V R
24      pVP                  4       R9   d   Rp K.  VP                  4       R9   g   KE  Rp KI  \
        P                  ! ^ 4        Te<   \
        P
                  ! \
        P                  T4       \
        P                  ! ^ 4       MV'       d   \        RR4       V'       d"   V'       g   V '       g   \        V R	V R24      hV #   \         d    \        T R	T R24      hi ; i  Te=   \
        P
                  ! \
        P                  T4       \
        P                  ! ^ 4       i i ; i)a  
Resolves the `trust_remote_code` argument. If there is remote code to be loaded, the user must opt-in to loading
it.

Args:
    trust_remote_code (`bool` or `None`):
        User-defined `trust_remote_code` value.
    model_name (`str`):
        The name of the model repository in huggingface.co.
    has_local_code (`bool`):
        Whether the model has local code.
    has_remote_code (`bool`):
        Whether the model has remote code.
    error_message (`str`, *optional*):
        Custom error message to display if there is remote code to load and the user didn't opt-in. If unset, the error
        message will be regarding loading a model with custom code.

Returns:
    The resolved `trust_remote_code` value.
NzThe repository z% references custom code contained in zm which must be executed to correctly load the model. You can inspect the repository content at https://hf.co/z .
zt contains custom code which must be executed to correctly load the model. You can inspect the repository content at z contains custom code which must be executed to correctly load the model. You can inspect the repository content at https://hf.co/Fz9 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] TzS.
Please pass the argument `trust_remote_code=True` to allow custom code to be run.)yesy1)non0rd   )r.   r,   r   abspathTIME_OUT_REMOTE_CODEsignalSIGALRMr/  alarminputlower	Exceptionr   )trust_remote_code
model_namehas_local_codehas_remote_codeerror_messageupstream_repoprev_sig_handleranswers   &&&&&&  r   resolve_trust_remote_coderG    s   . $!*-RS`Ra b,,9?$@ 
 WW]]:&&!* . ggooj9:$@  "* .,,6<t=    %!5!9#$#)==AU#V 12'/"(/)bcmbn oE FF
 ||~)::,0)+??,1)Q $/MM&..2BCLLO t,~6GoVWaVb c` a
 	

 )   $o%^_i^j kh i  $/MM&..2BCLLO 0s    BF4 F4 4GG AHc                   . p \        RRV RV/VB p\        VR4      ;_uu_ 4       pVP                  4       pRRR4       V F  pVP                  4       pV'       d   VP	                  R4      '       d   K4   \        V4      w  rxp	 \        P                  P                  V4      p
TeT   T	eP   \        P                  ! T4      P                  \        P                  ! T
4      \        P                  ! T	4      4      pMRpT'       d   K  TP                  T RT
 R	24       K  	  V'       d&   \#        R
V  R2RP%                  V4      ,           4      hR#   + '       g   i     EL#; i  \         d	    TpRRr Li ; i  \        P                  P                   d    TP                  T R24        EKq  i ; i  \          d     Li ; i)a  
Tries to locate `requirements_file` in a local folder or repo, and confirms that the environment has all the
python dependencies installed.

Args:
    path_or_repo_id (`str` or `os.PathLike`):
        This can be either:
        - a string, the *model id* of a model repo on huggingface.co.
        - a path to a *directory* potentially containing the file.
    kwargs (`dict[str, Any]`, *optional*):
        Additional arguments to pass to `cached_file`.
path_or_repo_idr`   rN#z (installed: None)Tz (installed: )z4Missing requirements in your local environment for `z`:
r   r   )r
   rG   	readlinesstriprq   r   r   r2   metadatar   PackageNotFoundErrorr-   r   from_stringvaluer   r   r   r   )rI  requirements_filer  failedrequirementsrM   requirementpackage_name	delimiterversion_numberlocal_package_versionis_satisfieds   &&,         r   check_python_requirementsr\  !  s    F""i?iM^ibhi,$$;;=L % (K%++-K+"8"8"="=7:OP[:\7
(1(:(:(B(B<(P%
 $)C0<<YGMMMM"78'--:W   $<];P:QQRST5 (> B?BSSWX[_[d[dek[ll
 	
 E %$$  7*,0$>7 %%:: -?@A  sv   #F7 E;F7 4F7 7E&E<%AF7 F7 E#		F7 &E96F7 8E99F7 <3F4/F7 3F44F7 7GG)NFNNNFNNr   )NN)zrequirements.txt)7__doc__rh   r   r   r2   importlib.metadataimportlib.utilr    r.   rI   r   r9  r+   	threadingpathlibr   typesr   typingr   huggingface_hubr   r   	packagingr   rs   r   r	   r
   r   r   utils.import_utilsr   r   
get_loggerr  r"   r&   Lockr   r5   r;   rP   r]   r   r   r   r   r   r	  r+  r/  r8  rG  r\  r   r   r   <module>ri     s    : 
       	 	   
     C   I 
		H	%B !~~' & &,'* @4$n *F-+ 	-+`!.Hg5TkV\IX  Rj5
r   