
    +h                        S SK r S SKJrJrJrJrJr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Jr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%  SSK&J'r'J(r(  \" 5       (       a  S SK)J*s  J+r,  Sr-OSr-\ R\                  " \/5      r0Sr1    SS\\2   S\\\3\	Rh                  4      S\\\2      S\\\5      4S jjr6 " S S\'\5      r7g)    N)AnyCallableDictListOptionalTupleUnion)T5TokenizerUMT5EncoderModel   )MultiPipelineCallbacksPipelineCallback)VaeImageProcessor)AuraFlowLoraLoaderMixin)AuraFlowTransformer2DModelAutoencoderKL)AttnProcessor2_0FusedAttnProcessor2_0XFormersAttnProcessor)FlowMatchEulerDiscreteScheduler)USE_PEFT_BACKEND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/james-whalen/.local/lib/python3.13/site-packages/diffusers/pipelines/aura_flow/pipeline_aura_flow.pyretrieve_timestepsr5   @   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\\\\   4   S\\\\   4   S\S\S\\R,                     S\\R.                     S\\R.                     S\\R.                     S\\R.                     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\\\\   4   S\\\\   4   S%\S&\\   S'\S\\   S(\\   S)\\   S*\\\RF                  \\RF                     4      S\\R.                     S\\R.                     S\\R.                     S\\R.                     S\\R.                     S\S+\\   S,\S-\\$\\%4      S.\\\&\\\$/S4   \'\(4      S/\\   S0\\)\*4   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transformerr0   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)r<   r=   r>   r?   r0   r>   r         )vae_scale_factor)super__init__register_modulesgetattrr/   r>   configblock_out_channelsrC   r   image_processor)selfr<   r=   r>   r?   r0   r.   s         r4   rE   AuraFlowPipeline.__init__   s|     	hq 	 	
 W^^bdikoVpVpc$((//*L*L&MPQ&Q Rvw0$BWBWXr6   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krK   s     r4   	<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` )	rC   r'   allrQ   
isinstancestrlisttypeshape)rK   promptheightwidthnegative_promptr;   negative_prompt_embedsprompt_attention_masknegative_prompt_attention_mask"callback_on_step_end_tensor_inputsrS   s   `          r4   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TrA      r\   r_   do_classifier_free_guidancenum_images_per_promptr"   r`   ra   rb   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.
NrA   r   T
max_lengthpt)
truncationrl   paddingreturn_tensors	input_idslongest)ro   rp   zZThe following part of your input was truncated because T5 can only handle sequences up to z	 tokens: attention_mask)dtyper"    r&   )rW   r   _lora_scaler=   r   r   _execution_devicerX   rY   r/   r[   r<   rq   torchequalbatch_decodeloggerwarningitemsto	unsqueezeexpandru   r?   repeatviewreshaper   )rK   r\   r_   rg   rh   r"   r;   r`   ra   rb   ri   rj   
batch_sizerl   text_inputstext_input_idsuntruncated_idsremoved_textrS   vru   bs_embedseq_len_uncond_tokensuncond_inputs                             r4   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"   ru   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"   ru   )r   intrC   rW   rY   r/   r'   r   )
rK   r   num_channels_latentsr]   r^   ru   r"   r   r:   r[   s
             r4   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r6   c                 4   U R                   R                  nU R                   R                  [        R                  S9  [        U R                   R                  R                  R                  S   R                  [        [        [        45      nU(       a  U R                   R                  R                  U5        U R                   R                  R                  R                  U5        U R                   R                  R                  R                  U5        g g )Nru   r   )r>   ru   r   ry   float32rW   decoder	mid_block
attentions	processorr   r   r   post_quant_convconv_in)rK   ru   use_torch_2_0_or_xformerss      r4   
upcast_vaeAuraFlowPipeline.upcast_vae  s    %--($.HH&&11!4>> %%%
! %HH$$''.HH$$''.HH&&))%0 %r6   c                     U R                   $ rP   )_guidance_scalerK   s    r4   guidance_scaleAuraFlowPipeline.guidance_scale  s    ###r6   c                     U R                   $ rP   )_attention_kwargsr   s    r4   attention_kwargs!AuraFlowPipeline.attention_kwargs  s    %%%r6   c                     U R                   $ rP   )_num_timestepsr   s    r4   num_timestepsAuraFlowPipeline.num_timesteps  s    """r6   2   g      @i   pilr!   r$   r   r]   r^   r   output_typereturn_dictr   callback_on_step_endrc   returnc                 
   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[%        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
[/        [        U5      X0R&                  R0                  -  -
  S5      n[        U5      U l        U R5                  US
9 n[7        U5       GH  u  nnU(       a  [         R"                  " U
/S-  5      OU
n[         R8                  " 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!RA                  S5      u  n"n#U"UU#U"-
  -  -   n!U R&                  RC                  U!UU
SS9S   n
UbJ  0 n$U H  n%[E        5       U%   U$U%'   M     U" U UUU$5      n&U&RG                  SU
5      n
U&RG                  SU5      nU[        U5      S-
  :X  d)  US-   U:  a0  US-   U R&                  R0                  -  S:X  a  URI                  5         [J        (       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 ge 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.
)rc   NrA   r   scaleg      ?)r\   r_   rg   rh   r"   r;   r`   ra   rb   ri   rj   )dim)r$   )totalr   i  r   F)encoder_hidden_statestimestepr   r   )r   r:   r;   latent)r   )images)6r?   rH   sample_sizerC   rd   r   r   rW   rX   rY   r/   r[   rx   r   getr   ry   catr5   r0   in_channelsr   ru   maxorderr   progress_bar	enumeratetensorr   r   r"   chunksteplocalspopupdateXLA_AVAILABLExm	mark_stepr>   float16force_upcastr   nextiterr   r,   decodescaling_factorrJ   postprocessmaybe_free_model_hooksr    ))rK   r\   r_   r!   r$   r   rh   r]   r^   r   r:   r;   ra   r`   rb   ri   r   r   r   r   rc   r   r"   rj   rg   r#   latent_channelsnum_warmup_stepsr   itlatent_model_inputr   
noise_prednoise_pred_uncondnoise_pred_textcallback_kwargsrS   callback_outputsimageneeds_upcastings)                                            r4   __call__AuraFlowPipeline.__call__  s   L 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
 *<DNNL_agpv)w&	& **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S6S66
T)r   r   rw   r   rJ   rC   )NNNNN)
NTrA   NNNNNrf   NrP   ).__name__
__module____qualname____firstlineno____doc___optional_componentsmodel_cpu_offload_seqrQ   r
   r   r   r   r   rE   rd   r	   rX   r   boolr   r   ry   r"   Tensorfloatr   r   r   propertyr   r   r   no_gradr   EXAMPLE_DOC_STRING	Generatorr   r   r   r   r   r    r   r   __static_attributes____classcell__)r.   s   @r4   r8   r8   {   s   " <
YY 'Y 	Y
 0Y 3Y. #"'++/AL 26,0%&)-049=8<AE#&&*Mlc49n%Ml sDI~.Ml &*	Ml
  #Ml &Ml  -Ml !) 6Ml  (5Ml )1(>Ml !Ml UOMlr @1$ $ $ & & # # ]]_12 )-15#%" #/0 $#MQ*.048<9=AE#&%* 59 9B/m1c49n%m1 sDI~.m1 !	m1
 Um1 m1  (}m1 m1 }m1 E%//43H"HIJm1 %,,'m1  -m1  (5m1 !) 6m1 )1(>m1  !!m1" c]#m1$ %m1& #4S>2'm1( '(Cd+T124DF\\]
)m1. -1I/m10 
"E)	*1m1 3 m1r6   r8   )NNNN)8r)   typingr   r   r   r   r   r   r	   ry   transformersr
   r   	callbacksr   r   rJ   r   loadersr   modelsr   r   models.attention_processorr   r   r   
schedulersr   utilsr   r   r   r   r   r   utils.torch_utilsr   pipeline_utilsr   r    torch_xla.core.xla_modelcore	xla_modelr   r   
get_loggerr   r|   r   r   rX   r"   r   r5   r8   r&   r6   r4   <module>r     s     D D D  6 A 0 . ? h h 9  . C ))MM			H	% $ *.15%)$(8*!#8* U3,-.8* S	"	8*
 T%[!8*vj1(*A j1r6   