
    
3j              
          S SK r S SKJrJr  S SKrS SKJrJr  SSKJ	r	J
r
  SSKJr  SSKJr  SSKJrJr  SS	KJr  SS
KJrJrJrJrJrJrJr  SSKJr  SSKJrJ r   \" 5       (       a  S SK!J"s  J#r$  Sr%OSr%\RL                  " \'5      r(Sr)    SS\*S-  S\+\RX                  -  S-  S\-\*   S-  S\-\.   S-  4S jjr/ " S S\\5      r0g)    N)AnyCallable)T5TokenizerUMT5EncoderModel   )MultiPipelineCallbacksPipelineCallback)VaeImageProcessor)AuraFlowLoraLoaderMixin)AuraFlowTransformer2DModelAutoencoderKL)FlowMatchEulerDiscreteScheduler)USE_PEFT_BACKEND	deprecateis_torch_xla_availableloggingreplace_example_docstringscale_lora_layersunscale_lora_layers)randn_tensor   )DiffusionPipelineImagePipelineOutputTFa  
    Examples:
        ```py
        >>> import torch
        >>> from diffusers import AuraFlowPipeline

        >>> pipe = AuraFlowPipeline.from_pretrained("fal/AuraFlow", torch_dtype=torch.float16)
        >>> pipe = pipe.to("cuda")
        >>> prompt = "A cat holding a sign that says hello world"
        >>> image = pipe(prompt).images[0]
        >>> image.save("aura_flow.png")
        ```
num_inference_stepsdevice	timestepssigmasc                    Ub  Ub  [        S5      eUb  S[        [        R                  " U R                  5      R
                  R                  5       5      ;   nU(       d  [        SU R                   S35      eU R                  " S
X2S.UD6  U R                  n[        U5      nX14$ Ub  S[        [        R                  " U R                  5      R
                  R                  5       5      ;   nU(       d  [        SU R                   S35      eU R                  " S
XBS.UD6  U R                  n[        U5      nX14$ U R                  " U4S	U0UD6  U R                  nX14$ )a  
Calls the scheduler's `set_timesteps` method and retrieves timesteps from the scheduler after the call. Handles
custom timesteps. Any kwargs will be supplied to `scheduler.set_timesteps`.

Args:
    scheduler (`SchedulerMixin`):
        The scheduler to get timesteps from.
    num_inference_steps (`int`):
        The number of diffusion steps used when generating samples with a pre-trained model. If used, `timesteps`
        must be `None`.
    device (`str` or `torch.device`, *optional*):
        The device to which the timesteps should be moved to. If `None`, the timesteps are not moved.
    timesteps (`list[int]`, *optional*):
        Custom timesteps used to override the timestep spacing strategy of the scheduler. If `timesteps` is passed,
        `num_inference_steps` and `sigmas` must be `None`.
    sigmas (`list[float]`, *optional*):
        Custom sigmas used to override the timestep spacing strategy of the scheduler. If `sigmas` is passed,
        `num_inference_steps` and `timesteps` must be `None`.

Returns:
    `tuple[torch.Tensor, int]`: A tuple where the first element is the timestep schedule from the scheduler and the
    second element is the number of inference steps.
zYOnly one of `timesteps` or `sigmas` can be passed. Please choose one to set custom valuesr   zThe current scheduler class zx's `set_timesteps` does not support custom timestep schedules. Please check whether you are using the correct scheduler.)r   r   r   zv's `set_timesteps` does not support custom sigmas schedules. Please check whether you are using the correct scheduler.)r   r   r    )

ValueErrorsetinspect	signatureset_timesteps
parameterskeys	__class__r   len)	schedulerr   r   r   r   kwargsaccepts_timestepsaccept_sigmass           j/home/wildlama/miniconda3/lib/python3.13/site-packages/diffusers/pipelines/aura_flow/pipeline_aura_flow.pyretrieve_timestepsr.   @   s}   > !3tuu'3w/@/@AXAX/Y/d/d/i/i/k+ll .y/B/B.C Da b  	M)MfM''	!)n )) 
	 C(9(9):Q:Q(R(](](b(b(d$ee.y/B/B.C D_ `  	GvGG''	!)n )) 	 3MFMfM''	))    c            .         ^  \ rS rSrSr/ rSrSS/rS\S\	S\
S	\S
\4
U 4S jjr     S3S jr          S4S\\\   -  S\\\   -  S\S\S\R(                  S-  S\R*                  S-  S\R*                  S-  S\R*                  S-  S\R*                  S-  S\S\S-  4S jjr S5S jrS r\S 5       r\S 5       r\S  5       r\R<                  " 5       \" \ 5      SSS!SS"SS#S#SSSSSSSS$SSSS/4S\\\   -  S\\\   -  S%\S&\\   S'\S\S-  S(\S-  S)\S-  S*\RB                  \\RB                     -  S-  S\R*                  S-  S\R*                  S-  S\R*                  S-  S\R*                  S-  S\R*                  S-  S\S+\S-  S,\S-\"\\#4   S-  S.\$\\/S4   \%-  \&-  S-  S/\\   S0\'\(-  4*S1 jj5       5       r)S2r*U =r+$ )6AuraFlowPipeline{   a  
Args:
    tokenizer (`T5TokenizerFast`):
        Tokenizer of class
        [T5Tokenizer](https://huggingface.co/docs/transformers/model_doc/t5#transformers.T5Tokenizer).
    text_encoder ([`T5EncoderModel`]):
        Frozen text-encoder. AuraFlow uses
        [T5](https://huggingface.co/docs/transformers/model_doc/t5#transformers.T5EncoderModel), specifically the
        [EleutherAI/pile-t5-xl](https://huggingface.co/EleutherAI/pile-t5-xl) variant.
    vae ([`AutoencoderKL`]):
        Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.
    transformer ([`AuraFlowTransformer2DModel`]):
        Conditional Transformer (MMDiT and DiT) architecture to denoise the encoded image latents.
    scheduler ([`FlowMatchEulerDiscreteScheduler`]):
        A scheduler to be used in combination with `transformer` to denoise the encoded image latents.
ztext_encoder->transformer->vaelatentsprompt_embeds	tokenizertext_encodervaetransformerr)   c                   > [         TU ]  5         U R                  XX4US9  [        U SS 5      (       a/  S[	        U R
                  R                  R                  5      S-
  -  OSU l        [        U R                  S9U l
        g )N)r5   r6   r7   r8   r)   r7   r         )vae_scale_factor)super__init__register_modulesgetattrr(   r7   configblock_out_channelsr<   r
   image_processor)selfr5   r6   r7   r8   r)   r'   s         r-   r>   AuraFlowPipeline.__init__   s|     	hq 	 	
 W^^bdikoVpVpc$((//*L*L&MPQ&Q Rvw0$BWBWXr/   Nc
           
        ^  UT R                   S-  -  S:w  d  UT R                   S-  -  S:w  a"  [        ST R                   S-   SU SU S35      eU	bW  [        U 4S jU	 5       5      (       d=  [        ST R                   S	U	 V
s/ s H  oT R                  ;  d  M  U
PM     sn
 35      eUb  Ub  [        S
U SU S35      eUc  Uc  [        S5      eUbA  [	        U[
        5      (       d,  [	        U[        5      (       d  [        S[        U5       35      eUb  Ub  [        S
U SU S35      eUb  Ub  [        SU SU S35      eUb  Uc  [        S5      eUb  Uc  [        S5      eUb  Ub  UR                  UR                  :w  a&  [        SUR                   SUR                   S35      eUR                  UR                  :w  a&  [        SUR                   SUR                   S35      eg g g s  sn
f )Nr   r   z-`height` and `width` have to be divisible by z	 but are z and .c              3   @   >#    U  H  oTR                   ;   v   M     g 7fN)_callback_tensor_inputs).0krD   s     r-   	<genexpr>0AuraFlowPipeline.check_inputs.<locals>.<genexpr>   s      F
7Y!---7Ys   z2`callback_on_step_end_tensor_inputs` has to be in z, but found zCannot forward both `prompt`: z and `prompt_embeds`: z2. Please make sure to only forward one of the two.zeProvide either `prompt` or `prompt_embeds`. Cannot leave both `prompt` and `prompt_embeds` undefined.z2`prompt` has to be of type `str` or `list` but is z and `negative_prompt_embeds`: z'Cannot forward both `negative_prompt`: zEMust provide `prompt_attention_mask` when specifying `prompt_embeds`.zWMust provide `negative_prompt_attention_mask` when specifying `negative_prompt_embeds`.zu`prompt_embeds` and `negative_prompt_embeds` must have the same shape when passed directly, but got: `prompt_embeds` z != `negative_prompt_embeds` z`prompt_attention_mask` and `negative_prompt_attention_mask` must have the same shape when passed directly, but got: `prompt_attention_mask` z% != `negative_prompt_attention_mask` )	r<   r    allrJ   
isinstancestrlisttypeshape)rD   promptheightwidthnegative_promptr4   negative_prompt_embedsprompt_attention_masknegative_prompt_attention_mask"callback_on_step_end_tensor_inputsrL   s   `          r-   check_inputsAuraFlowPipeline.check_inputs   s    T**Q./14AVAVYZAZ8[_`8`?@U@UXY@Y?ZZcdjckkpqvpwwxy  .9# F
7YF
 C
 C
 DTEaEaDbbn  |^  pH  |^vw  ko  kG  kG  bGpq  |^  pH  oI  J  -";08N}o ^0 0  ^ 5w  FC)@)@TZ\`IaIaQRVW]R^Q_`aa"8"D0 9*++]_ 
 &+A+M9/9J K*++]_ 
 $)>)Fdee!-2P2Xvww$)?)K""&<&B&BB --:-@-@,A B.445Q8 
 %**.L.R.RR 55J5P5P4Q R6<<=Q@  S *L$A pHs   G2G2Tr:      rU   rX   do_classifier_free_guidancenum_images_per_promptr   rY   rZ   r[   max_sequence_length
lora_scalec                 X   UbI  [        U [        5      (       a4  Xl        U R                  b!  [        (       a  [        U R                  U5        Uc  U R                  nUb  [        U[        5      (       a  SnO3Ub!  [        U[        5      (       a  [        U5      nOUR                  S   nU
nUGc,  U R                  USUSSS9nUS   nU R                  US	SS
9R                  nUR                  S   UR                  S   :  a^  [        R                  " UU5      (       dB  U R                  R                  USS2US-
  S24   5      n[         R#                  SU SU 35        UR%                  5        VVs0 s H  u  nnUUR'                  U5      _M     nnnU R                  " S0 UD6S   nUS   R)                  S5      R+                  UR                  5      nXh-  nU R                  b  U R                  R,                  nO&U R.                  b  U R.                  R,                  nOSnUR'                  UUS9nUR                  u  nnnUR1                  SUS5      nUR3                  UU-  US5      nUR5                  US5      nUR1                  US5      nU(       a  Uc  U=(       d    Sn[        U[        5      (       a  U/U-  OUnUR                  S   nU R                  USUSSS9nUR%                  5        VVs0 s H  u  nnUUR'                  U5      _M     nnnU R                  " S0 UD6S   nUS   R)                  S5      R+                  UR                  5      n	Xy-  nU(       al  UR                  S   nUR'                  UUS9nUR1                  SUS5      nUR3                  X-  US5      nU	R5                  US5      n	U	R1                  US5      n	OSnSn	U R                  b6  [        U [        5      (       a!  [        (       a  [7        U R                  U5        XhXy4$ s  snnf s  snnf )a:  
Encodes the prompt into text encoder hidden states.

Args:
    prompt (`str` or `list[str]`, *optional*):
        prompt to be encoded
    negative_prompt (`str` or `list[str]`, *optional*):
        The prompt not to guide the image generation. If not defined, one has to pass `negative_prompt_embeds`
        instead. Ignored when not using guidance (i.e., ignored if `guidance_scale` is less than `1`).
    do_classifier_free_guidance (`bool`, *optional*, defaults to `True`):
        whether to use classifier free guidance or not
    num_images_per_prompt (`int`, *optional*, defaults to 1):
        number of images that should be generated per prompt
    device: (`torch.device`, *optional*):
        torch device to place the resulting embeddings on
    prompt_embeds (`torch.Tensor`, *optional*):
        Pre-generated text embeddings. Can be used to easily tweak text inputs, *e.g.* prompt weighting. If not
        provided, text embeddings will be generated from `prompt` input argument.
    prompt_attention_mask (`torch.Tensor`, *optional*):
        Pre-generated attention mask for text embeddings.
    negative_prompt_embeds (`torch.Tensor`, *optional*):
        Pre-generated negative text embeddings.
    negative_prompt_attention_mask (`torch.Tensor`, *optional*):
        Pre-generated attention mask for negative text embeddings.
    max_sequence_length (`int`, defaults to 256): Maximum sequence length to use for the prompt.
    lora_scale (`float`, *optional*):
        A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.
Nr:   r   T
max_lengthpt)
truncationre   paddingreturn_tensors	input_idslongest)rh   ri   zZThe following part of your input was truncated because T5 can only handle sequences up to z	 tokens: attention_mask)dtyper    r   )rP   r   _lora_scaler6   r   r   _execution_devicerQ   rR   r(   rT   r5   rj   torchequalbatch_decodeloggerwarningitemsto	unsqueezeexpandrn   r8   repeatviewreshaper   )rD   rU   rX   r`   ra   r   r4   rY   rZ   r[   rb   rc   
batch_sizere   text_inputstext_input_idsuntruncated_idsremoved_textrL   vrn   bs_embedseq_len_uncond_tokensuncond_inputs                             r-   encode_promptAuraFlowPipeline.encode_prompt   sb   X !j7N&O&O)   ,1A1A!$"3"3Z@>++F*VS"9"9JJvt$<$<VJ&,,Q/J(
 ..%$# ) K )5N"nnVYW[n\ffO$$R(N,@,@,DDU[[N N  $~~::?1j[\n_aNaKa;bc"|9\N<
 8C7H7H7JK7Jtq!1add6l?7JKK --<<Q?M$/0@$A$K$KB$O$V$VWdWjWj$k!)AM(%%++E)$$**EE%((uV(D,22'1%,,Q0EqI%**86K+KWVXY 5 = =h K 5 < <=RTU V '+A+I-3O>HZ]>^>^_-
:dsM&,,Q/J>>%$# * L 9E8J8J8LM8L1AqttF|O8LLM%)%6%6%F%Fq%I"-.88<CCDZD`D`a + &<%\"&,2215G%;%>%>USY%>%Z"%;%B%B1F[]^%_"%;%@%@Acelnp%q"-K-S-ST\^`-a*-K-R-RShjk-l*%)"-1*($ 788=M=M#D$5$5zB5Kkky LB Ns   4P :P&c	                     Ub  UR                  XeS9$ UU[        U5      U R                  -  [        U5      U R                  -  4n	[        U[        5      (       a*  [        U5      U:w  a  [        S[        U5       SU S35      e[        XXeS9nU$ )N)r   rn   z/You have passed a list of generators of length z+, but requested an effective batch size of z@. Make sure the batch size matches the length of the generators.)	generatorr   rn   )rx   intr<   rP   rR   r(   r    r   )
rD   r~   num_channels_latentsrV   rW   rn   r   r   r3   rT   s
             r-   prepare_latents AuraFlowPipeline.prepare_latentsx  s     ::V:99  K4000J$///	
 i&&3y>Z+GA#i.AQ R&<'gi 
 u&Vr/   c                 l    [        SSS5        U R                  R                  [        R                  S9  g )N
upcast_vaez1.0.0z`upcast_vae` is deprecated. Please use `pipe.vae.to(torch.float32)`. For more details, please refer to: https://github.com/huggingface/diffusers/pull/12619#issue-3606633695.rn   )r   r7   rx   rr   float32rD   s    r-   r   AuraFlowPipeline.upcast_vae  s.     |	

 	%--(r/   c                     U R                   $ rI   )_guidance_scaler   s    r-   guidance_scaleAuraFlowPipeline.guidance_scale  s    ###r/   c                     U R                   $ rI   )_attention_kwargsr   s    r-   attention_kwargs!AuraFlowPipeline.attention_kwargs  s    %%%r/   c                     U R                   $ rI   )_num_timestepsr   s    r-   num_timestepsAuraFlowPipeline.num_timesteps  s    """r/   2   g      @i   pilr   r   r   rV   rW   r   output_typereturn_dictr   callback_on_step_endr\   returnc                 0
   U=(       d-    U R                   R                  R                  U R                  -  nU=(       d-    U R                   R                  R                  U R                  -  nU R	                  UUUUUUUUUS9	  XPl        UU l        Ub  [        U[        5      (       a  SnO3Ub!  [        U[        5      (       a  [        U5      nOUR                  S   nU R                  nU R                  b  U R                  R                  SS5      OSnUS:  nU R                  UUUUUUUUUUUS9u  nnnnU(       a  [         R"                  " X/SS9n[$        (       a  S	nOUn['        U R(                  UUUS
9u  nnU R                   R                  R*                  nU R-                  UU-  UUUUR.                  UU	U
5      n
[1        [        U5      X0R(                  R2                  -  -
  S5      n[        U5      U l        U R7                  US9 n[9        U5       GH  u  nnU(       a  [         R"                  " U
/S-  5      OU
n [         R:                  " US-  /5      R=                  U R                  S   5      n!U!R?                  U
R@                  U
R.                  S9n!U R                  U UU!SU R                  S9S   n"U(       a  U"RC                  S5      u  n#n$U#UU$U#-
  -  -   n"U R(                  RE                  U"UU
SS9S   n
UbJ  0 n%U H  n&[G        5       U&   U%U&'   M     U" U UUU%5      n'U'RI                  SU
5      n
U'RI                  SU5      nU[        U5      S-
  :X  d)  US-   U:  a0  US-   U R(                  R2                  -  S:X  a  URK                  5         [$        (       d  GM  [L        RN                  " 5         GM     SSS5        US:X  a  U
n(GOU RP                  R.                  [         RR                  :H  =(       a     U RP                  R                  RT                  n)U)(       a_  U RW                  5         U
R?                  [Y        [[        U RP                  R\                  R_                  5       5      5      R.                  5      n
U RP                  Ra                  XRP                  R                  Rb                  -  SS9S   n(U Rd                  Rg                  U(US9n(U Ri                  5         U(       d  U(4$ [k        U(S9$ ! , (       d  f       GNG= f)aK  
Function invoked when calling the pipeline for generation.

Args:
    prompt (`str` or `list[str]`, *optional*):
        The prompt or prompts to guide the image generation. If not defined, one has to pass `prompt_embeds`.
        instead.
    negative_prompt (`str` or `list[str]`, *optional*):
        The prompt or prompts not to guide the image generation. If not defined, one has to pass
        `negative_prompt_embeds` instead. Ignored when not using guidance (i.e., ignored if `guidance_scale` is
        less than `1`).
    height (`int`, *optional*, defaults to self.transformer.config.sample_size * self.vae_scale_factor):
        The height in pixels of the generated image. This is set to 1024 by default for best results.
    width (`int`, *optional*, defaults to self.transformer.config.sample_size * self.vae_scale_factor):
        The width in pixels of the generated image. This is set to 1024 by default for best results.
    num_inference_steps (`int`, *optional*, defaults to 50):
        The number of denoising steps. More denoising steps usually lead to a higher quality image at the
        expense of slower inference.
    sigmas (`list[float]`, *optional*):
        Custom sigmas used to override the timestep spacing strategy of the scheduler. If `sigmas` is passed,
        `num_inference_steps` and `timesteps` must be `None`.
    guidance_scale (`float`, *optional*, defaults to 5.0):
        Guidance scale as defined in [Classifier-Free Diffusion
        Guidance](https://huggingface.co/papers/2207.12598). `guidance_scale` is defined as `w` of equation 2.
        of [Imagen Paper](https://huggingface.co/papers/2205.11487). Guidance scale is enabled by setting
        `guidance_scale > 1`. Higher guidance scale encourages to generate images that are closely linked to
        the text `prompt`, usually at the expense of lower image quality.
    num_images_per_prompt (`int`, *optional*, defaults to 1):
        The number of images to generate per prompt.
    generator (`torch.Generator` or `list[torch.Generator]`, *optional*):
        One or a list of [torch generator(s)](https://pytorch.org/docs/stable/generated/torch.Generator.html)
        to make generation deterministic.
    latents (`torch.FloatTensor`, *optional*):
        Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
        generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
        tensor will be generated by sampling using the supplied random `generator`.
    prompt_embeds (`torch.FloatTensor`, *optional*):
        Pre-generated text embeddings. Can be used to easily tweak text inputs, *e.g.* prompt weighting. If not
        provided, text embeddings will be generated from `prompt` input argument.
    prompt_attention_mask (`torch.Tensor`, *optional*):
        Pre-generated attention mask for text embeddings.
    negative_prompt_embeds (`torch.FloatTensor`, *optional*):
        Pre-generated negative text embeddings. Can be used to easily tweak text inputs, *e.g.* prompt
        weighting. If not provided, negative_prompt_embeds will be generated from `negative_prompt` input
        argument.
    negative_prompt_attention_mask (`torch.Tensor`, *optional*):
        Pre-generated attention mask for negative text embeddings.
    output_type (`str`, *optional*, defaults to `"pil"`):
        The output format of the generate image. Choose between
        [PIL](https://pillow.readthedocs.io/en/stable/): `PIL.Image.Image` or `np.array`.
    return_dict (`bool`, *optional*, defaults to `True`):
        Whether or not to return a [`~pipelines.stable_diffusion_xl.StableDiffusionXLPipelineOutput`] instead
        of a plain tuple.
    attention_kwargs (`dict`, *optional*):
        A kwargs dictionary that if specified is passed along to the `AttentionProcessor` as defined under
        `self.processor` in
        [diffusers.models.attention_processor](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py).
    callback_on_step_end (`Callable`, *optional*):
        A function that calls at the end of each denoising steps during the inference. The function is called
        with the following arguments: `callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int,
        callback_kwargs: Dict)`. `callback_kwargs` will include a list of all tensors as specified by
        `callback_on_step_end_tensor_inputs`.
    callback_on_step_end_tensor_inputs (`list`, *optional*):
        The list of tensor inputs for the `callback_on_step_end` function. The tensors specified in the list
        will be passed as `callback_kwargs` argument. You will only be able to include variables listed in the
        `._callback_tensor_inputs` attribute of your pipeline class.
    max_sequence_length (`int` defaults to 256): Maximum sequence length to use with the `prompt`.

Examples:

Returns: [`~pipelines.ImagePipelineOutput`] or `tuple`:
    If `return_dict` is `True`, [`~pipelines.ImagePipelineOutput`] is returned, otherwise a `tuple` is returned
    where the first element is a list with the generated images.
)r\   Nr:   r   scaleg      ?)rU   rX   r`   ra   r   r4   rY   rZ   r[   rb   rc   )dimcpu)r   )totalr   i  r   F)encoder_hidden_statestimestepr   r   )r   r3   r4   latent)r   )images)6r8   rA   sample_sizer<   r]   r   r   rP   rQ   rR   r(   rT   rq   r   getr   rr   catXLA_AVAILABLEr.   r)   in_channelsr   rn   maxorderr   progress_bar	enumeratetensorrz   rx   r   chunksteplocalspopupdatexm	mark_stepr7   float16force_upcastr   nextiterpost_quant_convr%   decodescaling_factorrC   postprocessmaybe_free_model_hooksr   )*rD   rU   rX   r   r   r   ra   rV   rW   r   r3   r4   rZ   rY   r[   rb   r   r   r   r   r\   r~   r   rc   r`   timestep_devicer   latent_channelsnum_warmup_stepsr   itlatent_model_inputr   
noise_prednoise_pred_uncondnoise_pred_textcallback_kwargsrL   callback_outputsimageneeds_upcastings*                                             r-   __call__AuraFlowPipeline.__call__  s   H V4++22>>AVAVVT))00<<t?T?TT"!*/Q 	 
	
  .!1 *VS"9"9JJvt$<$<VJ&,,Q/J''AEAVAVAbT**..w=hl

 '5s&:# +(C"7'#9"7+I 3!  
	
!"* '!II'=&MSTUM
 =#O$O);NN/*
&	&
 **11==&&..	
 s9~0CnnFZFZ0ZZ\]^!)n%89\!),1A\UYYy1}%=bi" !<<T
3::;M;S;STU;VW#;;w~~W]];K "--&*7% %%)%:%: .  
 /9C9I9I!9L6%!2^YjGj5k!kJ ..--j!WRW-XYZ['3&(O?-3Xa[* @';D!Q'X$.229gFG$4$8$8-$XM I**A9I/IqSTuX\XfXfXlXlNlpqNq '') =LLNQ - :V ("E #hhnn=^$((//B^B^O!!**T$txx/G/G/R/R/T*U%V%\%\]HHOOGhhoo.L.L$LZ_O`abcE((44U4TE 	##%8O"%00y :9s   FT,T
T)r   r   rp   r   rC   r<   )NNNNN)
NTr:   NNNNNr_   NrI   ),__name__
__module____qualname____firstlineno____doc___optional_componentsmodel_cpu_offload_seqrJ   r   r   r   r   r   r>   r]   rQ   rR   boolr   rr   r   Tensorfloatr   r   r   propertyr   r   r   no_gradr   EXAMPLE_DOC_STRING	Generatordictr   r   r	   r   r   tupler   __static_attributes____classcell__)r'   s   @r-   r1   r1   {   s   " <
YY 'Y 	Y
 0Y 3Y. #"'++/AL ,0,0%&&*-16:59>B#&#'Mld3iMl tCyMl &*	Ml
  #Ml t#Ml ||d*Ml !&t 3Ml  %||d2Ml ).t(;Ml !Ml DLMlr @) $ $ & & # # ]]_12 #'+/#%" #,-! DH'+-1596:>B#&"' 26nr9B+q1d3iq1 tCyq1 !	q1
 Uq1 q1  #Tzq1 d
q1 Tzq1 ??T%//%::TAq1 $q1 ||d*q1  %||d2q1 !&t 3q1 ).t(;q1  !!q1" 4Z#q1$ %q1& sCx.4/'q1( 'Sz4'78;KKNddgkk)q1* -1I+q1, 
u	$-q1 3 q1r/   r1   )NNNN)1r"   typingr   r   rr   transformersr   r   	callbacksr   r	   rC   r
   loadersr   modelsr   r   
schedulersr   utilsr   r   r   r   r   r   r   utils.torch_utilsr   pipeline_utilsr   r   torch_xla.core.xla_modelcore	xla_modelr   r   
get_loggerr   ru   r   r   rQ   r   rR   r   r.   r1   r   r/   r-   <module>r      s        6 A 0 . ? 9   . C ))MM			H	% $ '+(,"&!%8*t8* %,,%8* Cy4	8*
 K$8*vd1(*A d1r/   