
    ?Ki1                        S 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rSSKrSSKrSSKJr  SSKJr  SSKJrJrJr  SSKJr  SSKJr  SS	KJrJrJrJrJ r J!r!  SS
K"J#r#J$r$  \!RJ                  " \&5      r'S\(S\(4S jr)\RT                  " 5       r+S r,S\\(\RZ                  4   SS4S jr.S\\(\RZ                  4   S\/\(   4S jr0S\\(\RZ                  4   S\/\(   4S jr1S\\(\RZ                  4   S\/\(   4S jr2S\\(\RZ                  4   S\/\(   4S jr3SS.S\(S\\(\RZ                  4   S\4S\54S jjr6         S2S\\(\RZ                  4   S\(S\\\(\RZ                  4      S\4S\\4   S \\7\(\(4      S!\\\4\(4      S"\\(   S#\4S$\\(   S%\\(   S\(4S& jjr8         S2S'\(S\\(\RZ                  4   S\\\(\RZ                  4      S\4S\\4   S \\7\(\(4      S!\\\4\(4      S"\\(   S#\4S$\\(   S(\\(   S\54S) jjr9S3S*\S+\\(\RZ                  4   S,\\7   S\/\(   4S- jjr:S. r;S/r< S4S0 jr=S5S1 jr>g)6z3Utilities to dynamically load objects from the Hub.    N)Path)
ModuleType)AnyOptionalUnion)try_to_load_from_cache)version   )HF_MODULES_CACHE TRANSFORMERS_DYNAMIC_MODULE_NAMEcached_fileextract_commit_hashis_offline_modelogging)VersionComparisonsplit_package_versionnamereturnc                 f   U R                  SS5      R                  SS5      nU(       a  US   R                  5       (       a  SU 3n[        R                  " U5      (       a  [        R                  SU SU  S	35        U$ UR                  5       (       d  [        R                  SU SU  S
35        U$ )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_r   _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     c/var/www/html/dynamic-report/venv/lib/python3.13/site-packages/transformers/dynamic_module_utils.py_sanitize_module_namer$   3   s    " ||C)11#zBHHQK''))xj>""xjdV <H H	
 O ""$$xjdV <H H	
 O    c                  H   [         [        R                  ;   a  g[        R                  R                  [         5        [        R
                  " [         SS9  [        [         5      S-  n U R                  5       (       d&  U R                  5         [        R                  " 5         gg)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_modulesr4   W   sm    
 388#HHOO$%KK 40%&6I##% r%   c                 j   [        5         [        [        5      U -  R                  5       nUR                  R                  5       (       d  [        UR                  5        [        R                  " USS9  US-  nUR                  5       (       d&  UR                  5         [        R                  " 5         gg)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)r4   r   r   resolveparentr/   create_dynamic_moduler-   r.   r0   r1   r2   )r   dynamic_module_pathr3   s      r#   r8   r8   g   s      01D8AAC%%,,..1889KK#d3#m3I 	##%	 r%   module_filec                 (   [        U SS9 nUR                  5       nSSS5        [        R                  " SW[        R                  S9nU[        R                  " SU[        R                  S9-  n[        [        U5      5      $ ! , (       d  f       Nm= f)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_importsrJ   }   st     
kG	,&&( 
- zz"=wbll[

#A7RTR^R^__$%&& 
-	,s   B
Bc                 l   SnU /n/ nU(       d  / nU H  nUR                  [        U5      5        M     [        U 5      R                  nU Vs/ s H  n[	        Xg-  5       S3PM     nnU Vs/ s H  oUU;  d  M
  UPM     nn[        U5      S:H  nUR                  U5        U(       d  M  U$ s  snf s  snf )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   )extendrJ   r   r7   strlen)	r:   	no_changefiles_to_checkall_relative_importsnew_importsrG   module_pathmnew_import_filess	            r#   get_relative_import_filesrW      s     I!]N A3A67   ;'..BMN+Qs;?34C8+N%5W%5BV9V!%5W'1,	##N3 i   OWs   B,-	B1:B1filenamec                    ^^^ [        U SS9 nUR                  5       nSSS5        [        5       mSSKmUUU4S jm[        R
                  " W5      nT" U5        [        T5      $ ! , (       d  f       NM= f)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.
r<   r=   Nr   c                   > [        U [        R                  5      (       a  g [        U [        R                  5      (       a  U R                  n[        R
                  " U5       H  n[        U[        R                  5      (       d  M$  [        UR                  SS5      nUR                  S5      (       a  UR                  S5      (       d'  [        T	R                  R                  U5      (       d  M    g    O[        U [        R                  5      (       aL  U R                   H;  nUR                   R#                  S5      S   nU(       d  M*  TR%                  U5        M=     Ov[        U [        R&                  5      (       aW  U R(                  S:X  aG  U R*                  (       a6  U R*                  R#                  S5      S   nU(       a  TR%                  U5        [        R,                  " U 5       H  nT" U5        M     g )Nid 	availableis_flash_attnr   r   )
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)
noderc   condition_nodecheck_functionalias
top_modulechildimported_modulesrecursive_look_for_importstransformerss
          r#   r|   /get_imports.<locals>.recursive_look_for_imports   sb   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%   )r@   rA   rF   transformers.utilsr`   parsesorted)rX   rG   rH   treer{   r|   r}   s       @@@r#   get_importsr      s`     
h	)Q&&( 
*u.B 99WDt$"##U 
*	)s   A&&
A4c                    [        U 5      n/ nU H  n [        R                  " U5        M     [        U5      S:  a0  [        SSR                  U5       SS	R                  U5       S
35      e[        U 5      $ ! [         aG  n[        R                  SU SU 35        S[        U5      ;   a  UR                  U5         SnAM  e SnAff = f)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  `)r   r1   import_moduleImportErrorr   r    rN   r,   rO   joinrJ   )rX   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   A88
C	;CCC	Fforce_reload
class_namerT   r   c          
         [         R                  R                  U5      nUR                  S5      nUR	                  [         R                  R
                  S5      n[        [        5      U-  n[           U(       a5  [        R                  R                  US5        [        R                  " 5         [        R                  R                  U5      n[        R                  R!                  X4S9nU/[#        [%        [        ['        U5      5      5      -   n[(        R*                  " SR-                  S U 5       5      5      R/                  5       nUc3  [        R                  R1                  U5      n	U	[        R                  U'   OUn	[3        U	SS5      U:w  a!  UR4                  R7                  U	5        Xl        [3        X5      sSSS5        $ ! , (       d  f       g= f)	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.
rL   r   N)locationr%   c              3   Z   #    U  H!  n[        U5      UR                  5       -   v   M#     g 7fN)bytes
read_bytes).0rG   s     r#   	<genexpr>&get_class_in_module.<locals>.<genexpr>,  s"     2cVbQR58alln3LVbs   )+__transformers_module_hash__r\   )r-   r+   normpathremovesuffixr   sepr   r   _HF_REMOTE_CODE_LOCKr*   modulespopr1   r2   getutilspec_from_file_locationr   maprW   hashlibsha256r   	hexdigestmodule_from_specrf   loaderexec_moduler   )
r   rT   r   r   r:   cached_modulemodule_specmodule_filesmodule_hashrs   s
             r#   get_class_in_moduler     sT   & 77K(DU#D<<S)D-.<K	KKOOD$''').1kkood.C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   3EG


Gpretrained_model_name_or_path	cache_dirforce_downloadresume_downloadproxiestokenrevisionlocal_files_only	repo_type_commit_hashc                 	   UR                  SS5      nUb+  [        R                  " S[        5        Ub  [	        S5      eUn[        5       (       a  U(       d  [        R                  S5        Sn[        U 5      n [        R                  R                  U 5      nU(       a)  [        [        R                  R                  U 5      5      nOQ[        R                  R                  R                  [!        [        U R#                  S5      5      5      n[%        XX*U	S9n/ n ['        U UUUUUUUUU	U
S	9nU(       d  WU:w  a  UR)                  U5        [-        U5      n[.        [        R                  R                  -   U-   n[1        U5        [3        [4        5      U-  nU[        [        R                  R                  U 5      5      :X  GaC  UU-  R7                  5       (       a(  [8        R:                  " U[        UU-  5      5      (       dL  UU-  R<                  R?                  SSS9  [@        RB                  " UUU-  5        [D        RF                  " 5         U H  n[3        U5      R<                  U S3-  n[        R                  R                  U U5      nUU-  R7                  5       (       a*  [8        R:                  " U[        UU-  5      5      (       a  M  [@        RB                  " UUU-  5        [D        RF                  " 5         M     GO([I        UU
5      nUU-  nU[        R                  R                  -   U-   n[        R                  R                  UU5      n[1        [3        U5      R<                  5        UU-  R7                  5       (       d/  [@        RB                  " UUU-  5        [D        RF                  " 5         U Hl  nUU-  R<                  U S3-  R7                  5       (       a  M-  [K        U [3        U5      R<                  U-   S3UUUUUUUUS9
  UR)                  U S35        Mn     [M        U5      S:  aU  UcR  SR                  U Vs/ s H  nSU 3PM
     sn5      nU	c  SOU	 S3nSU U  3n[        RO                  SU SU S35        [        R                  R                  UU5      $ ! [*         a    [        R                  S
U SU  S35        e f = fs  snf )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 `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.
use_auth_tokenNrThe `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 r   )parentsr(   rL   )r   r   r   r   r   r   r   r   r   
z- r\   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   r   inforN   r-   r+   isdirr$   basenamer   r   r   ro   r   r   r,   OSErrorr   r   r8   r   r   r/   filecmpcmpr7   mkdirshutilcopyr1   r2   r   get_cached_module_filerO   r    )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_hashfull_submodule_module_file_pathrG   repo_type_strurls                               r#   r   r   <  s   | '**+;TBN! A	
 uvv!1AB %((E$F!ww}}:;H)"''*:*:;X*YZ	GGKK$$S)>@]@c@cdg@h%ij	.))nw
 I*))+-% 
 M-AA[) ##78N 6CiON.)*+n<N)"''*:*:;X*YZZ ,4466gkk #n{&B"C?
 ?
 k)1177t7TKK,n{.JK'')+M -44-7LLM!#.K]!["]2::<<GKK"C(F$GE E .0NO++- , **>M (+5'"''++5C*,'',,~{*S'd#BCJJK,4466KK,n{.JK'')+M#k199}oS<QQYY[[&1K(//-?@D'#1$3#%%5!,   M?#!67 ,  9~h.II;AA3x;<	'/	{"5E'7T6UVGuCPY{AA	
 77<<44K  +K=A^@__`abx <s   1R5 S 5(Sclass_referencecode_revisionc                 4   UR                  SS5      nUb+  [        R                  " S[        5        Ub  [	        S5      eUnSU ;   a  U R                  S5      u  pOUnU R                  S5      u  pU
c  X:X  a  Un
[        UUS-   UUUUUU
UU	S9
n[        UUUS	9$ )
aF  
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 `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")
```r   Nr   r   z--r   rL   )r   r   r   r   r   r   r   r   r   )r   r   r   r   r   ro   r   r   )r   r   r   r   r   r   r   r   r   r   r   kwargsr   repo_idr:   r   final_modules                    r#   get_class_from_dynamic_moduler     s    t ZZ 0$7N! A	
 uvv #2#8#8#> /-33C8K!>!I )e%')L z<nUUr%   objfolderconfigc                 t  ^  T R                   S:X  a  [        R                  ST  SU S35        gU 4S jn[        U[        [
        45      (       a  U H  nU" U5        M     OUb  U" U5        / n[        R                  T R                      R                  n[        U5      [        U5      R                  -  n[        R                  " Xg5        UR                  U5        [        U5       HK  n[        U5      [        U5      R                  -  n[        R                  " X5        UR                  U5        MM     U$ )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                   > T
R                   R                  nUR                  S5      S   nU ST
R                   R                   3nSU;   a  S nS nT
R                   R                  R	                  S5      (       ag  U ST
R                   R                   3n[        T
SS 5      b=  [        T
S5      nUR                  nUR                  S5      S   nU SUR                   3nOU ST
R                   R                   3nXE4n[        U [        5      (       a%  U R                  S0 5      n	X9T
R                  '   XS'   g [        U SS 5      b  X0R                  T
R                  '   g T
R                  U0U l
        g )Nr   	TokenizerFastslow_tokenizer_classauto_map)	__class__
__module__ro   __name__rh   rf   r_   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_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    r_   rE   tupler*   r   __file__r   r   r   r   r,   rW   )	r   r   r   r   cfgresultobject_file	dest_fileneeded_files	   `        r#   custom_object_saver  k  s
    ~~#.se4x @ 	

 	<@ &4-((C#C( 		'F++cnn-66KV[ 1 6 67I
KK'
MM) 1=LD$5$:$:;	K+i  >
 Mr%   c                     [        S5      e)NzLoading 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                    Ucd  Ub  SU SU SU S3nOT[         R                  R                  U5      (       a'  SU S[         R                  R                  U5       S3nO	SU SU S3nU Gc  U(       a  Sn GOU(       a  [        S	:  a  Sn [
        R
                  " [
        R                  [        5      n[
        R                  " [        5        U cC  [        U S
U S35      nUR                  5       S;   a  Sn OUR                  5       S;   a  Sn U c  MC  [
        R                  " S	5         Ub;  [
        R
                  " [
        R                  U5        [
        R                  " S	5        OU(       a  [        SS5        U(       a  U(       d  U (       d  [        U S
U S35      eU $ ! [         a    [        U S
U S35      ef = f! Ub<  [
        R
                  " [
        R                  U5        [
        R                  " S	5        f f = f)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/Fr   z9 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0r\   zS.
Please pass the argument `trust_remote_code=True` to allow custom code to be run.)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_coder#    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F% F% %GG AHc                 L   / n [        SXS.UD6n[        US5       nUR                  5       nSSS5        U H  nUR                  5       nU(       a  UR	                  S5      (       a  M2   [        U5      u  pxn	 [        R                  R                  U5      n
UbI  U	bF  [        R                  " U5      " [        R                  " U
5      [        R                  " U	5      5      nOSnU(       a  M  UR                  U SU
 S	35        M     U(       a!  [!        S
U  S3SR#                  U5      -   5      eg! , (       d  f       GN= f! [         a	    UnSu  p Nf = f! [        R                  R                   a    UR                  U S35         GMZ  f = f! [         a     Nf = f)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_idrX   rN#NNz (installed: None)Tz (installed: )z4Missing requirements in your local environment for `z`:
r    )r   r@   	readlinesstripri   r   r   r1   metadatar	   PackageNotFoundErrorr,   r   from_stringr   r   r   r   )r%  requirements_filer   failedrequirementsrG   requirementpackage_name	delimiterversion_numberlocal_package_versionis_satisfieds               r#   check_python_requirementsr9    s    F""i?ibhi,$;;=L % (K%++-K+"8"8"="=7:OP[:\7
(1(:(:(B(B<(P%
 $)C0<<YGMM"78'--:W   $<];P:QQRST5 (> B?BSSWX[_[d[dek[ll
 	
 E %$  7*,6)	>7 %%:: -?@A  sp   F D4<F +E:EAF 0F 4
E>F EF EF 2FF FF 
F#"F#)	NFNNNNFNNr   r(  )zrequirements.txt)?__doc__r`   r   r   r1   importlib.metadataimportlib.utilr   r-   rB   r   r  r*   	threadingr   pathlibr   typesr   typingr   r   r   huggingface_hubr   	packagingr	   rk   r   r   r   r   r   r   utils.import_utilsr   r   
get_loggerr   r   rN   r$   Lockr   r4   PathLiker8   rE   rJ   rW   r   r   booltyper   r   r   r   r  r
  r  r#  r9  r*  r%   r#   <module>rI     s   : 
       	 	   
     ' ' 2   I 
		H	%  B !~~' & &c2;;&6 7 &D &,'eC,<&= '$s) '* 5bkk1A+B  tCy  @4$%R[[ 01 4$d3i 4$n *E#r{{"23  *S	  *N 	-+-+sBKK'(-+ 	-+
 
-+f 48 &*(,(,""#"&o5#(bkk)9#:o5o5 c2;;./0o5 	o5
 d^o5 d38n%o5 E$)$%o5 smo5 o5 }o5 3-o5 	o5j 48 &*(,(,""##'zVzV#(bkk)9#:zV c2;;./0zV 	zV
 d^zV d38n%zV E$)$%zV smzV zV }zV C=zV 
zVzIC IsBKK/?)@ I(SW. Idhildm IX   gkRj5
r%   