Buckets:

download
raw
11.9 kB
import{s as de,n as le,o as me}from"../chunks/scheduler.53228c21.js";import{S as ce,i as ue,e as d,s,c as M,h as fe,a as l,d as o,b as a,f as j,g as x,j as q,k as E,l as i,m as r,n as D,t as S,o as A,p as y}from"../chunks/index.cac5d66a.js";import{C as _e}from"../chunks/CopyLLMTxtMenu.127444ce.js";import{D as ee}from"../chunks/Docstring.3f02c614.js";import{H as re,E as pe}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.1e8e5da3.js";function he(te){let c,I,C,N,_,H,p,F,h,oe='A Transformer model for audio waveforms from <a href="https://huggingface.co/papers/2407.14358" rel="nofollow">Stable Audio Open</a>.',O,g,V,n,b,J,k,ne="The Diffusion Transformer model introduced in Stable Audio.",K,w,se='Reference: <a href="https://github.com/Stability-AI/stable-audio-tools" rel="nofollow">https://github.com/Stability-AI/stable-audio-tools</a>',Q,u,T,X,L,ae='The <a href="/docs/diffusers/pr_13751/en/api/models/stable_audio_transformer#diffusers.StableAudioDiTModel">StableAudioDiTModel</a> forward method.',Y,f,v,Z,z,ie="Disables custom attention processors and sets the default attention implementation.",G,$,R,P,U;return _=new _e({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),p=new re({props:{title:"StableAudioDiTModel",local:"stableaudioditmodel",headingTag:"h1"}}),g=new re({props:{title:"StableAudioDiTModel",local:"diffusers.StableAudioDiTModel",headingTag:"h2"}}),b=new ee({props:{name:"class diffusers.StableAudioDiTModel",anchor:"diffusers.StableAudioDiTModel",parameters:[{name:"sample_size",val:": int = 1024"},{name:"in_channels",val:": int = 64"},{name:"num_layers",val:": int = 24"},{name:"attention_head_dim",val:": int = 64"},{name:"num_attention_heads",val:": int = 24"},{name:"num_key_value_attention_heads",val:": int = 12"},{name:"out_channels",val:": int = 64"},{name:"cross_attention_dim",val:": int = 768"},{name:"time_proj_dim",val:": int = 256"},{name:"global_states_input_dim",val:": int = 1536"},{name:"cross_attention_input_dim",val:": int = 768"}],parametersDescription:[{anchor:"diffusers.StableAudioDiTModel.sample_size",description:"<strong>sample_size</strong> ( <code>int</code>, <em>optional</em>, defaults to 1024) &#x2014; The size of the input sample.",name:"sample_size"},{anchor:"diffusers.StableAudioDiTModel.in_channels",description:"<strong>in_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014; The number of channels in the input.",name:"in_channels"},{anchor:"diffusers.StableAudioDiTModel.num_layers",description:"<strong>num_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 24) &#x2014; The number of layers of Transformer blocks to use.",name:"num_layers"},{anchor:"diffusers.StableAudioDiTModel.attention_head_dim",description:"<strong>attention_head_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014; The number of channels in each head.",name:"attention_head_dim"},{anchor:"diffusers.StableAudioDiTModel.num_attention_heads",description:"<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 24) &#x2014; The number of heads to use for the query states.",name:"num_attention_heads"},{anchor:"diffusers.StableAudioDiTModel.num_key_value_attention_heads",description:`<strong>num_key_value_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
The number of heads to use for the key and value states.`,name:"num_key_value_attention_heads"},{anchor:"diffusers.StableAudioDiTModel.out_channels",description:"<strong>out_channels</strong> (<code>int</code>, defaults to 64) &#x2014; Number of output channels.",name:"out_channels"},{anchor:"diffusers.StableAudioDiTModel.cross_attention_dim",description:"<strong>cross_attention_dim</strong> ( <code>int</code>, <em>optional</em>, defaults to 768) &#x2014; Dimension of the cross-attention projection.",name:"cross_attention_dim"},{anchor:"diffusers.StableAudioDiTModel.time_proj_dim",description:"<strong>time_proj_dim</strong> ( <code>int</code>, <em>optional</em>, defaults to 256) &#x2014; Dimension of the timestep inner projection.",name:"time_proj_dim"},{anchor:"diffusers.StableAudioDiTModel.global_states_input_dim",description:`<strong>global_states_input_dim</strong> ( <code>int</code>, <em>optional</em>, defaults to 1536) &#x2014;
Input dimension of the global hidden states projection.`,name:"global_states_input_dim"},{anchor:"diffusers.StableAudioDiTModel.cross_attention_input_dim",description:`<strong>cross_attention_input_dim</strong> ( <code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Input dimension of the cross-attention projection`,name:"cross_attention_input_dim"}],source:"https://github.com/huggingface/diffusers/blob/vr_13751/src/diffusers/models/transformers/stable_audio_transformer.py#L183"}}),T=new ee({props:{name:"forward",anchor:"diffusers.StableAudioDiTModel.forward",parameters:[{name:"hidden_states",val:": FloatTensor"},{name:"timestep",val:": LongTensor = None"},{name:"encoder_hidden_states",val:": FloatTensor = None"},{name:"global_hidden_states",val:": FloatTensor = None"},{name:"rotary_embedding",val:": FloatTensor = None"},{name:"return_dict",val:": bool = True"},{name:"attention_mask",val:": torch.LongTensor | None = None"},{name:"encoder_attention_mask",val:": torch.LongTensor | None = None"}],parametersDescription:[{anchor:"diffusers.StableAudioDiTModel.forward.hidden_states",description:`<strong>hidden_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch size, in_channels, sequence_len)</code>) &#x2014;
Input <code>hidden_states</code>.`,name:"hidden_states"},{anchor:"diffusers.StableAudioDiTModel.forward.timestep",description:`<strong>timestep</strong> ( <code>torch.LongTensor</code>) &#x2014;
Used to indicate denoising step.`,name:"timestep"},{anchor:"diffusers.StableAudioDiTModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch size, encoder_sequence_len, cross_attention_input_dim)</code>) &#x2014;
Conditional embeddings (embeddings computed from the input conditions such as prompts) to use.`,name:"encoder_hidden_states"},{anchor:"diffusers.StableAudioDiTModel.forward.global_hidden_states",description:`<strong>global_hidden_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch size, global_sequence_len, global_states_input_dim)</code>) &#x2014;
Global embeddings that will be prepended to the hidden states.`,name:"global_hidden_states"},{anchor:"diffusers.StableAudioDiTModel.forward.rotary_embedding",description:`<strong>rotary_embedding</strong> (<code>torch.Tensor</code>) &#x2014;
The rotary embeddings to apply on query and key tensors during attention calculation.`,name:"rotary_embedding"},{anchor:"diffusers.StableAudioDiTModel.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>~models.transformer_2d.Transformer2DModelOutput</code> instead of a plain
tuple.`,name:"return_dict"},{anchor:"diffusers.StableAudioDiTModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_len)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices, formed by concatenating the attention
masks
for the two text encoders together. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"diffusers.StableAudioDiTModel.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_len)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token cross-attention indices, formed by concatenating
the attention masks
for the two text encoders together. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"}],source:"https://github.com/huggingface/diffusers/blob/vr_13751/src/diffusers/models/transformers/stable_audio_transformer.py#L282",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>If <code>return_dict</code> is True, an <code>~models.transformer_2d.Transformer2DModelOutput</code> is returned, otherwise a
<code>tuple</code> where the first element is the sample tensor.</p>
`}}),v=new ee({props:{name:"set_default_attn_processor",anchor:"diffusers.StableAudioDiTModel.set_default_attn_processor",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_13751/src/diffusers/models/transformers/stable_audio_transformer.py#L276"}}),$=new pe({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/stable_audio_transformer.md"}}),{c(){c=d("meta"),I=s(),C=d("p"),N=s(),M(_.$$.fragment),H=s(),M(p.$$.fragment),F=s(),h=d("p"),h.innerHTML=oe,O=s(),M(g.$$.fragment),V=s(),n=d("div"),M(b.$$.fragment),J=s(),k=d("p"),k.textContent=ne,K=s(),w=d("p"),w.innerHTML=se,Q=s(),u=d("div"),M(T.$$.fragment),X=s(),L=d("p"),L.innerHTML=ae,Y=s(),f=d("div"),M(v.$$.fragment),Z=s(),z=d("p"),z.textContent=ie,G=s(),M($.$$.fragment),R=s(),P=d("p"),this.h()},l(e){const t=fe("svelte-u9bgzb",document.head);c=l(t,"META",{name:!0,content:!0}),t.forEach(o),I=a(e),C=l(e,"P",{}),j(C).forEach(o),N=a(e),x(_.$$.fragment,e),H=a(e),x(p.$$.fragment,e),F=a(e),h=l(e,"P",{"data-svelte-h":!0}),q(h)!=="svelte-g5z5pk"&&(h.innerHTML=oe),O=a(e),x(g.$$.fragment,e),V=a(e),n=l(e,"DIV",{class:!0});var m=j(n);x(b.$$.fragment,m),J=a(m),k=l(m,"P",{"data-svelte-h":!0}),q(k)!=="svelte-cole5l"&&(k.textContent=ne),K=a(m),w=l(m,"P",{"data-svelte-h":!0}),q(w)!=="svelte-hb3xoq"&&(w.innerHTML=se),Q=a(m),u=l(m,"DIV",{class:!0});var W=j(u);x(T.$$.fragment,W),X=a(W),L=l(W,"P",{"data-svelte-h":!0}),q(L)!=="svelte-17hm8ms"&&(L.innerHTML=ae),W.forEach(o),Y=a(m),f=l(m,"DIV",{class:!0});var B=j(f);x(v.$$.fragment,B),Z=a(B),z=l(B,"P",{"data-svelte-h":!0}),q(z)!=="svelte-1lxcwhv"&&(z.textContent=ie),B.forEach(o),m.forEach(o),G=a(e),x($.$$.fragment,e),R=a(e),P=l(e,"P",{}),j(P).forEach(o),this.h()},h(){E(c,"name","hf:doc:metadata"),E(c,"content",ge),E(u,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),E(f,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),E(n,"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,t){i(document.head,c),r(e,I,t),r(e,C,t),r(e,N,t),D(_,e,t),r(e,H,t),D(p,e,t),r(e,F,t),r(e,h,t),r(e,O,t),D(g,e,t),r(e,V,t),r(e,n,t),D(b,n,null),i(n,J),i(n,k),i(n,K),i(n,w),i(n,Q),i(n,u),D(T,u,null),i(u,X),i(u,L),i(n,Y),i(n,f),D(v,f,null),i(f,Z),i(f,z),r(e,G,t),D($,e,t),r(e,R,t),r(e,P,t),U=!0},p:le,i(e){U||(S(_.$$.fragment,e),S(p.$$.fragment,e),S(g.$$.fragment,e),S(b.$$.fragment,e),S(T.$$.fragment,e),S(v.$$.fragment,e),S($.$$.fragment,e),U=!0)},o(e){A(_.$$.fragment,e),A(p.$$.fragment,e),A(g.$$.fragment,e),A(b.$$.fragment,e),A(T.$$.fragment,e),A(v.$$.fragment,e),A($.$$.fragment,e),U=!1},d(e){e&&(o(I),o(C),o(N),o(H),o(F),o(h),o(O),o(V),o(n),o(G),o(R),o(P)),o(c),y(_,e),y(p,e),y(g,e),y(b),y(T),y(v),y($,e)}}}const ge='{"title":"StableAudioDiTModel","local":"stableaudioditmodel","sections":[{"title":"StableAudioDiTModel","local":"diffusers.StableAudioDiTModel","sections":[],"depth":2}],"depth":1}';function be(te){return me(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class De extends ce{constructor(c){super(),ue(this,c,be,he,de,{})}}export{De as component};

Xet Storage Details

Size:
11.9 kB
·
Xet hash:
b7b2a8d22b3ec62f26c13f6dae79fa37bc7e87d99411bf5de5ed18b48da5fd1c

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.