import{s as Xe,n as Ye,o as Ze}from"../chunks/scheduler.8c3d61f6.js";import{S as et,i as tt,g as d,s as n,r as u,A as ot,h as i,f as t,c as r,j as b,u as m,x as _,k as $,y as s,a,v as f,d as p,t as g,w as h}from"../chunks/index.da70eac4.js";import{D as x}from"../chunks/Docstring.a42c214b.js";import{H as ne,E as nt}from"../chunks/getInferenceSnippets.a8672208.js";function rt(Ve){let v,re,te,se,y,ae,T,Se='The Oobleck variational autoencoder (VAE) model with KL loss was introduced in <a href="https://github.com/Stability-AI/stable-audio-tools" rel="nofollow">Stability-AI/stable-audio-tools</a> and <a href="https://huggingface.co/papers/2407.14358" rel="nofollow">Stable Audio Open</a> by Stability AI. The model is used in 🤗 Diffusers to encode audio waveforms into latents and to decode latent representations into audio waveforms.',de,C,qe="The abstract from the paper is:",ie,E,Ge="<em>Open generative models are vitally important for the community, allowing for fine-tunes and serving as baselines when presenting new models. However, most current text-to-audio models are private and not accessible for artists and researchers to build upon. Here we describe the architecture and training process of a new open-weights text-to-audio model trained with Creative Commons data. Our evaluation shows that the model’s performance is competitive with the state-of-the-art across various metrics. Notably, the reported FDopenl3 results (measuring the realism of the generations) showcase its potential for high-quality stereo sound synthesis at 44.1kHz.</em>",le,L,ce,l,I,Ae,R,Fe=`An autoencoder for encoding waveforms into latents and decoding latent representations into waveforms. First
introduced in Stable Audio.`,De,K,je=`This model inherits from <a href="/docs/diffusers/main/en/api/models/overview#diffusers.ModelMixin">ModelMixin</a>. Check the superclass documentation for it’s generic methods implemented
for all models (such as downloading or saving).`,ye,U,P,Te,B,M,Ce,A,H,Ee,J,Ne=`Disable sliced VAE decoding. If <code>enable_slicing</code> was previously enabled, this method will go back to computing
decoding in one step.`,Le,D,z,Ie,Q,We=`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.`,Pe,X,V,ue,S,me,k,q,Me,Y,Re="Output of decoding method.",fe,G,pe,O,F,He,Z,Ke="Output of decoding method.",ge,j,he,w,N,ze,ee,Ue="Output of AutoencoderOobleck encoding method.",be,W,$e,oe,_e;return y=new ne({props:{title:"AutoencoderOobleck",local:"autoencoderoobleck",headingTag:"h1"}}),L=new ne({props:{title:"AutoencoderOobleck",local:"diffusers.AutoencoderOobleck",headingTag:"h2"}}),I=new x({props:{name:"class diffusers.AutoencoderOobleck",anchor:"diffusers.AutoencoderOobleck",parameters:[{name:"encoder_hidden_size",val:" = 128"},{name:"downsampling_ratios",val:" = [2, 4, 4, 8, 8]"},{name:"channel_multiples",val:" = [1, 2, 4, 8, 16]"},{name:"decoder_channels",val:" = 128"},{name:"decoder_input_channels",val:" = 64"},{name:"audio_channels",val:" = 2"},{name:"sampling_rate",val:" = 44100"}],parametersDescription:[{anchor:"diffusers.AutoencoderOobleck.encoder_hidden_size",description:`<strong>encoder_hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
Intermediate representation dimension for the encoder.`,name:"encoder_hidden_size"},{anchor:"diffusers.AutoencoderOobleck.downsampling_ratios",description:`<strong>downsampling_ratios</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[2, 4, 4, 8, 8]</code>) &#x2014;
Ratios for downsampling in the encoder. These are used in reverse order for upsampling in the decoder.`,name:"downsampling_ratios"},{anchor:"diffusers.AutoencoderOobleck.channel_multiples",description:`<strong>channel_multiples</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[1, 2, 4, 8, 16]</code>) &#x2014;
Multiples used to determine the hidden sizes of the hidden layers.`,name:"channel_multiples"},{anchor:"diffusers.AutoencoderOobleck.decoder_channels",description:`<strong>decoder_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
Intermediate representation dimension for the decoder.`,name:"decoder_channels"},{anchor:"diffusers.AutoencoderOobleck.decoder_input_channels",description:`<strong>decoder_input_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Input dimension for the decoder. Corresponds to the latent dimension.`,name:"decoder_input_channels"},{anchor:"diffusers.AutoencoderOobleck.audio_channels",description:`<strong>audio_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
Number of channels in the audio data. Either 1 for mono or 2 for stereo.`,name:"audio_channels"},{anchor:"diffusers.AutoencoderOobleck.sampling_rate",description:`<strong>sampling_rate</strong> (<code>int</code>, <em>optional</em>, defaults to 44100) &#x2014;
The sampling rate at which the audio waveform should be digitalized expressed in hertz (Hz).`,name:"sampling_rate"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_oobleck.py#L294"}}),P=new x({props:{name:"wrapper",anchor:"diffusers.AutoencoderOobleck.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/accelerate_utils.py#L43"}}),M=new x({props:{name:"wrapper",anchor:"diffusers.AutoencoderOobleck.encode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/accelerate_utils.py#L43"}}),H=new x({props:{name:"disable_slicing",anchor:"diffusers.AutoencoderOobleck.disable_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_oobleck.py#L366"}}),z=new x({props:{name:"enable_slicing",anchor:"diffusers.AutoencoderOobleck.enable_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_oobleck.py#L359"}}),V=new x({props:{name:"forward",anchor:"diffusers.AutoencoderOobleck.forward",parameters:[{name:"sample",val:": Tensor"},{name:"sample_posterior",val:": bool = False"},{name:"return_dict",val:": bool = True"},{name:"generator",val:": typing.Optional[torch._C.Generator] = None"}],parametersDescription:[{anchor:"diffusers.AutoencoderOobleck.forward.sample",description:"<strong>sample</strong> (<code>torch.Tensor</code>) &#x2014; Input sample.",name:"sample"},{anchor:"diffusers.AutoencoderOobleck.forward.sample_posterior",description:`<strong>sample_posterior</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to sample from the posterior.`,name:"sample_posterior"},{anchor:"diffusers.AutoencoderOobleck.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <code>OobleckDecoderOutput</code> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_oobleck.py#L439"}}),S=new ne({props:{title:"OobleckDecoderOutput",local:"diffusers.models.autoencoders.autoencoder_oobleck.OobleckDecoderOutput",headingTag:"h2"}}),q=new x({props:{name:"class diffusers.models.autoencoders.autoencoder_oobleck.OobleckDecoderOutput",anchor:"diffusers.models.autoencoders.autoencoder_oobleck.OobleckDecoderOutput",parameters:[{name:"sample",val:": Tensor"}],parametersDescription:[{anchor:"diffusers.models.autoencoders.autoencoder_oobleck.OobleckDecoderOutput.sample",description:`<strong>sample</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, audio_channels, sequence_length)</code>) &#x2014;
The decoded output sample from the last layer of the model.`,name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_oobleck.py#L201"}}),G=new ne({props:{title:"OobleckDecoderOutput",local:"diffusers.models.autoencoders.autoencoder_oobleck.OobleckDecoderOutput",headingTag:"h2"}}),F=new x({props:{name:"class diffusers.models.autoencoders.autoencoder_oobleck.OobleckDecoderOutput",anchor:"diffusers.models.autoencoders.autoencoder_oobleck.OobleckDecoderOutput",parameters:[{name:"sample",val:": Tensor"}],parametersDescription:[{anchor:"diffusers.models.autoencoders.autoencoder_oobleck.OobleckDecoderOutput.sample",description:`<strong>sample</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, audio_channels, sequence_length)</code>) &#x2014;
The decoded output sample from the last layer of the model.`,name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_oobleck.py#L201"}}),j=new ne({props:{title:"AutoencoderOobleckOutput",local:"diffusers.models.autoencoders.autoencoder_oobleck.AutoencoderOobleckOutput",headingTag:"h2"}}),N=new x({props:{name:"class diffusers.models.autoencoders.autoencoder_oobleck.AutoencoderOobleckOutput",anchor:"diffusers.models.autoencoders.autoencoder_oobleck.AutoencoderOobleckOutput",parameters:[{name:"latent_dist",val:": OobleckDiagonalGaussianDistribution"}],parametersDescription:[{anchor:"diffusers.models.autoencoders.autoencoder_oobleck.AutoencoderOobleckOutput.latent_dist",description:`<strong>latent_dist</strong> (<code>OobleckDiagonalGaussianDistribution</code>) &#x2014;
Encoded outputs of <code>Encoder</code> represented as the mean and standard deviation of
<code>OobleckDiagonalGaussianDistribution</code>. <code>OobleckDiagonalGaussianDistribution</code> allows for sampling latents
from the distribution.`,name:"latent_dist"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_oobleck.py#L186"}}),W=new nt({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/autoencoder_oobleck.md"}}),{c(){v=d("meta"),re=n(),te=d("p"),se=n(),u(y.$$.fragment),ae=n(),T=d("p"),T.innerHTML=Se,de=n(),C=d("p"),C.textContent=qe,ie=n(),E=d("p"),E.innerHTML=Ge,le=n(),u(L.$$.fragment),ce=n(),l=d("div"),u(I.$$.fragment),Ae=n(),R=d("p"),R.textContent=Fe,De=n(),K=d("p"),K.innerHTML=je,ye=n(),U=d("div"),u(P.$$.fragment),Te=n(),B=d("div"),u(M.$$.fragment),Ce=n(),A=d("div"),u(H.$$.fragment),Ee=n(),J=d("p"),J.innerHTML=Ne,Le=n(),D=d("div"),u(z.$$.fragment),Ie=n(),Q=d("p"),Q.textContent=We,Pe=n(),X=d("div"),u(V.$$.fragment),ue=n(),u(S.$$.fragment),me=n(),k=d("div"),u(q.$$.fragment),Me=n(),Y=d("p"),Y.textContent=Re,fe=n(),u(G.$$.fragment),pe=n(),O=d("div"),u(F.$$.fragment),He=n(),Z=d("p"),Z.textContent=Ke,ge=n(),u(j.$$.fragment),he=n(),w=d("div"),u(N.$$.fragment),ze=n(),ee=d("p"),ee.textContent=Ue,be=n(),u(W.$$.fragment),$e=n(),oe=d("p"),this.h()},l(e){const o=ot("svelte-u9bgzb",document.head);v=i(o,"META",{name:!0,content:!0}),o.forEach(t),re=r(e),te=i(e,"P",{}),b(te).forEach(t),se=r(e),m(y.$$.fragment,e),ae=r(e),T=i(e,"P",{"data-svelte-h":!0}),_(T)!=="svelte-1fhkutu"&&(T.innerHTML=Se),de=r(e),C=i(e,"P",{"data-svelte-h":!0}),_(C)!=="svelte-1cwsb16"&&(C.textContent=qe),ie=r(e),E=i(e,"P",{"data-svelte-h":!0}),_(E)!=="svelte-1rfs7ni"&&(E.innerHTML=Ge),le=r(e),m(L.$$.fragment,e),ce=r(e),l=i(e,"DIV",{class:!0});var c=b(l);m(I.$$.fragment,c),Ae=r(c),R=i(c,"P",{"data-svelte-h":!0}),_(R)!=="svelte-qyq2gm"&&(R.textContent=Fe),De=r(c),K=i(c,"P",{"data-svelte-h":!0}),_(K)!=="svelte-1hyu2ru"&&(K.innerHTML=je),ye=r(c),U=i(c,"DIV",{class:!0});var Be=b(U);m(P.$$.fragment,Be),Be.forEach(t),Te=r(c),B=i(c,"DIV",{class:!0});var Je=b(B);m(M.$$.fragment,Je),Je.forEach(t),Ce=r(c),A=i(c,"DIV",{class:!0});var ve=b(A);m(H.$$.fragment,ve),Ee=r(ve),J=i(ve,"P",{"data-svelte-h":!0}),_(J)!=="svelte-189cc7b"&&(J.innerHTML=Ne),ve.forEach(t),Le=r(c),D=i(c,"DIV",{class:!0});var ke=b(D);m(z.$$.fragment,ke),Ie=r(ke),Q=i(ke,"P",{"data-svelte-h":!0}),_(Q)!=="svelte-14bnrb6"&&(Q.textContent=We),ke.forEach(t),Pe=r(c),X=i(c,"DIV",{class:!0});var Qe=b(X);m(V.$$.fragment,Qe),Qe.forEach(t),c.forEach(t),ue=r(e),m(S.$$.fragment,e),me=r(e),k=i(e,"DIV",{class:!0});var Oe=b(k);m(q.$$.fragment,Oe),Me=r(Oe),Y=i(Oe,"P",{"data-svelte-h":!0}),_(Y)!=="svelte-18u8upa"&&(Y.textContent=Re),Oe.forEach(t),fe=r(e),m(G.$$.fragment,e),pe=r(e),O=i(e,"DIV",{class:!0});var we=b(O);m(F.$$.fragment,we),He=r(we),Z=i(we,"P",{"data-svelte-h":!0}),_(Z)!=="svelte-18u8upa"&&(Z.textContent=Ke),we.forEach(t),ge=r(e),m(j.$$.fragment,e),he=r(e),w=i(e,"DIV",{class:!0});var xe=b(w);m(N.$$.fragment,xe),ze=r(xe),ee=i(xe,"P",{"data-svelte-h":!0}),_(ee)!=="svelte-1deyjjw"&&(ee.textContent=Ue),xe.forEach(t),be=r(e),m(W.$$.fragment,e),$e=r(e),oe=i(e,"P",{}),b(oe).forEach(t),this.h()},h(){$(v,"name","hf:doc:metadata"),$(v,"content",st),$(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(l,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,o){s(document.head,v),a(e,re,o),a(e,te,o),a(e,se,o),f(y,e,o),a(e,ae,o),a(e,T,o),a(e,de,o),a(e,C,o),a(e,ie,o),a(e,E,o),a(e,le,o),f(L,e,o),a(e,ce,o),a(e,l,o),f(I,l,null),s(l,Ae),s(l,R),s(l,De),s(l,K),s(l,ye),s(l,U),f(P,U,null),s(l,Te),s(l,B),f(M,B,null),s(l,Ce),s(l,A),f(H,A,null),s(A,Ee),s(A,J),s(l,Le),s(l,D),f(z,D,null),s(D,Ie),s(D,Q),s(l,Pe),s(l,X),f(V,X,null),a(e,ue,o),f(S,e,o),a(e,me,o),a(e,k,o),f(q,k,null),s(k,Me),s(k,Y),a(e,fe,o),f(G,e,o),a(e,pe,o),a(e,O,o),f(F,O,null),s(O,He),s(O,Z),a(e,ge,o),f(j,e,o),a(e,he,o),a(e,w,o),f(N,w,null),s(w,ze),s(w,ee),a(e,be,o),f(W,e,o),a(e,$e,o),a(e,oe,o),_e=!0},p:Ye,i(e){_e||(p(y.$$.fragment,e),p(L.$$.fragment,e),p(I.$$.fragment,e),p(P.$$.fragment,e),p(M.$$.fragment,e),p(H.$$.fragment,e),p(z.$$.fragment,e),p(V.$$.fragment,e),p(S.$$.fragment,e),p(q.$$.fragment,e),p(G.$$.fragment,e),p(F.$$.fragment,e),p(j.$$.fragment,e),p(N.$$.fragment,e),p(W.$$.fragment,e),_e=!0)},o(e){g(y.$$.fragment,e),g(L.$$.fragment,e),g(I.$$.fragment,e),g(P.$$.fragment,e),g(M.$$.fragment,e),g(H.$$.fragment,e),g(z.$$.fragment,e),g(V.$$.fragment,e),g(S.$$.fragment,e),g(q.$$.fragment,e),g(G.$$.fragment,e),g(F.$$.fragment,e),g(j.$$.fragment,e),g(N.$$.fragment,e),g(W.$$.fragment,e),_e=!1},d(e){e&&(t(re),t(te),t(se),t(ae),t(T),t(de),t(C),t(ie),t(E),t(le),t(ce),t(l),t(ue),t(me),t(k),t(fe),t(pe),t(O),t(ge),t(he),t(w),t(be),t($e),t(oe)),t(v),h(y,e),h(L,e),h(I),h(P),h(M),h(H),h(z),h(V),h(S,e),h(q),h(G,e),h(F),h(j,e),h(N),h(W,e)}}}const st='{"title":"AutoencoderOobleck","local":"autoencoderoobleck","sections":[{"title":"AutoencoderOobleck","local":"diffusers.AutoencoderOobleck","sections":[],"depth":2},{"title":"OobleckDecoderOutput","local":"diffusers.models.autoencoders.autoencoder_oobleck.OobleckDecoderOutput","sections":[],"depth":2},{"title":"OobleckDecoderOutput","local":"diffusers.models.autoencoders.autoencoder_oobleck.OobleckDecoderOutput","sections":[],"depth":2},{"title":"AutoencoderOobleckOutput","local":"diffusers.models.autoencoders.autoencoder_oobleck.AutoencoderOobleckOutput","sections":[],"depth":2}],"depth":1}';function at(Ve){return Ze(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ut extends et{constructor(v){super(),tt(this,v,at,rt,Xe,{})}}export{ut as component};
