import{S as Up,i as xp,s as Pp,e as r,k as d,w as g,t as s,M as Np,c as a,d as o,m as c,a as n,x as _,h as i,b as l,G as e,g as h,y as b,q as k,o as v,B as y,v as Sp,L as ai}from"../../chunks/vendor-hf-doc-builder.js";import{T as oi}from"../../chunks/Tip-hf-doc-builder.js";import{D as C}from"../../chunks/Docstring-hf-doc-builder.js";import{C as q}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as z}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ri}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Wp(J){let p,$,M,w,B;return w=new q({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBCYXJrTW9kZWwlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJzdW5vJTJGYmFyay1zbWFsbCUyMiklMEFtb2RlbCUyMCUzRCUyMEJhcmtNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyc3VubyUyRmJhcmstc21hbGwlMjIpJTBBJTBBJTIzJTIwVG8lMjBhZGQlMjBhJTIwdm9pY2UlMjBwcmVzZXQlMkMlMjB5b3UlMjBjYW4lMjBwYXNzJTIwJTYwdm9pY2VfcHJlc2V0JTYwJTIwdG8lMjAlNjBCYXJrUHJvY2Vzc29yLl9fY2FsbF9fKC4uLiklNjAlMEF2b2ljZV9wcmVzZXQlMjAlM0QlMjAlMjJ2MiUyRmVuX3NwZWFrZXJfNiUyMiUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTJDJTIwSSUyMG5lZWQlMjBoaW0lMjBpbiUyMG15JTIwbGlmZSUyMiUyQyUyMHZvaWNlX3ByZXNldCUzRHZvaWNlX3ByZXNldCklMEElMEFhdWRpb19hcnJheSUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwc2VtYW50aWNfbWF4X25ld190b2tlbnMlM0QxMDApJTBBYXVkaW9fYXJyYXklMjAlM0QlMjBhdWRpb19hcnJheS5jcHUoKS5udW1weSgpLnNxdWVlemUoKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, BarkModel

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;suno/bark-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BarkModel.from_pretrained(<span class="hljs-string">&quot;suno/bark-small&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To add a voice preset, you can pass \`voice_preset\` to \`BarkProcessor.__call__(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>voice_preset = <span class="hljs-string">&quot;v2/en_speaker_6&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(<span class="hljs-string">&quot;Hello, my dog is cute, I need him in my life&quot;</span>, voice_preset=voice_preset)

<span class="hljs-meta">&gt;&gt;&gt; </span>audio_array = model.generate(**inputs, semantic_max_new_tokens=<span class="hljs-number">100</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>audio_array = audio_array.cpu().numpy().squeeze()`}}),{c(){p=r("p"),$=s("Example:"),M=d(),g(w.$$.fragment)},l(f){p=a(f,"P",{});var u=n(p);$=i(u,"Example:"),u.forEach(o),M=c(f),_(w.$$.fragment,f)},m(f,u){h(f,p,u),e(p,$),h(f,M,u),b(w,f,u),B=!0},p:ai,i(f){B||(k(w.$$.fragment,f),B=!0)},o(f){v(w.$$.fragment,f),B=!1},d(f){f&&o(p),f&&o(M),y(w,f)}}}function Zp(J){let p,$,M,w,B;return{c(){p=r("p"),$=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),M=r("code"),w=s("Module"),B=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(f){p=a(f,"P",{});var u=n(p);$=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),M=a(u,"CODE",{});var j=n(M);w=i(j,"Module"),j.forEach(o),B=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(o)},m(f,u){h(f,p,u),e(p,$),e(p,M),e(M,w),e(p,B)},d(f){f&&o(p)}}}function Fp(J){let p,$,M,w,B;return{c(){p=r("p"),$=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),M=r("code"),w=s("Module"),B=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(f){p=a(f,"P",{});var u=n(p);$=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),M=a(u,"CODE",{});var j=n(M);w=i(j,"Module"),j.forEach(o),B=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(o)},m(f,u){h(f,p,u),e(p,$),e(p,M),e(M,w),e(p,B)},d(f){f&&o(p)}}}function Gp(J){let p,$,M,w,B;return{c(){p=r("p"),$=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),M=r("code"),w=s("Module"),B=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(f){p=a(f,"P",{});var u=n(p);$=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),M=a(u,"CODE",{});var j=n(M);w=i(j,"Module"),j.forEach(o),B=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(o)},m(f,u){h(f,p,u),e(p,$),e(p,M),e(M,w),e(p,B)},d(f){f&&o(p)}}}function Ap(J){let p,$,M,w,B;return{c(){p=r("p"),$=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),M=r("code"),w=s("Module"),B=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(f){p=a(f,"P",{});var u=n(p);$=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),M=a(u,"CODE",{});var j=n(M);w=i(j,"Module"),j.forEach(o),B=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(o)},m(f,u){h(f,p,u),e(p,$),e(p,M),e(M,w),e(p,B)},d(f){f&&o(p)}}}function Vp(J){let p,$,M,w,B;return w=new q({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJhcmtDb2Fyc2VDb25maWclMkMlMjBCYXJrQ29hcnNlTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQmFyayUyMHN1Yi1tb2R1bGUlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwQmFya0NvYXJzZUNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBzdW5vJTJGYmFyayUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwQmFya0NvYXJzZU1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BarkCoarseConfig, BarkCoarseModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Bark sub-module style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = BarkCoarseConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the suno/bark style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BarkCoarseModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){p=r("p"),$=s("Example:"),M=d(),g(w.$$.fragment)},l(f){p=a(f,"P",{});var u=n(p);$=i(u,"Example:"),u.forEach(o),M=c(f),_(w.$$.fragment,f)},m(f,u){h(f,p,u),e(p,$),h(f,M,u),b(w,f,u),B=!0},p:ai,i(f){B||(k(w.$$.fragment,f),B=!0)},o(f){v(w.$$.fragment,f),B=!1},d(f){f&&o(p),f&&o(M),y(w,f)}}}function Yp(J){let p,$,M,w,B;return w=new q({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJhcmtGaW5lQ29uZmlnJTJDJTIwQmFya0ZpbmVNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBCYXJrJTIwc3ViLW1vZHVsZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBCYXJrRmluZUNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBzdW5vJTJGYmFyayUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwQmFya0ZpbmVNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BarkFineConfig, BarkFineModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Bark sub-module style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = BarkFineConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the suno/bark style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BarkFineModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){p=r("p"),$=s("Example:"),M=d(),g(w.$$.fragment)},l(f){p=a(f,"P",{});var u=n(p);$=i(u,"Example:"),u.forEach(o),M=c(f),_(w.$$.fragment,f)},m(f,u){h(f,p,u),e(p,$),h(f,M,u),b(w,f,u),B=!0},p:ai,i(f){B||(k(w.$$.fragment,f),B=!0)},o(f){v(w.$$.fragment,f),B=!1},d(f){f&&o(p),f&&o(M),y(w,f)}}}function qp(J){let p,$,M,w,B;return w=new q({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJhcmtTZW1hbnRpY0NvbmZpZyUyQyUyMEJhcmtTZW1hbnRpY01vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEJhcmslMjBzdWItbW9kdWxlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMEJhcmtTZW1hbnRpY0NvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBzdW5vJTJGYmFyayUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwQmFya1NlbWFudGljTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BarkSemanticConfig, BarkSemanticModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Bark sub-module style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = BarkSemanticConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the suno/bark style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BarkSemanticModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){p=r("p"),$=s("Example:"),M=d(),g(w.$$.fragment)},l(f){p=a(f,"P",{});var u=n(p);$=i(u,"Example:"),u.forEach(o),M=c(f),_(w.$$.fragment,f)},m(f,u){h(f,p,u),e(p,$),h(f,M,u),b(w,f,u),B=!0},p:ai,i(f){B||(k(w.$$.fragment,f),B=!0)},o(f){v(w.$$.fragment,f),B=!1},d(f){f&&o(p),f&&o(M),y(w,f)}}}function Xp(J){let p,$,M,w,B,f,u,j,ni,gn,te,je,aa,Mt,si,na,ii,_n,Ie,li,Bt,di,ci,bn,Lo,mi,kn,A,Qo,Ko,hi,fi,pi,Ue,er,ui,gi,tr,_i,bi,ki,or,rr,vi,yi,wi,$t,Mi,ar,Bi,$i,vn,nr,Ti,yn,oe,xe,sa,Tt,Ci,ia,Ei,wn,R,Ji,la,zi,ji,da,Ii,Ui,Mn,re,Pe,ca,Ct,xi,ma,Pi,Bn,sr,Ni,$n,Et,Tn,ae,Ne,ha,Jt,Si,fa,Wi,Cn,ir,Zi,En,zt,Jn,jt,Fi,It,Gi,zn,ne,Se,pa,Ut,Ai,ua,Vi,jn,lr,Yi,In,dr,qi,Un,xt,xn,Pt,Xi,Nt,Ri,Pn,se,We,ga,St,Di,_a,Oi,Nn,cr,Hi,Sn,Wt,Wn,Ze,Li,Zt,Qi,Ki,Zn,ie,Fe,ba,Ft,el,ka,tl,Fn,V,ol,Gt,rl,al,At,nl,sl,Vt,il,ll,Gn,Yt,An,Ge,dl,va,cl,ml,Vn,qt,Yn,Ae,hl,ya,fl,pl,qn,Xt,Xn,mr,ul,Rn,Rt,Dn,Y,gl,Dt,_l,bl,Ot,kl,vl,Ht,yl,wl,On,le,Ve,wa,Lt,Ml,Ma,Bl,Hn,x,Qt,$l,Kt,Tl,hr,Cl,El,Jl,eo,zl,to,jl,Il,Ul,de,xl,fr,Pl,Nl,pr,Sl,Wl,Zl,Ye,oo,Fl,ro,Gl,ur,Al,Vl,Ln,ce,qe,Ba,ao,Yl,$a,ql,Qn,P,no,Xl,Ta,Rl,Dl,Xe,so,Ol,E,Hl,Ca,Ll,Ql,Ea,Kl,ed,Ja,td,od,za,rd,ad,ja,nd,sd,Ia,id,ld,Ua,dd,cd,md,Re,io,hd,xa,fd,pd,De,lo,ud,co,gd,gr,_d,bd,Kn,me,Oe,Pa,mo,kd,Na,vd,es,T,ho,yd,Sa,wd,Md,X,_r,br,Bd,$d,Td,He,kr,Cd,Ed,Wa,Jd,zd,jd,vr,yr,Id,Ud,xd,fo,Pd,wr,Nd,Sd,Wd,Za,Zd,Fd,po,Gd,Mr,Ad,Vd,Yd,uo,qd,go,Xd,Rd,Dd,D,_o,Od,bo,Hd,Fa,Ld,Qd,Kd,Le,ec,Qe,ko,tc,Ga,oc,ts,he,Ke,Aa,vo,rc,Va,ac,os,N,yo,nc,wo,sc,Br,ic,lc,dc,Mo,cc,Bo,mc,hc,fc,O,$o,pc,fe,uc,$r,gc,_c,Ya,bc,kc,vc,et,rs,pe,tt,qa,To,yc,Xa,wc,as,S,Co,Mc,Eo,Bc,Tr,$c,Tc,Cc,Jo,Ec,zo,Jc,zc,jc,H,jo,Ic,ue,Uc,Cr,xc,Pc,Ra,Nc,Sc,Wc,ot,ns,ge,rt,Da,Io,Zc,Oa,Fc,ss,W,Uo,Gc,_e,Ac,Ha,Vc,Yc,Er,qc,Xc,Rc,xo,Dc,Po,Oc,Hc,Lc,L,No,Qc,be,Kc,Jr,em,tm,La,om,rm,am,at,is,ke,nt,Qa,So,nm,Ka,sm,ls,ve,Wo,im,Q,Zo,lm,ye,dm,zr,cm,mm,en,hm,fm,pm,st,ds,we,it,tn,Fo,um,on,gm,cs,Z,Go,_m,Me,bm,jr,km,vm,Ao,ym,wm,Mm,Be,Bm,Ir,$m,Tm,Ur,Cm,Em,Jm,lt,ms,$e,dt,rn,Vo,zm,an,jm,hs,F,Yo,Im,Te,Um,xr,xm,Pm,qo,Nm,Sm,Wm,Ce,Zm,Pr,Fm,Gm,Nr,Am,Vm,Ym,ct,fs,Ee,mt,nn,Xo,qm,sn,Xm,ps,G,Ro,Rm,Je,Dm,Sr,Om,Hm,Do,Lm,Qm,Km,ze,eh,Wr,th,oh,Zr,rh,ah,nh,ht,us;return f=new z({}),Mt=new z({}),Tt=new z({}),Ct=new z({}),Et=new q({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJhcmtNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBZGV2aWNlJTIwJTNEJTIwJTIyY3VkYSUyMiUyMGlmJTIwdG9yY2guY3VkYS5pc19hdmFpbGFibGUoKSUyMGVsc2UlMjAlMjJjcHUlMjIlMEFtb2RlbCUyMCUzRCUyMEJhcmtNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyc3VubyUyRmJhcmstc21hbGwlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpLnRvKGRldmljZSk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BarkModel
<span class="hljs-keyword">import</span> torch

device = <span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>
model = BarkModel.from_pretrained(<span class="hljs-string">&quot;suno/bark-small&quot;</span>, torch_dtype=torch.float16).to(device)`}}),Jt=new z({}),zt=new q({props:{code:"bW9kZWwlMjAlM0QlMjAlMjBtb2RlbC50b19iZXR0ZXJ0cmFuc2Zvcm1lcigp",highlighted:"model =  model.to_bettertransformer()"}}),Ut=new z({}),xt=new q({props:{code:"bW9kZWwuZW5hYmxlX2NwdV9vZmZsb2FkKCk=",highlighted:"model.enable_cpu_offload()"}}),St=new z({}),Wt=new q({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJhcmtNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBZGV2aWNlJTIwJTNEJTIwJTIyY3VkYSUyMiUyMGlmJTIwdG9yY2guY3VkYS5pc19hdmFpbGFibGUoKSUyMGVsc2UlMjAlMjJjcHUlMjIlMEElMEElMjMlMjBsb2FkJTIwaW4lMjBmcDE2JTBBbW9kZWwlMjAlM0QlMjBCYXJrTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMnN1bm8lMkZiYXJrLXNtYWxsJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KS50byhkZXZpY2UpJTBBJTBBJTIzJTIwY29udmVydCUyMHRvJTIwYmV0dGVydHJhbnNmb3JtZXIlMEFtb2RlbCUyMCUzRCUyMEJldHRlclRyYW5zZm9ybWVyLnRyYW5zZm9ybShtb2RlbCUyQyUyMGtlZXBfb3JpZ2luYWxfbW9kZWwlM0RGYWxzZSklMEElMEElMjMlMjBlbmFibGUlMjBDUFUlMjBvZmZsb2FkJTBBbW9kZWwuZW5hYmxlX2NwdV9vZmZsb2FkKCk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BarkModel
<span class="hljs-keyword">import</span> torch

device = <span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>

<span class="hljs-comment"># load in fp16</span>
model = BarkModel.from_pretrained(<span class="hljs-string">&quot;suno/bark-small&quot;</span>, torch_dtype=torch.float16).to(device)

<span class="hljs-comment"># convert to bettertransformer</span>
model = BetterTransformer.transform(model, keep_original_model=<span class="hljs-literal">False</span>)

<span class="hljs-comment"># enable CPU offload</span>
model.enable_cpu_offload()`}}),Ft=new z({}),Yt=new q({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBCYXJrTW9kZWwlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJzdW5vJTJGYmFyayUyMiklMEFtb2RlbCUyMCUzRCUyMEJhcmtNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyc3VubyUyRmJhcmslMjIpJTBBJTBBdm9pY2VfcHJlc2V0JTIwJTNEJTIwJTIydjIlMkZlbl9zcGVha2VyXzYlMjIlMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHZvaWNlX3ByZXNldCUzRHZvaWNlX3ByZXNldCklMEElMEFhdWRpb19hcnJheSUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzKSUwQWF1ZGlvX2FycmF5JTIwJTNEJTIwYXVkaW9fYXJyYXkuY3B1KCkubnVtcHkoKS5zcXVlZXplKCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, BarkModel

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;suno/bark&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BarkModel.from_pretrained(<span class="hljs-string">&quot;suno/bark&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>voice_preset = <span class="hljs-string">&quot;v2/en_speaker_6&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, voice_preset=voice_preset)

<span class="hljs-meta">&gt;&gt;&gt; </span>audio_array = model.generate(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>audio_array = audio_array.cpu().numpy().squeeze()`}}),qt=new q({props:{code:"JTIzJTIwTXVsdGlsaW5ndWFsJTIwc3BlZWNoJTIwLSUyMHNpbXBsaWZpZWQlMjBDaGluZXNlJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKCUyMiVFNiU4MyU4QSVFNCVCQSVCQSVFNyU5QSU4NCVFRiVCQyU4MSVFNiU4OCU5MSVFNCVCQyU5QSVFOCVBRiVCNCVFNCVCOCVBRCVFNiU5NiU4NyUyMiklMEElMEElMjMlMjBNdWx0aWxpbmd1YWwlMjBzcGVlY2glMjAtJTIwRnJlbmNoJTIwLSUyMGxldCdzJTIwdXNlJTIwYSUyMHZvaWNlX3ByZXNldCUyMGFzJTIwd2VsbCUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvciglMjJJbmNyb3lhYmxlISUyMEplJTIwcGV1eCUyMGclQzMlQTluJUMzJUE5cmVyJTIwZHUlMjBzb24uJTIyJTJDJTIwdm9pY2VfcHJlc2V0JTNEJTIyZnJfc3BlYWtlcl81JTIyKSUwQSUwQSUyMyUyMEJhcmslMjBjYW4lMjBhbHNvJTIwZ2VuZXJhdGUlMjBtdXNpYy4lMjBZb3UlMjBjYW4lMjBoZWxwJTIwaXQlMjBvdXQlMjBieSUyMGFkZGluZyUyMG11c2ljJTIwbm90ZXMlMjBhcm91bmQlMjB5b3VyJTIwbHlyaWNzLiUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvciglMjIlRTIlOTklQUElMjBIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIwJUUyJTk5JUFBJTIyKSUwQSUwQWF1ZGlvX2FycmF5JTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoKippbnB1dHMpJTBBYXVkaW9fYXJyYXklMjAlM0QlMjBhdWRpb19hcnJheS5jcHUoKS5udW1weSgpLnNxdWVlemUoKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Multilingual speech - simplified Chinese</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(<span class="hljs-string">&quot;\u60CA\u4EBA\u7684\uFF01\u6211\u4F1A\u8BF4\u4E2D\u6587&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Multilingual speech - French - let&#x27;s use a voice_preset as well</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(<span class="hljs-string">&quot;Incroyable! Je peux g\xE9n\xE9rer du son.&quot;</span>, voice_preset=<span class="hljs-string">&quot;fr_speaker_5&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Bark can also generate music. You can help it out by adding music notes around your lyrics.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(<span class="hljs-string">&quot;\u266A Hello, my dog is cute \u266A&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>audio_array = model.generate(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>audio_array = audio_array.cpu().numpy().squeeze()`}}),Xt=new q({props:{code:"JTIzJTIwQWRkaW5nJTIwbm9uLXNwZWVjaCUyMGN1ZXMlMjB0byUyMHRoZSUyMGlucHV0JTIwdGV4dCUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvciglMjJIZWxsbyUyMHVoJTIwLi4uJTIwJTVCY2xlYXJzJTIwdGhyb2F0JTVEJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjAlNUJsYXVnaHRlciU1RCUyMiklMEElMEFhdWRpb19hcnJheSUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzKSUwQWF1ZGlvX2FycmF5JTIwJTNEJTIwYXVkaW9fYXJyYXkuY3B1KCkubnVtcHkoKS5zcXVlZXplKCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Adding non-speech cues to the input text</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(<span class="hljs-string">&quot;Hello uh ... [clears throat], my dog is cute [laughter]&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>audio_array = model.generate(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>audio_array = audio_array.cpu().numpy().squeeze()`}}),Rt=new q({props:{code:"ZnJvbSUyMHNjaXB5LmlvLndhdmZpbGUlMjBpbXBvcnQlMjB3cml0ZSUyMGFzJTIwd3JpdGVfd2F2JTBBJTBBJTIzJTIwc2F2ZSUyMGF1ZGlvJTIwdG8lMjBkaXNrJTJDJTIwYnV0JTIwZmlyc3QlMjB0YWtlJTIwdGhlJTIwc2FtcGxlJTIwcmF0ZSUyMGZyb20lMjB0aGUlMjBtb2RlbCUyMGNvbmZpZyUwQXNhbXBsZV9yYXRlJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGlvbl9jb25maWcuc2FtcGxlX3JhdGUlMEF3cml0ZV93YXYoJTIyYmFya19nZW5lcmF0aW9uLndhdiUyMiUyQyUyMHNhbXBsZV9yYXRlJTJDJTIwYXVkaW9fYXJyYXkp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> scipy.io.wavfile <span class="hljs-keyword">import</span> write <span class="hljs-keyword">as</span> write_wav

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># save audio to disk, but first take the sample rate from the model config</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>sample_rate = model.generation_config.sample_rate
<span class="hljs-meta">&gt;&gt;&gt; </span>write_wav(<span class="hljs-string">&quot;bark_generation.wav&quot;</span>, sample_rate, audio_array)`}}),Lt=new z({}),Qt=new C({props:{name:"class transformers.BarkConfig",anchor:"transformers.BarkConfig",parameters:[{name:"semantic_config",val:": typing.Dict = None"},{name:"coarse_acoustics_config",val:": typing.Dict = None"},{name:"fine_acoustics_config",val:": typing.Dict = None"},{name:"codec_config",val:": typing.Dict = None"},{name:"initializer_range",val:" = 0.02"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BarkConfig.semantic_config",description:`<strong>semantic_config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkSemanticConfig">BarkSemanticConfig</a>, <em>optional</em>) &#x2014;
Configuration of the underlying semantic sub-model.`,name:"semantic_config"},{anchor:"transformers.BarkConfig.coarse_acoustics_config",description:`<strong>coarse_acoustics_config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkCoarseConfig">BarkCoarseConfig</a>, <em>optional</em>) &#x2014;
Configuration of the underlying coarse acoustics sub-model.`,name:"coarse_acoustics_config"},{anchor:"transformers.BarkConfig.fine_acoustics_config",description:`<strong>fine_acoustics_config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkFineConfig">BarkFineConfig</a>, <em>optional</em>) &#x2014;
Configuration of the underlying fine acoustics sub-model.`,name:"fine_acoustics_config"},{anchor:"transformers.BarkConfig.codec_config",description:`<strong>codec_config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoConfig">AutoConfig</a>, <em>optional</em>) &#x2014;
Configuration of the underlying codec sub-model.</p>
<p>Example &#x2014;`,name:"codec_config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bark/configuration_bark.py#L219"}}),oo=new C({props:{name:"from_sub_model_configs",anchor:"transformers.BarkConfig.from_sub_model_configs",parameters:[{name:"semantic_config",val:": BarkSemanticConfig"},{name:"coarse_acoustics_config",val:": BarkCoarseConfig"},{name:"fine_acoustics_config",val:": BarkFineConfig"},{name:"codec_config",val:": PretrainedConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bark/configuration_bark.py#L309",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkConfig"
>BarkConfig</a></p>
`}}),ao=new z({}),no=new C({props:{name:"class transformers.BarkProcessor",anchor:"transformers.BarkProcessor",parameters:[{name:"tokenizer",val:""},{name:"speaker_embeddings",val:" = None"}],parametersDescription:[{anchor:"transformers.BarkProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
An instance of <a href="/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.BarkProcessor.speaker_embeddings",description:`<strong>speaker_embeddings</strong> (<code>Dict[Dict[str]]</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Optional nested speaker embeddings dictionary. The first level contains voice preset names (e.g
<code>&quot;en_speaker_4&quot;</code>). The second level contains <code>&quot;semantic_prompt&quot;</code>, <code>&quot;coarse_prompt&quot;</code> and <code>&quot;fine_prompt&quot;</code>
embeddings. The values correspond to the path of the corresponding <code>np.ndarray</code>. See
<a href="https://suno-ai.notion.site/8b8e8749ed514b0cbf3f699013548683?v=bc67cff786b04b50b3ceb756fd05f68c" rel="nofollow">here</a> for
a list of <code>voice_preset_names</code>.`,name:"speaker_embeddings"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bark/processing_bark.py#L34"}}),so=new C({props:{name:"__call__",anchor:"transformers.BarkProcessor.__call__",parameters:[{name:"text",val:" = None"},{name:"voice_preset",val:" = None"},{name:"return_tensors",val:" = 'pt'"},{name:"max_length",val:" = 256"},{name:"add_special_tokens",val:" = False"},{name:"return_attention_mask",val:" = True"},{name:"return_token_type_ids",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BarkProcessor.__call__.text",description:`<strong>text</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
(pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
<code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text"},{anchor:"transformers.BarkProcessor.__call__.voice_preset",description:`<strong>voice_preset</strong> (<code>str</code>, <code>Dict[np.ndarray]</code>) &#x2014;
The voice preset, i.e the speaker embeddings. It can either be a valid voice_preset name, e.g
<code>&quot;en_speaker_1&quot;</code>, or directly a dictionnary of <code>np.ndarray</code> embeddings for each submodel of <code>Bark</code>. Or
it can be a valid file name of a local <code>.npz</code> single voice preset.`,name:"voice_preset"},{anchor:"transformers.BarkProcessor.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors of a particular framework. Acceptable values are:</p>
<ul>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return NumPy <code>np.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bark/processing_bark.py#L218",returnDescription:`
<p>A tuple composed of a <a
  href="/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a>, i.e the output of the
<code>tokenizer</code> and a <a
  href="/docs/transformers/v4.32.0/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a>, i.e the voice preset with the right tensors type.</p>
`,returnType:`
<p>Tuple(<a
  href="/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a>, <a
  href="/docs/transformers/v4.32.0/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a>)</p>
`}}),io=new C({props:{name:"from_pretrained",anchor:"transformers.BarkProcessor.from_pretrained",parameters:[{name:"pretrained_processor_name_or_path",val:""},{name:"speaker_embeddings_dict_path",val:" = 'speaker_embeddings_path.json'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BarkProcessor.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
This can be either:</p>
<ul>
<li>a string, the <em>model id</em> of a pretrained <a href="/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkProcessor">BarkProcessor</a> hosted inside a model repo on
huggingface.co. Valid model ids can be located at the root-level, like <code>bert-base-uncased</code>, or
namespaced under a user or organization name, like <code>dbmdz/bert-base-german-cased</code>.</li>
<li>a path to a <em>directory</em> containing a processor saved using the <a href="/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkProcessor.save_pretrained">save_pretrained()</a>
method, e.g., <code>./my_model_directory/</code>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"transformers.BarkProcessor.from_pretrained.speaker_embeddings_dict_path",description:`<strong>speaker_embeddings_dict_path</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;speaker_embeddings_path.json&quot;</code>) &#x2014;
The name of the <code>.json</code> file containing the speaker_embeddings dictionnary located in
<code>pretrained_model_name_or_path</code>. If <code>None</code>, no speaker_embeddings is loaded.
**kwargs &#x2014;
Additional keyword arguments passed along to both
<code>~tokenization_utils_base.PreTrainedTokenizer.from_pretrained</code>.`,name:"speaker_embeddings_dict_path"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bark/processing_bark.py#L63"}}),lo=new C({props:{name:"save_pretrained",anchor:"transformers.BarkProcessor.save_pretrained",parameters:[{name:"save_directory",val:""},{name:"speaker_embeddings_dict_path",val:" = 'speaker_embeddings_path.json'"},{name:"speaker_embeddings_directory",val:" = 'speaker_embeddings'"},{name:"push_to_hub",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BarkProcessor.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory where the tokenizer files and the speaker embeddings will be saved (directory will be created
if it does not exist).`,name:"save_directory"},{anchor:"transformers.BarkProcessor.save_pretrained.speaker_embeddings_dict_path",description:`<strong>speaker_embeddings_dict_path</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;speaker_embeddings_path.json&quot;</code>) &#x2014;
The name of the <code>.json</code> file that will contains the speaker_embeddings nested path dictionnary, if it
exists, and that will be located in <code>pretrained_model_name_or_path/speaker_embeddings_directory</code>.`,name:"speaker_embeddings_dict_path"},{anchor:"transformers.BarkProcessor.save_pretrained.speaker_embeddings_directory",description:`<strong>speaker_embeddings_directory</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;speaker_embeddings/&quot;</code>) &#x2014;
The name of the folder in which the speaker_embeddings arrays will be saved.`,name:"speaker_embeddings_directory"},{anchor:"transformers.BarkProcessor.save_pretrained.push_to_hub",description:`<strong>push_to_hub</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to push your model to the Hugging Face model hub after saving it. You can specify the
repository you want to push to with <code>repo_id</code> (will default to the name of <code>save_directory</code> in your
namespace).
kwargs &#x2014;
Additional key word arguments passed along to the <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.push_to_hub">push_to_hub()</a> method.`,name:"push_to_hub"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bark/processing_bark.py#L117"}}),mo=new z({}),ho=new C({props:{name:"class transformers.BarkModel",anchor:"transformers.BarkModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BarkModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkConfig">BarkConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bark/modeling_bark.py#L1397"}}),_o=new C({props:{name:"generate",anchor:"transformers.BarkModel.generate",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"history_prompt",val:": typing.Union[typing.Dict[str, torch.Tensor], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BarkModel.generate.input_ids",description:`<strong>input_ids</strong> (<code>Optional[torch.Tensor]</code> of shape (batch_size, seq_len), <em>optional</em>) &#x2014;
Input ids. Will be truncated up to 256 tokens. Note that the output audios will be as long as the
longest generation among the batch.`,name:"input_ids"},{anchor:"transformers.BarkModel.generate.history_prompt",description:`<strong>history_prompt</strong> (<code>Optional[Dict[str,torch.Tensor]]</code>, <em>optional</em>) &#x2014;
Optional <code>Bark</code> speaker prompt. Note that for now, this model takes only one speaker prompt per batch.`,name:"history_prompt"},{anchor:"transformers.BarkModel.generate.kwargs",description:`<strong>kwargs</strong> (<em>optional</em>) &#x2014; Remaining dictionary of keyword arguments. Keyword arguments are of two types:</p>
<ul>
<li>Without a prefix, they will be entered as <code>**kwargs</code> for the <code>generate</code> method of each sub-model.</li>
<li>With a <em>semantic_</em>, <em>coarse_</em>, <em>fine_</em> prefix, they will be input for the <code>generate</code> method of the
semantic, coarse and fine respectively. It has the priority over the keywords without a prefix.</li>
</ul>
<p>This means you can, for example, specify a generation strategy for all sub-models except one.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bark/modeling_bark.py#L1478",returnDescription:`
<p>Output generated audio.</p>
`,returnType:`
<p>torch.LongTensor</p>
`}}),Le=new ri({props:{anchor:"transformers.BarkModel.generate.example",$$slots:{default:[Wp]},$$scope:{ctx:J}}}),ko=new C({props:{name:"enable_cpu_offload",anchor:"transformers.BarkModel.enable_cpu_offload",parameters:[{name:"gpu_id",val:": typing.Optional[int] = 0"}],parametersDescription:[{anchor:"transformers.BarkModel.enable_cpu_offload.gpu_id",description:`<strong>gpu_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
GPU id on which the sub-models will be loaded and offloaded.`,name:"gpu_id"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bark/modeling_bark.py#L1429"}}),vo=new z({}),yo=new C({props:{name:"class transformers.BarkSemanticModel",anchor:"transformers.BarkSemanticModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BarkSemanticModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkSemanticConfig">BarkSemanticConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bark/modeling_bark.py#L714"}}),$o=new C({props:{name:"forward",anchor:"transformers.BarkSemanticModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"input_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BarkSemanticModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it. Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BarkSemanticModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.BarkSemanticModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. 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>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BarkSemanticModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BarkSemanticModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BarkSemanticModel.forward.input_embeds",description:`<strong>input_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, input_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation.
Here, due to <code>Bark</code> particularities, if <code>past_key_values</code> is used, <code>input_embeds</code> will be ignored and you
have to use <code>input_ids</code>. If <code>past_key_values</code> is not used and <code>use_cache</code> is set to <code>True</code>, <code>input_embeds</code>
is used in priority instead of <code>input_ids</code>.`,name:"input_embeds"},{anchor:"transformers.BarkSemanticModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.BarkSemanticModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BarkSemanticModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BarkSemanticModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bark/modeling_bark.py#L531"}}),et=new oi({props:{$$slots:{default:[Zp]},$$scope:{ctx:J}}}),To=new z({}),Co=new C({props:{name:"class transformers.BarkCoarseModel",anchor:"transformers.BarkCoarseModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BarkCoarseModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkCoarseConfig">BarkCoarseConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bark/modeling_bark.py#L819"}}),jo=new C({props:{name:"forward",anchor:"transformers.BarkCoarseModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"input_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BarkCoarseModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it. Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BarkCoarseModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.BarkCoarseModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. 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>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BarkCoarseModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BarkCoarseModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BarkCoarseModel.forward.input_embeds",description:`<strong>input_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, input_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation.
Here, due to <code>Bark</code> particularities, if <code>past_key_values</code> is used, <code>input_embeds</code> will be ignored and you
have to use <code>input_ids</code>. If <code>past_key_values</code> is not used and <code>use_cache</code> is set to <code>True</code>, <code>input_embeds</code>
is used in priority instead of <code>input_ids</code>.`,name:"input_embeds"},{anchor:"transformers.BarkCoarseModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.BarkCoarseModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BarkCoarseModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BarkCoarseModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bark/modeling_bark.py#L531"}}),ot=new oi({props:{$$slots:{default:[Fp]},$$scope:{ctx:J}}}),Io=new z({}),Uo=new C({props:{name:"class transformers.BarkFineModel",anchor:"transformers.BarkFineModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BarkFineModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkFineConfig">BarkFineConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bark/modeling_bark.py#L1029"}}),No=new C({props:{name:"forward",anchor:"transformers.BarkFineModel.forward",parameters:[{name:"codebook_idx",val:": int"},{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"input_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BarkFineModel.forward.codebook_idx",description:`<strong>codebook_idx</strong> (<code>int</code>) &#x2014;
Index of the codebook that will be predicted.`,name:"codebook_idx"},{anchor:"transformers.BarkFineModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length, number_of_codebooks)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it. Initially, indices of the first two codebooks are obtained from the <code>coarse</code> sub-model. The rest is
predicted recursively by attending the previously predicted channels. The model predicts on windows of
length 1024.`,name:"input_ids"},{anchor:"transformers.BarkFineModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. 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>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BarkFineModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BarkFineModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BarkFineModel.forward.labels",description:"<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014; NOT IMPLEMENTED YET.",name:"labels"},{anchor:"transformers.BarkFineModel.forward.input_embeds",description:`<strong>input_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, input_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. If
<code>past_key_values</code> is used, optionally only the last <code>input_embeds</code> have to be input (see
<code>past_key_values</code>). This is useful if you want more control over how to convert <code>input_ids</code> indices into
associated vectors than the model&#x2019;s internal embedding lookup matrix.`,name:"input_embeds"},{anchor:"transformers.BarkFineModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BarkFineModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BarkFineModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bark/modeling_bark.py#L1125"}}),at=new oi({props:{$$slots:{default:[Gp]},$$scope:{ctx:J}}}),So=new z({}),Wo=new C({props:{name:"class transformers.BarkCausalModel",anchor:"transformers.BarkCausalModel",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bark/modeling_bark.py#L450"}}),Zo=new C({props:{name:"forward",anchor:"transformers.BarkCausalModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"input_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BarkCausalModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it. Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BarkCausalModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.BarkCausalModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. 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>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BarkCausalModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BarkCausalModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BarkCausalModel.forward.input_embeds",description:`<strong>input_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, input_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation.
Here, due to <code>Bark</code> particularities, if <code>past_key_values</code> is used, <code>input_embeds</code> will be ignored and you
have to use <code>input_ids</code>. If <code>past_key_values</code> is not used and <code>use_cache</code> is set to <code>True</code>, <code>input_embeds</code>
is used in priority instead of <code>input_ids</code>.`,name:"input_embeds"},{anchor:"transformers.BarkCausalModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.BarkCausalModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BarkCausalModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BarkCausalModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bark/modeling_bark.py#L531"}}),st=new oi({props:{$$slots:{default:[Ap]},$$scope:{ctx:J}}}),Fo=new z({}),Go=new C({props:{name:"class transformers.BarkCoarseConfig",anchor:"transformers.BarkCoarseConfig",parameters:[{name:"block_size",val:" = 1024"},{name:"input_vocab_size",val:" = 10048"},{name:"output_vocab_size",val:" = 10048"},{name:"num_layers",val:" = 12"},{name:"num_heads",val:" = 12"},{name:"hidden_size",val:" = 768"},{name:"dropout",val:" = 0.0"},{name:"bias",val:" = True"},{name:"initializer_range",val:" = 0.02"},{name:"use_cache",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BarkCoarseConfig.block_size",description:`<strong>block_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"block_size"},{anchor:"transformers.BarkCoarseConfig.input_vocab_size",description:`<strong>input_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 10_048) &#x2014;
Vocabulary size of a Bark sub-model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkCoarseModel">BarkCoarseModel</a>. Defaults to 10_048 but should be carefully thought with
regards to the chosen sub-model.`,name:"input_vocab_size"},{anchor:"transformers.BarkCoarseConfig.output_vocab_size",description:`<strong>output_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 10_048) &#x2014;
Output vocabulary size of a Bark sub-model. Defines the number of different tokens that can be represented
by the: <code>output_ids</code> when passing forward a <a href="/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkCoarseModel">BarkCoarseModel</a>. Defaults to 10_048 but should be carefully thought
with regards to the chosen sub-model.`,name:"output_vocab_size"},{anchor:"transformers.BarkCoarseConfig.num_layers",description:`<strong>num_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the given sub-model.`,name:"num_layers"},{anchor:"transformers.BarkCoarseConfig.num_heads",description:`<strong>num_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer architecture.`,name:"num_heads"},{anchor:"transformers.BarkCoarseConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the architecture.`,name:"hidden_size"},{anchor:"transformers.BarkCoarseConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.BarkCoarseConfig.bias",description:`<strong>bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to use bias in the linear layers and layer norm layers.`,name:"bias"},{anchor:"transformers.BarkCoarseConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.BarkCoarseConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bark/configuration_bark.py#L182"}}),lt=new ri({props:{anchor:"transformers.BarkCoarseConfig.example",$$slots:{default:[Vp]},$$scope:{ctx:J}}}),Vo=new z({}),Yo=new C({props:{name:"class transformers.BarkFineConfig",anchor:"transformers.BarkFineConfig",parameters:[{name:"tie_word_embeddings",val:" = True"},{name:"n_codes_total",val:" = 8"},{name:"n_codes_given",val:" = 1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BarkFineConfig.block_size",description:`<strong>block_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"block_size"},{anchor:"transformers.BarkFineConfig.input_vocab_size",description:`<strong>input_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 10_048) &#x2014;
Vocabulary size of a Bark sub-model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkFineModel">BarkFineModel</a>. Defaults to 10_048 but should be carefully thought with
regards to the chosen sub-model.`,name:"input_vocab_size"},{anchor:"transformers.BarkFineConfig.output_vocab_size",description:`<strong>output_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 10_048) &#x2014;
Output vocabulary size of a Bark sub-model. Defines the number of different tokens that can be represented
by the: <code>output_ids</code> when passing forward a <a href="/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkFineModel">BarkFineModel</a>. Defaults to 10_048 but should be carefully thought
with regards to the chosen sub-model.`,name:"output_vocab_size"},{anchor:"transformers.BarkFineConfig.num_layers",description:`<strong>num_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the given sub-model.`,name:"num_layers"},{anchor:"transformers.BarkFineConfig.num_heads",description:`<strong>num_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer architecture.`,name:"num_heads"},{anchor:"transformers.BarkFineConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the architecture.`,name:"hidden_size"},{anchor:"transformers.BarkFineConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.BarkFineConfig.bias",description:`<strong>bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to use bias in the linear layers and layer norm layers.`,name:"bias"},{anchor:"transformers.BarkFineConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.BarkFineConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models).`,name:"use_cache"},{anchor:"transformers.BarkFineConfig.n_codes_total",description:`<strong>n_codes_total</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
The total number of audio codebooks predicted. Used in the fine acoustics sub-model.`,name:"n_codes_total"},{anchor:"transformers.BarkFineConfig.n_codes_given",description:`<strong>n_codes_given</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of audio codebooks predicted in the coarse acoustics sub-model. Used in the acoustics
sub-models.`,name:"n_codes_given"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bark/configuration_bark.py#L209"}}),ct=new ri({props:{anchor:"transformers.BarkFineConfig.example",$$slots:{default:[Yp]},$$scope:{ctx:J}}}),Xo=new z({}),Ro=new C({props:{name:"class transformers.BarkSemanticConfig",anchor:"transformers.BarkSemanticConfig",parameters:[{name:"block_size",val:" = 1024"},{name:"input_vocab_size",val:" = 10048"},{name:"output_vocab_size",val:" = 10048"},{name:"num_layers",val:" = 12"},{name:"num_heads",val:" = 12"},{name:"hidden_size",val:" = 768"},{name:"dropout",val:" = 0.0"},{name:"bias",val:" = True"},{name:"initializer_range",val:" = 0.02"},{name:"use_cache",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BarkSemanticConfig.block_size",description:`<strong>block_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"block_size"},{anchor:"transformers.BarkSemanticConfig.input_vocab_size",description:`<strong>input_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 10_048) &#x2014;
Vocabulary size of a Bark sub-model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkSemanticModel">BarkSemanticModel</a>. Defaults to 10_048 but should be carefully thought with
regards to the chosen sub-model.`,name:"input_vocab_size"},{anchor:"transformers.BarkSemanticConfig.output_vocab_size",description:`<strong>output_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 10_048) &#x2014;
Output vocabulary size of a Bark sub-model. Defines the number of different tokens that can be represented
by the: <code>output_ids</code> when passing forward a <a href="/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkSemanticModel">BarkSemanticModel</a>. Defaults to 10_048 but should be carefully thought
with regards to the chosen sub-model.`,name:"output_vocab_size"},{anchor:"transformers.BarkSemanticConfig.num_layers",description:`<strong>num_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the given sub-model.`,name:"num_layers"},{anchor:"transformers.BarkSemanticConfig.num_heads",description:`<strong>num_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer architecture.`,name:"num_heads"},{anchor:"transformers.BarkSemanticConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the architecture.`,name:"hidden_size"},{anchor:"transformers.BarkSemanticConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.BarkSemanticConfig.bias",description:`<strong>bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to use bias in the linear layers and layer norm layers.`,name:"bias"},{anchor:"transformers.BarkSemanticConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.BarkSemanticConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/bark/configuration_bark.py#L160"}}),ht=new ri({props:{anchor:"transformers.BarkSemanticConfig.example",$$slots:{default:[qp]},$$scope:{ctx:J}}}),{c(){p=r("meta"),$=d(),M=r("h1"),w=r("a"),B=r("span"),g(f.$$.fragment),u=d(),j=r("span"),ni=s("Bark"),gn=d(),te=r("h2"),je=r("a"),aa=r("span"),g(Mt.$$.fragment),si=d(),na=r("span"),ii=s("Overview"),_n=d(),Ie=r("p"),li=s("Bark is a transformer-based text-to-speech model proposed by Suno AI in "),Bt=r("a"),di=s("suno-ai/bark"),ci=s("."),bn=d(),Lo=r("p"),mi=s("Bark is made of 4 main models:"),kn=d(),A=r("ul"),Qo=r("li"),Ko=r("a"),hi=s("BarkSemanticModel"),fi=s(" (also referred to as the \u2018text\u2019 model): a causal auto-regressive transformer model that takes as input tokenized text, and predicts semantic text tokens that capture the meaning of the text."),pi=d(),Ue=r("li"),er=r("a"),ui=s("BarkCoarseModel"),gi=s(" (also referred to as the \u2018coarse acoustics\u2019 model): a causal autoregressive transformer, that takes as input the results of the "),tr=r("a"),_i=s("BarkSemanticModel"),bi=s(" model. It aims at predicting the first two audio codebooks necessary for EnCodec."),ki=d(),or=r("li"),rr=r("a"),vi=s("BarkFineModel"),yi=s(" (the \u2018fine acoustics\u2019 model), this time a non-causal autoencoder transformer, which iteratively predicts the last codebooks based on the sum of the previous codebooks embeddings."),wi=d(),$t=r("li"),Mi=s("having predicted all the codebook channels from the "),ar=r("a"),Bi=s("EncodecModel"),$i=s(", Bark uses it to decode the output audio array."),vn=d(),nr=r("p"),Ti=s("It should be noted that each of the first three modules can support conditional speaker embeddings to condition the output sound according to specific predefined voice."),yn=d(),oe=r("h3"),xe=r("a"),sa=r("span"),g(Tt.$$.fragment),Ci=d(),ia=r("span"),Ei=s("Optimizing Bark"),wn=d(),R=r("p"),Ji=s("Bark can be optimized with just a few extra lines of code, which "),la=r("strong"),zi=s("significantly reduces its memory footprint"),ji=s(" and "),da=r("strong"),Ii=s("accelerates inference"),Ui=s("."),Mn=d(),re=r("h4"),Pe=r("a"),ca=r("span"),g(Ct.$$.fragment),xi=d(),ma=r("span"),Pi=s("Using half-precision"),Bn=d(),sr=r("p"),Ni=s("You can speed up inference and reduce memory footprint by 50% simply by loading the model in half-precision."),$n=d(),g(Et.$$.fragment),Tn=d(),ae=r("h4"),Ne=r("a"),ha=r("span"),g(Jt.$$.fragment),Si=d(),fa=r("span"),Wi=s("Using \u{1F917} Better Transformer"),Cn=d(),ir=r("p"),Zi=s("Better Transformer is an \u{1F917} Optimum feature that performs kernel fusion under the hood. You can gain 20% to 30% in speed with zero performance degradation. It only requires one line of code to export the model to \u{1F917} Better Transformer:"),En=d(),g(zt.$$.fragment),Jn=d(),jt=r("p"),Fi=s("Note that \u{1F917} Optimum must be installed before using this feature. "),It=r("a"),Gi=s("Here\u2019s how to install it."),zn=d(),ne=r("h4"),Se=r("a"),pa=r("span"),g(Ut.$$.fragment),Ai=d(),ua=r("span"),Vi=s("Using CPU offload"),jn=d(),lr=r("p"),Yi=s("As mentioned above, Bark is made up of 4 sub-models, which are called up sequentially during audio generation. In other words, while one sub-model is in use, the other sub-models are idle."),In=d(),dr=r("p"),qi=s("If you\u2019re using a CUDA device, a simple solution to benefit from an 80% reduction in memory footprint is to offload the GPU\u2019s submodels when they\u2019re idle. This operation is called CPU offloading. You can use it with one line of code."),Un=d(),g(xt.$$.fragment),xn=d(),Pt=r("p"),Xi=s("Note that \u{1F917} Accelerate must be installed before using this feature. "),Nt=r("a"),Ri=s("Here\u2019s how to install it."),Pn=d(),se=r("h4"),We=r("a"),ga=r("span"),g(St.$$.fragment),Di=d(),_a=r("span"),Oi=s("Combining optimizaton techniques"),Nn=d(),cr=r("p"),Hi=s("You can combine optimization techniques, and use CPU offload, half-precision and \u{1F917} Better Transformer all at once."),Sn=d(),g(Wt.$$.fragment),Wn=d(),Ze=r("p"),Li=s("Find out more on inference optimization techniques "),Zt=r("a"),Qi=s("here"),Ki=s("."),Zn=d(),ie=r("h3"),Fe=r("a"),ba=r("span"),g(Ft.$$.fragment),el=d(),ka=r("span"),tl=s("Tips"),Fn=d(),V=r("p"),ol=s("Suno offers a library of voice presets in a number of languages "),Gt=r("a"),rl=s("here"),al=s(`.
These presets are also uploaded in the hub `),At=r("a"),nl=s("here"),sl=s(" or "),Vt=r("a"),il=s("here"),ll=s("."),Gn=d(),g(Yt.$$.fragment),An=d(),Ge=r("p"),dl=s("Bark can generate highly realistic, "),va=r("strong"),cl=s("multilingual"),ml=s(" speech as well as other audio - including music, background noise and simple sound effects."),Vn=d(),g(qt.$$.fragment),Yn=d(),Ae=r("p"),hl=s("The model can also produce "),ya=r("strong"),fl=s("nonverbal communications"),pl=s(" like laughing, sighing and crying."),qn=d(),g(Xt.$$.fragment),Xn=d(),mr=r("p"),ul=s("To save the audio, simply take the sample rate from the model config and some scipy utility:"),Rn=d(),g(Rt.$$.fragment),Dn=d(),Y=r("p"),gl=s("This model was contributed by "),Dt=r("a"),_l=s("Yoach Lacombe (ylacombe)"),bl=s(" and "),Ot=r("a"),kl=s("Sanchit Gandhi (sanchit-gandhi)"),vl=s(`.
The original code can be found `),Ht=r("a"),yl=s("here"),wl=s("."),On=d(),le=r("h2"),Ve=r("a"),wa=r("span"),g(Lt.$$.fragment),Ml=d(),Ma=r("span"),Bl=s("BarkConfig"),Hn=d(),x=r("div"),g(Qt.$$.fragment),$l=d(),Kt=r("p"),Tl=s("This is the configuration class to store the configuration of a "),hr=r("a"),Cl=s("BarkModel"),El=s(`. It is used to instantiate a Bark
model according to the specified sub-models configurations, defining the model architecture.`),Jl=d(),eo=r("p"),zl=s(`Instantiating a configuration with the defaults will yield a similar configuration to that of the Bark
`),to=r("a"),jl=s("suno/bark"),Il=s(" architecture."),Ul=d(),de=r("p"),xl=s("Configuration objects inherit from "),fr=r("a"),Pl=s("PretrainedConfig"),Nl=s(` and can be used to control the model outputs. Read the
documentation from `),pr=r("a"),Sl=s("PretrainedConfig"),Wl=s(" for more information."),Zl=d(),Ye=r("div"),g(oo.$$.fragment),Fl=d(),ro=r("p"),Gl=s("Instantiate a "),ur=r("a"),Al=s("BarkConfig"),Vl=s(" (or a derived class) from bark sub-models configuration."),Ln=d(),ce=r("h2"),qe=r("a"),Ba=r("span"),g(ao.$$.fragment),Yl=d(),$a=r("span"),ql=s("BarkProcessor"),Qn=d(),P=r("div"),g(no.$$.fragment),Xl=d(),Ta=r("p"),Rl=s("Constructs a Bark processor which wraps a text tokenizer and optional Bark voice presets into a single processor."),Dl=d(),Xe=r("div"),g(so.$$.fragment),Ol=d(),E=r("p"),Hl=s("Main method to prepare for the model one or several sequences(s). This method forwards the "),Ca=r("code"),Ll=s("text"),Ql=s(" and "),Ea=r("code"),Kl=s("kwargs"),ed=s(`
arguments to the AutoTokenizer\u2019s `),Ja=r("code"),td=s("__call__()"),od=s(` to encode the text. The method also proposes a
voice preset which is a dictionary of arrays that conditions `),za=r("code"),rd=s("Bark"),ad=s("\u2019s output. "),ja=r("code"),nd=s("kwargs"),sd=s(` arguments are forwarded
to the tokenizer and to `),Ia=r("code"),id=s("cached_file"),ld=s(" method if "),Ua=r("code"),dd=s("voice_preset"),cd=s(" is a valid filename."),md=d(),Re=r("div"),g(io.$$.fragment),hd=d(),xa=r("p"),fd=s("Instantiate a Bark processor associated with a pretrained model."),pd=d(),De=r("div"),g(lo.$$.fragment),ud=d(),co=r("p"),gd=s(`Saves the attributes of this processor (tokenizer\u2026) in the specified directory so that it can be reloaded
using the `),gr=r("a"),_d=s("from_pretrained()"),bd=s(" method."),Kn=d(),me=r("h2"),Oe=r("a"),Pa=r("span"),g(mo.$$.fragment),kd=d(),Na=r("span"),vd=s("BarkModel"),es=d(),T=r("div"),g(ho.$$.fragment),yd=d(),Sa=r("p"),wd=s("The full Bark model, a text-to-speech model composed of 4 sub-models:"),Md=d(),X=r("ul"),_r=r("li"),br=r("a"),Bd=s("BarkSemanticModel"),$d=s(` (also referred to as the \u2018text\u2019 model): a causal auto-regressive transformer model that
takes
as input tokenized text, and predicts semantic text tokens that capture the meaning of the text.`),Td=d(),He=r("li"),kr=r("a"),Cd=s("BarkCoarseModel"),Ed=s(` (also refered to as the \u2018coarse acoustics\u2019 model), also a causal autoregressive transformer,
that takes into input the results of the last model. It aims at regressing the first two audio codebooks necessary
to `),Wa=r("code"),Jd=s("encodec"),zd=s("."),jd=d(),vr=r("li"),yr=r("a"),Id=s("BarkFineModel"),Ud=s(` (the \u2018fine acoustics\u2019 model), this time a non-causal autoencoder transformer, which iteratively
predicts the last codebooks based on the sum of the previous codebooks embeddings.`),xd=d(),fo=r("li"),Pd=s("having predicted all the codebook channels from the "),wr=r("a"),Nd=s("EncodecModel"),Sd=s(`, Bark uses it to decode the output audio
array.`),Wd=d(),Za=r("p"),Zd=s(`It should be noted that each of the first three modules can support conditional speaker embeddings to condition the
output sound according to specific predefined voice.`),Fd=d(),po=r("p"),Gd=s("This model inherits from "),Mr=r("a"),Ad=s("PreTrainedModel"),Vd=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Yd=d(),uo=r("p"),qd=s("This model is also a PyTorch "),go=r("a"),Xd=s("torch.nn.Module"),Rd=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Dd=d(),D=r("div"),g(_o.$$.fragment),Od=d(),bo=r("p"),Hd=s("Generates audio from an input prompt and an additional optional "),Fa=r("code"),Ld=s("Bark"),Qd=s(" speaker prompt."),Kd=d(),g(Le.$$.fragment),ec=d(),Qe=r("div"),g(ko.$$.fragment),tc=d(),Ga=r("p"),oc=s(`Offloads all sub-models to CPU using accelerate, reducing memory usage with a low impact on performance. This
method moves one whole sub-model at a time to the GPU when it is used, and the sub-model remains in GPU until
the next sub-model runs.`),ts=d(),he=r("h2"),Ke=r("a"),Aa=r("span"),g(vo.$$.fragment),rc=d(),Va=r("span"),ac=s("BarkSemanticModel"),os=d(),N=r("div"),g(yo.$$.fragment),nc=d(),wo=r("p"),sc=s(`Bark semantic (or text) model. It shares the same architecture as the coarse model.
It is a GPT-2 like autoregressive model with a language modeling head on top.
This model inherits from `),Br=r("a"),ic=s("PreTrainedModel"),lc=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),dc=d(),Mo=r("p"),cc=s("This model is also a PyTorch "),Bo=r("a"),mc=s("torch.nn.Module"),hc=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),fc=d(),O=r("div"),g($o.$$.fragment),pc=d(),fe=r("p"),uc=s("The "),$r=r("a"),gc=s("BarkCausalModel"),_c=s(" forward method, overrides the "),Ya=r("code"),bc=s("__call__"),kc=s(" special method."),vc=d(),g(et.$$.fragment),rs=d(),pe=r("h2"),tt=r("a"),qa=r("span"),g(To.$$.fragment),yc=d(),Xa=r("span"),wc=s("BarkCoarseModel"),as=d(),S=r("div"),g(Co.$$.fragment),Mc=d(),Eo=r("p"),Bc=s(`Bark coarse acoustics model.
It shares the same architecture as the semantic (or text) model. It is a GPT-2 like autoregressive model with a
language modeling head on top.
This model inherits from `),Tr=r("a"),$c=s("PreTrainedModel"),Tc=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Cc=d(),Jo=r("p"),Ec=s("This model is also a PyTorch "),zo=r("a"),Jc=s("torch.nn.Module"),zc=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),jc=d(),H=r("div"),g(jo.$$.fragment),Ic=d(),ue=r("p"),Uc=s("The "),Cr=r("a"),xc=s("BarkCausalModel"),Pc=s(" forward method, overrides the "),Ra=r("code"),Nc=s("__call__"),Sc=s(" special method."),Wc=d(),g(ot.$$.fragment),ns=d(),ge=r("h2"),rt=r("a"),Da=r("span"),g(Io.$$.fragment),Zc=d(),Oa=r("span"),Fc=s("BarkFineModel"),ss=d(),W=r("div"),g(Uo.$$.fragment),Gc=d(),_e=r("p"),Ac=s("Bark fine acoustics model. It is a non-causal GPT-like model with "),Ha=r("code"),Vc=s("config.n_codes_total"),Yc=s(` embedding layers and
language modeling heads, one for each codebook.
This model inherits from `),Er=r("a"),qc=s("PreTrainedModel"),Xc=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Rc=d(),xo=r("p"),Dc=s("This model is also a PyTorch "),Po=r("a"),Oc=s("torch.nn.Module"),Hc=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Lc=d(),L=r("div"),g(No.$$.fragment),Qc=d(),be=r("p"),Kc=s("The "),Jr=r("a"),em=s("BarkFineModel"),tm=s(" forward method, overrides the "),La=r("code"),om=s("__call__"),rm=s(" special method."),am=d(),g(at.$$.fragment),is=d(),ke=r("h2"),nt=r("a"),Qa=r("span"),g(So.$$.fragment),nm=d(),Ka=r("span"),sm=s("BarkCausalModel"),ls=d(),ve=r("div"),g(Wo.$$.fragment),im=d(),Q=r("div"),g(Zo.$$.fragment),lm=d(),ye=r("p"),dm=s("The "),zr=r("a"),cm=s("BarkCausalModel"),mm=s(" forward method, overrides the "),en=r("code"),hm=s("__call__"),fm=s(" special method."),pm=d(),g(st.$$.fragment),ds=d(),we=r("h2"),it=r("a"),tn=r("span"),g(Fo.$$.fragment),um=d(),on=r("span"),gm=s("BarkCoarseConfig"),cs=d(),Z=r("div"),g(Go.$$.fragment),_m=d(),Me=r("p"),bm=s("This is the configuration class to store the configuration of a "),jr=r("a"),km=s("BarkCoarseModel"),vm=s(`. It is used to instantiate the model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Bark `),Ao=r("a"),ym=s("suno/bark"),wm=s(`
architecture.`),Mm=d(),Be=r("p"),Bm=s("Configuration objects inherit from "),Ir=r("a"),$m=s("PretrainedConfig"),Tm=s(` and can be used to control the model outputs. Read the
documentation from `),Ur=r("a"),Cm=s("PretrainedConfig"),Em=s(" for more information."),Jm=d(),g(lt.$$.fragment),ms=d(),$e=r("h2"),dt=r("a"),rn=r("span"),g(Vo.$$.fragment),zm=d(),an=r("span"),jm=s("BarkFineConfig"),hs=d(),F=r("div"),g(Yo.$$.fragment),Im=d(),Te=r("p"),Um=s("This is the configuration class to store the configuration of a "),xr=r("a"),xm=s("BarkFineModel"),Pm=s(`. It is used to instantiate the model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Bark `),qo=r("a"),Nm=s("suno/bark"),Sm=s(`
architecture.`),Wm=d(),Ce=r("p"),Zm=s("Configuration objects inherit from "),Pr=r("a"),Fm=s("PretrainedConfig"),Gm=s(` and can be used to control the model outputs. Read the
documentation from `),Nr=r("a"),Am=s("PretrainedConfig"),Vm=s(" for more information."),Ym=d(),g(ct.$$.fragment),fs=d(),Ee=r("h2"),mt=r("a"),nn=r("span"),g(Xo.$$.fragment),qm=d(),sn=r("span"),Xm=s("BarkSemanticConfig"),ps=d(),G=r("div"),g(Ro.$$.fragment),Rm=d(),Je=r("p"),Dm=s("This is the configuration class to store the configuration of a "),Sr=r("a"),Om=s("BarkSemanticModel"),Hm=s(`. It is used to instantiate the model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Bark `),Do=r("a"),Lm=s("suno/bark"),Qm=s(`
architecture.`),Km=d(),ze=r("p"),eh=s("Configuration objects inherit from "),Wr=r("a"),th=s("PretrainedConfig"),oh=s(` and can be used to control the model outputs. Read the
documentation from `),Zr=r("a"),rh=s("PretrainedConfig"),ah=s(" for more information."),nh=d(),g(ht.$$.fragment),this.h()},l(t){const m=Np('[data-svelte="svelte-1phssyn"]',document.head);p=a(m,"META",{name:!0,content:!0}),m.forEach(o),$=c(t),M=a(t,"H1",{class:!0});var Oo=n(M);w=a(Oo,"A",{id:!0,class:!0,href:!0});var ln=n(w);B=a(ln,"SPAN",{});var dn=n(B);_(f.$$.fragment,dn),dn.forEach(o),ln.forEach(o),u=c(Oo),j=a(Oo,"SPAN",{});var cn=n(j);ni=i(cn,"Bark"),cn.forEach(o),Oo.forEach(o),gn=c(t),te=a(t,"H2",{class:!0});var Ho=n(te);je=a(Ho,"A",{id:!0,class:!0,href:!0});var mn=n(je);aa=a(mn,"SPAN",{});var hn=n(aa);_(Mt.$$.fragment,hn),hn.forEach(o),mn.forEach(o),si=c(Ho),na=a(Ho,"SPAN",{});var fn=n(na);ii=i(fn,"Overview"),fn.forEach(o),Ho.forEach(o),_n=c(t),Ie=a(t,"P",{});var gs=n(Ie);li=i(gs,"Bark is a transformer-based text-to-speech model proposed by Suno AI in "),Bt=a(gs,"A",{href:!0,rel:!0});var hh=n(Bt);di=i(hh,"suno-ai/bark"),hh.forEach(o),ci=i(gs,"."),gs.forEach(o),bn=c(t),Lo=a(t,"P",{});var fh=n(Lo);mi=i(fh,"Bark is made of 4 main models:"),fh.forEach(o),kn=c(t),A=a(t,"UL",{});var ft=n(A);Qo=a(ft,"LI",{});var sh=n(Qo);Ko=a(sh,"A",{href:!0});var ph=n(Ko);hi=i(ph,"BarkSemanticModel"),ph.forEach(o),fi=i(sh," (also referred to as the \u2018text\u2019 model): a causal auto-regressive transformer model that takes as input tokenized text, and predicts semantic text tokens that capture the meaning of the text."),sh.forEach(o),pi=c(ft),Ue=a(ft,"LI",{});var pn=n(Ue);er=a(pn,"A",{href:!0});var uh=n(er);ui=i(uh,"BarkCoarseModel"),uh.forEach(o),gi=i(pn," (also referred to as the \u2018coarse acoustics\u2019 model): a causal autoregressive transformer, that takes as input the results of the "),tr=a(pn,"A",{href:!0});var gh=n(tr);_i=i(gh,"BarkSemanticModel"),gh.forEach(o),bi=i(pn," model. It aims at predicting the first two audio codebooks necessary for EnCodec."),pn.forEach(o),ki=c(ft),or=a(ft,"LI",{});var ih=n(or);rr=a(ih,"A",{href:!0});var _h=n(rr);vi=i(_h,"BarkFineModel"),_h.forEach(o),yi=i(ih," (the \u2018fine acoustics\u2019 model), this time a non-causal autoencoder transformer, which iteratively predicts the last codebooks based on the sum of the previous codebooks embeddings."),ih.forEach(o),wi=c(ft),$t=a(ft,"LI",{});var _s=n($t);Mi=i(_s,"having predicted all the codebook channels from the "),ar=a(_s,"A",{href:!0});var bh=n(ar);Bi=i(bh,"EncodecModel"),bh.forEach(o),$i=i(_s,", Bark uses it to decode the output audio array."),_s.forEach(o),ft.forEach(o),vn=c(t),nr=a(t,"P",{});var kh=n(nr);Ti=i(kh,"It should be noted that each of the first three modules can support conditional speaker embeddings to condition the output sound according to specific predefined voice."),kh.forEach(o),yn=c(t),oe=a(t,"H3",{class:!0});var bs=n(oe);xe=a(bs,"A",{id:!0,class:!0,href:!0});var vh=n(xe);sa=a(vh,"SPAN",{});var yh=n(sa);_(Tt.$$.fragment,yh),yh.forEach(o),vh.forEach(o),Ci=c(bs),ia=a(bs,"SPAN",{});var wh=n(ia);Ei=i(wh,"Optimizing Bark"),wh.forEach(o),bs.forEach(o),wn=c(t),R=a(t,"P",{});var Fr=n(R);Ji=i(Fr,"Bark can be optimized with just a few extra lines of code, which "),la=a(Fr,"STRONG",{});var Mh=n(la);zi=i(Mh,"significantly reduces its memory footprint"),Mh.forEach(o),ji=i(Fr," and "),da=a(Fr,"STRONG",{});var Bh=n(da);Ii=i(Bh,"accelerates inference"),Bh.forEach(o),Ui=i(Fr,"."),Fr.forEach(o),Mn=c(t),re=a(t,"H4",{class:!0});var ks=n(re);Pe=a(ks,"A",{id:!0,class:!0,href:!0});var $h=n(Pe);ca=a($h,"SPAN",{});var Th=n(ca);_(Ct.$$.fragment,Th),Th.forEach(o),$h.forEach(o),xi=c(ks),ma=a(ks,"SPAN",{});var Ch=n(ma);Pi=i(Ch,"Using half-precision"),Ch.forEach(o),ks.forEach(o),Bn=c(t),sr=a(t,"P",{});var Eh=n(sr);Ni=i(Eh,"You can speed up inference and reduce memory footprint by 50% simply by loading the model in half-precision."),Eh.forEach(o),$n=c(t),_(Et.$$.fragment,t),Tn=c(t),ae=a(t,"H4",{class:!0});var vs=n(ae);Ne=a(vs,"A",{id:!0,class:!0,href:!0});var Jh=n(Ne);ha=a(Jh,"SPAN",{});var zh=n(ha);_(Jt.$$.fragment,zh),zh.forEach(o),Jh.forEach(o),Si=c(vs),fa=a(vs,"SPAN",{});var jh=n(fa);Wi=i(jh,"Using \u{1F917} Better Transformer"),jh.forEach(o),vs.forEach(o),Cn=c(t),ir=a(t,"P",{});var Ih=n(ir);Zi=i(Ih,"Better Transformer is an \u{1F917} Optimum feature that performs kernel fusion under the hood. You can gain 20% to 30% in speed with zero performance degradation. It only requires one line of code to export the model to \u{1F917} Better Transformer:"),Ih.forEach(o),En=c(t),_(zt.$$.fragment,t),Jn=c(t),jt=a(t,"P",{});var lh=n(jt);Fi=i(lh,"Note that \u{1F917} Optimum must be installed before using this feature. "),It=a(lh,"A",{href:!0,rel:!0});var Uh=n(It);Gi=i(Uh,"Here\u2019s how to install it."),Uh.forEach(o),lh.forEach(o),zn=c(t),ne=a(t,"H4",{class:!0});var ys=n(ne);Se=a(ys,"A",{id:!0,class:!0,href:!0});var xh=n(Se);pa=a(xh,"SPAN",{});var Ph=n(pa);_(Ut.$$.fragment,Ph),Ph.forEach(o),xh.forEach(o),Ai=c(ys),ua=a(ys,"SPAN",{});var Nh=n(ua);Vi=i(Nh,"Using CPU offload"),Nh.forEach(o),ys.forEach(o),jn=c(t),lr=a(t,"P",{});var Sh=n(lr);Yi=i(Sh,"As mentioned above, Bark is made up of 4 sub-models, which are called up sequentially during audio generation. In other words, while one sub-model is in use, the other sub-models are idle."),Sh.forEach(o),In=c(t),dr=a(t,"P",{});var Wh=n(dr);qi=i(Wh,"If you\u2019re using a CUDA device, a simple solution to benefit from an 80% reduction in memory footprint is to offload the GPU\u2019s submodels when they\u2019re idle. This operation is called CPU offloading. You can use it with one line of code."),Wh.forEach(o),Un=c(t),_(xt.$$.fragment,t),xn=c(t),Pt=a(t,"P",{});var dh=n(Pt);Xi=i(dh,"Note that \u{1F917} Accelerate must be installed before using this feature. "),Nt=a(dh,"A",{href:!0,rel:!0});var Zh=n(Nt);Ri=i(Zh,"Here\u2019s how to install it."),Zh.forEach(o),dh.forEach(o),Pn=c(t),se=a(t,"H4",{class:!0});var ws=n(se);We=a(ws,"A",{id:!0,class:!0,href:!0});var Fh=n(We);ga=a(Fh,"SPAN",{});var Gh=n(ga);_(St.$$.fragment,Gh),Gh.forEach(o),Fh.forEach(o),Di=c(ws),_a=a(ws,"SPAN",{});var Ah=n(_a);Oi=i(Ah,"Combining optimizaton techniques"),Ah.forEach(o),ws.forEach(o),Nn=c(t),cr=a(t,"P",{});var Vh=n(cr);Hi=i(Vh,"You can combine optimization techniques, and use CPU offload, half-precision and \u{1F917} Better Transformer all at once."),Vh.forEach(o),Sn=c(t),_(Wt.$$.fragment,t),Wn=c(t),Ze=a(t,"P",{});var Ms=n(Ze);Li=i(Ms,"Find out more on inference optimization techniques "),Zt=a(Ms,"A",{href:!0,rel:!0});var Yh=n(Zt);Qi=i(Yh,"here"),Yh.forEach(o),Ki=i(Ms,"."),Ms.forEach(o),Zn=c(t),ie=a(t,"H3",{class:!0});var Bs=n(ie);Fe=a(Bs,"A",{id:!0,class:!0,href:!0});var qh=n(Fe);ba=a(qh,"SPAN",{});var Xh=n(ba);_(Ft.$$.fragment,Xh),Xh.forEach(o),qh.forEach(o),el=c(Bs),ka=a(Bs,"SPAN",{});var Rh=n(ka);tl=i(Rh,"Tips"),Rh.forEach(o),Bs.forEach(o),Fn=c(t),V=a(t,"P",{});var pt=n(V);ol=i(pt,"Suno offers a library of voice presets in a number of languages "),Gt=a(pt,"A",{href:!0,rel:!0});var Dh=n(Gt);rl=i(Dh,"here"),Dh.forEach(o),al=i(pt,`.
These presets are also uploaded in the hub `),At=a(pt,"A",{href:!0,rel:!0});var Oh=n(At);nl=i(Oh,"here"),Oh.forEach(o),sl=i(pt," or "),Vt=a(pt,"A",{href:!0,rel:!0});var Hh=n(Vt);il=i(Hh,"here"),Hh.forEach(o),ll=i(pt,"."),pt.forEach(o),Gn=c(t),_(Yt.$$.fragment,t),An=c(t),Ge=a(t,"P",{});var $s=n(Ge);dl=i($s,"Bark can generate highly realistic, "),va=a($s,"STRONG",{});var Lh=n(va);cl=i(Lh,"multilingual"),Lh.forEach(o),ml=i($s," speech as well as other audio - including music, background noise and simple sound effects."),$s.forEach(o),Vn=c(t),_(qt.$$.fragment,t),Yn=c(t),Ae=a(t,"P",{});var Ts=n(Ae);hl=i(Ts,"The model can also produce "),ya=a(Ts,"STRONG",{});var Qh=n(ya);fl=i(Qh,"nonverbal communications"),Qh.forEach(o),pl=i(Ts," like laughing, sighing and crying."),Ts.forEach(o),qn=c(t),_(Xt.$$.fragment,t),Xn=c(t),mr=a(t,"P",{});var Kh=n(mr);ul=i(Kh,"To save the audio, simply take the sample rate from the model config and some scipy utility:"),Kh.forEach(o),Rn=c(t),_(Rt.$$.fragment,t),Dn=c(t),Y=a(t,"P",{});var ut=n(Y);gl=i(ut,"This model was contributed by "),Dt=a(ut,"A",{href:!0,rel:!0});var ef=n(Dt);_l=i(ef,"Yoach Lacombe (ylacombe)"),ef.forEach(o),bl=i(ut," and "),Ot=a(ut,"A",{href:!0,rel:!0});var tf=n(Ot);kl=i(tf,"Sanchit Gandhi (sanchit-gandhi)"),tf.forEach(o),vl=i(ut,`.
The original code can be found `),Ht=a(ut,"A",{href:!0,rel:!0});var of=n(Ht);yl=i(of,"here"),of.forEach(o),wl=i(ut,"."),ut.forEach(o),On=c(t),le=a(t,"H2",{class:!0});var Cs=n(le);Ve=a(Cs,"A",{id:!0,class:!0,href:!0});var rf=n(Ve);wa=a(rf,"SPAN",{});var af=n(wa);_(Lt.$$.fragment,af),af.forEach(o),rf.forEach(o),Ml=c(Cs),Ma=a(Cs,"SPAN",{});var nf=n(Ma);Bl=i(nf,"BarkConfig"),nf.forEach(o),Cs.forEach(o),Hn=c(t),x=a(t,"DIV",{class:!0});var K=n(x);_(Qt.$$.fragment,K),$l=c(K),Kt=a(K,"P",{});var Es=n(Kt);Tl=i(Es,"This is the configuration class to store the configuration of a "),hr=a(Es,"A",{href:!0});var sf=n(hr);Cl=i(sf,"BarkModel"),sf.forEach(o),El=i(Es,`. It is used to instantiate a Bark
model according to the specified sub-models configurations, defining the model architecture.`),Es.forEach(o),Jl=c(K),eo=a(K,"P",{});var Js=n(eo);zl=i(Js,`Instantiating a configuration with the defaults will yield a similar configuration to that of the Bark
`),to=a(Js,"A",{href:!0,rel:!0});var lf=n(to);jl=i(lf,"suno/bark"),lf.forEach(o),Il=i(Js," architecture."),Js.forEach(o),Ul=c(K),de=a(K,"P",{});var Gr=n(de);xl=i(Gr,"Configuration objects inherit from "),fr=a(Gr,"A",{href:!0});var df=n(fr);Pl=i(df,"PretrainedConfig"),df.forEach(o),Nl=i(Gr,` and can be used to control the model outputs. Read the
documentation from `),pr=a(Gr,"A",{href:!0});var cf=n(pr);Sl=i(cf,"PretrainedConfig"),cf.forEach(o),Wl=i(Gr," for more information."),Gr.forEach(o),Zl=c(K),Ye=a(K,"DIV",{class:!0});var zs=n(Ye);_(oo.$$.fragment,zs),Fl=c(zs),ro=a(zs,"P",{});var js=n(ro);Gl=i(js,"Instantiate a "),ur=a(js,"A",{href:!0});var mf=n(ur);Al=i(mf,"BarkConfig"),mf.forEach(o),Vl=i(js," (or a derived class) from bark sub-models configuration."),js.forEach(o),zs.forEach(o),K.forEach(o),Ln=c(t),ce=a(t,"H2",{class:!0});var Is=n(ce);qe=a(Is,"A",{id:!0,class:!0,href:!0});var hf=n(qe);Ba=a(hf,"SPAN",{});var ff=n(Ba);_(ao.$$.fragment,ff),ff.forEach(o),hf.forEach(o),Yl=c(Is),$a=a(Is,"SPAN",{});var pf=n($a);ql=i(pf,"BarkProcessor"),pf.forEach(o),Is.forEach(o),Qn=c(t),P=a(t,"DIV",{class:!0});var ee=n(P);_(no.$$.fragment,ee),Xl=c(ee),Ta=a(ee,"P",{});var uf=n(Ta);Rl=i(uf,"Constructs a Bark processor which wraps a text tokenizer and optional Bark voice presets into a single processor."),uf.forEach(o),Dl=c(ee),Xe=a(ee,"DIV",{class:!0});var Us=n(Xe);_(so.$$.fragment,Us),Ol=c(Us),E=a(Us,"P",{});var I=n(E);Hl=i(I,"Main method to prepare for the model one or several sequences(s). This method forwards the "),Ca=a(I,"CODE",{});var gf=n(Ca);Ll=i(gf,"text"),gf.forEach(o),Ql=i(I," and "),Ea=a(I,"CODE",{});var _f=n(Ea);Kl=i(_f,"kwargs"),_f.forEach(o),ed=i(I,`
arguments to the AutoTokenizer\u2019s `),Ja=a(I,"CODE",{});var bf=n(Ja);td=i(bf,"__call__()"),bf.forEach(o),od=i(I,` to encode the text. The method also proposes a
voice preset which is a dictionary of arrays that conditions `),za=a(I,"CODE",{});var kf=n(za);rd=i(kf,"Bark"),kf.forEach(o),ad=i(I,"\u2019s output. "),ja=a(I,"CODE",{});var vf=n(ja);nd=i(vf,"kwargs"),vf.forEach(o),sd=i(I,` arguments are forwarded
to the tokenizer and to `),Ia=a(I,"CODE",{});var yf=n(Ia);id=i(yf,"cached_file"),yf.forEach(o),ld=i(I," method if "),Ua=a(I,"CODE",{});var wf=n(Ua);dd=i(wf,"voice_preset"),wf.forEach(o),cd=i(I," is a valid filename."),I.forEach(o),Us.forEach(o),md=c(ee),Re=a(ee,"DIV",{class:!0});var xs=n(Re);_(io.$$.fragment,xs),hd=c(xs),xa=a(xs,"P",{});var Mf=n(xa);fd=i(Mf,"Instantiate a Bark processor associated with a pretrained model."),Mf.forEach(o),xs.forEach(o),pd=c(ee),De=a(ee,"DIV",{class:!0});var Ps=n(De);_(lo.$$.fragment,Ps),ud=c(Ps),co=a(Ps,"P",{});var Ns=n(co);gd=i(Ns,`Saves the attributes of this processor (tokenizer\u2026) in the specified directory so that it can be reloaded
using the `),gr=a(Ns,"A",{href:!0});var Bf=n(gr);_d=i(Bf,"from_pretrained()"),Bf.forEach(o),bd=i(Ns," method."),Ns.forEach(o),Ps.forEach(o),ee.forEach(o),Kn=c(t),me=a(t,"H2",{class:!0});var Ss=n(me);Oe=a(Ss,"A",{id:!0,class:!0,href:!0});var $f=n(Oe);Pa=a($f,"SPAN",{});var Tf=n(Pa);_(mo.$$.fragment,Tf),Tf.forEach(o),$f.forEach(o),kd=c(Ss),Na=a(Ss,"SPAN",{});var Cf=n(Na);vd=i(Cf,"BarkModel"),Cf.forEach(o),Ss.forEach(o),es=c(t),T=a(t,"DIV",{class:!0});var U=n(T);_(ho.$$.fragment,U),yd=c(U),Sa=a(U,"P",{});var Ef=n(Sa);wd=i(Ef,"The full Bark model, a text-to-speech model composed of 4 sub-models:"),Ef.forEach(o),Md=c(U),X=a(U,"UL",{});var gt=n(X);_r=a(gt,"LI",{});var ch=n(_r);br=a(ch,"A",{href:!0});var Jf=n(br);Bd=i(Jf,"BarkSemanticModel"),Jf.forEach(o),$d=i(ch,` (also referred to as the \u2018text\u2019 model): a causal auto-regressive transformer model that
takes
as input tokenized text, and predicts semantic text tokens that capture the meaning of the text.`),ch.forEach(o),Td=c(gt),He=a(gt,"LI",{});var un=n(He);kr=a(un,"A",{href:!0});var zf=n(kr);Cd=i(zf,"BarkCoarseModel"),zf.forEach(o),Ed=i(un,` (also refered to as the \u2018coarse acoustics\u2019 model), also a causal autoregressive transformer,
that takes into input the results of the last model. It aims at regressing the first two audio codebooks necessary
to `),Wa=a(un,"CODE",{});var jf=n(Wa);Jd=i(jf,"encodec"),jf.forEach(o),zd=i(un,"."),un.forEach(o),jd=c(gt),vr=a(gt,"LI",{});var mh=n(vr);yr=a(mh,"A",{href:!0});var If=n(yr);Id=i(If,"BarkFineModel"),If.forEach(o),Ud=i(mh,` (the \u2018fine acoustics\u2019 model), this time a non-causal autoencoder transformer, which iteratively
predicts the last codebooks based on the sum of the previous codebooks embeddings.`),mh.forEach(o),xd=c(gt),fo=a(gt,"LI",{});var Ws=n(fo);Pd=i(Ws,"having predicted all the codebook channels from the "),wr=a(Ws,"A",{href:!0});var Uf=n(wr);Nd=i(Uf,"EncodecModel"),Uf.forEach(o),Sd=i(Ws,`, Bark uses it to decode the output audio
array.`),Ws.forEach(o),gt.forEach(o),Wd=c(U),Za=a(U,"P",{});var xf=n(Za);Zd=i(xf,`It should be noted that each of the first three modules can support conditional speaker embeddings to condition the
output sound according to specific predefined voice.`),xf.forEach(o),Fd=c(U),po=a(U,"P",{});var Zs=n(po);Gd=i(Zs,"This model inherits from "),Mr=a(Zs,"A",{href:!0});var Pf=n(Mr);Ad=i(Pf,"PreTrainedModel"),Pf.forEach(o),Vd=i(Zs,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Zs.forEach(o),Yd=c(U),uo=a(U,"P",{});var Fs=n(uo);qd=i(Fs,"This model is also a PyTorch "),go=a(Fs,"A",{href:!0,rel:!0});var Nf=n(go);Xd=i(Nf,"torch.nn.Module"),Nf.forEach(o),Rd=i(Fs,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Fs.forEach(o),Dd=c(U),D=a(U,"DIV",{class:!0});var Ar=n(D);_(_o.$$.fragment,Ar),Od=c(Ar),bo=a(Ar,"P",{});var Gs=n(bo);Hd=i(Gs,"Generates audio from an input prompt and an additional optional "),Fa=a(Gs,"CODE",{});var Sf=n(Fa);Ld=i(Sf,"Bark"),Sf.forEach(o),Qd=i(Gs," speaker prompt."),Gs.forEach(o),Kd=c(Ar),_(Le.$$.fragment,Ar),Ar.forEach(o),ec=c(U),Qe=a(U,"DIV",{class:!0});var As=n(Qe);_(ko.$$.fragment,As),tc=c(As),Ga=a(As,"P",{});var Wf=n(Ga);oc=i(Wf,`Offloads all sub-models to CPU using accelerate, reducing memory usage with a low impact on performance. This
method moves one whole sub-model at a time to the GPU when it is used, and the sub-model remains in GPU until
the next sub-model runs.`),Wf.forEach(o),As.forEach(o),U.forEach(o),ts=c(t),he=a(t,"H2",{class:!0});var Vs=n(he);Ke=a(Vs,"A",{id:!0,class:!0,href:!0});var Zf=n(Ke);Aa=a(Zf,"SPAN",{});var Ff=n(Aa);_(vo.$$.fragment,Ff),Ff.forEach(o),Zf.forEach(o),rc=c(Vs),Va=a(Vs,"SPAN",{});var Gf=n(Va);ac=i(Gf,"BarkSemanticModel"),Gf.forEach(o),Vs.forEach(o),os=c(t),N=a(t,"DIV",{class:!0});var _t=n(N);_(yo.$$.fragment,_t),nc=c(_t),wo=a(_t,"P",{});var Ys=n(wo);sc=i(Ys,`Bark semantic (or text) model. It shares the same architecture as the coarse model.
It is a GPT-2 like autoregressive model with a language modeling head on top.
This model inherits from `),Br=a(Ys,"A",{href:!0});var Af=n(Br);ic=i(Af,"PreTrainedModel"),Af.forEach(o),lc=i(Ys,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ys.forEach(o),dc=c(_t),Mo=a(_t,"P",{});var qs=n(Mo);cc=i(qs,"This model is also a PyTorch "),Bo=a(qs,"A",{href:!0,rel:!0});var Vf=n(Bo);mc=i(Vf,"torch.nn.Module"),Vf.forEach(o),hc=i(qs,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),qs.forEach(o),fc=c(_t),O=a(_t,"DIV",{class:!0});var Vr=n(O);_($o.$$.fragment,Vr),pc=c(Vr),fe=a(Vr,"P",{});var Yr=n(fe);uc=i(Yr,"The "),$r=a(Yr,"A",{href:!0});var Yf=n($r);gc=i(Yf,"BarkCausalModel"),Yf.forEach(o),_c=i(Yr," forward method, overrides the "),Ya=a(Yr,"CODE",{});var qf=n(Ya);bc=i(qf,"__call__"),qf.forEach(o),kc=i(Yr," special method."),Yr.forEach(o),vc=c(Vr),_(et.$$.fragment,Vr),Vr.forEach(o),_t.forEach(o),rs=c(t),pe=a(t,"H2",{class:!0});var Xs=n(pe);tt=a(Xs,"A",{id:!0,class:!0,href:!0});var Xf=n(tt);qa=a(Xf,"SPAN",{});var Rf=n(qa);_(To.$$.fragment,Rf),Rf.forEach(o),Xf.forEach(o),yc=c(Xs),Xa=a(Xs,"SPAN",{});var Df=n(Xa);wc=i(Df,"BarkCoarseModel"),Df.forEach(o),Xs.forEach(o),as=c(t),S=a(t,"DIV",{class:!0});var bt=n(S);_(Co.$$.fragment,bt),Mc=c(bt),Eo=a(bt,"P",{});var Rs=n(Eo);Bc=i(Rs,`Bark coarse acoustics model.
It shares the same architecture as the semantic (or text) model. It is a GPT-2 like autoregressive model with a
language modeling head on top.
This model inherits from `),Tr=a(Rs,"A",{href:!0});var Of=n(Tr);$c=i(Of,"PreTrainedModel"),Of.forEach(o),Tc=i(Rs,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Rs.forEach(o),Cc=c(bt),Jo=a(bt,"P",{});var Ds=n(Jo);Ec=i(Ds,"This model is also a PyTorch "),zo=a(Ds,"A",{href:!0,rel:!0});var Hf=n(zo);Jc=i(Hf,"torch.nn.Module"),Hf.forEach(o),zc=i(Ds,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ds.forEach(o),jc=c(bt),H=a(bt,"DIV",{class:!0});var qr=n(H);_(jo.$$.fragment,qr),Ic=c(qr),ue=a(qr,"P",{});var Xr=n(ue);Uc=i(Xr,"The "),Cr=a(Xr,"A",{href:!0});var Lf=n(Cr);xc=i(Lf,"BarkCausalModel"),Lf.forEach(o),Pc=i(Xr," forward method, overrides the "),Ra=a(Xr,"CODE",{});var Qf=n(Ra);Nc=i(Qf,"__call__"),Qf.forEach(o),Sc=i(Xr," special method."),Xr.forEach(o),Wc=c(qr),_(ot.$$.fragment,qr),qr.forEach(o),bt.forEach(o),ns=c(t),ge=a(t,"H2",{class:!0});var Os=n(ge);rt=a(Os,"A",{id:!0,class:!0,href:!0});var Kf=n(rt);Da=a(Kf,"SPAN",{});var ep=n(Da);_(Io.$$.fragment,ep),ep.forEach(o),Kf.forEach(o),Zc=c(Os),Oa=a(Os,"SPAN",{});var tp=n(Oa);Fc=i(tp,"BarkFineModel"),tp.forEach(o),Os.forEach(o),ss=c(t),W=a(t,"DIV",{class:!0});var kt=n(W);_(Uo.$$.fragment,kt),Gc=c(kt),_e=a(kt,"P",{});var Rr=n(_e);Ac=i(Rr,"Bark fine acoustics model. It is a non-causal GPT-like model with "),Ha=a(Rr,"CODE",{});var op=n(Ha);Vc=i(op,"config.n_codes_total"),op.forEach(o),Yc=i(Rr,` embedding layers and
language modeling heads, one for each codebook.
This model inherits from `),Er=a(Rr,"A",{href:!0});var rp=n(Er);qc=i(rp,"PreTrainedModel"),rp.forEach(o),Xc=i(Rr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Rr.forEach(o),Rc=c(kt),xo=a(kt,"P",{});var Hs=n(xo);Dc=i(Hs,"This model is also a PyTorch "),Po=a(Hs,"A",{href:!0,rel:!0});var ap=n(Po);Oc=i(ap,"torch.nn.Module"),ap.forEach(o),Hc=i(Hs,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Hs.forEach(o),Lc=c(kt),L=a(kt,"DIV",{class:!0});var Dr=n(L);_(No.$$.fragment,Dr),Qc=c(Dr),be=a(Dr,"P",{});var Or=n(be);Kc=i(Or,"The "),Jr=a(Or,"A",{href:!0});var np=n(Jr);em=i(np,"BarkFineModel"),np.forEach(o),tm=i(Or," forward method, overrides the "),La=a(Or,"CODE",{});var sp=n(La);om=i(sp,"__call__"),sp.forEach(o),rm=i(Or," special method."),Or.forEach(o),am=c(Dr),_(at.$$.fragment,Dr),Dr.forEach(o),kt.forEach(o),is=c(t),ke=a(t,"H2",{class:!0});var Ls=n(ke);nt=a(Ls,"A",{id:!0,class:!0,href:!0});var ip=n(nt);Qa=a(ip,"SPAN",{});var lp=n(Qa);_(So.$$.fragment,lp),lp.forEach(o),ip.forEach(o),nm=c(Ls),Ka=a(Ls,"SPAN",{});var dp=n(Ka);sm=i(dp,"BarkCausalModel"),dp.forEach(o),Ls.forEach(o),ls=c(t),ve=a(t,"DIV",{class:!0});var Qs=n(ve);_(Wo.$$.fragment,Qs),im=c(Qs),Q=a(Qs,"DIV",{class:!0});var Hr=n(Q);_(Zo.$$.fragment,Hr),lm=c(Hr),ye=a(Hr,"P",{});var Lr=n(ye);dm=i(Lr,"The "),zr=a(Lr,"A",{href:!0});var cp=n(zr);cm=i(cp,"BarkCausalModel"),cp.forEach(o),mm=i(Lr," forward method, overrides the "),en=a(Lr,"CODE",{});var mp=n(en);hm=i(mp,"__call__"),mp.forEach(o),fm=i(Lr," special method."),Lr.forEach(o),pm=c(Hr),_(st.$$.fragment,Hr),Hr.forEach(o),Qs.forEach(o),ds=c(t),we=a(t,"H2",{class:!0});var Ks=n(we);it=a(Ks,"A",{id:!0,class:!0,href:!0});var hp=n(it);tn=a(hp,"SPAN",{});var fp=n(tn);_(Fo.$$.fragment,fp),fp.forEach(o),hp.forEach(o),um=c(Ks),on=a(Ks,"SPAN",{});var pp=n(on);gm=i(pp,"BarkCoarseConfig"),pp.forEach(o),Ks.forEach(o),cs=c(t),Z=a(t,"DIV",{class:!0});var vt=n(Z);_(Go.$$.fragment,vt),_m=c(vt),Me=a(vt,"P",{});var Qr=n(Me);bm=i(Qr,"This is the configuration class to store the configuration of a "),jr=a(Qr,"A",{href:!0});var up=n(jr);km=i(up,"BarkCoarseModel"),up.forEach(o),vm=i(Qr,`. It is used to instantiate the model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Bark `),Ao=a(Qr,"A",{href:!0,rel:!0});var gp=n(Ao);ym=i(gp,"suno/bark"),gp.forEach(o),wm=i(Qr,`
architecture.`),Qr.forEach(o),Mm=c(vt),Be=a(vt,"P",{});var Kr=n(Be);Bm=i(Kr,"Configuration objects inherit from "),Ir=a(Kr,"A",{href:!0});var _p=n(Ir);$m=i(_p,"PretrainedConfig"),_p.forEach(o),Tm=i(Kr,` and can be used to control the model outputs. Read the
documentation from `),Ur=a(Kr,"A",{href:!0});var bp=n(Ur);Cm=i(bp,"PretrainedConfig"),bp.forEach(o),Em=i(Kr," for more information."),Kr.forEach(o),Jm=c(vt),_(lt.$$.fragment,vt),vt.forEach(o),ms=c(t),$e=a(t,"H2",{class:!0});var ei=n($e);dt=a(ei,"A",{id:!0,class:!0,href:!0});var kp=n(dt);rn=a(kp,"SPAN",{});var vp=n(rn);_(Vo.$$.fragment,vp),vp.forEach(o),kp.forEach(o),zm=c(ei),an=a(ei,"SPAN",{});var yp=n(an);jm=i(yp,"BarkFineConfig"),yp.forEach(o),ei.forEach(o),hs=c(t),F=a(t,"DIV",{class:!0});var yt=n(F);_(Yo.$$.fragment,yt),Im=c(yt),Te=a(yt,"P",{});var ea=n(Te);Um=i(ea,"This is the configuration class to store the configuration of a "),xr=a(ea,"A",{href:!0});var wp=n(xr);xm=i(wp,"BarkFineModel"),wp.forEach(o),Pm=i(ea,`. It is used to instantiate the model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Bark `),qo=a(ea,"A",{href:!0,rel:!0});var Mp=n(qo);Nm=i(Mp,"suno/bark"),Mp.forEach(o),Sm=i(ea,`
architecture.`),ea.forEach(o),Wm=c(yt),Ce=a(yt,"P",{});var ta=n(Ce);Zm=i(ta,"Configuration objects inherit from "),Pr=a(ta,"A",{href:!0});var Bp=n(Pr);Fm=i(Bp,"PretrainedConfig"),Bp.forEach(o),Gm=i(ta,` and can be used to control the model outputs. Read the
documentation from `),Nr=a(ta,"A",{href:!0});var $p=n(Nr);Am=i($p,"PretrainedConfig"),$p.forEach(o),Vm=i(ta," for more information."),ta.forEach(o),Ym=c(yt),_(ct.$$.fragment,yt),yt.forEach(o),fs=c(t),Ee=a(t,"H2",{class:!0});var ti=n(Ee);mt=a(ti,"A",{id:!0,class:!0,href:!0});var Tp=n(mt);nn=a(Tp,"SPAN",{});var Cp=n(nn);_(Xo.$$.fragment,Cp),Cp.forEach(o),Tp.forEach(o),qm=c(ti),sn=a(ti,"SPAN",{});var Ep=n(sn);Xm=i(Ep,"BarkSemanticConfig"),Ep.forEach(o),ti.forEach(o),ps=c(t),G=a(t,"DIV",{class:!0});var wt=n(G);_(Ro.$$.fragment,wt),Rm=c(wt),Je=a(wt,"P",{});var oa=n(Je);Dm=i(oa,"This is the configuration class to store the configuration of a "),Sr=a(oa,"A",{href:!0});var Jp=n(Sr);Om=i(Jp,"BarkSemanticModel"),Jp.forEach(o),Hm=i(oa,`. It is used to instantiate the model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Bark `),Do=a(oa,"A",{href:!0,rel:!0});var zp=n(Do);Lm=i(zp,"suno/bark"),zp.forEach(o),Qm=i(oa,`
architecture.`),oa.forEach(o),Km=c(wt),ze=a(wt,"P",{});var ra=n(ze);eh=i(ra,"Configuration objects inherit from "),Wr=a(ra,"A",{href:!0});var jp=n(Wr);th=i(jp,"PretrainedConfig"),jp.forEach(o),oh=i(ra,` and can be used to control the model outputs. Read the
documentation from `),Zr=a(ra,"A",{href:!0});var Ip=n(Zr);rh=i(Ip,"PretrainedConfig"),Ip.forEach(o),ah=i(ra," for more information."),ra.forEach(o),nh=c(wt),_(ht.$$.fragment,wt),wt.forEach(o),this.h()},h(){l(p,"name","hf:doc:metadata"),l(p,"content",JSON.stringify(Rp)),l(w,"id","bark"),l(w,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(w,"href","#bark"),l(M,"class","relative group"),l(je,"id","overview"),l(je,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(je,"href","#overview"),l(te,"class","relative group"),l(Bt,"href","https://github.com/suno-ai/bark"),l(Bt,"rel","nofollow"),l(Ko,"href","/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkSemanticModel"),l(er,"href","/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkCoarseModel"),l(tr,"href","/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkSemanticModel"),l(rr,"href","/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkFineModel"),l(ar,"href","/docs/transformers/v4.32.0/en/model_doc/encodec#transformers.EncodecModel"),l(xe,"id","optimizing-bark"),l(xe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(xe,"href","#optimizing-bark"),l(oe,"class","relative group"),l(Pe,"id","using-halfprecision"),l(Pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Pe,"href","#using-halfprecision"),l(re,"class","relative group"),l(Ne,"id","using-better-transformer"),l(Ne,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Ne,"href","#using-better-transformer"),l(ae,"class","relative group"),l(It,"href","https://huggingface.co/docs/optimum/installation"),l(It,"rel","nofollow"),l(Se,"id","using-cpu-offload"),l(Se,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Se,"href","#using-cpu-offload"),l(ne,"class","relative group"),l(Nt,"href","https://huggingface.co/docs/accelerate/basic_tutorials/install"),l(Nt,"rel","nofollow"),l(We,"id","combining-optimizaton-techniques"),l(We,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(We,"href","#combining-optimizaton-techniques"),l(se,"class","relative group"),l(Zt,"href","https://huggingface.co/docs/transformers/perf_infer_gpu_one"),l(Zt,"rel","nofollow"),l(Fe,"id","tips"),l(Fe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Fe,"href","#tips"),l(ie,"class","relative group"),l(Gt,"href","https://suno-ai.notion.site/8b8e8749ed514b0cbf3f699013548683?v=bc67cff786b04b50b3ceb756fd05f68c"),l(Gt,"rel","nofollow"),l(At,"href","https://huggingface.co/suno/bark-small/tree/main/speaker_embeddings"),l(At,"rel","nofollow"),l(Vt,"href","https://huggingface.co/suno/bark/tree/main/speaker_embeddings"),l(Vt,"rel","nofollow"),l(Dt,"href","https://huggingface.co/ylacombe"),l(Dt,"rel","nofollow"),l(Ot,"href","https://github.com/sanchit-gandhi"),l(Ot,"rel","nofollow"),l(Ht,"href","https://github.com/suno-ai/bark"),l(Ht,"rel","nofollow"),l(Ve,"id","transformers.BarkConfig"),l(Ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Ve,"href","#transformers.BarkConfig"),l(le,"class","relative group"),l(hr,"href","/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkModel"),l(to,"href","https://huggingface.co/suno/bark"),l(to,"rel","nofollow"),l(fr,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(pr,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(ur,"href","/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkConfig"),l(Ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(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(qe,"id","transformers.BarkProcessor"),l(qe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(qe,"href","#transformers.BarkProcessor"),l(ce,"class","relative group"),l(Xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(gr,"href","/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkProcessor.from_pretrained"),l(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Oe,"id","transformers.BarkModel"),l(Oe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Oe,"href","#transformers.BarkModel"),l(me,"class","relative group"),l(br,"href","/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkSemanticModel"),l(kr,"href","/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkCoarseModel"),l(yr,"href","/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkFineModel"),l(wr,"href","/docs/transformers/v4.32.0/en/model_doc/encodec#transformers.EncodecModel"),l(Mr,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),l(go,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(go,"rel","nofollow"),l(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ke,"id","transformers.BarkSemanticModel"),l(Ke,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Ke,"href","#transformers.BarkSemanticModel"),l(he,"class","relative group"),l(Br,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),l(Bo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Bo,"rel","nofollow"),l($r,"href","/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkCausalModel"),l(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(tt,"id","transformers.BarkCoarseModel"),l(tt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(tt,"href","#transformers.BarkCoarseModel"),l(pe,"class","relative group"),l(Tr,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),l(zo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(zo,"rel","nofollow"),l(Cr,"href","/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkCausalModel"),l(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(rt,"id","transformers.BarkFineModel"),l(rt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(rt,"href","#transformers.BarkFineModel"),l(ge,"class","relative group"),l(Er,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),l(Po,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Po,"rel","nofollow"),l(Jr,"href","/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkFineModel"),l(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(nt,"id","transformers.BarkCausalModel"),l(nt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(nt,"href","#transformers.BarkCausalModel"),l(ke,"class","relative group"),l(zr,"href","/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkCausalModel"),l(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(it,"id","transformers.BarkCoarseConfig"),l(it,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(it,"href","#transformers.BarkCoarseConfig"),l(we,"class","relative group"),l(jr,"href","/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkCoarseModel"),l(Ao,"href","https://huggingface.co/suno/bark"),l(Ao,"rel","nofollow"),l(Ir,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(Ur,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(dt,"id","transformers.BarkFineConfig"),l(dt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(dt,"href","#transformers.BarkFineConfig"),l($e,"class","relative group"),l(xr,"href","/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkFineModel"),l(qo,"href","https://huggingface.co/suno/bark"),l(qo,"rel","nofollow"),l(Pr,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(Nr,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(mt,"id","transformers.BarkSemanticConfig"),l(mt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(mt,"href","#transformers.BarkSemanticConfig"),l(Ee,"class","relative group"),l(Sr,"href","/docs/transformers/v4.32.0/en/model_doc/bark#transformers.BarkSemanticModel"),l(Do,"href","https://huggingface.co/suno/bark"),l(Do,"rel","nofollow"),l(Wr,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(Zr,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,m){e(document.head,p),h(t,$,m),h(t,M,m),e(M,w),e(w,B),b(f,B,null),e(M,u),e(M,j),e(j,ni),h(t,gn,m),h(t,te,m),e(te,je),e(je,aa),b(Mt,aa,null),e(te,si),e(te,na),e(na,ii),h(t,_n,m),h(t,Ie,m),e(Ie,li),e(Ie,Bt),e(Bt,di),e(Ie,ci),h(t,bn,m),h(t,Lo,m),e(Lo,mi),h(t,kn,m),h(t,A,m),e(A,Qo),e(Qo,Ko),e(Ko,hi),e(Qo,fi),e(A,pi),e(A,Ue),e(Ue,er),e(er,ui),e(Ue,gi),e(Ue,tr),e(tr,_i),e(Ue,bi),e(A,ki),e(A,or),e(or,rr),e(rr,vi),e(or,yi),e(A,wi),e(A,$t),e($t,Mi),e($t,ar),e(ar,Bi),e($t,$i),h(t,vn,m),h(t,nr,m),e(nr,Ti),h(t,yn,m),h(t,oe,m),e(oe,xe),e(xe,sa),b(Tt,sa,null),e(oe,Ci),e(oe,ia),e(ia,Ei),h(t,wn,m),h(t,R,m),e(R,Ji),e(R,la),e(la,zi),e(R,ji),e(R,da),e(da,Ii),e(R,Ui),h(t,Mn,m),h(t,re,m),e(re,Pe),e(Pe,ca),b(Ct,ca,null),e(re,xi),e(re,ma),e(ma,Pi),h(t,Bn,m),h(t,sr,m),e(sr,Ni),h(t,$n,m),b(Et,t,m),h(t,Tn,m),h(t,ae,m),e(ae,Ne),e(Ne,ha),b(Jt,ha,null),e(ae,Si),e(ae,fa),e(fa,Wi),h(t,Cn,m),h(t,ir,m),e(ir,Zi),h(t,En,m),b(zt,t,m),h(t,Jn,m),h(t,jt,m),e(jt,Fi),e(jt,It),e(It,Gi),h(t,zn,m),h(t,ne,m),e(ne,Se),e(Se,pa),b(Ut,pa,null),e(ne,Ai),e(ne,ua),e(ua,Vi),h(t,jn,m),h(t,lr,m),e(lr,Yi),h(t,In,m),h(t,dr,m),e(dr,qi),h(t,Un,m),b(xt,t,m),h(t,xn,m),h(t,Pt,m),e(Pt,Xi),e(Pt,Nt),e(Nt,Ri),h(t,Pn,m),h(t,se,m),e(se,We),e(We,ga),b(St,ga,null),e(se,Di),e(se,_a),e(_a,Oi),h(t,Nn,m),h(t,cr,m),e(cr,Hi),h(t,Sn,m),b(Wt,t,m),h(t,Wn,m),h(t,Ze,m),e(Ze,Li),e(Ze,Zt),e(Zt,Qi),e(Ze,Ki),h(t,Zn,m),h(t,ie,m),e(ie,Fe),e(Fe,ba),b(Ft,ba,null),e(ie,el),e(ie,ka),e(ka,tl),h(t,Fn,m),h(t,V,m),e(V,ol),e(V,Gt),e(Gt,rl),e(V,al),e(V,At),e(At,nl),e(V,sl),e(V,Vt),e(Vt,il),e(V,ll),h(t,Gn,m),b(Yt,t,m),h(t,An,m),h(t,Ge,m),e(Ge,dl),e(Ge,va),e(va,cl),e(Ge,ml),h(t,Vn,m),b(qt,t,m),h(t,Yn,m),h(t,Ae,m),e(Ae,hl),e(Ae,ya),e(ya,fl),e(Ae,pl),h(t,qn,m),b(Xt,t,m),h(t,Xn,m),h(t,mr,m),e(mr,ul),h(t,Rn,m),b(Rt,t,m),h(t,Dn,m),h(t,Y,m),e(Y,gl),e(Y,Dt),e(Dt,_l),e(Y,bl),e(Y,Ot),e(Ot,kl),e(Y,vl),e(Y,Ht),e(Ht,yl),e(Y,wl),h(t,On,m),h(t,le,m),e(le,Ve),e(Ve,wa),b(Lt,wa,null),e(le,Ml),e(le,Ma),e(Ma,Bl),h(t,Hn,m),h(t,x,m),b(Qt,x,null),e(x,$l),e(x,Kt),e(Kt,Tl),e(Kt,hr),e(hr,Cl),e(Kt,El),e(x,Jl),e(x,eo),e(eo,zl),e(eo,to),e(to,jl),e(eo,Il),e(x,Ul),e(x,de),e(de,xl),e(de,fr),e(fr,Pl),e(de,Nl),e(de,pr),e(pr,Sl),e(de,Wl),e(x,Zl),e(x,Ye),b(oo,Ye,null),e(Ye,Fl),e(Ye,ro),e(ro,Gl),e(ro,ur),e(ur,Al),e(ro,Vl),h(t,Ln,m),h(t,ce,m),e(ce,qe),e(qe,Ba),b(ao,Ba,null),e(ce,Yl),e(ce,$a),e($a,ql),h(t,Qn,m),h(t,P,m),b(no,P,null),e(P,Xl),e(P,Ta),e(Ta,Rl),e(P,Dl),e(P,Xe),b(so,Xe,null),e(Xe,Ol),e(Xe,E),e(E,Hl),e(E,Ca),e(Ca,Ll),e(E,Ql),e(E,Ea),e(Ea,Kl),e(E,ed),e(E,Ja),e(Ja,td),e(E,od),e(E,za),e(za,rd),e(E,ad),e(E,ja),e(ja,nd),e(E,sd),e(E,Ia),e(Ia,id),e(E,ld),e(E,Ua),e(Ua,dd),e(E,cd),e(P,md),e(P,Re),b(io,Re,null),e(Re,hd),e(Re,xa),e(xa,fd),e(P,pd),e(P,De),b(lo,De,null),e(De,ud),e(De,co),e(co,gd),e(co,gr),e(gr,_d),e(co,bd),h(t,Kn,m),h(t,me,m),e(me,Oe),e(Oe,Pa),b(mo,Pa,null),e(me,kd),e(me,Na),e(Na,vd),h(t,es,m),h(t,T,m),b(ho,T,null),e(T,yd),e(T,Sa),e(Sa,wd),e(T,Md),e(T,X),e(X,_r),e(_r,br),e(br,Bd),e(_r,$d),e(X,Td),e(X,He),e(He,kr),e(kr,Cd),e(He,Ed),e(He,Wa),e(Wa,Jd),e(He,zd),e(X,jd),e(X,vr),e(vr,yr),e(yr,Id),e(vr,Ud),e(X,xd),e(X,fo),e(fo,Pd),e(fo,wr),e(wr,Nd),e(fo,Sd),e(T,Wd),e(T,Za),e(Za,Zd),e(T,Fd),e(T,po),e(po,Gd),e(po,Mr),e(Mr,Ad),e(po,Vd),e(T,Yd),e(T,uo),e(uo,qd),e(uo,go),e(go,Xd),e(uo,Rd),e(T,Dd),e(T,D),b(_o,D,null),e(D,Od),e(D,bo),e(bo,Hd),e(bo,Fa),e(Fa,Ld),e(bo,Qd),e(D,Kd),b(Le,D,null),e(T,ec),e(T,Qe),b(ko,Qe,null),e(Qe,tc),e(Qe,Ga),e(Ga,oc),h(t,ts,m),h(t,he,m),e(he,Ke),e(Ke,Aa),b(vo,Aa,null),e(he,rc),e(he,Va),e(Va,ac),h(t,os,m),h(t,N,m),b(yo,N,null),e(N,nc),e(N,wo),e(wo,sc),e(wo,Br),e(Br,ic),e(wo,lc),e(N,dc),e(N,Mo),e(Mo,cc),e(Mo,Bo),e(Bo,mc),e(Mo,hc),e(N,fc),e(N,O),b($o,O,null),e(O,pc),e(O,fe),e(fe,uc),e(fe,$r),e($r,gc),e(fe,_c),e(fe,Ya),e(Ya,bc),e(fe,kc),e(O,vc),b(et,O,null),h(t,rs,m),h(t,pe,m),e(pe,tt),e(tt,qa),b(To,qa,null),e(pe,yc),e(pe,Xa),e(Xa,wc),h(t,as,m),h(t,S,m),b(Co,S,null),e(S,Mc),e(S,Eo),e(Eo,Bc),e(Eo,Tr),e(Tr,$c),e(Eo,Tc),e(S,Cc),e(S,Jo),e(Jo,Ec),e(Jo,zo),e(zo,Jc),e(Jo,zc),e(S,jc),e(S,H),b(jo,H,null),e(H,Ic),e(H,ue),e(ue,Uc),e(ue,Cr),e(Cr,xc),e(ue,Pc),e(ue,Ra),e(Ra,Nc),e(ue,Sc),e(H,Wc),b(ot,H,null),h(t,ns,m),h(t,ge,m),e(ge,rt),e(rt,Da),b(Io,Da,null),e(ge,Zc),e(ge,Oa),e(Oa,Fc),h(t,ss,m),h(t,W,m),b(Uo,W,null),e(W,Gc),e(W,_e),e(_e,Ac),e(_e,Ha),e(Ha,Vc),e(_e,Yc),e(_e,Er),e(Er,qc),e(_e,Xc),e(W,Rc),e(W,xo),e(xo,Dc),e(xo,Po),e(Po,Oc),e(xo,Hc),e(W,Lc),e(W,L),b(No,L,null),e(L,Qc),e(L,be),e(be,Kc),e(be,Jr),e(Jr,em),e(be,tm),e(be,La),e(La,om),e(be,rm),e(L,am),b(at,L,null),h(t,is,m),h(t,ke,m),e(ke,nt),e(nt,Qa),b(So,Qa,null),e(ke,nm),e(ke,Ka),e(Ka,sm),h(t,ls,m),h(t,ve,m),b(Wo,ve,null),e(ve,im),e(ve,Q),b(Zo,Q,null),e(Q,lm),e(Q,ye),e(ye,dm),e(ye,zr),e(zr,cm),e(ye,mm),e(ye,en),e(en,hm),e(ye,fm),e(Q,pm),b(st,Q,null),h(t,ds,m),h(t,we,m),e(we,it),e(it,tn),b(Fo,tn,null),e(we,um),e(we,on),e(on,gm),h(t,cs,m),h(t,Z,m),b(Go,Z,null),e(Z,_m),e(Z,Me),e(Me,bm),e(Me,jr),e(jr,km),e(Me,vm),e(Me,Ao),e(Ao,ym),e(Me,wm),e(Z,Mm),e(Z,Be),e(Be,Bm),e(Be,Ir),e(Ir,$m),e(Be,Tm),e(Be,Ur),e(Ur,Cm),e(Be,Em),e(Z,Jm),b(lt,Z,null),h(t,ms,m),h(t,$e,m),e($e,dt),e(dt,rn),b(Vo,rn,null),e($e,zm),e($e,an),e(an,jm),h(t,hs,m),h(t,F,m),b(Yo,F,null),e(F,Im),e(F,Te),e(Te,Um),e(Te,xr),e(xr,xm),e(Te,Pm),e(Te,qo),e(qo,Nm),e(Te,Sm),e(F,Wm),e(F,Ce),e(Ce,Zm),e(Ce,Pr),e(Pr,Fm),e(Ce,Gm),e(Ce,Nr),e(Nr,Am),e(Ce,Vm),e(F,Ym),b(ct,F,null),h(t,fs,m),h(t,Ee,m),e(Ee,mt),e(mt,nn),b(Xo,nn,null),e(Ee,qm),e(Ee,sn),e(sn,Xm),h(t,ps,m),h(t,G,m),b(Ro,G,null),e(G,Rm),e(G,Je),e(Je,Dm),e(Je,Sr),e(Sr,Om),e(Je,Hm),e(Je,Do),e(Do,Lm),e(Je,Qm),e(G,Km),e(G,ze),e(ze,eh),e(ze,Wr),e(Wr,th),e(ze,oh),e(ze,Zr),e(Zr,rh),e(ze,ah),e(G,nh),b(ht,G,null),us=!0},p(t,[m]){const Oo={};m&2&&(Oo.$$scope={dirty:m,ctx:t}),Le.$set(Oo);const ln={};m&2&&(ln.$$scope={dirty:m,ctx:t}),et.$set(ln);const dn={};m&2&&(dn.$$scope={dirty:m,ctx:t}),ot.$set(dn);const cn={};m&2&&(cn.$$scope={dirty:m,ctx:t}),at.$set(cn);const Ho={};m&2&&(Ho.$$scope={dirty:m,ctx:t}),st.$set(Ho);const mn={};m&2&&(mn.$$scope={dirty:m,ctx:t}),lt.$set(mn);const hn={};m&2&&(hn.$$scope={dirty:m,ctx:t}),ct.$set(hn);const fn={};m&2&&(fn.$$scope={dirty:m,ctx:t}),ht.$set(fn)},i(t){us||(k(f.$$.fragment,t),k(Mt.$$.fragment,t),k(Tt.$$.fragment,t),k(Ct.$$.fragment,t),k(Et.$$.fragment,t),k(Jt.$$.fragment,t),k(zt.$$.fragment,t),k(Ut.$$.fragment,t),k(xt.$$.fragment,t),k(St.$$.fragment,t),k(Wt.$$.fragment,t),k(Ft.$$.fragment,t),k(Yt.$$.fragment,t),k(qt.$$.fragment,t),k(Xt.$$.fragment,t),k(Rt.$$.fragment,t),k(Lt.$$.fragment,t),k(Qt.$$.fragment,t),k(oo.$$.fragment,t),k(ao.$$.fragment,t),k(no.$$.fragment,t),k(so.$$.fragment,t),k(io.$$.fragment,t),k(lo.$$.fragment,t),k(mo.$$.fragment,t),k(ho.$$.fragment,t),k(_o.$$.fragment,t),k(Le.$$.fragment,t),k(ko.$$.fragment,t),k(vo.$$.fragment,t),k(yo.$$.fragment,t),k($o.$$.fragment,t),k(et.$$.fragment,t),k(To.$$.fragment,t),k(Co.$$.fragment,t),k(jo.$$.fragment,t),k(ot.$$.fragment,t),k(Io.$$.fragment,t),k(Uo.$$.fragment,t),k(No.$$.fragment,t),k(at.$$.fragment,t),k(So.$$.fragment,t),k(Wo.$$.fragment,t),k(Zo.$$.fragment,t),k(st.$$.fragment,t),k(Fo.$$.fragment,t),k(Go.$$.fragment,t),k(lt.$$.fragment,t),k(Vo.$$.fragment,t),k(Yo.$$.fragment,t),k(ct.$$.fragment,t),k(Xo.$$.fragment,t),k(Ro.$$.fragment,t),k(ht.$$.fragment,t),us=!0)},o(t){v(f.$$.fragment,t),v(Mt.$$.fragment,t),v(Tt.$$.fragment,t),v(Ct.$$.fragment,t),v(Et.$$.fragment,t),v(Jt.$$.fragment,t),v(zt.$$.fragment,t),v(Ut.$$.fragment,t),v(xt.$$.fragment,t),v(St.$$.fragment,t),v(Wt.$$.fragment,t),v(Ft.$$.fragment,t),v(Yt.$$.fragment,t),v(qt.$$.fragment,t),v(Xt.$$.fragment,t),v(Rt.$$.fragment,t),v(Lt.$$.fragment,t),v(Qt.$$.fragment,t),v(oo.$$.fragment,t),v(ao.$$.fragment,t),v(no.$$.fragment,t),v(so.$$.fragment,t),v(io.$$.fragment,t),v(lo.$$.fragment,t),v(mo.$$.fragment,t),v(ho.$$.fragment,t),v(_o.$$.fragment,t),v(Le.$$.fragment,t),v(ko.$$.fragment,t),v(vo.$$.fragment,t),v(yo.$$.fragment,t),v($o.$$.fragment,t),v(et.$$.fragment,t),v(To.$$.fragment,t),v(Co.$$.fragment,t),v(jo.$$.fragment,t),v(ot.$$.fragment,t),v(Io.$$.fragment,t),v(Uo.$$.fragment,t),v(No.$$.fragment,t),v(at.$$.fragment,t),v(So.$$.fragment,t),v(Wo.$$.fragment,t),v(Zo.$$.fragment,t),v(st.$$.fragment,t),v(Fo.$$.fragment,t),v(Go.$$.fragment,t),v(lt.$$.fragment,t),v(Vo.$$.fragment,t),v(Yo.$$.fragment,t),v(ct.$$.fragment,t),v(Xo.$$.fragment,t),v(Ro.$$.fragment,t),v(ht.$$.fragment,t),us=!1},d(t){o(p),t&&o($),t&&o(M),y(f),t&&o(gn),t&&o(te),y(Mt),t&&o(_n),t&&o(Ie),t&&o(bn),t&&o(Lo),t&&o(kn),t&&o(A),t&&o(vn),t&&o(nr),t&&o(yn),t&&o(oe),y(Tt),t&&o(wn),t&&o(R),t&&o(Mn),t&&o(re),y(Ct),t&&o(Bn),t&&o(sr),t&&o($n),y(Et,t),t&&o(Tn),t&&o(ae),y(Jt),t&&o(Cn),t&&o(ir),t&&o(En),y(zt,t),t&&o(Jn),t&&o(jt),t&&o(zn),t&&o(ne),y(Ut),t&&o(jn),t&&o(lr),t&&o(In),t&&o(dr),t&&o(Un),y(xt,t),t&&o(xn),t&&o(Pt),t&&o(Pn),t&&o(se),y(St),t&&o(Nn),t&&o(cr),t&&o(Sn),y(Wt,t),t&&o(Wn),t&&o(Ze),t&&o(Zn),t&&o(ie),y(Ft),t&&o(Fn),t&&o(V),t&&o(Gn),y(Yt,t),t&&o(An),t&&o(Ge),t&&o(Vn),y(qt,t),t&&o(Yn),t&&o(Ae),t&&o(qn),y(Xt,t),t&&o(Xn),t&&o(mr),t&&o(Rn),y(Rt,t),t&&o(Dn),t&&o(Y),t&&o(On),t&&o(le),y(Lt),t&&o(Hn),t&&o(x),y(Qt),y(oo),t&&o(Ln),t&&o(ce),y(ao),t&&o(Qn),t&&o(P),y(no),y(so),y(io),y(lo),t&&o(Kn),t&&o(me),y(mo),t&&o(es),t&&o(T),y(ho),y(_o),y(Le),y(ko),t&&o(ts),t&&o(he),y(vo),t&&o(os),t&&o(N),y(yo),y($o),y(et),t&&o(rs),t&&o(pe),y(To),t&&o(as),t&&o(S),y(Co),y(jo),y(ot),t&&o(ns),t&&o(ge),y(Io),t&&o(ss),t&&o(W),y(Uo),y(No),y(at),t&&o(is),t&&o(ke),y(So),t&&o(ls),t&&o(ve),y(Wo),y(Zo),y(st),t&&o(ds),t&&o(we),y(Fo),t&&o(cs),t&&o(Z),y(Go),y(lt),t&&o(ms),t&&o($e),y(Vo),t&&o(hs),t&&o(F),y(Yo),y(ct),t&&o(fs),t&&o(Ee),y(Xo),t&&o(ps),t&&o(G),y(Ro),y(ht)}}}const Rp={local:"bark",sections:[{local:"overview",sections:[{local:"optimizing-bark",sections:[{local:"using-halfprecision",title:"Using half-precision"},{local:"using-better-transformer",title:"Using \u{1F917} Better Transformer"},{local:"using-cpu-offload",title:"Using CPU offload"},{local:"combining-optimizaton-techniques",title:"Combining optimizaton techniques"}],title:"Optimizing Bark"},{local:"tips",title:"Tips"}],title:"Overview"},{local:"transformers.BarkConfig",title:"BarkConfig"},{local:"transformers.BarkProcessor",title:"BarkProcessor"},{local:"transformers.BarkModel",title:"BarkModel"},{local:"transformers.BarkSemanticModel",title:"BarkSemanticModel"},{local:"transformers.BarkCoarseModel",title:"BarkCoarseModel"},{local:"transformers.BarkFineModel",title:"BarkFineModel"},{local:"transformers.BarkCausalModel",title:"BarkCausalModel"},{local:"transformers.BarkCoarseConfig",title:"BarkCoarseConfig"},{local:"transformers.BarkFineConfig",title:"BarkFineConfig"},{local:"transformers.BarkSemanticConfig",title:"BarkSemanticConfig"}],title:"Bark"};function Dp(J){return Sp(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class tu extends Up{constructor(p){super();xp(this,p,Dp,Xp,Pp,{})}}export{tu as default,Rp as metadata};
