
    bi              !           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m	Z	m
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 d	d
lmZ ej4                  dk  rddlZnddlmZ 	  ej<                         a ejB                  e"      Z#h dZ$e$jK                  dh      Z&ejN                  jQ                  dd      jS                         Z*ejN                  jQ                  dd      jS                         Z+ejN                  jQ                  dd      jS                         Z,ejN                  jQ                  dd      jS                         Z-ejN                  jQ                  dd      jS                         Z.e.e$v Z.ej^                  ej`                  ejb                  ejd                  ejf                  ejh                  dZ5dejl                  v xs  e7d ejN                  D              Z8dde9de:dee:e9f   fdZ;e+e&v re*e$vr e;d      \  Z<Z=ne#j}                  d       dZ<dZ=dZ?dZ@e,e&v r|ej                  j                  d      duxr ej                  j                  d       duZCeCr@	  ej                  d      Z? ej                  d       Z@e#j}                  d!e? d"e@ d#       ndZCe-e&v r e;d$      \  ZFZGne#j}                  d%       dZFdZHej                  j                  d&      duZIeIr9d'ZJdZHeJD ]  ZK	  ej                  eK      ZH n eHduZIeIre#j                  d(eH        	 d)ZJdZMeJD ]  ZK	  ej                  eK      ZM n eMduZNeNre#j                  d*eM        ej                  j                  d+      duZO	  ej                  d,      ZPe#j                  d-eP        ej                  j                  d.      duZQ	  ej                  d/      ZRe#j                  d0eR         e;d1      \  ZSZT e;d2      \  ZUZV e;d3      \  ZWZX e;d4      \  ZYZZ e;d5      \  Z[Z\ e;d6      \  Z]Z^ e;d7      \  Z_Z` e;d8      \  ZaZb e;d9      \  ZcZd e;d:      \  ZeZf e;d;      \  ZgZh e;d<      \  ZiZj e;d=      \  ZkZl e;d>      \  ZmZn e;d?      \  ZoZp e;d@      \  ZqZr e;dA      \  ZsZt e;dB      \  ZuZv e;dC      \  ZwZx e;dD      \  ZyZz e;dE      \  Z{Z| e;dF      \  Z}Z~ e;dG      \  ZZ e;dH      \  ZZ e;dI      \  ZZ e;dJ      \  ZZ e;dK      \  ZZ e;dC      \  ZwZx e;dLdMN      \  ZZ e;dO      \  ZZ e;dP      \  ZZ e;dQ      \  ZZ e;dR      \  ZZ e;dS      \  ZZ e;dT      \  ZZ e;dU      \  ZZ e;dV      \  ZZdW ZdX ZdY ZdZ Zd[ Zd\ Zd] Zd^ Zd_ Zd` Zda Zdb Zdc Zdd Zde Zdf Zdg Zdh Zdi Zdj Zdk Zdl Zdm Zdn Zdo Zdp Zdq Zdr Zds Zdt Zdu Zdv Zdw Zdx Zdy Zdz Zd{ Zd| Zd} Zd~ Zd Zd Zd Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ e	d+eeffd eeffd6eeffdeeffdeeffdFeeffdeeffd3eeffd7eeffdGeeffd8eeffd9eeffd:eeffd;eeffd<eeffdEeeffd>eeffdeeffd?eeffd$eeffdCeeffd=eeffdDeeffdJeeffdKeeffdeeffdOeeffdPeeffdQeeffg      Zd Z G d de      Zdee9ef   de9de9fdZde9de9fdZde9de9fdZde9de9fdZde9de9fdZde9de9fdZde9de9fdZde9de9fdZde9de9fdZde9de9fdZde9de9fdZde9de9fdZde9de9fdZde9de9fdZde9de9fdZd Z G d de      Z G d de      Zy# e $ r daY w xY w# ej                  $ r dZCY w xY w# ej                  $ r Y w xY w# ej                  $ r Y w xY w# ej                  $ r dZNY w xY w# ej                  $ r dZOY Yw xY w# ej                  $ r dZQY -w xY w)zD
Import utilities: Utilities related to imports and our lazy inits.
    N)OrderedDictdefaultdict)chain)
ModuleType)AnyTupleUnion)is_jinja_available)Versionparse   )logging)      >   1ONYESTRUEAUTOUSE_TF	USE_TORCHUSE_FLAXUSE_SAFETENSORSDIFFUSERS_SLOW_IMPORTFALSE)>z>=z==z!=z<=<zgoogle.colabc              #   >   K   | ]  }|j                  d         yw)COLAB_N)
startswith).0ks     W/home/cdr/jupyterlab/.venv/lib/python3.12/site-packages/diffusers/utils/import_utils.py	<genexpr>r$   :   s     7cSTX8N7cs   Fpkg_nameget_dist_namereturnc                    t         j                  j                  |       d u}d}|rzt        t	        t
              a	 t        j                         D ]  }|j                  d      xs dj                         }|j                  xs g D ch c]>  }t        |j                        dkD  r|j                  d   nt        j                  |      @ c}d hz
  }t        d |      }|xs |D ]'  }	t        |	   j!                  |j"                  d          )  	 	 |rW| t        v rOt        |    rFt        t        |          dkD  r%t&        j)                  d|  d	t        |    d           t        |    d   } t        j*                  |       }t&        j-                  d
|  d|        ||fS ||fS c c}w # t$        $ r
}
Y d }
~
d }
~
ww xY w# t.        t        j0                  f$ r d}Y ||fS w xY w)NN/Aztop_level.txt r   r   c                 
    d| vS )N. )names    r#   <lambda>z'_is_package_available.<locals>.<lambda>L   s
    co     Namez)Multiple distributions found for package z. Picked distribution: zSuccessfully imported z	 version F)	importlibutil	find_spec_package_mapr   listimportlib_metadatadistributions	read_textsplitfileslenpartsinspectgetmodulenamefilterappendmetadata	ExceptionloggerwarningversiondebugImportErrorPackageNotFoundError)r%   r&   
pkg_existspkg_versiondist_top_level_declaredf_infered_opt_names_top_level_inferredpkg_s              r#   _is_package_availablerS   =   s   ))(34?JK&t,L.<<> HD+/>>/+J+Pb*W*W*Y'_c_i_i_omo*YZc!''lQ&6
G<Q<QRS<TT**& +11MOa*b'2I6I H$S)00v1FGHH
	\!9l8>T|H-.2NNCH:Mdeqrze{|}e~d  A (1!4,44X>KLL1(9[MRS {"":{"")*   /DDE 	J{""	s9   AF* 	AF%AF* B	G  %F* *	F=8F= G! G!torchz*Disabling PyTorch because USE_TORCH is setr)   jaxflaxzJAX version z, Flax version z available.safetensorsz+Disabling Safetensors because USE_TF is setonnxruntime)rX   zonnxruntime-cannzonnxruntime-directmlort_nightly_directmlzonnxruntime-gpuort_nightly_gpuzonnxruntime-migraphxzonnxruntime-openvinozonnxruntime-qnnzonnxruntime-rocmzonnxruntime-trainingzonnxruntime-vitisaiz*Successfully imported onnxruntime version )zopencv-pythonzopencv-contrib-pythonzopencv-python-headlesszopencv-contrib-python-headlessz"Successfully imported cv2 version bs4beautifulsoup4z#Successfully imported ftfy version imwatermarkzinvisible-watermarkz2Successfully imported invisible-watermark version 	torch_xla	torch_nputransformershuggingface_hubkernelsinflect	unidecodek_diffusionnote_seqwandbtensorboardcompelsentencepiecetorchsdepefttorchvision
matplotlibtimmbitsandbytesimageioftfyscipylibrosa
acceleratexformersgguftorchaooptimumT)r&   pytorch_retinafacebetter_profanitynltkcosmos_guardrailsageattention
flash_attnflash_attn_3korniac                      t         S N)_torch_availabler-   r0   r#   is_torch_availabler          r0   c                      t         S r   )_torch_xla_availabler-   r0   r#   is_torch_xla_availabler          r0   c                      t         S r   )_torch_npu_availabler-   r0   r#   is_torch_npu_availabler      r   r0   c                      t         S r   )_flax_availabler-   r0   r#   is_flax_availabler          r0   c                      t         S r   )_transformers_availabler-   r0   r#   is_transformers_availabler          ""r0   c                      t         S r   )_inflect_availabler-   r0   r#   is_inflect_availabler          r0   c                      t         S r   )_unidecode_availabler-   r0   r#   is_unidecode_availabler      r   r0   c                      t         S r   )_onnx_availabler-   r0   r#   is_onnx_availabler     r   r0   c                      t         S r   )_opencv_availabler-   r0   r#   is_opencv_availabler         r0   c                      t         S r   )_scipy_availabler-   r0   r#   is_scipy_availabler   
  r   r0   c                      t         S r   )_librosa_availabler-   r0   r#   is_librosa_availabler     r   r0   c                      t         S r   )_xformers_availabler-   r0   r#   is_xformers_availabler         r0   c                      t         S r   )_accelerate_availabler-   r0   r#   is_accelerate_availabler           r0   c                      t         S r   )_kernels_availabler-   r0   r#   is_kernels_availabler     r   r0   c                      t         S r   )_k_diffusion_availabler-   r0   r#   is_k_diffusion_availabler         !!r0   c                      t         S r   )_note_seq_availabler-   r0   r#   is_note_seq_availabler   "  r   r0   c                      t         S r   )_wandb_availabler-   r0   r#   is_wandb_availabler   &  r   r0   c                      t         S r   )_tensorboard_availabler-   r0   r#   is_tensorboard_availabler   *  r   r0   c                      t         S r   )_compel_availabler-   r0   r#   is_compel_availabler   .  r   r0   c                      t         S r   )_ftfy_availabler-   r0   r#   is_ftfy_availabler   2  r   r0   c                      t         S r   )_bs4_availabler-   r0   r#   is_bs4_availabler   6  s    r0   c                      t         S r   )_torchsde_availabler-   r0   r#   is_torchsde_availabler   :  r   r0   c                      t         S r   )_invisible_watermark_availabler-   r0   r#    is_invisible_watermark_availabler   >  s    ))r0   c                      t         S r   )_peft_availabler-   r0   r#   is_peft_availabler   B  r   r0   c                      t         S r   )_torchvision_availabler-   r0   r#   is_torchvision_availabler   F  r   r0   c                      t         S r   )_matplotlib_availabler-   r0   r#   is_matplotlib_availabler   J  r   r0   c                      t         S r   )_safetensors_availabler-   r0   r#   is_safetensors_availabler   N  r   r0   c                      t         S r   )_bitsandbytes_availabler-   r0   r#   is_bitsandbytes_availabler   R  r   r0   c                      t         S r   )_is_google_colabr-   r0   r#   is_google_colabr   V  r   r0   c                      t         S r   )_sentencepiece_availabler-   r0   r#   is_sentencepiece_availabler   Z      ##r0   c                      t         S r   )_imageio_availabler-   r0   r#   is_imageio_availabler   ^  r   r0   c                      t         S r   )_gguf_availabler-   r0   r#   is_gguf_availabler   b  r   r0   c                      t         S r   )_torchao_availabler-   r0   r#   is_torchao_availabler   f  r   r0   c                      t         S r   )_optimum_quanto_availabler-   r0   r#   is_optimum_quanto_availabler   j  s    $$r0   c                      t         S r   )_timm_availabler-   r0   r#   is_timm_availabler   n  r   r0   c                      t         S r   )_pytorch_retinaface_availabler-   r0   r#   is_pytorch_retinaface_availabler   r  s    ((r0   c                      t         S r   )_better_profanity_availabler-   r0   r#   is_better_profanity_availabler   v      &&r0   c                      t         S r   )_nltk_availabler-   r0   r#   is_nltk_availabler   z  r   r0   c                      t         S r   )_cosmos_guardrail_availabler-   r0   r#   is_cosmos_guardrail_availabler  ~  r   r0   c                  &    t        d dD              S )Nc              3   Z   K   | ]#  }t         j                  j                  |       % y wr   )r2   r3   r4   )r!   libs     r#   r$   z#is_hpu_available.<locals>.<genexpr>  s     iy~~'',is   )+)habana_frameworkszhabana_frameworks.torch)allr-   r0   r#   is_hpu_availabler    s    i8hiiir0   c                      t         S r   )_sageattention_availabler-   r0   r#   is_sageattention_availabler    r   r0   c                      t         S r   )_flash_attn_availabler-   r0   r#   is_flash_attn_availabler    r   r0   c                      t         S r   )_flash_attn_3_availabler-   r0   r#   is_flash_attn_3_availabler    r   r0   c                      t         S r   )_kornia_availabler-   r0   r#   is_kornia_availabler    r   r0   z
{0} requires the FLAX library but it was not found in your environment. Checkout the instructions on the
installation page: https://github.com/google/flax and follow the ones that match your environment.
z
{0} requires the inflect library but it was not found in your environment. You can install it with pip: `pip install
inflect`
z
{0} requires the PyTorch library but it was not found in your environment. Checkout the instructions on the
installation page: https://pytorch.org/get-started/locally/ and follow the ones that match your environment.
z
{0} requires the onnxruntime library but it was not found in your environment. You can install it with pip: `pip
install onnxruntime`
z
{0} requires the OpenCV library but it was not found in your environment. You can install it with pip: `pip
install opencv-python`
z{
{0} requires the scipy library but it was not found in your environment. You can install it with pip: `pip install
scipy`
z
{0} requires the librosa library but it was not found in your environment.  Checkout the instructions on the
installation page: https://librosa.org/doc/latest/install.html and follow the ones that match your environment.
z
{0} requires the transformers library but it was not found in your environment. You can install it with pip: `pip
install transformers`
z
{0} requires the unidecode library but it was not found in your environment. You can install it with pip: `pip install
Unidecode`
z
{0} requires the k-diffusion library but it was not found in your environment. You can install it with pip: `pip
install k-diffusion`
z
{0} requires the note-seq library but it was not found in your environment. You can install it with pip: `pip
install note-seq`
z{
{0} requires the wandb library but it was not found in your environment. You can install it with pip: `pip
install wandb`
z
{0} requires the tensorboard library but it was not found in your environment. You can install it with pip: `pip
install tensorboard`
z}
{0} requires the compel library but it was not found in your environment. You can install it with pip: `pip install compel`
z
{0} requires the Beautiful Soup library but it was not found in your environment. You can install it with pip:
`pip install beautifulsoup4`. Please note that you may need to restart your runtime after installation.
a8  
{0} requires the ftfy library but it was not found in your environment. Checkout the instructions on the
installation section: https://github.com/rspeer/python-ftfy/tree/master#installing and follow the ones
that match your environment. Please note that you may need to restart your runtime after installation.
z
{0} requires the torchsde library but it was not found in your environment. You can install it with pip: `pip install torchsde`
z
{0} requires the invisible-watermark library but it was not found in your environment. You can install it with pip: `pip install invisible-watermark>=0.2.0`
zy
{0} requires the peft library but it was not found in your environment. You can install it with pip: `pip install peft`
z
{0} requires the safetensors library but it was not found in your environment. You can install it with pip: `pip install safetensors`
z
{0} requires the sentencepiece library but it was not found in your environment. You can install it with pip: `pip install sentencepiece`
z
{0} requires the bitsandbytes library but it was not found in your environment. You can install it with pip: `pip install bitsandbytes`
z
{0} requires the imageio library and ffmpeg but it was not found in your environment. You can install it with pip: `pip install imageio imageio-ffmpeg`
zy
{0} requires the gguf library but it was not found in your environment. You can install it with pip: `pip install gguf`
z
{0} requires the torchao library but it was not found in your environment. You can install it with pip: `pip install
torchao`
z
{0} requires the optimum-quanto library but it was not found in your environment. You can install it with pip: `pip
install optimum-quanto`
z
{0} requires the pytorch_retinaface library but it was not found in your environment. You can install it with pip: `pip install pytorch_retinaface`
z
{0} requires the better_profanity library but it was not found in your environment. You can install it with pip: `pip install better_profanity`
zy
{0} requires the nltk library but it was not found in your environment. You can install it with pip: `pip install nltk`
onnxopencvinvisible_watermarkquantoc                    t        |t        t        f      s|g}t        | d      r| j                  n| j
                  j                  }d |D        }|D cg c]  \  }} |       r|j                  |        }}}|rt        dj                  |            |dv rt        dd      rt        d| d      |d	v rt        dd
      rt        d| d      y y c c}}w )N__name__c              3   .   K   | ]  }t         |     y wr   )BACKENDS_MAPPING)r!   backends     r#   r$   z$requires_backends.<locals>.<genexpr>b  s     @Gw'@s   r*   )%VersatileDiffusionTextToImagePipelineVersatileDiffusionPipeline$VersatileDiffusionDualGuidedPipeline%StableDiffusionImageVariationPipelineUnCLIPPipeliner   z4.25.0z9You need to install `transformers>=4.25` in order to use z/: 
```
 pip install --upgrade transformers 
```) StableDiffusionDepth2ImgPipeline"StableDiffusionPix2PixZeroPipelinez4.26.0z9You need to install `transformers>=4.26` in order to use )

isinstancer6   tuplehasattrr  	__class__formatrH   joinis_transformers_version)objbackendsr.   checks	availablemsgfaileds          r#   requires_backendsr2  ]  s    hu.:"3
33<<9O9OD@x@F5;O>9c9;cjjOFO"''&/**   "#x
0Gv N, ,
 	

 YY^uX_ Gv N, ,
 	
_Y! Ps   C&Cc                   "     e Zd ZdZ fdZ xZS )DummyObjectz
    Metaclass for the dummy objects. Any class inheriting from it will return the ImportError generated by
    `requires_backend` each time a user tries to access any method of that class.
    c                 |    |j                  d      r|dvrt        | 	  | |      S t        | | j                         y )NrR   )_load_connected_pipes_is_onnx)r    super__getattr__r2  	_backends)clskeyr(  s     r#   r9  zDummyObject.__getattr__  s7    >>#3.S#S7&sC00#s}}-r0   )r  
__module____qualname____doc__r9  __classcell__r(  s   @r#   r4  r4  |  s    
. .r0   r4  library_or_version	operationrequirement_versionc                    |t         j                         vr,t        dt        t         j                                d|       t         |   }t	        | t
              rt        t        j                  |             }  || t        |            S )a  
    Compares a library version to some requirement using a given operation.

    Args:
        library_or_version (`str` or `packaging.version.Version`):
            A library name or a version to check.
        operation (`str`):
            A string representation of an operator, such as `">"` or `"<="`.
        requirement_version (`str`):
            The version to compare the library version against
    z`operation` must be one of z, received )	STR_OPERATION_TO_FUNCkeys
ValueErrorr6   r%  strr   r7   rF   )rB  rC  rD  s      r#   compare_versionsrJ    s     -22446t<Q<V<V<X7Y6ZZefoepqrr%i0I$c*"#5#=#=>P#QR'/B)CDDr0   rF   c                 6    t        t        t              | |      S )a	  
    Compares the current PyTorch version to a given reference with an operation.

    Args:
        operation (`str`):
            A string representation of an operator, such as `">"` or `"<="`
        version (`str`):
            A string version of PyTorch
    )rJ  r   _torch_versionrC  rF   s     r#   is_torch_versionrN    s     E.19gFFr0   c                 D    t         syt        t        t              | |      S )a  
    Compares the current torch_xla version to a given reference with an operation.

    Args:
        operation (`str`):
            A string representation of an operator, such as `">"` or `"<="`
        version (`str`):
            A string version of torch_xla
    F)r   rJ  r   _torch_xla_versionrM  s     r#   is_torch_xla_versionrQ    s     "E"45y'JJr0   c                 D    t         syt        t        t              | |      S )a  
    Compares the current Transformers version to a given reference with an operation.

    Args:
        operation (`str`):
            A string representation of an operator, such as `">"` or `"<="`
        version (`str`):
            A version string
    F)r   rJ  r   _transformers_versionrM  s     r#   r+  r+    s     #E"78)WMMr0   c                 D    t         syt        t        t              | |      S )a  
    Compares the current Hugging Face Hub version to a given reference with an operation.

    Args:
        operation (`str`):
            A string representation of an operator, such as `">"` or `"<="`
        version (`str`):
            A version string
    F)_hf_hub_availablerJ  r   _hf_hub_versionrM  s     r#   is_hf_hub_versionrW    s     E/2IwGGr0   c                 D    t         syt        t        t              | |      S a  
    Compares the current Accelerate version to a given reference with an operation.

    Args:
        operation (`str`):
            A string representation of an operator, such as `">"` or `"<="`
        version (`str`):
            A version string
    F)r   rJ  r   _accelerate_versionrM  s     r#   is_accelerate_versionr[         !E"56	7KKr0   c                 D    t         syt        t        t              | |      S )z
    Compares the current PEFT version to a given reference with an operation.

    Args:
        operation (`str`):
            A string representation of an operator, such as `">"` or `"<="`
        version (`str`):
            A version string
    F)r   rJ  r   _peft_versionrM  s     r#   is_peft_versionr_         E-0)WEEr0   c                 D    t         syt        t        t              | |      S )a  
    Args:
    Compares the current bitsandbytes version to a given reference with an operation.
        operation (`str`):
            A string representation of an operator, such as `">"` or `"<="`
        version (`str`):
            A version string
    F)r   rJ  r   _bitsandbytes_versionrM  s     r#   is_bitsandbytes_versionrc    s     #E"78)WMMr0   c                 D    t         syt        t        t              | |      S rY  )r   rJ  r   _gguf_versionrM  s     r#   is_gguf_versionrf    r`  r0   c                 D    t         syt        t        t              | |      S )z
    Compares the current torchao version to a given reference with an operation.

    Args:
        operation (`str`):
            A string representation of an operator, such as `">"` or `"<="`
        version (`str`):
            A version string
    F)r   rJ  r   _torchao_versionrM  s     r#   is_torchao_versionri    s     E"23YHHr0   c                 D    t         syt        t        t              | |      S )a  
    Compares the current k-diffusion version to a given reference with an operation.

    Args:
        operation (`str`):
            A string representation of an operator, such as `">"` or `"<="`
        version (`str`):
            A version string
    F)r   rJ  r   _k_diffusion_versionrM  s     r#   is_k_diffusion_versionrl  "  s     "E"67GLLr0   c                 D    t         syt        t        t              | |      S rY  )r   rJ  r   _optimum_quanto_versionrM  s     r#   is_optimum_quanto_versionro  1  s     %E"9:IwOOr0   c                 D    t         syt        t        t              | |      S )z
    Compares the current xformers version to a given reference with an operation.

    Args:
        operation (`str`):
            A string representation of an operator, such as `">"` or `"<="`
        version (`str`):
            A version string
    F)r   rJ  r   _xformers_versionrM  s     r#   is_xformers_versionrr  @  s     E"34iIIr0   c                 D    t         syt        t        t              | |      S )a  
    Compares the current sageattention version to a given reference with an operation.

    Args:
        operation (`str`):
            A string representation of an operator, such as `">"` or `"<="`
        version (`str`):
            A version string
    F)r
  rJ  r   _sageattention_versionrM  s     r#   is_sageattention_versionru  O  s     $E"899gNNr0   c                 D    t         syt        t        t              | |      S )a  
    Compares the current flash-attention version to a given reference with an operation.

    Args:
        operation (`str`):
            A string representation of an operator, such as `">"` or `"<="`
        version (`str`):
            A version string
    F)r  rJ  r   _flash_attn_versionrM  s     r#   is_flash_attn_versionrx  ^  r\  r0   c                 l    i }t        |       D ]#  }|j                  d      rt        | |      ||<   % |S )a  
    Returns a dict of object names and values in a module, while skipping private/internal objects

    Args:
        module (ModuleType):
            Module to extract the objects from.

    Returns:
        dict: Dictionary of object names and corresponding values
    rR   )dirr    getattr)moduleobjectsr.   s      r#   get_objects_from_moduler~  m  sB     GF .??3-.
 Nr0   c                       e Zd ZdZy)OptionalDependencyNotAvailablezh
    An error indicating that an optional dependency of Diffusers was not found in the environment.
    N)r  r=  r>  r?  r-   r0   r#   r  r    s    r0   r  c                   P     e Zd ZdZd
 fd	Z fdZdedefdZdefdZ	d	 Z
 xZS )_LazyModulezu
    Module class that surfaces all objects but only performs associated imports when the objects are requested.
    c                    t         	|   |       t        |j                               | _        i | _        |j                         D ]  \  }}|D ]  }|| j
                  |<     t        |j                               t        t        |j                                z   | _
        || _        || _        t        j                  j                  |      g| _        |i n|| _        || _        || _        y r   )r8  __init__setrG  _modules_class_to_moduleitemsr6   r   values__all____file____spec__ospathdirname__path___objects_name_import_structure)
selfr.   module_fileimport_structuremodule_specextra_objectsr<  r  valuer(  s
            r#   r  z_LazyModule.__init__  s    ,1134 "+113 	3KC 3/2%%e,3	3 ,1134tECSCZCZC\<]7^^##56+3
!1r0   c                 r    t         |          }| j                  D ]  }||vs|j                  |        |S r   )r8  __dir__r  rA   )r  resultattrr(  s      r#   r  z_LazyModule.__dir__  s?    " LL 	$D6!d#	$ r0   r.   r'   c                 ^   || j                   v r| j                   |   S || j                  v r| j                  |      }nb|| j                  j	                         v r+| j                  | j                  |         }t        ||      }nt        d| j                   d|       t        | ||       |S )Nzmodule z has no attribute )	r  r  _get_moduler  rG  r{  AttributeErrorr  setattr)r  r.   r  r|  s       r#   r9  z_LazyModule.__getattr__  s    4== ==&&4== $$T*ET**//11%%d&;&;D&ABFFD)E 74==/9KD6!RSSdE"r0   module_namec           	          	 t        j                  d|z   | j                        S # t        $ r$}t	        d| j                   d| d|       |d }~ww xY w)Nr,   zFailed to import z@ because of the following error (look up to see its traceback):
)r2   import_moduler  rC   RuntimeError)r  r  es      r#   r  z_LazyModule._get_module  sf    	**3+<dmmLL 	#DMM?!K= A!!"% 	s   "% 	AAAc                 `    | j                   | j                  | j                  | j                  ffS r   )r(  r  r  r  )r  s    r#   
__reduce__z_LazyModule.__reduce__  s&    T]]D<R<R STTr0   )NN)r  r=  r>  r?  r  r  rI  r   r9  r  r  r@  rA  s   @r#   r  r    s7    2"  s Ur0   r  )F)r?  importlib.utilr2   r>   operatoropr  syscollectionsr   r   	itertoolsr   typesr   typingr   r   r	   huggingface_hub.utilsr
   packaging.versionr   r   r*   r   version_infor7   importlib.metadatarB   packages_distributionsr5   rC   
get_loggerr  rD   ENV_VARS_TRUE_VALUESunionENV_VARS_TRUE_AND_AUTO_VALUESenvirongetupperr   r   USE_JAXr   r   gtgeeqneleltrF  modulesanyr   rI  boolrS   r   rL  info_jax_version_flax_versionr3   r4   r   rF   rI   r   _safetensors_version_onnxruntime_versionr   
candidatesrQ   rG   _opencv_versionr   r   _bs4_versionr   _invisible_watermark_versionr   rP  r   _torch_npu_versionr   rS  rU  rV  r   _kernels_versionr   _inflect_versionr   _unidecode_versionr   rk  r   _note_seq_versionr   _wandb_versionr   _tensorboard_versionr   _compel_versionr   _sentencepiece_versionr   _torchsde_versionr   r^  r   _torchvision_versionr   _matplotlib_versionr   _timm_versionr   rb  r   _imageio_versionr   _ftfy_versionr   _scipy_versionr   _librosa_versionr   rZ  r   rq  r   re  r   rh  r   rn  r   _pytorch_retinaface_versionr   _better_profanity_versionr   _nltk_versionr  _cosmos_guardrail_versionr
  rt  r  rw  r  _flash_attn_3_versionr  _kornia_versionr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  FLAX_IMPORT_ERRORINFLECT_IMPORT_ERRORPYTORCH_IMPORT_ERRORONNX_IMPORT_ERROROPENCV_IMPORT_ERRORSCIPY_IMPORT_ERRORLIBROSA_IMPORT_ERRORTRANSFORMERS_IMPORT_ERRORUNIDECODE_IMPORT_ERRORK_DIFFUSION_IMPORT_ERRORNOTE_SEQ_IMPORT_ERRORWANDB_IMPORT_ERRORTENSORBOARD_IMPORT_ERRORCOMPEL_IMPORT_ERRORBS4_IMPORT_ERRORFTFY_IMPORT_ERRORTORCHSDE_IMPORT_ERROR INVISIBLE_WATERMARK_IMPORT_ERRORPEFT_IMPORT_ERRORSAFETENSORS_IMPORT_ERRORSENTENCEPIECE_IMPORT_ERRORBITSANDBYTES_IMPORT_ERRORIMAGEIO_IMPORT_ERRORGGUF_IMPORT_ERRORTORCHAO_IMPORT_ERRORQUANTO_IMPORT_ERRORPYTORCH_RETINAFACE_IMPORT_ERRORBETTER_PROFANITY_IMPORT_ERRORNLTK_IMPORT_ERRORr  r2  typer4  rJ  rN  rQ  r+  rW  r[  r_  rc  rf  ri  rl  ro  rr  ru  rx  r~  BaseExceptionr  r  r-   r0   r#   <module>r     sd      	 
 0   $ $ 4 ,  f3<%<<>L 
		H	%1  4 : :F8 D 	&	)	/	/	1JJNN;/557	
**..V
,
2
2
4**..!2F;AAC

'>HNNP -1EE  ee255RUURTRWRW^`^c^cd !S[[0cC7cXZXbXb7c4c  #C  #  #tUXyIY  #F --&@T2T'<W'E$n KK<=N
++nn..u5TArinnF^F^_eFfnrFrO	$5-55e<L6.66v>MKK,|nOM?R]^_ O333H3W00 KK=>" ..**=9EJ   	#=#5#=#=c#B  +$6OABVAWXYJ O 	8088=O (t39/9JKL ))%0<-%--.>?L
LL6|nEF "+!9!9-!HPT!T +#=#5#=#=>S#T 
LLEFbEcde ,A+M ( (+@+M ( (1F~1V . .%:;L%M " ?'<Y'G $ $'<Y'G $ $+@+M ( (/D]/S , ,)>z)J & &#8#A   ./D]/S , ,%:8%D " ?3H3Y 0 0)>z)J & &!6v!> /D]/S , ,-B<-P * *!6v!> 1F~1V . .'<Y'G $ $!6v!> #8#A   .'<Y'G $ $-B<-P * *)>z)J & &!6v!> '<Y'G $ $1F~1V . .5J9dh5i 2 2=RSg=h : :9NOa9b 6 6!6v!> 9NOa9b 6 63H3Y 0 0-B<-P * *1F~1V . .%:8%D " ?  # !""*"!"#$%)''j$!#
              
   
$  
 
 
  
 
  
 # 
! 
 
 	!#345	#%678	)+?@A	#%678	')<=>	%'9:;	%';<=	35NOP	-/EFG	)+?@A	13KLM	+-BCD	%'9:;	13KLM	')<=>	#%678	+-BCD	!ACc de	#%678	13KLM	35NOP	57QRS	)+?@A	#%678	)+?@A	/1DEF	 ?A`ab	;=Z[\	#%678;  F
>	.$ 	.EsG|)< E Ecf E*
G 
Gc 
GKC K# KNs NS NH Hs HLS L3 LFs FS FNs NS NFs FS FI# I IMc MC MP Ps PJ3 J JO Oc OLS L3 L*] 9U* 9U  LP "66 	$#O	$F "66 		( "66 		
 ..  .. N .. +%*"+s   $]6 !<^ .^	_ (^2:_ 5&_  9&_8 6^ ^^^^/.^/2__ __ __ _54_58``