
    +h                        S SK r S SKJrJrJrJr  S SKrS SKJr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Jr  SS	KJr  S
SKJrJr  SSKJr  \" 5       (       a  S SKJs  Jr   Sr!OSr!\RD                  " \#5      r$Sr% " S S\5      r&g)    N)CallableListOptionalUnion)T5EncoderModelT5TokenizerT5TokenizerFast   )AutoencoderOobleckStableAudioDiTModel)get_1d_rotary_pos_embed)EDMDPMSolverMultistepScheduler)is_torch_xla_availableloggingreplace_example_docstring)randn_tensor   )AudioPipelineOutputDiffusionPipeline   )StableAudioProjectionModelTFa  
    Examples:
        ```py
        >>> import scipy
        >>> import torch
        >>> import soundfile as sf
        >>> from diffusers import StableAudioPipeline

        >>> repo_id = "stabilityai/stable-audio-open-1.0"
        >>> pipe = StableAudioPipeline.from_pretrained(repo_id, torch_dtype=torch.float16)
        >>> pipe = pipe.to("cuda")

        >>> # define the prompts
        >>> prompt = "The sound of a hammer hitting a wooden surface."
        >>> negative_prompt = "Low quality."

        >>> # set the seed for generator
        >>> generator = torch.Generator("cuda").manual_seed(0)

        >>> # run the generation
        >>> audio = pipe(
        ...     prompt,
        ...     negative_prompt=negative_prompt,
        ...     num_inference_steps=200,
        ...     audio_end_in_s=10.0,
        ...     num_waveforms_per_prompt=3,
        ...     generator=generator,
        ... ).audios

        >>> output = audio[0].T.float().cpu().numpy()
        >>> sf.write("hammer.wav", output, pipe.vae.sampling_rate)
        ```
c            ,       N  ^  \ rS rSrSrSrS\S\S\S\	\
\4   S\S	\4U 4S
 jjrS rS r     S)S\\R&                     S\\R&                     S\\R(                     S\\R(                     4S jjrS rS r       S*S jr    S+S jr\R4                  " 5       \" \5                          S,S\	\\\   4   S\\   S\\   S\ S\S\\	\\\   4      S\\    S\S\\	\RB                  \\RB                     4      S \\R&                     S!\\R&                     S"\\R&                     S\\R&                     S\\R&                     S\\R(                     S\\R(                     S#\"S$\\#\ \ \R&                  /S4      S%\\    S&\\   4(S' jj5       5       r$S(r%U =r&$ )-StableAudioPipelineR   a  
Pipeline for text-to-audio generation using StableAudio.

This model inherits from [`DiffusionPipeline`]. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).

Args:
    vae ([`AutoencoderOobleck`]):
        Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.
    text_encoder ([`~transformers.T5EncoderModel`]):
        Frozen text-encoder. StableAudio uses the encoder of
        [T5](https://huggingface.co/docs/transformers/model_doc/t5#transformers.T5EncoderModel), specifically the
        [google-t5/t5-base](https://huggingface.co/google-t5/t5-base) variant.
    projection_model ([`StableAudioProjectionModel`]):
        A trained model used to linearly project the hidden-states from the text encoder model and the start and
        end seconds. The projected hidden-states from the encoder and the conditional seconds are concatenated to
        give the input to the transformer model.
    tokenizer ([`~transformers.T5Tokenizer`]):
        Tokenizer to tokenize text for the frozen text-encoder.
    transformer ([`StableAudioDiTModel`]):
        A `StableAudioDiTModel` to denoise the encoded audio latents.
    scheduler ([`EDMDPMSolverMultistepScheduler`]):
        A scheduler to be used in combination with `transformer` to denoise the encoded audio latents.
z0text_encoder->projection_model->transformer->vaevaetext_encoderprojection_model	tokenizertransformer	schedulerc           	         > [         TU ]  5         U R                  UUUUUUS9  U R                  R                  R
                  S-  U l        g )N)r   r   r   r   r   r    r   )super__init__register_modulesr   configattention_head_dimrotary_embed_dim)selfr   r   r   r   r   r    	__class__s          p/home/james-whalen/.local/lib/python3.13/site-packages/diffusers/pipelines/stable_audio/pipeline_stable_audio.pyr#   StableAudioPipeline.__init__n   sV     	%-# 	 	
 !% 0 0 7 7 J Ja O    c                 8    U R                   R                  5         g)z
Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.
N)r   enable_slicingr(   s    r*   enable_vae_slicing&StableAudioPipeline.enable_vae_slicing   s    
 	!r,   c                 8    U R                   R                  5         g)z
Disable sliced VAE decoding. If `enable_vae_slicing` was previously enabled, this method will go back to
computing decoding in one step.
N)r   disable_slicingr/   s    r*   disable_vae_slicing'StableAudioPipeline.disable_vae_slicing   s    
 	  "r,   Nprompt_embedsnegative_prompt_embedsattention_masknegative_attention_maskc	                 &   Ub  [        U[        5      (       a  Sn	O3Ub!  [        U[        5      (       a  [        U5      n	OUR                  S   n	UGcq  U R                  USU R
                  R                  SSS9n
U
R                  nU
R                  nU R                  USSS9R                  nUR                  S	   UR                  S	   :  a  [        R                  " X5      (       d  U R
                  R                  US S 2U R
                  R                  S-
  S	24   5      n[        R                  S
U R                  R                  R                    SU R
                  R                   SU 35        UR#                  U5      nUR#                  U5      nU R                  R%                  5         U R                  UUS9nUS   nU(       Ga]  UGbY  ['        U5      ['        U5      La$  [)        S['        U5       S['        U5       S35      e[        U[        5      (       a  U/nO2U	[        U5      :w  a!  [+        SU S[        U5       SU SU	 S3	5      eUnU R                  USU R
                  R                  SSS9nUR                  R#                  U5      nUR                  R#                  U5      nU R                  R%                  5         U R                  UUS9nUS   nUbD  [        R,                  " UR#                  [        R.                  5      R1                  S5      US5      nU(       am  Ubj  [        R2                  " Xe/5      nUb  Uc  [        R4                  " U5      nOUc  Ub  [        R4                  " U5      nUb  [        R2                  " X/5      nU R7                  US9R8                  nUbX  XWR1                  S	5      R#                  UR:                  5      -  nXWR1                  S	5      R#                  UR:                  5      -  nU$ )Nr   r   
max_lengthTpt)paddingr;   
truncationreturn_tensorslongest)r=   r?   z7The following part of your input was truncated because z! can only handle sequences up to z	 tokens: )r8   z?`negative_prompt` should be the same type to `prompt`, but got z != .z`negative_prompt`: z has batch size z, but `prompt`: zT. Please make sure that passed `negative_prompt` matches the batch size of `prompt`.r           )text_hidden_states)
isinstancestrlistlenshaper   model_max_length	input_idsr8   torchequalbatch_decodeloggerwarningr   r%   
model_typetoevaltype	TypeError
ValueErrorwherebool	unsqueezecat	ones_liker   rD   dtype)r(   promptdevicedo_classifier_free_guidancenegative_promptr6   r7   r8   r9   
batch_sizetext_inputstext_input_idsuntruncated_idsremoved_textuncond_tokensuncond_inputuncond_input_idss                    r*   encode_prompt!StableAudioPipeline.encode_prompt   s*    *VS"9"9JJvt$<$<VJ&,,Q/J ..$>>::# ) K )22N(77N"nnVYW[n\ffO$$R(N,@,@,DDU[[N N  $~~::#At~~'F'F'JR'O$OP  MdN_N_NfNfNqNqMr s337>>3R3R2SS\]i\jl
 ,..v6N+..v6N ""$ --- . M *!,M&?+FF|4#88UVZ[jVkUl mV~Q(  OS11!0 1s?33 )/)::J3K_J` ax/
| <33  !0  >>$>>::# * L  ,5588@&2&A&A&D&DV&L# ""$%)%6%6 6 &7 &" &<A%>"&2).+..uzz:DDQGI_ad*&
 '+A+M "II'=&MNM).E.M*///.*I'',C,O!&1H!I)!&,C+T!U--, . 


 	 %),D,DR,H,K,KML_L_,``M),D,DR,H,K,KML_L_,``Mr,   c                    [        U[        5      (       a  UOU/n[        U[        5      (       a  UOU/n[        U5      S:X  a  X-  n[        U5      S:X  a  X%-  nU Vs/ s H  n[        U5      PM     nn[        R
                  " U5      R                  U5      nU Vs/ s H  n[        U5      PM     nn[        R
                  " U5      R                  U5      nU R                  UUS9nUR                  nUR                  n	U(       a,  [        R                  " X/SS9n[        R                  " X/SS9n	X4$ s  snf s  snf )Nr   )start_secondsend_secondsr   dim)rE   rG   rH   floatrL   tensorrR   r   seconds_start_hidden_statesseconds_end_hidden_statesrZ   )
r(   audio_start_in_saudio_end_in_sr^   r_   ra   xprojection_outputrr   rs   s
             r*   encode_duration#StableAudioPipeline.encode_duration  sE    0::JD/Q/Q+XhWi+5nd+K+KR`Qa A%/<~!#+8N /??.>E!H.>? <<(89<<VD,:;Nq%(N;n588@ 11*& 2 
 '8&S&S#$5$O$O! '*/))5P4ntu*v'(-		3L2hno(p%*EE' @ <s   D9D>c                 n   S[        [        R                  " U R                  R                  5      R
                  R                  5       5      ;   n0 nU(       a  X$S'   S[        [        R                  " U R                  R                  5      R
                  R                  5       5      ;   nU(       a  XS'   U$ )Neta	generator)setinspect	signaturer    step
parameterskeys)r(   r|   r{   accepts_etaextra_step_kwargsaccepts_generators         r*   prepare_extra_step_kwargs-StableAudioPipeline.prepare_extra_step_kwargs2  s     s7#4#4T^^5H5H#I#T#T#Y#Y#[\\'*e$ (3w/@/@ATAT/U/`/`/e/e/g+hh-6k*  r,   c           	         X2:  a  [        SU SU S35      eX R                  R                  R                  :  d#  X R                  R                  R                  :  aQ  [        SU R                  R                  R                   SU R                  R                  R                   SU S35      eX0R                  R                  R                  :  d#  X0R                  R                  R                  :  aQ  [        SU R                  R                  R                   SU R                  R                  R                   SU S35      eUb  Ub6  [        U[        5      (       a  US	::  a  [        S
U S[        U5       S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  UR                  UR                  :w  a&  [        SUR                   SUR                   S35      eUbB  UR                  UR                  S S :w  a%  [        SUR                   SUR                   35      eUc  U
b  [        S5      eUb@  XR                  R                  :w  a&  [        SU R                  R                   SU S35      eg g )Nz`audio_end_in_s=z(' must be higher than 'audio_start_in_s=z` but z4`audio_start_in_s` must be greater than or equal to z, and lower than or equal to z but is rB   z2`audio_end_in_s` must be greater than or equal to r   z5`callback_steps` has to be a positive integer but is z	 of type zCannot forward both `prompt`: z and `prompt_embeds`: z2. Please make sure to only forward one of the two.zoProvide either `prompt`, or `prompt_embeds`. Cannot leave`prompt` undefined without specifying `prompt_embeds`.z2`prompt` has to be of type `str` or `list` but is z'Cannot forward both `negative_prompt`: z and `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` r   zq`attention_mask should have the same batch size and sequence length as `prompt_embeds`, but got:`attention_mask: z != `prompt_embeds` zt`initial_audio_waveforms' is provided but the sampling rate is not. Make sure to pass `initial_audio_sampling_rate`.z&`initial_audio_sampling_rate` must be z
' but is `zX`.Make sure to resample the `initial_audio_waveforms` and to correct the sampling rate. )rV   r   r%   	min_value	max_valuerE   intrT   rF   rG   rI   r   sampling_rate
hop_length)r(   r]   rt   ru   callback_stepsr`   r6   r7   r8   r9   initial_audio_waveformsinitial_audio_sampling_rates               r*   check_inputs StableAudioPipeline.check_inputsC  s    ,">"22Z[kZllrs 
 44;;EEE"7"7">">"H"HHFtG\G\GcGcGmGmFn  oL  MQ  Mb  Mb  Mi  Mi  Ms  Ms  Lt t&'q*  2299CCC 5 5 < < F FFDTEZEZEaEaEkEkDl  mJ  KO  K`  K`  Kg  Kg  Kq  Kq  Jr r$%Q( 
 "&
>30O0OSaefSfGGW X(), 
 -";08N}o ^0 0  ^!6I  FC)@)@TZ\`IaIaQRVW]R^Q_`aa&+A+M9/9J K*++]_ 
 $)?)K""&<&B&BB --:-@-@,A B.445Q8 
 )n.B.BmFYFYZ\[\F].] ((6(<(<'==QR_ReReQfh 
 '.3J3V G  '27RV^V^VlVl7l89L9L8MZXsWt ui i  8m2r,   c           	         XU4n[        U[        5      (       a*  [        U5      U:w  a  [        S[        U5       SU S35      eUc  [	        XXTS9nOUR                  U5      nXpR                  R                  -  nUGb  UR                  S:X  a  UR                  S5      nO)UR                  S:w  a  [        SUR                   S	35      e[        U R                  R                  R                  5      U R                  R                  -  nX-  X4nUR                   S   S:X  a  U
S:X  a  UR#                  SSS5      nO)UR                   S   S:X  a  U
S:X  a  UR%                  SS
S9nUR                   S S US S :w  a  [        SUR                    S35      eUR                   S   nX:  a  [&        R)                  SU SU S35        O!X:  a  [&        R)                  SU SU S35        UR+                  U5      nUS S 2S S 2S U24   US S 2S S 2S [-        X5      24'   U R                  R/                  U5      R0                  R3                  U5      nUR#                  U	SS45      nUU-   nU$ )Nz/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.)r|   r^   r\   r   r   r
   z`initial_audio_waveforms` must be of shape `(batch_size, num_channels, audio_length)` or `(batch_size, audio_length)` but has `z` dimensionsT)keepdimz`initial_audio_waveforms` must be of shape `(batch_size, num_channels, audio_length)` or `(batch_size, audio_length)` but is of shape ``rA   z(The provided input waveform is shorter (z") than the required audio length (z') of the model and will thus be padded.z'The provided input waveform is longer (z() of the model and will thus be cropped.)rE   rG   rH   rV   r   rR   r    init_noise_sigmandimrY   r   r   r%   sample_sizer   r   rI   repeatmeanrO   rP   	new_zerosminencodelatent_distsample)r(   ra   num_channels_vaer   r\   r^   r|   latentsr   num_waveforms_per_promptaudio_channelsrI   audio_vae_lengthaudio_shapeaudio_lengthaudioencoded_audios                    r*   prepare_latents#StableAudioPipeline.prepare_latents  s    {;i&&3y>Z+GA#i.AQ R&<'gi 
 ?"5fZGjj(G NN;;; #.&++q0*A*K*KA*N'(--2  V  Wn  Ws  Ws  Vt  t@  A   #4#3#3#:#:#F#FG$((J]J]]%A>dK ',,Q/1419L*A*H*HAq*Q'(..q1Q6>Q;N*A*F*FqRV*F*W'&,,Ra0KOC  ^  _v  _|  _|  ^}  }~   
 388<L.>|nLno  oA  Ah  i 0=l^Kmn~m  @h  i ,55kBEAXYZ\]_p`p_pYpAqE!Q=#l===> HHOOE2>>EEiPM)002JAq1QRM#g-Gr,   r]   ru   rt   num_inference_stepsguidance_scaler`   r   r{   r|   r   r   r   return_dictcallbackr   output_typec                    U R                   R                  nU R                  R                  R                  U-  U R                   R                  R
                  -  nUc  UnX#-
  U:  a  [        SX#-
   SU SU S35      e[        X0R                   R                  R
                  -  5      n[        X R                   R                  R
                  -  5      n[        U R                  R                  R                  5      nU R                  UUUUUUUUUUU5        Ub  [        U[        5      (       a  SnO3Ub!  [        U[        5      (       a  [        U5      nOUR                  S   nU R                  nUS:  nU R                  UUUUUUUU5      nU R!                  UUUU=(       a    USL=(       d    USLU5      u  nn["        R$                  " UUU/SS	9n["        R$                  " UU/S
S	9n U(       aS  UcP  UcM  ["        R&                  " UUR(                  S9n!["        R$                  " U!U/SS	9n["        R$                  " U U /SS	9n UR                  u  n"n#n$UR+                  SUS5      nUR-                  U"U-  U#U$5      nU R+                  SUS5      n U R-                  U"U-  SU R                  S   5      n U R.                  R1                  UUS9  U R.                  R2                  n%U R                  R                  R4                  n&U R7                  UU-  U&UUR8                  UU	U
UUU R                   R                  R:                  S9
n
U R=                  X5      n'[?        U R@                  U
R                  S
   U R                  S   -   SSS9n([        U%5      X@R.                  RB                  -  -
  n)U RE                  US9 n*[G        U%5       GHY  u  n+n,U(       a  ["        R$                  " U
/S
-  5      OU
n-U R.                  RI                  U-U,5      n-U R                  U-U,RK                  S5      UU U(SS9S   n.U(       a  U.RM                  S
5      u  n/n0U/UU0U/-
  -  -   n.U R.                  RN                  " U.U,U
40 U'D6RP                  n
U+[        U%5      S-
  :X  d)  U+S-   U):  a`  U+S-   U R.                  RB                  -  S:X  a@  U*RS                  5         Ub-  U+U-  S:X  a$  U+[U        U R.                  SS5      -  n1U" U1U,U
5        [V        (       d  GMD  [X        RZ                  " 5         GM\     SSS5        US:X  d&  U R                   R]                  U
5      R^                  n2O	[a        U
S9$ U2SS2SS2UU24   n2US:X  a,  U2Rc                  5       Re                  5       Rg                  5       n2U Ri                  5         U(       d  U24$ [a        U2S9$ ! , (       d  f       N= f)u  
The call function to the pipeline for generation.

Args:
    prompt (`str` or `List[str]`, *optional*):
        The prompt or prompts to guide audio generation. If not defined, you need to pass `prompt_embeds`.
    audio_end_in_s (`float`, *optional*, defaults to 47.55):
        Audio end index in seconds.
    audio_start_in_s (`float`, *optional*, defaults to 0):
        Audio start index in seconds.
    num_inference_steps (`int`, *optional*, defaults to 100):
        The number of denoising steps. More denoising steps usually lead to a higher quality audio at the
        expense of slower inference.
    guidance_scale (`float`, *optional*, defaults to 7.0):
        A higher guidance scale value encourages the model to generate audio that is closely linked to the text
        `prompt` at the expense of lower sound quality. Guidance scale is enabled when `guidance_scale > 1`.
    negative_prompt (`str` or `List[str]`, *optional*):
        The prompt or prompts to guide what to not include in audio generation. If not defined, you need to
        pass `negative_prompt_embeds` instead. Ignored when not using guidance (`guidance_scale < 1`).
    num_waveforms_per_prompt (`int`, *optional*, defaults to 1):
        The number of waveforms to generate per prompt.
    eta (`float`, *optional*, defaults to 0.0):
        Corresponds to parameter eta (η) from the [DDIM](https://huggingface.co/papers/2010.02502) paper. Only
        applies to the [`~schedulers.DDIMScheduler`], and is ignored in other schedulers.
    generator (`torch.Generator` or `List[torch.Generator]`, *optional*):
        A [`torch.Generator`](https://pytorch.org/docs/stable/generated/torch.Generator.html) to make
        generation deterministic.
    latents (`torch.Tensor`, *optional*):
        Pre-generated noisy latents sampled from a Gaussian distribution, to be used as inputs for audio
        generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
        tensor is generated by sampling using the supplied random `generator`.
    initial_audio_waveforms (`torch.Tensor`, *optional*):
        Optional initial audio waveforms to use as the initial audio waveform for generation. Must be of shape
        `(batch_size, num_channels, audio_length)` or `(batch_size, audio_length)`, where `batch_size`
        corresponds to the number of prompts passed to the model.
    initial_audio_sampling_rate (`int`, *optional*):
        Sampling rate of the `initial_audio_waveforms`, if they are provided. Must be the same as the model.
    prompt_embeds (`torch.Tensor`, *optional*):
        Pre-computed text embeddings from the text encoder model. Can be used to easily tweak text inputs,
        *e.g.* prompt weighting. If not provided, text embeddings will be computed from `prompt` input
        argument.
    negative_prompt_embeds (`torch.Tensor`, *optional*):
        Pre-computed negative text embeddings from the text encoder model. Can be used to easily tweak text
        inputs, *e.g.* prompt weighting. If not provided, negative_prompt_embeds will be computed from
        `negative_prompt` input argument.
    attention_mask (`torch.LongTensor`, *optional*):
        Pre-computed attention mask to be applied to the `prompt_embeds`. If not provided, attention mask will
        be computed from `prompt` input argument.
    negative_attention_mask (`torch.LongTensor`, *optional*):
        Pre-computed attention mask to be applied to the `negative_text_audio_duration_embeds`.
    return_dict (`bool`, *optional*, defaults to `True`):
        Whether or not to return a [`~pipelines.stable_diffusion.StableDiffusionPipelineOutput`] instead of a
        plain tuple.
    callback (`Callable`, *optional*):
        A function that calls every `callback_steps` steps during inference. The function is called with the
        following arguments: `callback(step: int, timestep: int, latents: torch.Tensor)`.
    callback_steps (`int`, *optional*, defaults to 1):
        The frequency at which the `callback` function is called. If not specified, the callback is called at
        every step.
    output_type (`str`, *optional*, defaults to `"pt"`):
        The output format of the generated audio. Choose between `"np"` to return a NumPy `np.ndarray` or
        `"pt"` to return a PyTorch `torch.Tensor` object. Set to `"latent"` to return the latent diffusion
        model (LDM) output.

Examples:

Returns:
    [`~pipelines.stable_diffusion.StableDiffusionPipelineOutput`] or `tuple`:
        If `return_dict` is `True`, [`~pipelines.stable_diffusion.StableDiffusionPipelineOutput`] is returned,
        otherwise a `tuple` is returned where the first element is a list with the generated audio.
Nz"The total audio length requested (z5s) is longer than the model maximum possible length (z4). Make sure that 'audio_end_in_s-audio_start_in_s<=z'.r   r   g      ?rn   r   )r^   rA   )r   TF)use_realrepeat_interleave_real)total)encoder_hidden_statesglobal_hidden_statesrotary_embeddingr   orderlatent)audiosnp)5r   r   r   r%   r   r   rV   r   r   rE   rF   rG   rH   rI   _execution_deviceri   rx   rL   rZ   
zeros_liker^   r   viewr    set_timesteps	timestepsin_channelsr   r\   r   r   r   r'   r   progress_bar	enumeratescale_model_inputrY   chunkr   prev_sampleupdategetattrXLA_AVAILABLExm	mark_stepdecoder   r   cpurp   numpymaybe_free_model_hooks)3r(   r]   ru   rt   r   r   r`   r   r{   r|   r   r   r   r6   r7   r8   r9   r   r   r   r   downsample_ratiomax_audio_length_in_swaveform_startwaveform_endwaveform_lengthra   r^   r_   rr   rs   text_audio_duration_embedsaudio_duration_embeds#negative_text_audio_duration_embedsbs_embedseq_lenhidden_sizer   r   r   r   num_warmup_stepsr   itlatent_model_input
noise_prednoise_pred_uncondnoise_pred_textstep_idxr   s3                                                      r*   __call__StableAudioPipeline.__call__  s5   B  88.. $ 0 0 7 7 C CFV VY]YaYaYhYhYvYv v!2N,/DD4^5V4W  XM  Nc  Md  dX  Yn  Xo  oq  r  -0M0MMN>HHOO,I,IIJd..55AAB 	"##'	
 *VS"9"9JJvt$<$<VJ&,,Q/J'' '5s&:# **'"#	
 BFAUAU'o_D-H-nLbjnLnB
>#%> &+YY79RSYZ&
" !&		+FHa*bhi j '+A+IoNe272B2B*3M3T3T3/ */46PQWX*& %*II/DF[.\bc$d!)C)I)I&';%?%F%FqJbde%f"%?%D%D//+&
" !6 < <Q@XZ[ \ 5 : ://5J5P5PQS5T!

 	$$%8$HNN,,	  ++22>>&&11&,,#$88??99 ' 
 !::9J 3!!MM!4::1==#(	
 y>,?..BVBV,VV%89\!),1A\UYYy1}%=bi"%)^^%E%EFXZ[%\" "--&KKN*D)>%5 % .  
 /9C9I9I!9L6%!2^YjGj5k!kJ ..--j!WZHYZff I**A9I/IqSTuX\XfXfXlXlNlpqNq '')+N0Ba0G#$(K#K 1g6 =LLN? - :F h&HHOOG,33E&g66aN<778$IIK%%'--/E##%8O"%00e :9s    EW
W


W)r'   )NNNNN)NNNNNNN)NNNN)NNrC   d   g      @Nr   rC   NNNNNNNNTNr   r<   )'__name__
__module____qualname____firstlineno____doc__model_cpu_offload_seqr   r   r   r   r   r	   r   r   r#   r0   r4   r   rL   Tensor
LongTensorri   rx   r   r   r   no_gradr   EXAMPLE_DOC_STRINGrF   r   rp   r   	GeneratorrX   r   r   __static_attributes____classcell__)r)   s   @r*   r   r   R   s   2 OPP %P 5	P
 o56P )P 2P,"# 049=59>Bv  -v !) 6v !!1!12v "*%*:*:!;vp$FN!. # $ $$(V@  $!%EN ]]_12 )-*.,/#& #;?23MQ*.:>>B049=59>B GK()%)+P1c49n%P1 !P1 #5/	P1
 !P1 P1 "%T#Y"78P1 #+3-P1 P1 E%//43H"HIJP1 %,,'P1 "*%,,!7P1 &.ell%;P1  -P1 !) 6P1  !!1!12!P1" "*%*:*:!;#P1$ %P1& 8S#u||$<d$BCD'P1( !)P1* c]+P1 3 P1r,   r   )'r~   typingr   r   r   r   rL   transformersr   r   r	   modelsr   r   models.embeddingsr   
schedulersr   utilsr   r   r   utils.torch_utilsr   pipeline_utilsr   r   modeling_stable_audior   torch_xla.core.xla_modelcore	xla_modelr   r   
get_loggerr   rO   r   r    r,   r*   <module>r      s     2 2   > 8 8 
 . C = ))MM			H	%  Fb
1+ b
1r,   