import{S as H2,i as R2,s as Q2,e as s,k as l,w as _,t as a,M as G2,c as r,d as o,m as c,a as i,x as v,h as n,b as d,F as e,g as f,y as b,q as T,o as k,B as w}from"../../chunks/vendor-4833417e.js";import{T as ge}from"../../chunks/Tip-fffd6df1.js";import{D as A}from"../../chunks/Docstring-4f315ed9.js";import{C as N}from"../../chunks/CodeBlock-6a3d1b46.js";import{I as B}from"../../chunks/IconCopyLink-4b81c553.js";import"../../chunks/CopyButton-dacfbfaf.js";function X2($){let p,x,m,y,D;return{c(){p=s("p"),x=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=s("code"),y=a("Module"),D=a(`
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(g){p=r(g,"P",{});var u=i(p);x=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(u,"CODE",{});var V=i(m);y=n(V,"Module"),V.forEach(o),D=n(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(g,u){f(g,p,u),e(p,x),e(p,m),e(m,y),e(p,D)},d(g){g&&o(p)}}}function U2($){let p,x,m,y,D;return{c(){p=s("p"),x=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=s("code"),y=a("Module"),D=a(`
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(g){p=r(g,"P",{});var u=i(p);x=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(u,"CODE",{});var V=i(m);y=n(V,"Module"),V.forEach(o),D=n(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(g,u){f(g,p,u),e(p,x),e(p,m),e(m,y),e(p,D)},d(g){g&&o(p)}}}function J2($){let p,x,m,y,D;return{c(){p=s("p"),x=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=s("code"),y=a("Module"),D=a(`
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(g){p=r(g,"P",{});var u=i(p);x=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(u,"CODE",{});var V=i(m);y=n(V,"Module"),V.forEach(o),D=n(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(g,u){f(g,p,u),e(p,x),e(p,m),e(m,y),e(p,D)},d(g){g&&o(p)}}}function K2($){let p,x,m,y,D;return{c(){p=s("p"),x=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=s("code"),y=a("Module"),D=a(`
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(g){p=r(g,"P",{});var u=i(p);x=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(u,"CODE",{});var V=i(m);y=n(V,"Module"),V.forEach(o),D=n(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(g,u){f(g,p,u),e(p,x),e(p,m),e(m,y),e(p,D)},d(g){g&&o(p)}}}function Y2($){let p,x,m,y,D;return{c(){p=s("p"),x=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=s("code"),y=a("Module"),D=a(`
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(g){p=r(g,"P",{});var u=i(p);x=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(u,"CODE",{});var V=i(m);y=n(V,"Module"),V.forEach(o),D=n(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(g,u){f(g,p,u),e(p,x),e(p,m),e(m,y),e(p,D)},d(g){g&&o(p)}}}function Z2($){let p,x,m,y,D;return{c(){p=s("p"),x=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=s("code"),y=a("Module"),D=a(`
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(g){p=r(g,"P",{});var u=i(p);x=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(u,"CODE",{});var V=i(m);y=n(V,"Module"),V.forEach(o),D=n(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(g,u){f(g,p,u),e(p,x),e(p,m),e(m,y),e(p,D)},d(g){g&&o(p)}}}function ev($){let p,x,m,y,D;return{c(){p=s("p"),x=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=s("code"),y=a("Module"),D=a(`
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(g){p=r(g,"P",{});var u=i(p);x=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(u,"CODE",{});var V=i(m);y=n(V,"Module"),V.forEach(o),D=n(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(g,u){f(g,p,u),e(p,x),e(p,m),e(m,y),e(p,D)},d(g){g&&o(p)}}}function tv($){let p,x,m,y,D;return{c(){p=s("p"),x=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=s("code"),y=a("Module"),D=a(`
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(g){p=r(g,"P",{});var u=i(p);x=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(u,"CODE",{});var V=i(m);y=n(V,"Module"),V.forEach(o),D=n(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(g,u){f(g,p,u),e(p,x),e(p,m),e(m,y),e(p,D)},d(g){g&&o(p)}}}function ov($){let p,x,m,y,D;return{c(){p=s("p"),x=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=s("code"),y=a("Module"),D=a(`
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(g){p=r(g,"P",{});var u=i(p);x=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(u,"CODE",{});var V=i(m);y=n(V,"Module"),V.forEach(o),D=n(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(g,u){f(g,p,u),e(p,x),e(p,m),e(m,y),e(p,D)},d(g){g&&o(p)}}}function av($){let p,x,m,y,D;return{c(){p=s("p"),x=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=s("code"),y=a("Module"),D=a(`
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(g){p=r(g,"P",{});var u=i(p);x=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(u,"CODE",{});var V=i(m);y=n(V,"Module"),V.forEach(o),D=n(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(g,u){f(g,p,u),e(p,x),e(p,m),e(m,y),e(p,D)},d(g){g&&o(p)}}}function nv($){let p,x,m,y,D;return{c(){p=s("p"),x=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=s("code"),y=a("Module"),D=a(`
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(g){p=r(g,"P",{});var u=i(p);x=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(u,"CODE",{});var V=i(m);y=n(V,"Module"),V.forEach(o),D=n(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(g,u){f(g,p,u),e(p,x),e(p,m),e(m,y),e(p,D)},d(g){g&&o(p)}}}function sv($){let p,x,m,y,D;return{c(){p=s("p"),x=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=s("code"),y=a("Module"),D=a(`
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(g){p=r(g,"P",{});var u=i(p);x=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(u,"CODE",{});var V=i(m);y=n(V,"Module"),V.forEach(o),D=n(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(g,u){f(g,p,u),e(p,x),e(p,m),e(m,y),e(p,D)},d(g){g&&o(p)}}}function rv($){let p,x,m,y,D,g,u,V,xd,Qr,ze,mt,ms,Ht,Dd,fs,Vd,Gr,ft,$d,Rt,Ad,Fd,Xr,hn,Cd,Ur,un,Qt,Md,Gt,qd,jd,Jr,mn,zd,Kr,fn,Xt,Ed,gn,Pd,Sd,Yr,ve,Ld,Ut,Nd,Wd,Jt,Id,Od,Zr,Ee,gt,gs,Kt,Bd,_s,Hd,ei,H,Yt,Rd,_e,Qd,_n,Gd,Xd,vn,Ud,Jd,Zt,Kd,Yd,Zd,Pe,el,bn,tl,ol,Tn,al,nl,sl,vs,rl,il,eo,ti,Se,_t,bs,to,dl,Ts,ll,oi,R,oo,cl,Le,pl,kn,hl,ul,ao,ml,fl,gl,Ne,_l,wn,vl,bl,yn,Tl,kl,wl,ks,yl,xl,no,ai,We,vt,ws,so,Dl,ys,Vl,ni,Q,ro,$l,io,Al,lo,Fl,Cl,Ml,co,ql,xn,jl,zl,El,po,Pl,ho,Sl,Ll,Nl,J,uo,Wl,Ie,Il,Dn,Ol,Bl,xs,Hl,Rl,Ql,bt,Gl,Ds,Xl,Ul,mo,si,Oe,Tt,Vs,fo,Jl,$s,Kl,ri,M,go,Yl,As,Zl,ec,_o,tc,vo,oc,ac,nc,bo,sc,Vn,rc,ic,dc,To,lc,ko,cc,pc,hc,K,wo,uc,Be,mc,$n,fc,gc,Fs,_c,vc,bc,kt,Tc,Cs,kc,wc,yo,ii,He,wt,Ms,xo,yc,qs,xc,di,G,Do,Dc,Re,Vc,js,$c,Ac,Vo,Fc,Cc,Mc,$o,qc,An,jc,zc,Ec,Ao,Pc,Fo,Sc,Lc,Nc,W,Co,Wc,Qe,Ic,Fn,Oc,Bc,zs,Hc,Rc,Qc,yt,Gc,Es,Xc,Uc,Mo,Jc,qo,li,Ge,xt,Ps,jo,Kc,Ss,Yc,ci,q,zo,Zc,Ls,ep,tp,Eo,op,Po,ap,np,sp,So,rp,Cn,ip,dp,lp,Lo,cp,No,pp,hp,up,I,Wo,mp,Xe,fp,Mn,gp,_p,Ns,vp,bp,Tp,Dt,kp,Ws,wp,yp,Io,xp,Oo,pi,Ue,Vt,Is,Bo,Dp,Os,Vp,hi,j,Ho,$p,Bs,Ap,Fp,Ro,Cp,Qo,Mp,qp,jp,Go,zp,qn,Ep,Pp,Sp,Xo,Lp,Uo,Np,Wp,Ip,Y,Jo,Op,Je,Bp,jn,Hp,Rp,Hs,Qp,Gp,Xp,$t,Up,Rs,Jp,Kp,Ko,ui,Ke,At,Qs,Yo,Yp,Gs,Zp,mi,F,Zo,eh,ea,th,ta,oh,ah,nh,oa,sh,zn,rh,ih,dh,aa,lh,na,ch,ph,hh,sa,uh,Xs,mh,fh,gh,z,_h,Us,vh,bh,Js,Th,kh,Ks,wh,yh,Ys,xh,Dh,Zs,Vh,$h,er,Ah,Fh,Ch,Ft,Mh,tr,qh,jh,ra,zh,Eh,Z,ia,Ph,Ye,Sh,En,Lh,Nh,or,Wh,Ih,Oh,Ct,Bh,ar,Hh,Rh,da,fi,Ze,Mt,nr,la,Qh,sr,Gh,gi,X,ca,Xh,et,Uh,rr,Jh,Kh,pa,Yh,Zh,eu,ha,tu,Pn,ou,au,nu,ua,su,ma,ru,iu,du,ee,fa,lu,tt,cu,Sn,pu,hu,ir,uu,mu,fu,qt,gu,dr,_u,vu,ga,_i,ot,jt,lr,_a,bu,cr,Tu,vi,U,va,ku,at,wu,pr,yu,xu,ba,Du,Vu,$u,Ta,Au,Ln,Fu,Cu,Mu,ka,qu,wa,ju,zu,Eu,te,ya,Pu,nt,Su,Nn,Lu,Nu,hr,Wu,Iu,Ou,zt,Bu,ur,Hu,Ru,xa,bi,st,Et,mr,Da,Qu,fr,Gu,Ti,E,Va,Xu,gr,Uu,Ju,$a,Ku,Aa,Yu,Zu,em,Fa,tm,Wn,om,am,nm,Ca,sm,Ma,rm,im,dm,C,qa,lm,rt,cm,In,pm,hm,_r,um,mm,fm,Pt,gm,vr,_m,vm,ja,bm,br,Tm,km,za,ki,it,St,Tr,Ea,wm,kr,ym,wi,P,Pa,xm,wr,Dm,Vm,Sa,$m,La,Am,Fm,Cm,Na,Mm,On,qm,jm,zm,Wa,Em,Ia,Pm,Sm,Lm,oe,Oa,Nm,dt,Wm,Bn,Im,Om,yr,Bm,Hm,Rm,Lt,Qm,xr,Gm,Xm,Ba,yi,lt,Nt,Dr,Ha,Um,Vr,Jm,xi,S,Ra,Km,$r,Ym,Zm,Qa,ef,Ga,tf,of,af,Xa,nf,Hn,sf,rf,df,Ua,lf,Ja,cf,pf,hf,ae,Ka,uf,ct,mf,Rn,ff,gf,Ar,_f,vf,bf,Wt,Tf,Fr,kf,wf,Ya,Di,pt,It,Cr,Za,yf,Mr,xf,Vi,L,en,Df,ht,Vf,qr,$f,Af,jr,Ff,Cf,Mf,tn,qf,on,jf,zf,Ef,an,Pf,Qn,Sf,Lf,Nf,nn,Wf,sn,If,Of,Bf,ne,rn,Hf,ut,Rf,Gn,Qf,Gf,zr,Xf,Uf,Jf,Ot,Kf,Er,Yf,Zf,dn,$i;return g=new B({}),Ht=new B({}),Kt=new B({}),Yt=new A({props:{name:"class transformers.Data2VecTextConfig",anchor:"transformers.Data2VecTextConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"use_cache",val:" = True"},{name:"classifier_dropout",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/configuration_data2vec_text.py#L31",parametersDescription:[{anchor:"transformers.Data2VecTextConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the DATA2VEC model. Defines the number of different tokens that can be represented by
the <code>inputs_ids</code> passed when calling <code>Data2VecModel</code>.`,name:"vocab_size"},{anchor:"transformers.Data2VecTextConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.Data2VecTextConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.Data2VecTextConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.Data2VecTextConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.Data2VecTextConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.Data2VecTextConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.Data2VecTextConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.Data2VecTextConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#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:"max_position_embeddings"},{anchor:"transformers.Data2VecTextConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <code>Data2VecModel</code>.`,name:"type_vocab_size"},{anchor:"transformers.Data2VecTextConfig.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.Data2VecTextConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.Data2VecTextConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;</code>. For
positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.Data2VecTextConfig.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). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.Data2VecTextConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The dropout ratio for the classification head.`,name:"classifier_dropout"}]}}),eo=new N({props:{code:`from transformers import Data2VecTextModel, Data2VecTextConfig

# Initializing a Data2VecText facebook/data2vec-text-base style configuration
configuration = Data2VecTextConfig()

# Initializing a model from the facebook/data2vec-text-base style configuration
model = Data2VecTextModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Data2VecTextModel, Data2VecTextConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Data2VecText facebook/data2vec-text-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Data2VecTextConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the facebook/data2vec-text-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecTextModel(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`}}),to=new B({}),oo=new A({props:{name:"class transformers.Data2VecAudioConfig",anchor:"transformers.Data2VecAudioConfig",parameters:[{name:"vocab_size",val:" = 32"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout",val:" = 0.1"},{name:"activation_dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.1"},{name:"feat_proj_dropout",val:" = 0.0"},{name:"final_dropout",val:" = 0.1"},{name:"layerdrop",val:" = 0.1"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"feat_extract_activation",val:" = 'gelu'"},{name:"conv_dim",val:" = (512, 512, 512, 512, 512, 512, 512)"},{name:"conv_stride",val:" = (5, 2, 2, 2, 2, 2, 2)"},{name:"conv_kernel",val:" = (10, 3, 3, 3, 3, 2, 2)"},{name:"conv_bias",val:" = False"},{name:"num_conv_pos_embedding_groups",val:" = 16"},{name:"conv_pos_kernel_size",val:" = 19"},{name:"num_conv_pos_embeddings",val:" = 5"},{name:"mask_time_prob",val:" = 0.05"},{name:"mask_time_length",val:" = 10"},{name:"mask_time_min_masks",val:" = 2"},{name:"mask_feature_prob",val:" = 0.0"},{name:"mask_feature_length",val:" = 10"},{name:"mask_feature_min_masks",val:" = 0"},{name:"ctc_loss_reduction",val:" = 'sum'"},{name:"ctc_zero_infinity",val:" = False"},{name:"use_weighted_layer_sum",val:" = False"},{name:"classifier_proj_size",val:" = 256"},{name:"tdnn_dim",val:" = (512, 512, 512, 512, 1500)"},{name:"tdnn_kernel",val:" = (5, 3, 3, 1, 1)"},{name:"tdnn_dilation",val:" = (1, 2, 3, 1, 1)"},{name:"xvector_output_dim",val:" = 512"},{name:"pad_token_id",val:" = 0"},{name:"bos_token_id",val:" = 1"},{name:"eos_token_id",val:" = 2"},{name:"add_adapter",val:" = False"},{name:"adapter_kernel_size",val:" = 3"},{name:"adapter_stride",val:" = 2"},{name:"num_adapter_layers",val:" = 3"},{name:"output_hidden_size",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/configuration_data2vec_audio.py#L31",parametersDescription:[{anchor:"transformers.Data2VecAudioConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Vocabulary size of the Data2VecAudio model. Defines the number of different tokens that can be represented
by the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecAudioModel">Data2VecAudioModel</a> or <code>TFData2VecAudioModel</code>. Vocabulary size
of the model. Defines the different tokens that can be represented by the <em>inputs_ids</em> passed to the
forward method of <a href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecAudioModel">Data2VecAudioModel</a>.`,name:"vocab_size"},{anchor:"transformers.Data2VecAudioConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.Data2VecAudioConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.Data2VecAudioConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.Data2VecAudioConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.Data2VecAudioConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.Data2VecAudioConfig.hidden_dropout",description:`<strong>hidden_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout"},{anchor:"transformers.Data2VecAudioConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.Data2VecAudioConfig.final_dropout",description:`<strong>final_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for the final projection layer of <a href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecAudioForCTC">Data2VecAudioForCTC</a>.`,name:"final_dropout"},{anchor:"transformers.Data2VecAudioConfig.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.Data2VecAudioConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.Data2VecAudioConfig.feat_proj_dropout",description:`<strong>feat_proj_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for output of the feature encoder.`,name:"feat_proj_dropout"},{anchor:"transformers.Data2VecAudioConfig.feat_extract_activation",description:"<strong>feat_extract_activation</strong> (<code>str, </code>optional<code>, defaults to </code>&#x201C;gelu&#x201D;<code>) -- The non-linear activation function (function or string) in the 1D convolutional layers of the feature extractor. If string, </code>&#x201C;gelu&#x201D;<code>, </code>&#x201C;relu&#x201D;<code>, </code>&#x201C;selu&#x201D;<code>and</code>&#x201C;gelu_new&#x201D;` are supported.",name:"feat_extract_activation"},{anchor:"transformers.Data2VecAudioConfig.conv_dim",description:`<strong>conv_dim</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to <code>(512, 512, 512, 512, 512, 512, 512)</code>) &#x2014;
A tuple of integers defining the number of input and output channels of each 1D convolutional layer in the
feature encoder. The length of <em>conv_dim</em> defines the number of 1D convolutional layers.`,name:"conv_dim"},{anchor:"transformers.Data2VecAudioConfig.conv_stride",description:`<strong>conv_stride</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to <code>(5, 2, 2, 2, 2, 2, 2)</code>) &#x2014;
A tuple of integers defining the stride of each 1D convolutional layer in the feature encoder. The length
of <em>conv_stride</em> defines the number of convolutional layers and has to match the length of <em>conv_dim</em>.`,name:"conv_stride"},{anchor:"transformers.Data2VecAudioConfig.conv_kernel",description:`<strong>conv_kernel</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to <code>(10, 3, 3, 3, 3, 3, 3)</code>) &#x2014;
A tuple of integers defining the kernel size of each 1D convolutional layer in the feature encoder. The
length of <em>conv_kernel</em> defines the number of convolutional layers and has to match the length of
<em>conv_dim</em>.`,name:"conv_kernel"},{anchor:"transformers.Data2VecAudioConfig.conv_bias",description:`<strong>conv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the 1D convolutional layers have a bias.`,name:"conv_bias"},{anchor:"transformers.Data2VecAudioConfig.num_conv_pos_embeddings",description:`<strong>num_conv_pos_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
Number of convolutional positional embeddings. Defines the kernel size of 1D convolutional positional
embeddings layer.`,name:"num_conv_pos_embeddings"},{anchor:"transformers.Data2VecAudioConfig.num_conv_pos_embedding_groups",description:`<strong>num_conv_pos_embedding_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of groups of 1D convolutional positional embeddings layer.`,name:"num_conv_pos_embedding_groups"},{anchor:"transformers.Data2VecAudioConfig.mask_time_prob",description:`<strong>mask_time_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.05) &#x2014;
Percentage (between 0 and 1) of all feature vectors along the time axis which will be masked. The masking
procecure generates &#x201D;mask_time_prob<em>len(time_axis)/mask_time_length&#x201D; independent masks over the axis. If
reasoning from the propability of each feature vector to be chosen as the start of the vector span to be
masked, </em>mask_time_prob<em> should be \`prob_vector_start</em>mask_time_length\`. Note that overlap may decrease the`,name:"mask_time_prob"},{anchor:"transformers.Data2VecAudioConfig.mask_time_length",description:`<strong>mask_time_length</strong> (<code>int</code>, <em>optional</em>, defaults to 10) &#x2014;
Length of vector span along the time axis.`,name:"mask_time_length"},{anchor:"transformers.Data2VecAudioConfig.mask_time_min_masks",description:`<strong>mask_time_min_masks</strong> (<code>int</code>, <em>optional</em>, defaults to 2), &#x2014;
The minimum number of masks of length <code>mask_feature_length</code> generated along the time axis, each time step,
irrespectively of <code>mask_feature_prob</code>. Only relevant if &#x201D;mask_time_prob*len(time_axis)/mask_time_length &lt;
mask_time_min_masks&#x201D;`,name:"mask_time_min_masks"},{anchor:"transformers.Data2VecAudioConfig.mask_feature_prob",description:`<strong>mask_feature_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Percentage (between 0 and 1) of all feature vectors along the feature axis which will be masked. The
masking procecure generates &#x201D;mask_feature_prob<em>len(feature_axis)/mask_time_length&#x201D; independent masks over
the axis. If reasoning from the propability of each feature vector to be chosen as the start of the vector
span to be masked, </em>mask_feature_prob<em> should be \`prob_vector_start</em>mask_feature_length<code>. Note that overlap may decrease the actual percentage of masked vectors. This is only relevant if </code>apply_spec_augment is
True\`.`,name:"mask_feature_prob"},{anchor:"transformers.Data2VecAudioConfig.mask_feature_length",description:`<strong>mask_feature_length</strong> (<code>int</code>, <em>optional</em>, defaults to 10) &#x2014;
Length of vector span along the feature axis.`,name:"mask_feature_length"},{anchor:"transformers.Data2VecAudioConfig.mask_feature_min_masks",description:`<strong>mask_feature_min_masks</strong> (<code>int</code>, <em>optional</em>, defaults to 0), &#x2014;
The minimum number of masks of length <code>mask_feature_length</code> generated along the feature axis, each time
step, irrespectively of <code>mask_feature_prob</code>. Only relevant if
&#x201D;mask_feature_prob*len(feature_axis)/mask_feature_length &lt; mask_feature_min_masks&#x201D;`,name:"mask_feature_min_masks"},{anchor:"transformers.Data2VecAudioConfig.ctc_loss_reduction",description:`<strong>ctc_loss_reduction</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;sum&quot;</code>) &#x2014;
Specifies the reduction to apply to the output of <code>torch.nn.CTCLoss</code>. Only relevant when training an
instance of <a href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecAudioForCTC">Data2VecAudioForCTC</a>.`,name:"ctc_loss_reduction"},{anchor:"transformers.Data2VecAudioConfig.ctc_zero_infinity",description:`<strong>ctc_zero_infinity</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to zero infinite losses and the associated gradients of <code>torch.nn.CTCLoss</code>. Infinite losses mainly
occur when the inputs are too short to be aligned to the targets. Only relevant when training an instance
of <a href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecAudioForCTC">Data2VecAudioForCTC</a>.`,name:"ctc_zero_infinity"},{anchor:"transformers.Data2VecAudioConfig.use_weighted_layer_sum",description:`<strong>use_weighted_layer_sum</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a weighted average of layer outputs with learned weights. Only relevant when using an
instance of <a href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecAudioForSequenceClassification">Data2VecAudioForSequenceClassification</a>.`,name:"use_weighted_layer_sum"},{anchor:"transformers.Data2VecAudioConfig.classifier_proj_size",description:`<strong>classifier_proj_size</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Dimensionality of the projection before token mean-pooling for classification.`,name:"classifier_proj_size"},{anchor:"transformers.Data2VecAudioConfig.tdnn_dim",description:`<strong>tdnn_dim</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to <code>(512, 512, 512, 512, 1500)</code>) &#x2014;
A tuple of integers defining the number of output channels of each 1D convolutional layer in the <em>TDNN</em>
module of the <em>XVector</em> model. The length of <em>tdnn_dim</em> defines the number of <em>TDNN</em> layers.`,name:"tdnn_dim"},{anchor:"transformers.Data2VecAudioConfig.tdnn_kernel",description:`<strong>tdnn_kernel</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to <code>(5, 3, 3, 1, 1)</code>) &#x2014;
A tuple of integers defining the kernel size of each 1D convolutional layer in the <em>TDNN</em> module of the
<em>XVector</em> model. The length of <em>tdnn_kernel</em> has to match the length of <em>tdnn_dim</em>.`,name:"tdnn_kernel"},{anchor:"transformers.Data2VecAudioConfig.tdnn_dilation",description:`<strong>tdnn_dilation</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to <code>(1, 2, 3, 1, 1)</code>) &#x2014;
A tuple of integers defining the dilation factor of each 1D convolutional layer in <em>TDNN</em> module of the
<em>XVector</em> model. The length of <em>tdnn_dilation</em> has to match the length of <em>tdnn_dim</em>.`,name:"tdnn_dilation"},{anchor:"transformers.Data2VecAudioConfig.xvector_output_dim",description:`<strong>xvector_output_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimensionality of the <em>XVector</em> embedding vectors.`,name:"xvector_output_dim"},{anchor:"transformers.Data2VecAudioConfig.add_adapter",description:`<strong>add_adapter</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether a convolutional network should be stacked on top of the Data2VecAudio Encoder. Can be very useful
for warm-starting Data2VecAudio for SpeechEncoderDecoder models.`,name:"add_adapter"},{anchor:"transformers.Data2VecAudioConfig.adapter_kernel_size",description:`<strong>adapter_kernel_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Kernel size of the convolutional layers in the adapter network. Only relevant if <code>add_adapter is True</code>.`,name:"adapter_kernel_size"},{anchor:"transformers.Data2VecAudioConfig.adapter_stride",description:`<strong>adapter_stride</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
Stride of the convolutional layers in the adapter network. Only relevant if <code>add_adapter is True</code>.`,name:"adapter_stride"},{anchor:"transformers.Data2VecAudioConfig.num_adapter_layers",description:`<strong>num_adapter_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Number of convolutional layers that should be used in the adapter network. Only relevant if <code>add_adapter is True</code>.`,name:"num_adapter_layers"},{anchor:"transformers.Data2VecAudioConfig.output_hidden_size",description:`<strong>output_hidden_size</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Dimensionality of the encoder output layer. If not defined, this defaults to <em>hidden-size</em>. Only relevant
if <code>add_adapter is True</code>.`,name:"output_hidden_size"}]}}),no=new N({props:{code:`from transformers import Data2VecAudioModel, Data2VecAudioConfig

# Initializing a Data2VecAudio facebook/data2vec-audio-base-960h style configuration
configuration = Data2VecAudioConfig()

# Initializing a model from the facebook/data2vec-audio-base-960h style configuration
model = Data2VecAudioModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Data2VecAudioModel, Data2VecAudioConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Data2VecAudio facebook/data2vec-audio-base-960h style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Data2VecAudioConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the facebook/data2vec-audio-base-960h style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecAudioModel(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`}}),so=new B({}),ro=new A({props:{name:"class transformers.Data2VecAudioModel",anchor:"transformers.Data2VecAudioModel",parameters:[{name:"config",val:": Data2VecAudioConfig"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_audio.py#L898",parametersDescription:[{anchor:"transformers.Data2VecAudioModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecAudioConfig">Data2VecAudioConfig</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/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),uo=new A({props:{name:"forward",anchor:"transformers.Data2VecAudioModel.forward",parameters:[{name:"input_values",val:""},{name:"attention_mask",val:" = None"},{name:"mask_time_indices",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_audio.py#L969",parametersDescription:[{anchor:"transformers.Data2VecAudioModel.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Float values of input raw speech waveform. Values can be obtained by loading a <em>.flac</em> or <em>.wav</em> audio file
into an array of type <em>List[float]</em> or a <em>numpy.ndarray</em>, <em>e.g.</em> via the soundfile library (<em>pip install
soundfile</em>). To prepare the array into <em>input_values</em>, the <a href="/docs/transformers/pr_15839/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor">Wav2Vec2Processor</a> should be used for padding
and conversion into a tensor of type <em>torch.FloatTensor</em>. See <a href="/docs/transformers/pr_15839/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.Data2VecAudioModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing convolution and 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></p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/data2vec-audio-base-960h" rel="nofollow">data2vec-audio-base</a>, <code>attention_mask</code> should
<strong>not</strong> be passed to avoid degraded performance when doing batched inference. For such models
<code>input_values</code> should simply be padded with 0 and passed without <code>attention_mask</code>. Be aware that these
models also yield slightly different results depending on whether <code>input_values</code> is padded or not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.Data2VecAudioModel.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.Data2VecAudioModel.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.Data2VecAudioModel.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/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],returnDescription:`
<p>A <code>transformers.models.data2vec.modeling_data2vec_audio.Data2VecAudioBaseModelOutput</code>or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecAudioConfig"
>Data2VecAudioConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>extract_features</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, conv_dim[-1])</code>) \u2014 Sequence of extracted feature vectors of the last convolutional layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.data2vec.modeling_data2vec_audio.Data2VecAudioBaseModelOutput</code>or <code>tuple(torch.FloatTensor)</code></p>
`}}),bt=new ge({props:{$$slots:{default:[X2]},$$scope:{ctx:$}}}),mo=new N({props:{code:`from transformers import Wav2Vec2Processor, Data2VecAudioModel
import torch
from datasets import load_dataset

dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

processor = Wav2Vec2Processor.from_pretrained("facebook/data2vec-audio-base-960h")
model = Data2VecAudioModel.from_pretrained("facebook/data2vec-audio-base-960h")

# audio file is decoded on the fly
inputs = processor(dataset[0]["audio"]["array"], sampling_rate=sampling_rate, return_tensors="pt")
with torch.no_grad():
    outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2Processor, Data2VecAudioModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_demo&quot;</span>, <span class="hljs-string">&quot;clean&quot;</span>, split=<span class="hljs-string">&quot;validation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.sort(<span class="hljs-string">&quot;id&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>sampling_rate = dataset.features[<span class="hljs-string">&quot;audio&quot;</span>].sampling_rate

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = Wav2Vec2Processor.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-audio-base-960h&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecAudioModel.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-audio-base-960h&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># audio file is decoded on the fly</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>], sampling_rate=sampling_rate, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">292</span>, <span class="hljs-number">768</span>]`}}),fo=new B({}),go=new A({props:{name:"class transformers.Data2VecAudioForAudioFrameClassification",anchor:"transformers.Data2VecAudioForAudioFrameClassification",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_audio.py#L1291",parametersDescription:[{anchor:"transformers.Data2VecAudioForAudioFrameClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecAudioConfig">Data2VecAudioConfig</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/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),wo=new A({props:{name:"forward",anchor:"transformers.Data2VecAudioForAudioFrameClassification.forward",parameters:[{name:"input_values",val:""},{name:"attention_mask",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_audio.py#L1334",parametersDescription:[{anchor:"transformers.Data2VecAudioForAudioFrameClassification.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Float values of input raw speech waveform. Values can be obtained by loading a <em>.flac</em> or <em>.wav</em> audio file
into an array of type <em>List[float]</em> or a <em>numpy.ndarray</em>, <em>e.g.</em> via the soundfile library (<em>pip install
soundfile</em>). To prepare the array into <em>input_values</em>, the <a href="/docs/transformers/pr_15839/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor">Wav2Vec2Processor</a> should be used for padding
and conversion into a tensor of type <em>torch.FloatTensor</em>. See <a href="/docs/transformers/pr_15839/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.Data2VecAudioForAudioFrameClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing convolution and 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></p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/data2vec-audio-base-960h" rel="nofollow">data2vec-audio-base</a>, <code>attention_mask</code> should
<strong>not</strong> be passed to avoid degraded performance when doing batched inference. For such models
<code>input_values</code> should simply be padded with 0 and passed without <code>attention_mask</code>. Be aware that these
models also yield slightly different results depending on whether <code>input_values</code> is padded or not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.Data2VecAudioForAudioFrameClassification.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.Data2VecAudioForAudioFrameClassification.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.Data2VecAudioForAudioFrameClassification.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/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecAudioForAudioFrameClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecAudioConfig"
>Data2VecAudioConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),kt=new ge({props:{$$slots:{default:[U2]},$$scope:{ctx:$}}}),yo=new N({props:{code:`from transformers import Wav2Vec2FeatureExtractor, Data2VecAudioForAudioFrameClassification
from datasets import load_dataset
import torch

dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained("hf-internal-testing/tiny-random-data2vec-audio-frame")
model = Data2VecAudioForAudioFrameClassification.from_pretrained("hf-internal-testing/tiny-random-data2vec-audio-frame")

# audio file is decoded on the fly
inputs = feature_extractor(dataset[0]["audio"]["array"], return_tensors="pt", sampling_rate=sampling_rate)
with torch.no_grad():
    logits = model(**inputs).logits

probabilities = torch.sigmoid(logits[0])
# labels is a one-hot array of shape (num_frames, num_speakers)
labels = (probabilities > 0.5).long()
labels[0].tolist()`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2FeatureExtractor, Data2VecAudioForAudioFrameClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_demo&quot;</span>, <span class="hljs-string">&quot;clean&quot;</span>, split=<span class="hljs-string">&quot;validation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.sort(<span class="hljs-string">&quot;id&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>sampling_rate = dataset.features[<span class="hljs-string">&quot;audio&quot;</span>].sampling_rate

<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained(<span class="hljs-string">&quot;hf-internal-testing/tiny-random-data2vec-audio-frame&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecAudioForAudioFrameClassification.from_pretrained(<span class="hljs-string">&quot;hf-internal-testing/tiny-random-data2vec-audio-frame&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># audio file is decoded on the fly</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = feature_extractor(dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, sampling_rate=sampling_rate)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>probabilities = torch.sigmoid(logits[<span class="hljs-number">0</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># labels is a one-hot array of shape (num_frames, num_speakers)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = (probabilities &gt; <span class="hljs-number">0.5</span>).long()
<span class="hljs-meta">&gt;&gt;&gt; </span>labels[<span class="hljs-number">0</span>].tolist()
[<span class="hljs-number">1</span>, <span class="hljs-number">1</span>]`}}),xo=new B({}),Do=new A({props:{name:"class transformers.Data2VecAudioForCTC",anchor:"transformers.Data2VecAudioForCTC",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_audio.py#L1036",parametersDescription:[{anchor:"transformers.Data2VecAudioForCTC.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecAudioConfig">Data2VecAudioConfig</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/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),Co=new A({props:{name:"forward",anchor:"transformers.Data2VecAudioForCTC.forward",parameters:[{name:"input_values",val:""},{name:"attention_mask",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"},{name:"labels",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_audio.py#L1077",parametersDescription:[{anchor:"transformers.Data2VecAudioForCTC.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Float values of input raw speech waveform. Values can be obtained by loading a <em>.flac</em> or <em>.wav</em> audio file
into an array of type <em>List[float]</em> or a <em>numpy.ndarray</em>, <em>e.g.</em> via the soundfile library (<em>pip install
soundfile</em>). To prepare the array into <em>input_values</em>, the <a href="/docs/transformers/pr_15839/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor">Wav2Vec2Processor</a> should be used for padding
and conversion into a tensor of type <em>torch.FloatTensor</em>. See <a href="/docs/transformers/pr_15839/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.Data2VecAudioForCTC.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing convolution and 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></p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/data2vec-audio-base-960h" rel="nofollow">data2vec-audio-base</a>, <code>attention_mask</code> should
<strong>not</strong> be passed to avoid degraded performance when doing batched inference. For such models
<code>input_values</code> should simply be padded with 0 and passed without <code>attention_mask</code>. Be aware that these
models also yield slightly different results depending on whether <code>input_values</code> is padded or not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.Data2VecAudioForCTC.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.Data2VecAudioForCTC.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.Data2VecAudioForCTC.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/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecAudioForCTC.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_length)</code>, <em>optional</em>) &#x2014;
Labels for connectionist temporal classification. Note that <code>target_length</code> has to be smaller or equal to
the sequence length of the output logits. Indices are selected in <code>[-100, 0, ..., config.vocab_size - 1]</code>.
All labels set to <code>-100</code> are ignored (masked), the loss is only computed for labels in <code>[0, ..., config.vocab_size - 1]</code>.`,name:"labels"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.CausalLMOutput"
>transformers.modeling_outputs.CausalLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecAudioConfig"
>Data2VecAudioConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.CausalLMOutput"
>transformers.modeling_outputs.CausalLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),yt=new ge({props:{$$slots:{default:[J2]},$$scope:{ctx:$}}}),Mo=new N({props:{code:`from transformers import Wav2Vec2Processor, Data2VecAudioForCTC
from datasets import load_dataset
import torch

dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

processor = Wav2Vec2Processor.from_pretrained("facebook/data2vec-audio-base-960h")
model = Data2VecAudioForCTC.from_pretrained("facebook/data2vec-audio-base-960h")

# audio file is decoded on the fly
inputs = processor(dataset[0]["audio"]["array"], sampling_rate=sampling_rate, return_tensors="pt")
with torch.no_grad():
    logits = model(**inputs).logits
predicted_ids = torch.argmax(logits, dim=-1)

# transcribe speech
transcription = processor.batch_decode(predicted_ids)
transcription[0]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2Processor, Data2VecAudioForCTC
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_demo&quot;</span>, <span class="hljs-string">&quot;clean&quot;</span>, split=<span class="hljs-string">&quot;validation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.sort(<span class="hljs-string">&quot;id&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>sampling_rate = dataset.features[<span class="hljs-string">&quot;audio&quot;</span>].sampling_rate

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = Wav2Vec2Processor.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-audio-base-960h&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecAudioForCTC.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-audio-base-960h&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># audio file is decoded on the fly</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>], sampling_rate=sampling_rate, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_ids = torch.argmax(logits, dim=-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># transcribe speech</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>transcription = processor.batch_decode(predicted_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>transcription[<span class="hljs-number">0</span>]
<span class="hljs-string">&#x27;MISTER QUILTER IS THE APOSTLE OF THE MIDDLE CLASSES AND WE ARE GLAD TO WELCOME HIS GOSPEL&#x27;</span>`}}),qo=new N({props:{code:`with processor.as_target_processor():
    inputs["labels"] = processor(dataset[0]["text"], return_tensors="pt").input_ids

# compute loss
loss = model(**inputs).loss
round(loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> processor.as_target_processor():
<span class="hljs-meta">... </span>    inputs[<span class="hljs-string">&quot;labels&quot;</span>] = processor(dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;text&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute loss</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">66.95</span>`}}),jo=new B({}),zo=new A({props:{name:"class transformers.Data2VecAudioForSequenceClassification",anchor:"transformers.Data2VecAudioForSequenceClassification",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_audio.py#L1167",parametersDescription:[{anchor:"transformers.Data2VecAudioForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecAudioConfig">Data2VecAudioConfig</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/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),Wo=new A({props:{name:"forward",anchor:"transformers.Data2VecAudioForSequenceClassification.forward",parameters:[{name:"input_values",val:""},{name:"attention_mask",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"},{name:"labels",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_audio.py#L1212",parametersDescription:[{anchor:"transformers.Data2VecAudioForSequenceClassification.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Float values of input raw speech waveform. Values can be obtained by loading a <em>.flac</em> or <em>.wav</em> audio file
into an array of type <em>List[float]</em> or a <em>numpy.ndarray</em>, <em>e.g.</em> via the soundfile library (<em>pip install
soundfile</em>). To prepare the array into <em>input_values</em>, the <a href="/docs/transformers/pr_15839/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor">Wav2Vec2Processor</a> should be used for padding
and conversion into a tensor of type <em>torch.FloatTensor</em>. See <a href="/docs/transformers/pr_15839/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.Data2VecAudioForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing convolution and 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></p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/data2vec-audio-base-960h" rel="nofollow">data2vec-audio-base</a>, <code>attention_mask</code> should
<strong>not</strong> be passed to avoid degraded performance when doing batched inference. For such models
<code>input_values</code> should simply be padded with 0 and passed without <code>attention_mask</code>. Be aware that these
models also yield slightly different results depending on whether <code>input_values</code> is padded or not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.Data2VecAudioForSequenceClassification.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.Data2VecAudioForSequenceClassification.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.Data2VecAudioForSequenceClassification.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/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecAudioForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecAudioConfig"
>Data2VecAudioConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Dt=new ge({props:{$$slots:{default:[K2]},$$scope:{ctx:$}}}),Io=new N({props:{code:`from transformers import Wav2Vec2FeatureExtractor, Data2VecAudioForSequenceClassification
from datasets import load_dataset
import torch

dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained("hf-internal-testing/tiny-random-data2vec-seq-class")
model = Data2VecAudioForSequenceClassification.from_pretrained("hf-internal-testing/tiny-random-data2vec-seq-class")

# audio file is decoded on the fly
inputs = feature_extractor(dataset[0]["audio"]["array"], sampling_rate=sampling_rate, return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_ids = torch.argmax(logits, dim=-1).item()
predicted_label = model.config.id2label[predicted_class_ids]
predicted_label`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2FeatureExtractor, Data2VecAudioForSequenceClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_demo&quot;</span>, <span class="hljs-string">&quot;clean&quot;</span>, split=<span class="hljs-string">&quot;validation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.sort(<span class="hljs-string">&quot;id&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>sampling_rate = dataset.features[<span class="hljs-string">&quot;audio&quot;</span>].sampling_rate

<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained(<span class="hljs-string">&quot;hf-internal-testing/tiny-random-data2vec-seq-class&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecAudioForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;hf-internal-testing/tiny-random-data2vec-seq-class&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># audio file is decoded on the fly</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = feature_extractor(dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>], sampling_rate=sampling_rate, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_ids = torch.argmax(logits, dim=-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = model.config.id2label[predicted_class_ids]
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label
<span class="hljs-string">&#x27;LABEL_1&#x27;</span>`}}),Oo=new N({props:{code:`# compute loss - target_label is e.g. "down"
target_label = model.config.id2label[0]
inputs["labels"] = torch.tensor([model.config.label2id[target_label]])
loss = model(**inputs).loss
round(loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute loss - target_label is e.g. &quot;down&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_label = model.config.id2label[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs[<span class="hljs-string">&quot;labels&quot;</span>] = torch.tensor([model.config.label2id[target_label]])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">0.69</span>`}}),Bo=new B({}),Ho=new A({props:{name:"class transformers.Data2VecAudioForXVector",anchor:"transformers.Data2VecAudioForXVector",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_audio.py#L1449",parametersDescription:[{anchor:"transformers.Data2VecAudioForXVector.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecAudioConfig">Data2VecAudioConfig</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/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),Jo=new A({props:{name:"forward",anchor:"transformers.Data2VecAudioForXVector.forward",parameters:[{name:"input_values",val:""},{name:"attention_mask",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"},{name:"labels",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_audio.py#L1511",parametersDescription:[{anchor:"transformers.Data2VecAudioForXVector.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Float values of input raw speech waveform. Values can be obtained by loading a <em>.flac</em> or <em>.wav</em> audio file
into an array of type <em>List[float]</em> or a <em>numpy.ndarray</em>, <em>e.g.</em> via the soundfile library (<em>pip install
soundfile</em>). To prepare the array into <em>input_values</em>, the <a href="/docs/transformers/pr_15839/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor">Wav2Vec2Processor</a> should be used for padding
and conversion into a tensor of type <em>torch.FloatTensor</em>. See <a href="/docs/transformers/pr_15839/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.Data2VecAudioForXVector.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing convolution and 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></p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/data2vec-audio-base-960h" rel="nofollow">data2vec-audio-base</a>, <code>attention_mask</code> should
<strong>not</strong> be passed to avoid degraded performance when doing batched inference. For such models
<code>input_values</code> should simply be padded with 0 and passed without <code>attention_mask</code>. Be aware that these
models also yield slightly different results depending on whether <code>input_values</code> is padded or not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.Data2VecAudioForXVector.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.Data2VecAudioForXVector.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.Data2VecAudioForXVector.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/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecAudioForXVector.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],returnDescription:`
<p>A <code>transformers.models.data2vec.modeling_data2vec_audio.XVectorOutput</code>or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecAudioConfig"
>Data2VecAudioConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.xvector_output_dim)</code>) \u2014 Classification hidden states before AMSoftmax.</p>
</li>
<li>
<p><strong>embeddings</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.xvector_output_dim)</code>) \u2014 Utterance embeddings used for vector similarity-based retrieval.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.data2vec.modeling_data2vec_audio.XVectorOutput</code>or <code>tuple(torch.FloatTensor)</code></p>
`}}),$t=new ge({props:{$$slots:{default:[Y2]},$$scope:{ctx:$}}}),Ko=new N({props:{code:`from transformers import Wav2Vec2FeatureExtractor, Data2VecAudioForXVector
from datasets import load_dataset
import torch

dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained("hf-internal-testing/tiny-random-data2vec-xvector")
model = Data2VecAudioForXVector.from_pretrained("hf-internal-testing/tiny-random-data2vec-xvector")

# audio file is decoded on the fly
inputs = feature_extractor(
    [d["array"] for d in dataset[:2]["audio"]], sampling_rate=sampling_rate, return_tensors="pt", padding=True
)
with torch.no_grad():
    embeddings = model(**inputs).embeddings

embeddings = torch.nn.functional.normalize(embeddings, dim=-1).cpu()

# the resulting embeddings can be used for cosine similarity-based retrieval
cosine_sim = torch.nn.CosineSimilarity(dim=-1)
similarity = cosine_sim(embeddings[0], embeddings[1])
threshold = 0.7  # the optimal threshold is dataset-dependent
if similarity < threshold:
    print("Speakers are not the same!")
round(similarity.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2FeatureExtractor, Data2VecAudioForXVector
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_demo&quot;</span>, <span class="hljs-string">&quot;clean&quot;</span>, split=<span class="hljs-string">&quot;validation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.sort(<span class="hljs-string">&quot;id&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>sampling_rate = dataset.features[<span class="hljs-string">&quot;audio&quot;</span>].sampling_rate

<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained(<span class="hljs-string">&quot;hf-internal-testing/tiny-random-data2vec-xvector&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecAudioForXVector.from_pretrained(<span class="hljs-string">&quot;hf-internal-testing/tiny-random-data2vec-xvector&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># audio file is decoded on the fly</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = feature_extractor(
<span class="hljs-meta">... </span>    [d[<span class="hljs-string">&quot;array&quot;</span>] <span class="hljs-keyword">for</span> d <span class="hljs-keyword">in</span> dataset[:<span class="hljs-number">2</span>][<span class="hljs-string">&quot;audio&quot;</span>]], sampling_rate=sampling_rate, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    embeddings = model(**inputs).embeddings

<span class="hljs-meta">&gt;&gt;&gt; </span>embeddings = torch.nn.functional.normalize(embeddings, dim=-<span class="hljs-number">1</span>).cpu()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the resulting embeddings can be used for cosine similarity-based retrieval</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>cosine_sim = torch.nn.CosineSimilarity(dim=-<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>similarity = cosine_sim(embeddings[<span class="hljs-number">0</span>], embeddings[<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>threshold = <span class="hljs-number">0.7</span>  <span class="hljs-comment"># the optimal threshold is dataset-dependent</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">if</span> similarity &lt; threshold:
<span class="hljs-meta">... </span>    <span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Speakers are not the same!&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(similarity.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">1.0</span>`}}),Yo=new B({}),Zo=new A({props:{name:"class transformers.Data2VecTextModel",anchor:"transformers.Data2VecTextModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_text.py#L700",parametersDescription:[{anchor:"transformers.Data2VecTextModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecTextConfig">Data2VecTextConfig</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/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),ia=new A({props:{name:"forward",anchor:"transformers.Data2VecTextModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",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:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = 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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_text.py#L744",parametersDescription:[{anchor:"transformers.Data2VecTextModel.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/roberta#transformers.RobertaTokenizer">RobertaTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Data2VecTextModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</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.Data2VecTextModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.Data2VecTextModel.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.Data2VecTextModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. 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.Data2VecTextModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 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. 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:"inputs_embeds"},{anchor:"transformers.Data2VecTextModel.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.Data2VecTextModel.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.Data2VecTextModel.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/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecTextModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.Data2VecTextModel.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.Data2VecTextModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up 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>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.Data2VecTextModel.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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecTextConfig"
>Data2VecTextConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 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>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ct=new ge({props:{$$slots:{default:[Z2]},$$scope:{ctx:$}}}),da=new N({props:{code:`from transformers import RobertaTokenizer, Data2VecTextModel
import torch

tokenizer = RobertaTokenizer.from_pretrained("facebook/data2vec-text-base")
model = Data2VecTextModel.from_pretrained("facebook/data2vec-text-base")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> RobertaTokenizer, Data2VecTextModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = RobertaTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecTextModel.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),la=new B({}),ca=new A({props:{name:"class transformers.Data2VecTextForCausalLM",anchor:"transformers.Data2VecTextForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_text.py#L885",parametersDescription:[{anchor:"transformers.Data2VecTextForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecTextConfig">Data2VecTextConfig</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/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),fa=new A({props:{name:"forward",anchor:"transformers.Data2VecTextForCausalLM.forward",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"labels",val:" = None"},{name:"past_key_values",val:" = None"},{name:"use_cache",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_text.py#L911",parametersDescription:[{anchor:"transformers.Data2VecTextForCausalLM.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/roberta#transformers.RobertaTokenizer">RobertaTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Data2VecTextForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</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.Data2VecTextForCausalLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.Data2VecTextForCausalLM.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.Data2VecTextForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. 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.Data2VecTextForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 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. 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:"inputs_embeds"},{anchor:"transformers.Data2VecTextForCausalLM.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.Data2VecTextForCausalLM.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.Data2VecTextForCausalLM.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/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecTextForCausalLM.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.Data2VecTextForCausalLM.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.Data2VecTextForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the left-to-right language modeling loss (next word prediction). Indices should be in
<code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are
ignored (masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.Data2VecTextForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up 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>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.Data2VecTextForCausalLM.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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecTextConfig"
>Data2VecTextConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key,
value states of the self-attention and the cross-attention layers if model is used in encoder-decoder
setting. Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),qt=new ge({props:{$$slots:{default:[ev]},$$scope:{ctx:$}}}),ga=new N({props:{code:`from transformers import Data2VecTextTokenizer, Data2VecTextForCausalLM, Data2VecTextConfig
import torch

tokenizer = Data2VecTextTokenizer.from_pretrained("facebook/data2vec-text-base")
config = Data2VecTextConfig.from_pretrained("data2vec-base")
config.is_decoder = True
model = Data2VecTextForCausalLM.from_pretrained("data2vec-base", config=config)

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

prediction_logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Data2VecTextTokenizer, Data2VecTextForCausalLM, Data2VecTextConfig
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = Data2VecTextTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>config = Data2VecTextConfig.from_pretrained(<span class="hljs-string">&quot;data2vec-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>config.is_decoder = <span class="hljs-literal">True</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecTextForCausalLM.from_pretrained(<span class="hljs-string">&quot;data2vec-base&quot;</span>, config=config)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>prediction_logits = outputs.logits`}}),_a=new B({}),va=new A({props:{name:"class transformers.Data2VecTextForMaskedLM",anchor:"transformers.Data2VecTextForMaskedLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_text.py#L1037",parametersDescription:[{anchor:"transformers.Data2VecTextForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecTextConfig">Data2VecTextConfig</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/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),ya=new A({props:{name:"forward",anchor:"transformers.Data2VecTextForMaskedLM.forward",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"labels",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_text.py#L1066",parametersDescription:[{anchor:"transformers.Data2VecTextForMaskedLM.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/roberta#transformers.RobertaTokenizer">RobertaTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Data2VecTextForMaskedLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</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.Data2VecTextForMaskedLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.Data2VecTextForMaskedLM.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.Data2VecTextForMaskedLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. 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.Data2VecTextForMaskedLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 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. 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:"inputs_embeds"},{anchor:"transformers.Data2VecTextForMaskedLM.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.Data2VecTextForMaskedLM.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.Data2VecTextForMaskedLM.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/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecTextForMaskedLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.Data2VecTextForMaskedLM.forward.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, any]</code>, optional, defaults to <em>{}</em>) &#x2014;
Used to hide legacy arguments that have been deprecated.`,name:"kwargs"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecTextConfig"
>Data2VecTextConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),zt=new ge({props:{$$slots:{default:[tv]},$$scope:{ctx:$}}}),xa=new N({props:{code:`from transformers import RobertaTokenizer, Data2VecTextForMaskedLM
import torch

tokenizer = RobertaTokenizer.from_pretrained("facebook/data2vec-text-base")
model = Data2VecTextForMaskedLM.from_pretrained("facebook/data2vec-text-base")

inputs = tokenizer("The capital of France is <mask>.", return_tensors="pt")
labels = tokenizer("The capital of France is Paris.", return_tensors="pt")["input_ids"]

outputs = model(**inputs, labels=labels)
loss = outputs.loss
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> RobertaTokenizer, Data2VecTextForMaskedLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = RobertaTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecTextForMaskedLM.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The capital of France is &lt;mask&gt;.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tokenizer(<span class="hljs-string">&quot;The capital of France is Paris.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),Da=new B({}),Va=new A({props:{name:"class transformers.Data2VecTextForSequenceClassification",anchor:"transformers.Data2VecTextForSequenceClassification",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_text.py#L1167",parametersDescription:[{anchor:"transformers.Data2VecTextForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecTextConfig">Data2VecTextConfig</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/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),qa=new A({props:{name:"forward",anchor:"transformers.Data2VecTextForSequenceClassification.forward",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"labels",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_text.py#L1181",parametersDescription:[{anchor:"transformers.Data2VecTextForSequenceClassification.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/roberta#transformers.RobertaTokenizer">RobertaTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Data2VecTextForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</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.Data2VecTextForSequenceClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.Data2VecTextForSequenceClassification.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.Data2VecTextForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. 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.Data2VecTextForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 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. 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:"inputs_embeds"},{anchor:"transformers.Data2VecTextForSequenceClassification.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.Data2VecTextForSequenceClassification.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.Data2VecTextForSequenceClassification.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/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecTextForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecTextConfig"
>Data2VecTextConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Pt=new ge({props:{$$slots:{default:[ov]},$$scope:{ctx:$}}}),ja=new N({props:{code:`import torch
from transformers import RobertaTokenizer, Data2VecTextForSequenceClassification

torch.manual_seed(0)
tokenizer = RobertaTokenizer.from_pretrained("facebook/data2vec-text-base")
model = Data2VecTextForSequenceClassification.from_pretrained("facebook/data2vec-text-base", num_labels=2)

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
labels = torch.tensor([1]).unsqueeze(0)  # Batch size 1
outputs = model(**inputs, labels=labels)
loss = outputs.loss
logits = outputs.logits
list(logits.shape)
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> RobertaTokenizer, Data2VecTextForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>torch.manual_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = RobertaTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecTextForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>, num_labels=<span class="hljs-number">2</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>]).unsqueeze(<span class="hljs-number">0</span>)  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
`}}),za=new N({props:{code:`import torch
from transformers import RobertaTokenizer, Data2VecTextForSequenceClassification

torch.manual_seed(0)
tokenizer = RobertaTokenizer.from_pretrained("facebook/data2vec-text-base")
model = Data2VecTextForSequenceClassification.from_pretrained("facebook/data2vec-text-base", problem_type="multi_label_classification", num_labels=2)

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
labels = torch.tensor([[1, 1]], dtype=torch.float)  # need dtype=float for BCEWithLogitsLoss
outputs = model(**inputs, labels=labels)
loss = outputs.loss
list(logits.shape)
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> RobertaTokenizer, Data2VecTextForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>torch.manual_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = RobertaTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecTextForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>, num_labels=<span class="hljs-number">2</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([[<span class="hljs-number">1</span>, <span class="hljs-number">1</span>]], dtype=torch.<span class="hljs-built_in">float</span>)  <span class="hljs-comment"># need dtype=float for BCEWithLogitsLoss</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
`}}),Ea=new B({}),Pa=new A({props:{name:"class transformers.Data2VecTextForMultipleChoice",anchor:"transformers.Data2VecTextForMultipleChoice",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_text.py#L1265",parametersDescription:[{anchor:"transformers.Data2VecTextForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecTextConfig">Data2VecTextConfig</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/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),Oa=new A({props:{name:"forward",anchor:"transformers.Data2VecTextForMultipleChoice.forward",parameters:[{name:"input_ids",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"labels",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_text.py#L1278",parametersDescription:[{anchor:"transformers.Data2VecTextForMultipleChoice.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/roberta#transformers.RobertaTokenizer">RobertaTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Data2VecTextForMultipleChoice.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, 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.Data2VecTextForMultipleChoice.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.Data2VecTextForMultipleChoice.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, 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.Data2VecTextForMultipleChoice.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. 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.Data2VecTextForMultipleChoice.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, 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. 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:"inputs_embeds"},{anchor:"transformers.Data2VecTextForMultipleChoice.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.Data2VecTextForMultipleChoice.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.Data2VecTextForMultipleChoice.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/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecTextForMultipleChoice.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the multiple choice classification loss. Indices should be in <code>[0, ..., num_choices-1]</code> where <code>num_choices</code> is the size of the second dimension of the input tensors. (See
<code>input_ids</code> above)`,name:"labels"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecTextConfig"
>Data2VecTextConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <em>(1,)</em>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices)</code>) \u2014 <em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Lt=new ge({props:{$$slots:{default:[av]},$$scope:{ctx:$}}}),Ba=new N({props:{code:`from transformers import RobertaTokenizer, Data2VecTextForMultipleChoice
import torch

tokenizer = RobertaTokenizer.from_pretrained("facebook/data2vec-text-base")
model = Data2VecTextForMultipleChoice.from_pretrained("facebook/data2vec-text-base")

prompt = "In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced."
choice0 = "It is eaten with a fork and a knife."
choice1 = "It is eaten while held in the hand."
labels = torch.tensor(0).unsqueeze(0)  # choice0 is correct (according to Wikipedia ;)), batch size 1

encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors="pt", padding=True)
outputs = model(**{k: v.unsqueeze(0) for k, v in encoding.items()}, labels=labels)  # batch size is 1

# the linear classifier still needs to be trained
loss = outputs.loss
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> RobertaTokenizer, Data2VecTextForMultipleChoice
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = RobertaTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecTextForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice0 = <span class="hljs-string">&quot;It is eaten with a fork and a knife.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice1 = <span class="hljs-string">&quot;It is eaten while held in the hand.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor(<span class="hljs-number">0</span>).unsqueeze(<span class="hljs-number">0</span>)  <span class="hljs-comment"># choice0 is correct (according to Wikipedia ;)), batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**{k: v.unsqueeze(<span class="hljs-number">0</span>) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> encoding.items()}, labels=labels)  <span class="hljs-comment"># batch size is 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the linear classifier still needs to be trained</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),Ha=new B({}),Ra=new A({props:{name:"class transformers.Data2VecTextForTokenClassification",anchor:"transformers.Data2VecTextForTokenClassification",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_text.py#L1360",parametersDescription:[{anchor:"transformers.Data2VecTextForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecTextConfig">Data2VecTextConfig</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/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),Ka=new A({props:{name:"forward",anchor:"transformers.Data2VecTextForTokenClassification.forward",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"labels",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_text.py#L1378",parametersDescription:[{anchor:"transformers.Data2VecTextForTokenClassification.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/roberta#transformers.RobertaTokenizer">RobertaTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Data2VecTextForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</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.Data2VecTextForTokenClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.Data2VecTextForTokenClassification.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.Data2VecTextForTokenClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. 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.Data2VecTextForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 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. 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:"inputs_embeds"},{anchor:"transformers.Data2VecTextForTokenClassification.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.Data2VecTextForTokenClassification.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.Data2VecTextForTokenClassification.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/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecTextForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecTextConfig"
>Data2VecTextConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Wt=new ge({props:{$$slots:{default:[nv]},$$scope:{ctx:$}}}),Ya=new N({props:{code:`from transformers import RobertaTokenizer, Data2VecTextForTokenClassification
import torch

tokenizer = RobertaTokenizer.from_pretrained("facebook/data2vec-text-base")
model = Data2VecTextForTokenClassification.from_pretrained("facebook/data2vec-text-base")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
labels = torch.tensor([1] * inputs["input_ids"].size(1)).unsqueeze(0)  # Batch size 1

outputs = model(**inputs, labels=labels)
loss = outputs.loss
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> RobertaTokenizer, Data2VecTextForTokenClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = RobertaTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecTextForTokenClassification.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>] * inputs[<span class="hljs-string">&quot;input_ids&quot;</span>].size(<span class="hljs-number">1</span>)).unsqueeze(<span class="hljs-number">0</span>)  <span class="hljs-comment"># Batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),Za=new B({}),en=new A({props:{name:"class transformers.Data2VecTextForQuestionAnswering",anchor:"transformers.Data2VecTextForQuestionAnswering",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_text.py#L1468",parametersDescription:[{anchor:"transformers.Data2VecTextForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecTextConfig">Data2VecTextConfig</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/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),rn=new A({props:{name:"forward",anchor:"transformers.Data2VecTextForQuestionAnswering.forward",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"start_positions",val:" = None"},{name:"end_positions",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/data2vec/modeling_data2vec_text.py#L1482",parametersDescription:[{anchor:"transformers.Data2VecTextForQuestionAnswering.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/roberta#transformers.RobertaTokenizer">RobertaTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Data2VecTextForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</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.Data2VecTextForQuestionAnswering.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.Data2VecTextForQuestionAnswering.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.Data2VecTextForQuestionAnswering.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. 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.Data2VecTextForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 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. 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:"inputs_embeds"},{anchor:"transformers.Data2VecTextForQuestionAnswering.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.Data2VecTextForQuestionAnswering.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.Data2VecTextForQuestionAnswering.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/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecTextForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.Data2VecTextForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecTextConfig"
>Data2VecTextConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ot=new ge({props:{$$slots:{default:[sv]},$$scope:{ctx:$}}}),dn=new N({props:{code:`from transformers import RobertaTokenizer, Data2VecTextForQuestionAnswering
import torch

torch.manual_seed(0)
tokenizer = RobertaTokenizer.from_pretrained("facebook/data2vec-text-base")
model = Data2VecTextForQuestionAnswering.from_pretrained("facebook/data2vec-text-base")

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"
inputs = tokenizer(question, text, return_tensors="pt")
start_positions = torch.tensor([1])
end_positions = torch.tensor([3])

outputs = model(**inputs, start_positions=start_positions, end_positions=end_positions)
loss = outputs.loss
round(loss.item(), 2)


start_scores = outputs.start_logits
list(start_scores.shape)


end_scores = outputs.end_logits
list(end_scores.shape)
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> RobertaTokenizer, Data2VecTextForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>torch.manual_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = RobertaTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecTextForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>question, text = <span class="hljs-string">&quot;Who was Jim Henson?&quot;</span>, <span class="hljs-string">&quot;Jim Henson was a nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(question, text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>start_positions = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>end_positions = torch.tensor([<span class="hljs-number">3</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=start_positions, end_positions=end_positions)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span>start_scores = outputs.start_logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(start_scores.shape)


<span class="hljs-meta">&gt;&gt;&gt; </span>end_scores = outputs.end_logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(end_scores.shape)
`}}),{c(){p=s("meta"),x=l(),m=s("h1"),y=s("a"),D=s("span"),_(g.$$.fragment),u=l(),V=s("span"),xd=a("Data2Vec"),Qr=l(),ze=s("h2"),mt=s("a"),ms=s("span"),_(Ht.$$.fragment),Dd=l(),fs=s("span"),Vd=a("Overview"),Gr=l(),ft=s("p"),$d=a("The Data2Vec model was proposed in "),Rt=s("a"),Ad=a("data2vec: A General Framework for Self-supervised Learning in Speech, Vision and Language"),Fd=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and Michael Auli.
Data2Vec proposes a unified framework for self-supervised learning across different data modalities - text, audio and images.
Importantly, predicted targets for pre-training are contextualized latent representations of the inputs, rather than modality-specific, context-independent targets.`),Xr=l(),hn=s("p"),Cd=a("The abstract from the paper is the following:"),Ur=l(),un=s("p"),Qt=s("em"),Md=a(`While the general idea of self-supervised learning is identical across modalities, the actual algorithms and
objectives differ widely because they were developed with a single modality in mind. To get us closer to general
self-supervised learning, we present data2vec, a framework that uses the same learning method for either speech,
NLP or computer vision. The core idea is to predict latent representations of the full input data based on a
masked view of the input in a selfdistillation setup using a standard Transformer architecture.
Instead of predicting modality-specific targets such as words, visual tokens or units of human speech which
are local in nature, data2vec predicts contextualized latent representations that contain information from
the entire input. Experiments on the major benchmarks of speech recognition, image classification, and
natural language understanding demonstrate a new state of the art or competitive performance to predominant approaches.
Models and code are available at `),Gt=s("a"),qd=a("www.github.com/pytorch/fairseq/tree/master/examples/data2vec"),jd=a("."),Jr=l(),mn=s("p"),zd=a("Tips:"),Kr=l(),fn=s("ul"),Xt=s("li"),Ed=a(`Both Data2VecAudio and Data2VecText have been trained using the same self-supervised learning method.
In the case of Data2VecAudio, preprocessing is identical to `),gn=s("a"),Pd=a("RobertaModel"),Sd=a(", including tokenization."),Yr=l(),ve=s("p"),Ld=a("This model was contributed by "),Ut=s("a"),Nd=a("edugp"),Wd=a(`.
The original code can be found `),Jt=s("a"),Id=a("here"),Od=a("."),Zr=l(),Ee=s("h2"),gt=s("a"),gs=s("span"),_(Kt.$$.fragment),Bd=l(),_s=s("span"),Hd=a("Data2VecTextConfig"),ei=l(),H=s("div"),_(Yt.$$.fragment),Rd=l(),_e=s("p"),Qd=a("This is the configuration class to store the configuration of a "),_n=s("a"),Gd=a("Data2VecTextModel"),Xd=a(" and "),vn=s("a"),Ud=a("Data2VecTextModel"),Jd=a(`. It
is used to instantiate a Data2VecText 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 Data2VecText
`),Zt=s("a"),Kd=a("facebook/data2vec-text-base"),Yd=a(" architecture."),Zd=l(),Pe=s("p"),el=a("Configuration objects inherit from "),bn=s("a"),tl=a("PretrainedConfig"),ol=a(` and can be used to control the model outputs. Read the
documentation from `),Tn=s("a"),al=a("PretrainedConfig"),nl=a(" for more information."),sl=l(),vs=s("p"),rl=a("Examples:"),il=l(),_(eo.$$.fragment),ti=l(),Se=s("h2"),_t=s("a"),bs=s("span"),_(to.$$.fragment),dl=l(),Ts=s("span"),ll=a("Data2VecAudioConfig"),oi=l(),R=s("div"),_(oo.$$.fragment),cl=l(),Le=s("p"),pl=a("This is the configuration class to store the configuration of a "),kn=s("a"),hl=a("Data2VecAudioModel"),ul=a(`. It is used to instantiate
an Data2VecAudio 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 Data2VecAudio
`),ao=s("a"),ml=a("facebook/data2vec-audio-base-960h"),fl=a(" architecture."),gl=l(),Ne=s("p"),_l=a("Configuration objects inherit from "),wn=s("a"),vl=a("PretrainedConfig"),bl=a(` and can be used to control the model outputs. Read the
documentation from `),yn=s("a"),Tl=a("PretrainedConfig"),kl=a(" for more information."),wl=l(),ks=s("p"),yl=a("Example:"),xl=l(),_(no.$$.fragment),ai=l(),We=s("h2"),vt=s("a"),ws=s("span"),_(so.$$.fragment),Dl=l(),ys=s("span"),Vl=a("Data2VecAudioModel"),ni=l(),Q=s("div"),_(ro.$$.fragment),$l=l(),io=s("p"),Al=a(`The bare Data2VecAudio Model transformer outputting raw hidden-states without any specific head on top.
Data2VecAudio was proposed in `),lo=s("a"),Fl=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),Cl=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),Ml=l(),co=s("p"),ql=a("This model inherits from "),xn=s("a"),jl=a("PreTrainedModel"),zl=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),El=l(),po=s("p"),Pl=a("This model is a PyTorch "),ho=s("a"),Sl=a("torch.nn.Module"),Ll=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Nl=l(),J=s("div"),_(uo.$$.fragment),Wl=l(),Ie=s("p"),Il=a("The "),Dn=s("a"),Ol=a("Data2VecAudioModel"),Bl=a(" forward method, overrides the "),xs=s("code"),Hl=a("__call__"),Rl=a(" special method."),Ql=l(),_(bt.$$.fragment),Gl=l(),Ds=s("p"),Xl=a("Example:"),Ul=l(),_(mo.$$.fragment),si=l(),Oe=s("h2"),Tt=s("a"),Vs=s("span"),_(fo.$$.fragment),Jl=l(),$s=s("span"),Kl=a("Data2VecAudioForAudioFrameClassification"),ri=l(),M=s("div"),_(go.$$.fragment),Yl=l(),As=s("p"),Zl=a("Data2VecAudio Model with a frame classification head on top for tasks like Speaker Diarization."),ec=l(),_o=s("p"),tc=a("Data2VecAudio was proposed in "),vo=s("a"),oc=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),ac=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),nc=l(),bo=s("p"),sc=a("This model inherits from "),Vn=s("a"),rc=a("PreTrainedModel"),ic=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),dc=l(),To=s("p"),lc=a("This model is a PyTorch "),ko=s("a"),cc=a("torch.nn.Module"),pc=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),hc=l(),K=s("div"),_(wo.$$.fragment),uc=l(),Be=s("p"),mc=a("The "),$n=s("a"),fc=a("Data2VecAudioForAudioFrameClassification"),gc=a(" forward method, overrides the "),Fs=s("code"),_c=a("__call__"),vc=a(" special method."),bc=l(),_(kt.$$.fragment),Tc=l(),Cs=s("p"),kc=a("Example:"),wc=l(),_(yo.$$.fragment),ii=l(),He=s("h2"),wt=s("a"),Ms=s("span"),_(xo.$$.fragment),yc=l(),qs=s("span"),xc=a("Data2VecAudioForCTC"),di=l(),G=s("div"),_(Do.$$.fragment),Dc=l(),Re=s("p"),Vc=a("Data2VecAudio Model with a "),js=s("code"),$c=a("language modeling"),Ac=a(` head on top for Connectionist Temporal Classification (CTC).
Data2VecAudio was proposed in `),Vo=s("a"),Fc=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),Cc=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),Mc=l(),$o=s("p"),qc=a("This model inherits from "),An=s("a"),jc=a("PreTrainedModel"),zc=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Ec=l(),Ao=s("p"),Pc=a("This model is a PyTorch "),Fo=s("a"),Sc=a("torch.nn.Module"),Lc=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Nc=l(),W=s("div"),_(Co.$$.fragment),Wc=l(),Qe=s("p"),Ic=a("The "),Fn=s("a"),Oc=a("Data2VecAudioForCTC"),Bc=a(" forward method, overrides the "),zs=s("code"),Hc=a("__call__"),Rc=a(" special method."),Qc=l(),_(yt.$$.fragment),Gc=l(),Es=s("p"),Xc=a("Example:"),Uc=l(),_(Mo.$$.fragment),Jc=l(),_(qo.$$.fragment),li=l(),Ge=s("h2"),xt=s("a"),Ps=s("span"),_(jo.$$.fragment),Kc=l(),Ss=s("span"),Yc=a("Data2VecAudioForSequenceClassification"),ci=l(),q=s("div"),_(zo.$$.fragment),Zc=l(),Ls=s("p"),ep=a(`Data2VecAudio Model with a sequence classification head on top (a linear layer over the pooled output) for tasks
like SUPERB Keyword Spotting.`),tp=l(),Eo=s("p"),op=a("Data2VecAudio was proposed in "),Po=s("a"),ap=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),np=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),sp=l(),So=s("p"),rp=a("This model inherits from "),Cn=s("a"),ip=a("PreTrainedModel"),dp=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),lp=l(),Lo=s("p"),cp=a("This model is a PyTorch "),No=s("a"),pp=a("torch.nn.Module"),hp=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),up=l(),I=s("div"),_(Wo.$$.fragment),mp=l(),Xe=s("p"),fp=a("The "),Mn=s("a"),gp=a("Data2VecAudioForSequenceClassification"),_p=a(" forward method, overrides the "),Ns=s("code"),vp=a("__call__"),bp=a(" special method."),Tp=l(),_(Dt.$$.fragment),kp=l(),Ws=s("p"),wp=a("Example:"),yp=l(),_(Io.$$.fragment),xp=l(),_(Oo.$$.fragment),pi=l(),Ue=s("h2"),Vt=s("a"),Is=s("span"),_(Bo.$$.fragment),Dp=l(),Os=s("span"),Vp=a("Data2VecAudioForXVector"),hi=l(),j=s("div"),_(Ho.$$.fragment),$p=l(),Bs=s("p"),Ap=a("Data2VecAudio Model with an XVector feature extraction head on top for tasks like Speaker Verification."),Fp=l(),Ro=s("p"),Cp=a("Data2VecAudio was proposed in "),Qo=s("a"),Mp=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),qp=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),jp=l(),Go=s("p"),zp=a("This model inherits from "),qn=s("a"),Ep=a("PreTrainedModel"),Pp=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Sp=l(),Xo=s("p"),Lp=a("This model is a PyTorch "),Uo=s("a"),Np=a("torch.nn.Module"),Wp=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ip=l(),Y=s("div"),_(Jo.$$.fragment),Op=l(),Je=s("p"),Bp=a("The "),jn=s("a"),Hp=a("Data2VecAudioForXVector"),Rp=a(" forward method, overrides the "),Hs=s("code"),Qp=a("__call__"),Gp=a(" special method."),Xp=l(),_($t.$$.fragment),Up=l(),Rs=s("p"),Jp=a("Example:"),Kp=l(),_(Ko.$$.fragment),ui=l(),Ke=s("h2"),At=s("a"),Qs=s("span"),_(Yo.$$.fragment),Yp=l(),Gs=s("span"),Zp=a("Data2VecTextModel"),mi=l(),F=s("div"),_(Zo.$$.fragment),eh=l(),ea=s("p"),th=a(`The bare Data2VecText Model for text transformer outputting raw hidden-states without any specific head on top.
Data2VecText was proposed in `),ta=s("a"),oh=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),ah=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),nh=l(),oa=s("p"),sh=a("This model inherits from "),zn=s("a"),rh=a("PreTrainedModel"),ih=a(`. 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.)`),dh=l(),aa=s("p"),lh=a("This model is also a PyTorch "),na=s("a"),ch=a("torch.nn.Module"),ph=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),hh=l(),sa=s("p"),uh=a(`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),Xs=s("em"),mh=a(`Attention is
all you need`),fh=a(`_ by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz
Kaiser and Illia Polosukhin.`),gh=l(),z=s("p"),_h=a("To behave as an decoder the model needs to be initialized with the "),Us=s("code"),vh=a("is_decoder"),bh=a(` argument of the configuration set
to `),Js=s("code"),Th=a("True"),kh=a(". To be used in a Seq2Seq model, the model needs to initialized with both "),Ks=s("code"),wh=a("is_decoder"),yh=a(` argument and
`),Ys=s("code"),xh=a("add_cross_attention"),Dh=a(" set to "),Zs=s("code"),Vh=a("True"),$h=a("; an "),er=s("code"),Ah=a("encoder_hidden_states"),Fh=a(" is then expected as an input to the forward pass."),Ch=l(),Ft=s("p"),Mh=a(".. _"),tr=s("em"),qh=a("Attention is all you need"),jh=a(": "),ra=s("a"),zh=a("https://arxiv.org/abs/1706.03762"),Eh=l(),Z=s("div"),_(ia.$$.fragment),Ph=l(),Ye=s("p"),Sh=a("The "),En=s("a"),Lh=a("Data2VecTextModel"),Nh=a(" forward method, overrides the "),or=s("code"),Wh=a("__call__"),Ih=a(" special method."),Oh=l(),_(Ct.$$.fragment),Bh=l(),ar=s("p"),Hh=a("Example:"),Rh=l(),_(da.$$.fragment),fi=l(),Ze=s("h2"),Mt=s("a"),nr=s("span"),_(la.$$.fragment),Qh=l(),sr=s("span"),Gh=a("Data2VecTextForCausalLM"),gi=l(),X=s("div"),_(ca.$$.fragment),Xh=l(),et=s("p"),Uh=a("Data2VecText Model with a "),rr=s("code"),Jh=a("language modeling"),Kh=a(` head on top for CLM fine-tuning.
Data2VecText was proposed in `),pa=s("a"),Yh=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),Zh=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),eu=l(),ha=s("p"),tu=a("This model inherits from "),Pn=s("a"),ou=a("PreTrainedModel"),au=a(`. 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.)`),nu=l(),ua=s("p"),su=a("This model is also a PyTorch "),ma=s("a"),ru=a("torch.nn.Module"),iu=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),du=l(),ee=s("div"),_(fa.$$.fragment),lu=l(),tt=s("p"),cu=a("The "),Sn=s("a"),pu=a("Data2VecTextForCausalLM"),hu=a(" forward method, overrides the "),ir=s("code"),uu=a("__call__"),mu=a(" special method."),fu=l(),_(qt.$$.fragment),gu=l(),dr=s("p"),_u=a("Example:"),vu=l(),_(ga.$$.fragment),_i=l(),ot=s("h2"),jt=s("a"),lr=s("span"),_(_a.$$.fragment),bu=l(),cr=s("span"),Tu=a("Data2VecTextForMaskedLM"),vi=l(),U=s("div"),_(va.$$.fragment),ku=l(),at=s("p"),wu=a("data2vec Model with a "),pr=s("code"),yu=a("language modeling"),xu=a(` head on top.
Data2VecText was proposed in `),ba=s("a"),Du=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),Vu=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),$u=l(),Ta=s("p"),Au=a("This model inherits from "),Ln=s("a"),Fu=a("PreTrainedModel"),Cu=a(`. 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.)`),Mu=l(),ka=s("p"),qu=a("This model is also a PyTorch "),wa=s("a"),ju=a("torch.nn.Module"),zu=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Eu=l(),te=s("div"),_(ya.$$.fragment),Pu=l(),nt=s("p"),Su=a("The "),Nn=s("a"),Lu=a("Data2VecTextForMaskedLM"),Nu=a(" forward method, overrides the "),hr=s("code"),Wu=a("__call__"),Iu=a(" special method."),Ou=l(),_(zt.$$.fragment),Bu=l(),ur=s("p"),Hu=a("Example:"),Ru=l(),_(xa.$$.fragment),bi=l(),st=s("h2"),Et=s("a"),mr=s("span"),_(Da.$$.fragment),Qu=l(),fr=s("span"),Gu=a("Data2VecTextForSequenceClassification"),Ti=l(),E=s("div"),_(Va.$$.fragment),Xu=l(),gr=s("p"),Uu=a(`Data2VecText Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),Ju=l(),$a=s("p"),Ku=a("Data2VecText was proposed in "),Aa=s("a"),Yu=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),Zu=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),em=l(),Fa=s("p"),tm=a("This model inherits from "),Wn=s("a"),om=a("PreTrainedModel"),am=a(`. 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.)`),nm=l(),Ca=s("p"),sm=a("This model is also a PyTorch "),Ma=s("a"),rm=a("torch.nn.Module"),im=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),dm=l(),C=s("div"),_(qa.$$.fragment),lm=l(),rt=s("p"),cm=a("The "),In=s("a"),pm=a("Data2VecTextForSequenceClassification"),hm=a(" forward method, overrides the "),_r=s("code"),um=a("__call__"),mm=a(" special method."),fm=l(),_(Pt.$$.fragment),gm=l(),vr=s("p"),_m=a("Example of single-label classification:"),vm=l(),_(ja.$$.fragment),bm=l(),br=s("p"),Tm=a("Example of multi-label classification:"),km=l(),_(za.$$.fragment),ki=l(),it=s("h2"),St=s("a"),Tr=s("span"),_(Ea.$$.fragment),wm=l(),kr=s("span"),ym=a("Data2VecTextForMultipleChoice"),wi=l(),P=s("div"),_(Pa.$$.fragment),xm=l(),wr=s("p"),Dm=a(`Data2VecText Model with a multiple choice classification head on top (a linear layer on top of the pooled output
and a softmax) e.g. for RocStories/SWAG tasks.`),Vm=l(),Sa=s("p"),$m=a("Data2VecText was proposed in "),La=s("a"),Am=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),Fm=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),Cm=l(),Na=s("p"),Mm=a("This model inherits from "),On=s("a"),qm=a("PreTrainedModel"),jm=a(`. 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.)`),zm=l(),Wa=s("p"),Em=a("This model is also a PyTorch "),Ia=s("a"),Pm=a("torch.nn.Module"),Sm=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Lm=l(),oe=s("div"),_(Oa.$$.fragment),Nm=l(),dt=s("p"),Wm=a("The "),Bn=s("a"),Im=a("Data2VecTextForMultipleChoice"),Om=a(" forward method, overrides the "),yr=s("code"),Bm=a("__call__"),Hm=a(" special method."),Rm=l(),_(Lt.$$.fragment),Qm=l(),xr=s("p"),Gm=a("Example:"),Xm=l(),_(Ba.$$.fragment),yi=l(),lt=s("h2"),Nt=s("a"),Dr=s("span"),_(Ha.$$.fragment),Um=l(),Vr=s("span"),Jm=a("Data2VecTextForTokenClassification"),xi=l(),S=s("div"),_(Ra.$$.fragment),Km=l(),$r=s("p"),Ym=a(`Data2VecText Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g.
for Named-Entity-Recognition (NER) tasks.`),Zm=l(),Qa=s("p"),ef=a("Data2VecText was proposed in "),Ga=s("a"),tf=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),of=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),af=l(),Xa=s("p"),nf=a("This model inherits from "),Hn=s("a"),sf=a("PreTrainedModel"),rf=a(`. 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.)`),df=l(),Ua=s("p"),lf=a("This model is also a PyTorch "),Ja=s("a"),cf=a("torch.nn.Module"),pf=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),hf=l(),ae=s("div"),_(Ka.$$.fragment),uf=l(),ct=s("p"),mf=a("The "),Rn=s("a"),ff=a("Data2VecTextForTokenClassification"),gf=a(" forward method, overrides the "),Ar=s("code"),_f=a("__call__"),vf=a(" special method."),bf=l(),_(Wt.$$.fragment),Tf=l(),Fr=s("p"),kf=a("Example:"),wf=l(),_(Ya.$$.fragment),Di=l(),pt=s("h2"),It=s("a"),Cr=s("span"),_(Za.$$.fragment),yf=l(),Mr=s("span"),xf=a("Data2VecTextForQuestionAnswering"),Vi=l(),L=s("div"),_(en.$$.fragment),Df=l(),ht=s("p"),Vf=a(`Data2VecText Model with a span classification head on top for extractive question-answering tasks like SQuAD (a
linear layers on top of the hidden-states output to compute `),qr=s("code"),$f=a("span start logits"),Af=a(" and "),jr=s("code"),Ff=a("span end logits"),Cf=a(")."),Mf=l(),tn=s("p"),qf=a("Data2VecText was proposed in "),on=s("a"),jf=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),zf=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),Ef=l(),an=s("p"),Pf=a("This model inherits from "),Qn=s("a"),Sf=a("PreTrainedModel"),Lf=a(`. 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.)`),Nf=l(),nn=s("p"),Wf=a("This model is also a PyTorch "),sn=s("a"),If=a("torch.nn.Module"),Of=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Bf=l(),ne=s("div"),_(rn.$$.fragment),Hf=l(),ut=s("p"),Rf=a("The "),Gn=s("a"),Qf=a("Data2VecTextForQuestionAnswering"),Gf=a(" forward method, overrides the "),zr=s("code"),Xf=a("__call__"),Uf=a(" special method."),Jf=l(),_(Ot.$$.fragment),Kf=l(),Er=s("p"),Yf=a("Example:"),Zf=l(),_(dn.$$.fragment),this.h()},l(t){const h=G2('[data-svelte="svelte-1phssyn"]',document.head);p=r(h,"META",{name:!0,content:!0}),h.forEach(o),x=c(t),m=r(t,"H1",{class:!0});var ln=i(m);y=r(ln,"A",{id:!0,class:!0,href:!0});var Pr=i(y);D=r(Pr,"SPAN",{});var Sr=i(D);v(g.$$.fragment,Sr),Sr.forEach(o),Pr.forEach(o),u=c(ln),V=r(ln,"SPAN",{});var Lr=i(V);xd=n(Lr,"Data2Vec"),Lr.forEach(o),ln.forEach(o),Qr=c(t),ze=r(t,"H2",{class:!0});var cn=i(ze);mt=r(cn,"A",{id:!0,class:!0,href:!0});var Nr=i(mt);ms=r(Nr,"SPAN",{});var Wr=i(ms);v(Ht.$$.fragment,Wr),Wr.forEach(o),Nr.forEach(o),Dd=c(cn),fs=r(cn,"SPAN",{});var Ir=i(fs);Vd=n(Ir,"Overview"),Ir.forEach(o),cn.forEach(o),Gr=c(t),ft=r(t,"P",{});var pn=i(ft);$d=n(pn,"The Data2Vec model was proposed in "),Rt=r(pn,"A",{href:!0,rel:!0});var Or=i(Rt);Ad=n(Or,"data2vec: A General Framework for Self-supervised Learning in Speech, Vision and Language"),Or.forEach(o),Fd=n(pn,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and Michael Auli.
Data2Vec proposes a unified framework for self-supervised learning across different data modalities - text, audio and images.
Importantly, predicted targets for pre-training are contextualized latent representations of the inputs, rather than modality-specific, context-independent targets.`),pn.forEach(o),Xr=c(t),hn=r(t,"P",{});var Br=i(hn);Cd=n(Br,"The abstract from the paper is the following:"),Br.forEach(o),Ur=c(t),un=r(t,"P",{});var Hr=i(un);Qt=r(Hr,"EM",{});var Ai=i(Qt);Md=n(Ai,`While the general idea of self-supervised learning is identical across modalities, the actual algorithms and
objectives differ widely because they were developed with a single modality in mind. To get us closer to general
self-supervised learning, we present data2vec, a framework that uses the same learning method for either speech,
NLP or computer vision. The core idea is to predict latent representations of the full input data based on a
masked view of the input in a selfdistillation setup using a standard Transformer architecture.
Instead of predicting modality-specific targets such as words, visual tokens or units of human speech which
are local in nature, data2vec predicts contextualized latent representations that contain information from
the entire input. Experiments on the major benchmarks of speech recognition, image classification, and
natural language understanding demonstrate a new state of the art or competitive performance to predominant approaches.
Models and code are available at `),Gt=r(Ai,"A",{href:!0,rel:!0});var eg=i(Gt);qd=n(eg,"www.github.com/pytorch/fairseq/tree/master/examples/data2vec"),eg.forEach(o),jd=n(Ai,"."),Ai.forEach(o),Hr.forEach(o),Jr=c(t),mn=r(t,"P",{});var tg=i(mn);zd=n(tg,"Tips:"),tg.forEach(o),Kr=c(t),fn=r(t,"UL",{});var og=i(fn);Xt=r(og,"LI",{});var Fi=i(Xt);Ed=n(Fi,`Both Data2VecAudio and Data2VecText have been trained using the same self-supervised learning method.
In the case of Data2VecAudio, preprocessing is identical to `),gn=r(Fi,"A",{href:!0});var ag=i(gn);Pd=n(ag,"RobertaModel"),ag.forEach(o),Sd=n(Fi,", including tokenization."),Fi.forEach(o),og.forEach(o),Yr=c(t),ve=r(t,"P",{});var Xn=i(ve);Ld=n(Xn,"This model was contributed by "),Ut=r(Xn,"A",{href:!0,rel:!0});var ng=i(Ut);Nd=n(ng,"edugp"),ng.forEach(o),Wd=n(Xn,`.
The original code can be found `),Jt=r(Xn,"A",{href:!0,rel:!0});var sg=i(Jt);Id=n(sg,"here"),sg.forEach(o),Od=n(Xn,"."),Xn.forEach(o),Zr=c(t),Ee=r(t,"H2",{class:!0});var Ci=i(Ee);gt=r(Ci,"A",{id:!0,class:!0,href:!0});var rg=i(gt);gs=r(rg,"SPAN",{});var ig=i(gs);v(Kt.$$.fragment,ig),ig.forEach(o),rg.forEach(o),Bd=c(Ci),_s=r(Ci,"SPAN",{});var dg=i(_s);Hd=n(dg,"Data2VecTextConfig"),dg.forEach(o),Ci.forEach(o),ei=c(t),H=r(t,"DIV",{class:!0});var be=i(H);v(Yt.$$.fragment,be),Rd=c(be),_e=r(be,"P",{});var Bt=i(_e);Qd=n(Bt,"This is the configuration class to store the configuration of a "),_n=r(Bt,"A",{href:!0});var lg=i(_n);Gd=n(lg,"Data2VecTextModel"),lg.forEach(o),Xd=n(Bt," and "),vn=r(Bt,"A",{href:!0});var cg=i(vn);Ud=n(cg,"Data2VecTextModel"),cg.forEach(o),Jd=n(Bt,`. It
is used to instantiate a Data2VecText 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 Data2VecText
`),Zt=r(Bt,"A",{href:!0,rel:!0});var pg=i(Zt);Kd=n(pg,"facebook/data2vec-text-base"),pg.forEach(o),Yd=n(Bt," architecture."),Bt.forEach(o),Zd=c(be),Pe=r(be,"P",{});var Un=i(Pe);el=n(Un,"Configuration objects inherit from "),bn=r(Un,"A",{href:!0});var hg=i(bn);tl=n(hg,"PretrainedConfig"),hg.forEach(o),ol=n(Un,` and can be used to control the model outputs. Read the
documentation from `),Tn=r(Un,"A",{href:!0});var ug=i(Tn);al=n(ug,"PretrainedConfig"),ug.forEach(o),nl=n(Un," for more information."),Un.forEach(o),sl=c(be),vs=r(be,"P",{});var mg=i(vs);rl=n(mg,"Examples:"),mg.forEach(o),il=c(be),v(eo.$$.fragment,be),be.forEach(o),ti=c(t),Se=r(t,"H2",{class:!0});var Mi=i(Se);_t=r(Mi,"A",{id:!0,class:!0,href:!0});var fg=i(_t);bs=r(fg,"SPAN",{});var gg=i(bs);v(to.$$.fragment,gg),gg.forEach(o),fg.forEach(o),dl=c(Mi),Ts=r(Mi,"SPAN",{});var _g=i(Ts);ll=n(_g,"Data2VecAudioConfig"),_g.forEach(o),Mi.forEach(o),oi=c(t),R=r(t,"DIV",{class:!0});var Te=i(R);v(oo.$$.fragment,Te),cl=c(Te),Le=r(Te,"P",{});var Jn=i(Le);pl=n(Jn,"This is the configuration class to store the configuration of a "),kn=r(Jn,"A",{href:!0});var vg=i(kn);hl=n(vg,"Data2VecAudioModel"),vg.forEach(o),ul=n(Jn,`. It is used to instantiate
an Data2VecAudio 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 Data2VecAudio
`),ao=r(Jn,"A",{href:!0,rel:!0});var bg=i(ao);ml=n(bg,"facebook/data2vec-audio-base-960h"),bg.forEach(o),fl=n(Jn," architecture."),Jn.forEach(o),gl=c(Te),Ne=r(Te,"P",{});var Kn=i(Ne);_l=n(Kn,"Configuration objects inherit from "),wn=r(Kn,"A",{href:!0});var Tg=i(wn);vl=n(Tg,"PretrainedConfig"),Tg.forEach(o),bl=n(Kn,` and can be used to control the model outputs. Read the
documentation from `),yn=r(Kn,"A",{href:!0});var kg=i(yn);Tl=n(kg,"PretrainedConfig"),kg.forEach(o),kl=n(Kn," for more information."),Kn.forEach(o),wl=c(Te),ks=r(Te,"P",{});var wg=i(ks);yl=n(wg,"Example:"),wg.forEach(o),xl=c(Te),v(no.$$.fragment,Te),Te.forEach(o),ai=c(t),We=r(t,"H2",{class:!0});var qi=i(We);vt=r(qi,"A",{id:!0,class:!0,href:!0});var yg=i(vt);ws=r(yg,"SPAN",{});var xg=i(ws);v(so.$$.fragment,xg),xg.forEach(o),yg.forEach(o),Dl=c(qi),ys=r(qi,"SPAN",{});var Dg=i(ys);Vl=n(Dg,"Data2VecAudioModel"),Dg.forEach(o),qi.forEach(o),ni=c(t),Q=r(t,"DIV",{class:!0});var ke=i(Q);v(ro.$$.fragment,ke),$l=c(ke),io=r(ke,"P",{});var ji=i(io);Al=n(ji,`The bare Data2VecAudio Model transformer outputting raw hidden-states without any specific head on top.
Data2VecAudio was proposed in `),lo=r(ji,"A",{href:!0,rel:!0});var Vg=i(lo);Fl=n(Vg,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),Vg.forEach(o),Cl=n(ji,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),ji.forEach(o),Ml=c(ke),co=r(ke,"P",{});var zi=i(co);ql=n(zi,"This model inherits from "),xn=r(zi,"A",{href:!0});var $g=i(xn);jl=n($g,"PreTrainedModel"),$g.forEach(o),zl=n(zi,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),zi.forEach(o),El=c(ke),po=r(ke,"P",{});var Ei=i(po);Pl=n(Ei,"This model is a PyTorch "),ho=r(Ei,"A",{href:!0,rel:!0});var Ag=i(ho);Sl=n(Ag,"torch.nn.Module"),Ag.forEach(o),Ll=n(Ei,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ei.forEach(o),Nl=c(ke),J=r(ke,"DIV",{class:!0});var we=i(J);v(uo.$$.fragment,we),Wl=c(we),Ie=r(we,"P",{});var Yn=i(Ie);Il=n(Yn,"The "),Dn=r(Yn,"A",{href:!0});var Fg=i(Dn);Ol=n(Fg,"Data2VecAudioModel"),Fg.forEach(o),Bl=n(Yn," forward method, overrides the "),xs=r(Yn,"CODE",{});var Cg=i(xs);Hl=n(Cg,"__call__"),Cg.forEach(o),Rl=n(Yn," special method."),Yn.forEach(o),Ql=c(we),v(bt.$$.fragment,we),Gl=c(we),Ds=r(we,"P",{});var Mg=i(Ds);Xl=n(Mg,"Example:"),Mg.forEach(o),Ul=c(we),v(mo.$$.fragment,we),we.forEach(o),ke.forEach(o),si=c(t),Oe=r(t,"H2",{class:!0});var Pi=i(Oe);Tt=r(Pi,"A",{id:!0,class:!0,href:!0});var qg=i(Tt);Vs=r(qg,"SPAN",{});var jg=i(Vs);v(fo.$$.fragment,jg),jg.forEach(o),qg.forEach(o),Jl=c(Pi),$s=r(Pi,"SPAN",{});var zg=i($s);Kl=n(zg,"Data2VecAudioForAudioFrameClassification"),zg.forEach(o),Pi.forEach(o),ri=c(t),M=r(t,"DIV",{class:!0});var ie=i(M);v(go.$$.fragment,ie),Yl=c(ie),As=r(ie,"P",{});var Eg=i(As);Zl=n(Eg,"Data2VecAudio Model with a frame classification head on top for tasks like Speaker Diarization."),Eg.forEach(o),ec=c(ie),_o=r(ie,"P",{});var Si=i(_o);tc=n(Si,"Data2VecAudio was proposed in "),vo=r(Si,"A",{href:!0,rel:!0});var Pg=i(vo);oc=n(Pg,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),Pg.forEach(o),ac=n(Si,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),Si.forEach(o),nc=c(ie),bo=r(ie,"P",{});var Li=i(bo);sc=n(Li,"This model inherits from "),Vn=r(Li,"A",{href:!0});var Sg=i(Vn);rc=n(Sg,"PreTrainedModel"),Sg.forEach(o),ic=n(Li,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Li.forEach(o),dc=c(ie),To=r(ie,"P",{});var Ni=i(To);lc=n(Ni,"This model is a PyTorch "),ko=r(Ni,"A",{href:!0,rel:!0});var Lg=i(ko);cc=n(Lg,"torch.nn.Module"),Lg.forEach(o),pc=n(Ni,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ni.forEach(o),hc=c(ie),K=r(ie,"DIV",{class:!0});var ye=i(K);v(wo.$$.fragment,ye),uc=c(ye),Be=r(ye,"P",{});var Zn=i(Be);mc=n(Zn,"The "),$n=r(Zn,"A",{href:!0});var Ng=i($n);fc=n(Ng,"Data2VecAudioForAudioFrameClassification"),Ng.forEach(o),gc=n(Zn," forward method, overrides the "),Fs=r(Zn,"CODE",{});var Wg=i(Fs);_c=n(Wg,"__call__"),Wg.forEach(o),vc=n(Zn," special method."),Zn.forEach(o),bc=c(ye),v(kt.$$.fragment,ye),Tc=c(ye),Cs=r(ye,"P",{});var Ig=i(Cs);kc=n(Ig,"Example:"),Ig.forEach(o),wc=c(ye),v(yo.$$.fragment,ye),ye.forEach(o),ie.forEach(o),ii=c(t),He=r(t,"H2",{class:!0});var Wi=i(He);wt=r(Wi,"A",{id:!0,class:!0,href:!0});var Og=i(wt);Ms=r(Og,"SPAN",{});var Bg=i(Ms);v(xo.$$.fragment,Bg),Bg.forEach(o),Og.forEach(o),yc=c(Wi),qs=r(Wi,"SPAN",{});var Hg=i(qs);xc=n(Hg,"Data2VecAudioForCTC"),Hg.forEach(o),Wi.forEach(o),di=c(t),G=r(t,"DIV",{class:!0});var xe=i(G);v(Do.$$.fragment,xe),Dc=c(xe),Re=r(xe,"P",{});var es=i(Re);Vc=n(es,"Data2VecAudio Model with a "),js=r(es,"CODE",{});var Rg=i(js);$c=n(Rg,"language modeling"),Rg.forEach(o),Ac=n(es,` head on top for Connectionist Temporal Classification (CTC).
Data2VecAudio was proposed in `),Vo=r(es,"A",{href:!0,rel:!0});var Qg=i(Vo);Fc=n(Qg,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),Qg.forEach(o),Cc=n(es,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),es.forEach(o),Mc=c(xe),$o=r(xe,"P",{});var Ii=i($o);qc=n(Ii,"This model inherits from "),An=r(Ii,"A",{href:!0});var Gg=i(An);jc=n(Gg,"PreTrainedModel"),Gg.forEach(o),zc=n(Ii,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Ii.forEach(o),Ec=c(xe),Ao=r(xe,"P",{});var Oi=i(Ao);Pc=n(Oi,"This model is a PyTorch "),Fo=r(Oi,"A",{href:!0,rel:!0});var Xg=i(Fo);Sc=n(Xg,"torch.nn.Module"),Xg.forEach(o),Lc=n(Oi,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Oi.forEach(o),Nc=c(xe),W=r(xe,"DIV",{class:!0});var de=i(W);v(Co.$$.fragment,de),Wc=c(de),Qe=r(de,"P",{});var ts=i(Qe);Ic=n(ts,"The "),Fn=r(ts,"A",{href:!0});var Ug=i(Fn);Oc=n(Ug,"Data2VecAudioForCTC"),Ug.forEach(o),Bc=n(ts," forward method, overrides the "),zs=r(ts,"CODE",{});var Jg=i(zs);Hc=n(Jg,"__call__"),Jg.forEach(o),Rc=n(ts," special method."),ts.forEach(o),Qc=c(de),v(yt.$$.fragment,de),Gc=c(de),Es=r(de,"P",{});var Kg=i(Es);Xc=n(Kg,"Example:"),Kg.forEach(o),Uc=c(de),v(Mo.$$.fragment,de),Jc=c(de),v(qo.$$.fragment,de),de.forEach(o),xe.forEach(o),li=c(t),Ge=r(t,"H2",{class:!0});var Bi=i(Ge);xt=r(Bi,"A",{id:!0,class:!0,href:!0});var Yg=i(xt);Ps=r(Yg,"SPAN",{});var Zg=i(Ps);v(jo.$$.fragment,Zg),Zg.forEach(o),Yg.forEach(o),Kc=c(Bi),Ss=r(Bi,"SPAN",{});var e_=i(Ss);Yc=n(e_,"Data2VecAudioForSequenceClassification"),e_.forEach(o),Bi.forEach(o),ci=c(t),q=r(t,"DIV",{class:!0});var le=i(q);v(zo.$$.fragment,le),Zc=c(le),Ls=r(le,"P",{});var t_=i(Ls);ep=n(t_,`Data2VecAudio Model with a sequence classification head on top (a linear layer over the pooled output) for tasks
like SUPERB Keyword Spotting.`),t_.forEach(o),tp=c(le),Eo=r(le,"P",{});var Hi=i(Eo);op=n(Hi,"Data2VecAudio was proposed in "),Po=r(Hi,"A",{href:!0,rel:!0});var o_=i(Po);ap=n(o_,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),o_.forEach(o),np=n(Hi,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),Hi.forEach(o),sp=c(le),So=r(le,"P",{});var Ri=i(So);rp=n(Ri,"This model inherits from "),Cn=r(Ri,"A",{href:!0});var a_=i(Cn);ip=n(a_,"PreTrainedModel"),a_.forEach(o),dp=n(Ri,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Ri.forEach(o),lp=c(le),Lo=r(le,"P",{});var Qi=i(Lo);cp=n(Qi,"This model is a PyTorch "),No=r(Qi,"A",{href:!0,rel:!0});var n_=i(No);pp=n(n_,"torch.nn.Module"),n_.forEach(o),hp=n(Qi,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Qi.forEach(o),up=c(le),I=r(le,"DIV",{class:!0});var ce=i(I);v(Wo.$$.fragment,ce),mp=c(ce),Xe=r(ce,"P",{});var os=i(Xe);fp=n(os,"The "),Mn=r(os,"A",{href:!0});var s_=i(Mn);gp=n(s_,"Data2VecAudioForSequenceClassification"),s_.forEach(o),_p=n(os," forward method, overrides the "),Ns=r(os,"CODE",{});var r_=i(Ns);vp=n(r_,"__call__"),r_.forEach(o),bp=n(os," special method."),os.forEach(o),Tp=c(ce),v(Dt.$$.fragment,ce),kp=c(ce),Ws=r(ce,"P",{});var i_=i(Ws);wp=n(i_,"Example:"),i_.forEach(o),yp=c(ce),v(Io.$$.fragment,ce),xp=c(ce),v(Oo.$$.fragment,ce),ce.forEach(o),le.forEach(o),pi=c(t),Ue=r(t,"H2",{class:!0});var Gi=i(Ue);Vt=r(Gi,"A",{id:!0,class:!0,href:!0});var d_=i(Vt);Is=r(d_,"SPAN",{});var l_=i(Is);v(Bo.$$.fragment,l_),l_.forEach(o),d_.forEach(o),Dp=c(Gi),Os=r(Gi,"SPAN",{});var c_=i(Os);Vp=n(c_,"Data2VecAudioForXVector"),c_.forEach(o),Gi.forEach(o),hi=c(t),j=r(t,"DIV",{class:!0});var pe=i(j);v(Ho.$$.fragment,pe),$p=c(pe),Bs=r(pe,"P",{});var p_=i(Bs);Ap=n(p_,"Data2VecAudio Model with an XVector feature extraction head on top for tasks like Speaker Verification."),p_.forEach(o),Fp=c(pe),Ro=r(pe,"P",{});var Xi=i(Ro);Cp=n(Xi,"Data2VecAudio was proposed in "),Qo=r(Xi,"A",{href:!0,rel:!0});var h_=i(Qo);Mp=n(h_,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),h_.forEach(o),qp=n(Xi,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),Xi.forEach(o),jp=c(pe),Go=r(pe,"P",{});var Ui=i(Go);zp=n(Ui,"This model inherits from "),qn=r(Ui,"A",{href:!0});var u_=i(qn);Ep=n(u_,"PreTrainedModel"),u_.forEach(o),Pp=n(Ui,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Ui.forEach(o),Sp=c(pe),Xo=r(pe,"P",{});var Ji=i(Xo);Lp=n(Ji,"This model is a PyTorch "),Uo=r(Ji,"A",{href:!0,rel:!0});var m_=i(Uo);Np=n(m_,"torch.nn.Module"),m_.forEach(o),Wp=n(Ji,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ji.forEach(o),Ip=c(pe),Y=r(pe,"DIV",{class:!0});var De=i(Y);v(Jo.$$.fragment,De),Op=c(De),Je=r(De,"P",{});var as=i(Je);Bp=n(as,"The "),jn=r(as,"A",{href:!0});var f_=i(jn);Hp=n(f_,"Data2VecAudioForXVector"),f_.forEach(o),Rp=n(as," forward method, overrides the "),Hs=r(as,"CODE",{});var g_=i(Hs);Qp=n(g_,"__call__"),g_.forEach(o),Gp=n(as," special method."),as.forEach(o),Xp=c(De),v($t.$$.fragment,De),Up=c(De),Rs=r(De,"P",{});var __=i(Rs);Jp=n(__,"Example:"),__.forEach(o),Kp=c(De),v(Ko.$$.fragment,De),De.forEach(o),pe.forEach(o),ui=c(t),Ke=r(t,"H2",{class:!0});var Ki=i(Ke);At=r(Ki,"A",{id:!0,class:!0,href:!0});var v_=i(At);Qs=r(v_,"SPAN",{});var b_=i(Qs);v(Yo.$$.fragment,b_),b_.forEach(o),v_.forEach(o),Yp=c(Ki),Gs=r(Ki,"SPAN",{});var T_=i(Gs);Zp=n(T_,"Data2VecTextModel"),T_.forEach(o),Ki.forEach(o),mi=c(t),F=r(t,"DIV",{class:!0});var O=i(F);v(Zo.$$.fragment,O),eh=c(O),ea=r(O,"P",{});var Yi=i(ea);th=n(Yi,`The bare Data2VecText Model for text transformer outputting raw hidden-states without any specific head on top.
Data2VecText was proposed in `),ta=r(Yi,"A",{href:!0,rel:!0});var k_=i(ta);oh=n(k_,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),k_.forEach(o),ah=n(Yi,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),Yi.forEach(o),nh=c(O),oa=r(O,"P",{});var Zi=i(oa);sh=n(Zi,"This model inherits from "),zn=r(Zi,"A",{href:!0});var w_=i(zn);rh=n(w_,"PreTrainedModel"),w_.forEach(o),ih=n(Zi,`. 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.)`),Zi.forEach(o),dh=c(O),aa=r(O,"P",{});var ed=i(aa);lh=n(ed,"This model is also a PyTorch "),na=r(ed,"A",{href:!0,rel:!0});var y_=i(na);ch=n(y_,"torch.nn.Module"),y_.forEach(o),ph=n(ed,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ed.forEach(o),hh=c(O),sa=r(O,"P",{});var td=i(sa);uh=n(td,`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),Xs=r(td,"EM",{});var x_=i(Xs);mh=n(x_,`Attention is
all you need`),x_.forEach(o),fh=n(td,`_ by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz
Kaiser and Illia Polosukhin.`),td.forEach(o),gh=c(O),z=r(O,"P",{});var se=i(z);_h=n(se,"To behave as an decoder the model needs to be initialized with the "),Us=r(se,"CODE",{});var D_=i(Us);vh=n(D_,"is_decoder"),D_.forEach(o),bh=n(se,` argument of the configuration set
to `),Js=r(se,"CODE",{});var V_=i(Js);Th=n(V_,"True"),V_.forEach(o),kh=n(se,". To be used in a Seq2Seq model, the model needs to initialized with both "),Ks=r(se,"CODE",{});var $_=i(Ks);wh=n($_,"is_decoder"),$_.forEach(o),yh=n(se,` argument and
`),Ys=r(se,"CODE",{});var A_=i(Ys);xh=n(A_,"add_cross_attention"),A_.forEach(o),Dh=n(se," set to "),Zs=r(se,"CODE",{});var F_=i(Zs);Vh=n(F_,"True"),F_.forEach(o),$h=n(se,"; an "),er=r(se,"CODE",{});var C_=i(er);Ah=n(C_,"encoder_hidden_states"),C_.forEach(o),Fh=n(se," is then expected as an input to the forward pass."),se.forEach(o),Ch=c(O),Ft=r(O,"P",{});var Rr=i(Ft);Mh=n(Rr,".. _"),tr=r(Rr,"EM",{});var M_=i(tr);qh=n(M_,"Attention is all you need"),M_.forEach(o),jh=n(Rr,": "),ra=r(Rr,"A",{href:!0,rel:!0});var q_=i(ra);zh=n(q_,"https://arxiv.org/abs/1706.03762"),q_.forEach(o),Rr.forEach(o),Eh=c(O),Z=r(O,"DIV",{class:!0});var Ve=i(Z);v(ia.$$.fragment,Ve),Ph=c(Ve),Ye=r(Ve,"P",{});var ns=i(Ye);Sh=n(ns,"The "),En=r(ns,"A",{href:!0});var j_=i(En);Lh=n(j_,"Data2VecTextModel"),j_.forEach(o),Nh=n(ns," forward method, overrides the "),or=r(ns,"CODE",{});var z_=i(or);Wh=n(z_,"__call__"),z_.forEach(o),Ih=n(ns," special method."),ns.forEach(o),Oh=c(Ve),v(Ct.$$.fragment,Ve),Bh=c(Ve),ar=r(Ve,"P",{});var E_=i(ar);Hh=n(E_,"Example:"),E_.forEach(o),Rh=c(Ve),v(da.$$.fragment,Ve),Ve.forEach(o),O.forEach(o),fi=c(t),Ze=r(t,"H2",{class:!0});var od=i(Ze);Mt=r(od,"A",{id:!0,class:!0,href:!0});var P_=i(Mt);nr=r(P_,"SPAN",{});var S_=i(nr);v(la.$$.fragment,S_),S_.forEach(o),P_.forEach(o),Qh=c(od),sr=r(od,"SPAN",{});var L_=i(sr);Gh=n(L_,"Data2VecTextForCausalLM"),L_.forEach(o),od.forEach(o),gi=c(t),X=r(t,"DIV",{class:!0});var $e=i(X);v(ca.$$.fragment,$e),Xh=c($e),et=r($e,"P",{});var ss=i(et);Uh=n(ss,"Data2VecText Model with a "),rr=r(ss,"CODE",{});var N_=i(rr);Jh=n(N_,"language modeling"),N_.forEach(o),Kh=n(ss,` head on top for CLM fine-tuning.
Data2VecText was proposed in `),pa=r(ss,"A",{href:!0,rel:!0});var W_=i(pa);Yh=n(W_,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),W_.forEach(o),Zh=n(ss,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),ss.forEach(o),eu=c($e),ha=r($e,"P",{});var ad=i(ha);tu=n(ad,"This model inherits from "),Pn=r(ad,"A",{href:!0});var I_=i(Pn);ou=n(I_,"PreTrainedModel"),I_.forEach(o),au=n(ad,`. 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.)`),ad.forEach(o),nu=c($e),ua=r($e,"P",{});var nd=i(ua);su=n(nd,"This model is also a PyTorch "),ma=r(nd,"A",{href:!0,rel:!0});var O_=i(ma);ru=n(O_,"torch.nn.Module"),O_.forEach(o),iu=n(nd,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),nd.forEach(o),du=c($e),ee=r($e,"DIV",{class:!0});var Ae=i(ee);v(fa.$$.fragment,Ae),lu=c(Ae),tt=r(Ae,"P",{});var rs=i(tt);cu=n(rs,"The "),Sn=r(rs,"A",{href:!0});var B_=i(Sn);pu=n(B_,"Data2VecTextForCausalLM"),B_.forEach(o),hu=n(rs," forward method, overrides the "),ir=r(rs,"CODE",{});var H_=i(ir);uu=n(H_,"__call__"),H_.forEach(o),mu=n(rs," special method."),rs.forEach(o),fu=c(Ae),v(qt.$$.fragment,Ae),gu=c(Ae),dr=r(Ae,"P",{});var R_=i(dr);_u=n(R_,"Example:"),R_.forEach(o),vu=c(Ae),v(ga.$$.fragment,Ae),Ae.forEach(o),$e.forEach(o),_i=c(t),ot=r(t,"H2",{class:!0});var sd=i(ot);jt=r(sd,"A",{id:!0,class:!0,href:!0});var Q_=i(jt);lr=r(Q_,"SPAN",{});var G_=i(lr);v(_a.$$.fragment,G_),G_.forEach(o),Q_.forEach(o),bu=c(sd),cr=r(sd,"SPAN",{});var X_=i(cr);Tu=n(X_,"Data2VecTextForMaskedLM"),X_.forEach(o),sd.forEach(o),vi=c(t),U=r(t,"DIV",{class:!0});var Fe=i(U);v(va.$$.fragment,Fe),ku=c(Fe),at=r(Fe,"P",{});var is=i(at);wu=n(is,"data2vec Model with a "),pr=r(is,"CODE",{});var U_=i(pr);yu=n(U_,"language modeling"),U_.forEach(o),xu=n(is,` head on top.
Data2VecText was proposed in `),ba=r(is,"A",{href:!0,rel:!0});var J_=i(ba);Du=n(J_,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),J_.forEach(o),Vu=n(is,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),is.forEach(o),$u=c(Fe),Ta=r(Fe,"P",{});var rd=i(Ta);Au=n(rd,"This model inherits from "),Ln=r(rd,"A",{href:!0});var K_=i(Ln);Fu=n(K_,"PreTrainedModel"),K_.forEach(o),Cu=n(rd,`. 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.)`),rd.forEach(o),Mu=c(Fe),ka=r(Fe,"P",{});var id=i(ka);qu=n(id,"This model is also a PyTorch "),wa=r(id,"A",{href:!0,rel:!0});var Y_=i(wa);ju=n(Y_,"torch.nn.Module"),Y_.forEach(o),zu=n(id,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),id.forEach(o),Eu=c(Fe),te=r(Fe,"DIV",{class:!0});var Ce=i(te);v(ya.$$.fragment,Ce),Pu=c(Ce),nt=r(Ce,"P",{});var ds=i(nt);Su=n(ds,"The "),Nn=r(ds,"A",{href:!0});var Z_=i(Nn);Lu=n(Z_,"Data2VecTextForMaskedLM"),Z_.forEach(o),Nu=n(ds," forward method, overrides the "),hr=r(ds,"CODE",{});var e2=i(hr);Wu=n(e2,"__call__"),e2.forEach(o),Iu=n(ds," special method."),ds.forEach(o),Ou=c(Ce),v(zt.$$.fragment,Ce),Bu=c(Ce),ur=r(Ce,"P",{});var t2=i(ur);Hu=n(t2,"Example:"),t2.forEach(o),Ru=c(Ce),v(xa.$$.fragment,Ce),Ce.forEach(o),Fe.forEach(o),bi=c(t),st=r(t,"H2",{class:!0});var dd=i(st);Et=r(dd,"A",{id:!0,class:!0,href:!0});var o2=i(Et);mr=r(o2,"SPAN",{});var a2=i(mr);v(Da.$$.fragment,a2),a2.forEach(o),o2.forEach(o),Qu=c(dd),fr=r(dd,"SPAN",{});var n2=i(fr);Gu=n(n2,"Data2VecTextForSequenceClassification"),n2.forEach(o),dd.forEach(o),Ti=c(t),E=r(t,"DIV",{class:!0});var he=i(E);v(Va.$$.fragment,he),Xu=c(he),gr=r(he,"P",{});var s2=i(gr);Uu=n(s2,`Data2VecText Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),s2.forEach(o),Ju=c(he),$a=r(he,"P",{});var ld=i($a);Ku=n(ld,"Data2VecText was proposed in "),Aa=r(ld,"A",{href:!0,rel:!0});var r2=i(Aa);Yu=n(r2,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),r2.forEach(o),Zu=n(ld,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),ld.forEach(o),em=c(he),Fa=r(he,"P",{});var cd=i(Fa);tm=n(cd,"This model inherits from "),Wn=r(cd,"A",{href:!0});var i2=i(Wn);om=n(i2,"PreTrainedModel"),i2.forEach(o),am=n(cd,`. 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.)`),cd.forEach(o),nm=c(he),Ca=r(he,"P",{});var pd=i(Ca);sm=n(pd,"This model is also a PyTorch "),Ma=r(pd,"A",{href:!0,rel:!0});var d2=i(Ma);rm=n(d2,"torch.nn.Module"),d2.forEach(o),im=n(pd,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),pd.forEach(o),dm=c(he),C=r(he,"DIV",{class:!0});var re=i(C);v(qa.$$.fragment,re),lm=c(re),rt=r(re,"P",{});var ls=i(rt);cm=n(ls,"The "),In=r(ls,"A",{href:!0});var l2=i(In);pm=n(l2,"Data2VecTextForSequenceClassification"),l2.forEach(o),hm=n(ls," forward method, overrides the "),_r=r(ls,"CODE",{});var c2=i(_r);um=n(c2,"__call__"),c2.forEach(o),mm=n(ls," special method."),ls.forEach(o),fm=c(re),v(Pt.$$.fragment,re),gm=c(re),vr=r(re,"P",{});var p2=i(vr);_m=n(p2,"Example of single-label classification:"),p2.forEach(o),vm=c(re),v(ja.$$.fragment,re),bm=c(re),br=r(re,"P",{});var h2=i(br);Tm=n(h2,"Example of multi-label classification:"),h2.forEach(o),km=c(re),v(za.$$.fragment,re),re.forEach(o),he.forEach(o),ki=c(t),it=r(t,"H2",{class:!0});var hd=i(it);St=r(hd,"A",{id:!0,class:!0,href:!0});var u2=i(St);Tr=r(u2,"SPAN",{});var m2=i(Tr);v(Ea.$$.fragment,m2),m2.forEach(o),u2.forEach(o),wm=c(hd),kr=r(hd,"SPAN",{});var f2=i(kr);ym=n(f2,"Data2VecTextForMultipleChoice"),f2.forEach(o),hd.forEach(o),wi=c(t),P=r(t,"DIV",{class:!0});var ue=i(P);v(Pa.$$.fragment,ue),xm=c(ue),wr=r(ue,"P",{});var g2=i(wr);Dm=n(g2,`Data2VecText Model with a multiple choice classification head on top (a linear layer on top of the pooled output
and a softmax) e.g. for RocStories/SWAG tasks.`),g2.forEach(o),Vm=c(ue),Sa=r(ue,"P",{});var ud=i(Sa);$m=n(ud,"Data2VecText was proposed in "),La=r(ud,"A",{href:!0,rel:!0});var _2=i(La);Am=n(_2,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),_2.forEach(o),Fm=n(ud,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),ud.forEach(o),Cm=c(ue),Na=r(ue,"P",{});var md=i(Na);Mm=n(md,"This model inherits from "),On=r(md,"A",{href:!0});var v2=i(On);qm=n(v2,"PreTrainedModel"),v2.forEach(o),jm=n(md,`. 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.)`),md.forEach(o),zm=c(ue),Wa=r(ue,"P",{});var fd=i(Wa);Em=n(fd,"This model is also a PyTorch "),Ia=r(fd,"A",{href:!0,rel:!0});var b2=i(Ia);Pm=n(b2,"torch.nn.Module"),b2.forEach(o),Sm=n(fd,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),fd.forEach(o),Lm=c(ue),oe=r(ue,"DIV",{class:!0});var Me=i(oe);v(Oa.$$.fragment,Me),Nm=c(Me),dt=r(Me,"P",{});var cs=i(dt);Wm=n(cs,"The "),Bn=r(cs,"A",{href:!0});var T2=i(Bn);Im=n(T2,"Data2VecTextForMultipleChoice"),T2.forEach(o),Om=n(cs," forward method, overrides the "),yr=r(cs,"CODE",{});var k2=i(yr);Bm=n(k2,"__call__"),k2.forEach(o),Hm=n(cs," special method."),cs.forEach(o),Rm=c(Me),v(Lt.$$.fragment,Me),Qm=c(Me),xr=r(Me,"P",{});var w2=i(xr);Gm=n(w2,"Example:"),w2.forEach(o),Xm=c(Me),v(Ba.$$.fragment,Me),Me.forEach(o),ue.forEach(o),yi=c(t),lt=r(t,"H2",{class:!0});var gd=i(lt);Nt=r(gd,"A",{id:!0,class:!0,href:!0});var y2=i(Nt);Dr=r(y2,"SPAN",{});var x2=i(Dr);v(Ha.$$.fragment,x2),x2.forEach(o),y2.forEach(o),Um=c(gd),Vr=r(gd,"SPAN",{});var D2=i(Vr);Jm=n(D2,"Data2VecTextForTokenClassification"),D2.forEach(o),gd.forEach(o),xi=c(t),S=r(t,"DIV",{class:!0});var me=i(S);v(Ra.$$.fragment,me),Km=c(me),$r=r(me,"P",{});var V2=i($r);Ym=n(V2,`Data2VecText Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g.
for Named-Entity-Recognition (NER) tasks.`),V2.forEach(o),Zm=c(me),Qa=r(me,"P",{});var _d=i(Qa);ef=n(_d,"Data2VecText was proposed in "),Ga=r(_d,"A",{href:!0,rel:!0});var $2=i(Ga);tf=n($2,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),$2.forEach(o),of=n(_d,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),_d.forEach(o),af=c(me),Xa=r(me,"P",{});var vd=i(Xa);nf=n(vd,"This model inherits from "),Hn=r(vd,"A",{href:!0});var A2=i(Hn);sf=n(A2,"PreTrainedModel"),A2.forEach(o),rf=n(vd,`. 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.)`),vd.forEach(o),df=c(me),Ua=r(me,"P",{});var bd=i(Ua);lf=n(bd,"This model is also a PyTorch "),Ja=r(bd,"A",{href:!0,rel:!0});var F2=i(Ja);cf=n(F2,"torch.nn.Module"),F2.forEach(o),pf=n(bd,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),bd.forEach(o),hf=c(me),ae=r(me,"DIV",{class:!0});var qe=i(ae);v(Ka.$$.fragment,qe),uf=c(qe),ct=r(qe,"P",{});var ps=i(ct);mf=n(ps,"The "),Rn=r(ps,"A",{href:!0});var C2=i(Rn);ff=n(C2,"Data2VecTextForTokenClassification"),C2.forEach(o),gf=n(ps," forward method, overrides the "),Ar=r(ps,"CODE",{});var M2=i(Ar);_f=n(M2,"__call__"),M2.forEach(o),vf=n(ps," special method."),ps.forEach(o),bf=c(qe),v(Wt.$$.fragment,qe),Tf=c(qe),Fr=r(qe,"P",{});var q2=i(Fr);kf=n(q2,"Example:"),q2.forEach(o),wf=c(qe),v(Ya.$$.fragment,qe),qe.forEach(o),me.forEach(o),Di=c(t),pt=r(t,"H2",{class:!0});var Td=i(pt);It=r(Td,"A",{id:!0,class:!0,href:!0});var j2=i(It);Cr=r(j2,"SPAN",{});var z2=i(Cr);v(Za.$$.fragment,z2),z2.forEach(o),j2.forEach(o),yf=c(Td),Mr=r(Td,"SPAN",{});var E2=i(Mr);xf=n(E2,"Data2VecTextForQuestionAnswering"),E2.forEach(o),Td.forEach(o),Vi=c(t),L=r(t,"DIV",{class:!0});var fe=i(L);v(en.$$.fragment,fe),Df=c(fe),ht=r(fe,"P",{});var hs=i(ht);Vf=n(hs,`Data2VecText Model with a span classification head on top for extractive question-answering tasks like SQuAD (a
linear layers on top of the hidden-states output to compute `),qr=r(hs,"CODE",{});var P2=i(qr);$f=n(P2,"span start logits"),P2.forEach(o),Af=n(hs," and "),jr=r(hs,"CODE",{});var S2=i(jr);Ff=n(S2,"span end logits"),S2.forEach(o),Cf=n(hs,")."),hs.forEach(o),Mf=c(fe),tn=r(fe,"P",{});var kd=i(tn);qf=n(kd,"Data2VecText was proposed in "),on=r(kd,"A",{href:!0,rel:!0});var L2=i(on);jf=n(L2,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),L2.forEach(o),zf=n(kd,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),kd.forEach(o),Ef=c(fe),an=r(fe,"P",{});var wd=i(an);Pf=n(wd,"This model inherits from "),Qn=r(wd,"A",{href:!0});var N2=i(Qn);Sf=n(N2,"PreTrainedModel"),N2.forEach(o),Lf=n(wd,`. 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.)`),wd.forEach(o),Nf=c(fe),nn=r(fe,"P",{});var yd=i(nn);Wf=n(yd,"This model is also a PyTorch "),sn=r(yd,"A",{href:!0,rel:!0});var W2=i(sn);If=n(W2,"torch.nn.Module"),W2.forEach(o),Of=n(yd,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),yd.forEach(o),Bf=c(fe),ne=r(fe,"DIV",{class:!0});var je=i(ne);v(rn.$$.fragment,je),Hf=c(je),ut=r(je,"P",{});var us=i(ut);Rf=n(us,"The "),Gn=r(us,"A",{href:!0});var I2=i(Gn);Qf=n(I2,"Data2VecTextForQuestionAnswering"),I2.forEach(o),Gf=n(us," forward method, overrides the "),zr=r(us,"CODE",{});var O2=i(zr);Xf=n(O2,"__call__"),O2.forEach(o),Uf=n(us," special method."),us.forEach(o),Jf=c(je),v(Ot.$$.fragment,je),Kf=c(je),Er=r(je,"P",{});var B2=i(Er);Yf=n(B2,"Example:"),B2.forEach(o),Zf=c(je),v(dn.$$.fragment,je),je.forEach(o),fe.forEach(o),this.h()},h(){d(p,"name","hf:doc:metadata"),d(p,"content",JSON.stringify(iv)),d(y,"id","data2vec"),d(y,"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"),d(y,"href","#data2vec"),d(m,"class","relative group"),d(mt,"id","overview"),d(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"),d(mt,"href","#overview"),d(ze,"class","relative group"),d(Rt,"href","https://arxiv.org/pdf/2202.03555"),d(Rt,"rel","nofollow"),d(Gt,"href","http://www.github.com/pytorch/fairseq/tree/master/examples/data2vec"),d(Gt,"rel","nofollow"),d(gn,"href","/docs/transformers/pr_15839/en/model_doc/roberta#transformers.RobertaModel"),d(Ut,"href","https://huggingface.co/edugp"),d(Ut,"rel","nofollow"),d(Jt,"href","https://github.com/pytorch/fairseq/tree/main/examples/data2vec"),d(Jt,"rel","nofollow"),d(gt,"id","transformers.Data2VecTextConfig"),d(gt,"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"),d(gt,"href","#transformers.Data2VecTextConfig"),d(Ee,"class","relative group"),d(_n,"href","/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecTextModel"),d(vn,"href","/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecTextModel"),d(Zt,"href","https://huggingface.co/facebook/data2vec-text-base"),d(Zt,"rel","nofollow"),d(bn,"href","/docs/transformers/pr_15839/en/main_classes/configuration#transformers.PretrainedConfig"),d(Tn,"href","/docs/transformers/pr_15839/en/main_classes/configuration#transformers.PretrainedConfig"),d(H,"class","docstring"),d(_t,"id","transformers.Data2VecAudioConfig"),d(_t,"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"),d(_t,"href","#transformers.Data2VecAudioConfig"),d(Se,"class","relative group"),d(kn,"href","/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecAudioModel"),d(ao,"href","https://huggingface.co/facebook/data2vec-audio-base-960h"),d(ao,"rel","nofollow"),d(wn,"href","/docs/transformers/pr_15839/en/main_classes/configuration#transformers.PretrainedConfig"),d(yn,"href","/docs/transformers/pr_15839/en/main_classes/configuration#transformers.PretrainedConfig"),d(R,"class","docstring"),d(vt,"id","transformers.Data2VecAudioModel"),d(vt,"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"),d(vt,"href","#transformers.Data2VecAudioModel"),d(We,"class","relative group"),d(lo,"href","https://arxiv.org/pdf/2202.03555"),d(lo,"rel","nofollow"),d(xn,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),d(ho,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(ho,"rel","nofollow"),d(Dn,"href","/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecAudioModel"),d(J,"class","docstring"),d(Q,"class","docstring"),d(Tt,"id","transformers.Data2VecAudioForAudioFrameClassification"),d(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"),d(Tt,"href","#transformers.Data2VecAudioForAudioFrameClassification"),d(Oe,"class","relative group"),d(vo,"href","https://arxiv.org/pdf/2202.03555"),d(vo,"rel","nofollow"),d(Vn,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),d(ko,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(ko,"rel","nofollow"),d($n,"href","/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecAudioForAudioFrameClassification"),d(K,"class","docstring"),d(M,"class","docstring"),d(wt,"id","transformers.Data2VecAudioForCTC"),d(wt,"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"),d(wt,"href","#transformers.Data2VecAudioForCTC"),d(He,"class","relative group"),d(Vo,"href","https://arxiv.org/pdf/2202.03555"),d(Vo,"rel","nofollow"),d(An,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),d(Fo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Fo,"rel","nofollow"),d(Fn,"href","/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecAudioForCTC"),d(W,"class","docstring"),d(G,"class","docstring"),d(xt,"id","transformers.Data2VecAudioForSequenceClassification"),d(xt,"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"),d(xt,"href","#transformers.Data2VecAudioForSequenceClassification"),d(Ge,"class","relative group"),d(Po,"href","https://arxiv.org/pdf/2202.03555"),d(Po,"rel","nofollow"),d(Cn,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),d(No,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(No,"rel","nofollow"),d(Mn,"href","/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecAudioForSequenceClassification"),d(I,"class","docstring"),d(q,"class","docstring"),d(Vt,"id","transformers.Data2VecAudioForXVector"),d(Vt,"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"),d(Vt,"href","#transformers.Data2VecAudioForXVector"),d(Ue,"class","relative group"),d(Qo,"href","https://arxiv.org/pdf/2202.03555"),d(Qo,"rel","nofollow"),d(qn,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),d(Uo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Uo,"rel","nofollow"),d(jn,"href","/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecAudioForXVector"),d(Y,"class","docstring"),d(j,"class","docstring"),d(At,"id","transformers.Data2VecTextModel"),d(At,"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"),d(At,"href","#transformers.Data2VecTextModel"),d(Ke,"class","relative group"),d(ta,"href","https://arxiv.org/pdf/2202.03555"),d(ta,"rel","nofollow"),d(zn,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),d(na,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(na,"rel","nofollow"),d(ra,"href","https://arxiv.org/abs/1706.03762"),d(ra,"rel","nofollow"),d(En,"href","/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecTextModel"),d(Z,"class","docstring"),d(F,"class","docstring"),d(Mt,"id","transformers.Data2VecTextForCausalLM"),d(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"),d(Mt,"href","#transformers.Data2VecTextForCausalLM"),d(Ze,"class","relative group"),d(pa,"href","https://arxiv.org/pdf/2202.03555"),d(pa,"rel","nofollow"),d(Pn,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),d(ma,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(ma,"rel","nofollow"),d(Sn,"href","/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecTextForCausalLM"),d(ee,"class","docstring"),d(X,"class","docstring"),d(jt,"id","transformers.Data2VecTextForMaskedLM"),d(jt,"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"),d(jt,"href","#transformers.Data2VecTextForMaskedLM"),d(ot,"class","relative group"),d(ba,"href","https://arxiv.org/pdf/2202.03555"),d(ba,"rel","nofollow"),d(Ln,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),d(wa,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(wa,"rel","nofollow"),d(Nn,"href","/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecTextForMaskedLM"),d(te,"class","docstring"),d(U,"class","docstring"),d(Et,"id","transformers.Data2VecTextForSequenceClassification"),d(Et,"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"),d(Et,"href","#transformers.Data2VecTextForSequenceClassification"),d(st,"class","relative group"),d(Aa,"href","https://arxiv.org/pdf/2202.03555"),d(Aa,"rel","nofollow"),d(Wn,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),d(Ma,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ma,"rel","nofollow"),d(In,"href","/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecTextForSequenceClassification"),d(C,"class","docstring"),d(E,"class","docstring"),d(St,"id","transformers.Data2VecTextForMultipleChoice"),d(St,"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"),d(St,"href","#transformers.Data2VecTextForMultipleChoice"),d(it,"class","relative group"),d(La,"href","https://arxiv.org/pdf/2202.03555"),d(La,"rel","nofollow"),d(On,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),d(Ia,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ia,"rel","nofollow"),d(Bn,"href","/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecTextForMultipleChoice"),d(oe,"class","docstring"),d(P,"class","docstring"),d(Nt,"id","transformers.Data2VecTextForTokenClassification"),d(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"),d(Nt,"href","#transformers.Data2VecTextForTokenClassification"),d(lt,"class","relative group"),d(Ga,"href","https://arxiv.org/pdf/2202.03555"),d(Ga,"rel","nofollow"),d(Hn,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),d(Ja,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ja,"rel","nofollow"),d(Rn,"href","/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecTextForTokenClassification"),d(ae,"class","docstring"),d(S,"class","docstring"),d(It,"id","transformers.Data2VecTextForQuestionAnswering"),d(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"),d(It,"href","#transformers.Data2VecTextForQuestionAnswering"),d(pt,"class","relative group"),d(on,"href","https://arxiv.org/pdf/2202.03555"),d(on,"rel","nofollow"),d(Qn,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),d(sn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(sn,"rel","nofollow"),d(Gn,"href","/docs/transformers/pr_15839/en/model_doc/data2vec#transformers.Data2VecTextForQuestionAnswering"),d(ne,"class","docstring"),d(L,"class","docstring")},m(t,h){e(document.head,p),f(t,x,h),f(t,m,h),e(m,y),e(y,D),b(g,D,null),e(m,u),e(m,V),e(V,xd),f(t,Qr,h),f(t,ze,h),e(ze,mt),e(mt,ms),b(Ht,ms,null),e(ze,Dd),e(ze,fs),e(fs,Vd),f(t,Gr,h),f(t,ft,h),e(ft,$d),e(ft,Rt),e(Rt,Ad),e(ft,Fd),f(t,Xr,h),f(t,hn,h),e(hn,Cd),f(t,Ur,h),f(t,un,h),e(un,Qt),e(Qt,Md),e(Qt,Gt),e(Gt,qd),e(Qt,jd),f(t,Jr,h),f(t,mn,h),e(mn,zd),f(t,Kr,h),f(t,fn,h),e(fn,Xt),e(Xt,Ed),e(Xt,gn),e(gn,Pd),e(Xt,Sd),f(t,Yr,h),f(t,ve,h),e(ve,Ld),e(ve,Ut),e(Ut,Nd),e(ve,Wd),e(ve,Jt),e(Jt,Id),e(ve,Od),f(t,Zr,h),f(t,Ee,h),e(Ee,gt),e(gt,gs),b(Kt,gs,null),e(Ee,Bd),e(Ee,_s),e(_s,Hd),f(t,ei,h),f(t,H,h),b(Yt,H,null),e(H,Rd),e(H,_e),e(_e,Qd),e(_e,_n),e(_n,Gd),e(_e,Xd),e(_e,vn),e(vn,Ud),e(_e,Jd),e(_e,Zt),e(Zt,Kd),e(_e,Yd),e(H,Zd),e(H,Pe),e(Pe,el),e(Pe,bn),e(bn,tl),e(Pe,ol),e(Pe,Tn),e(Tn,al),e(Pe,nl),e(H,sl),e(H,vs),e(vs,rl),e(H,il),b(eo,H,null),f(t,ti,h),f(t,Se,h),e(Se,_t),e(_t,bs),b(to,bs,null),e(Se,dl),e(Se,Ts),e(Ts,ll),f(t,oi,h),f(t,R,h),b(oo,R,null),e(R,cl),e(R,Le),e(Le,pl),e(Le,kn),e(kn,hl),e(Le,ul),e(Le,ao),e(ao,ml),e(Le,fl),e(R,gl),e(R,Ne),e(Ne,_l),e(Ne,wn),e(wn,vl),e(Ne,bl),e(Ne,yn),e(yn,Tl),e(Ne,kl),e(R,wl),e(R,ks),e(ks,yl),e(R,xl),b(no,R,null),f(t,ai,h),f(t,We,h),e(We,vt),e(vt,ws),b(so,ws,null),e(We,Dl),e(We,ys),e(ys,Vl),f(t,ni,h),f(t,Q,h),b(ro,Q,null),e(Q,$l),e(Q,io),e(io,Al),e(io,lo),e(lo,Fl),e(io,Cl),e(Q,Ml),e(Q,co),e(co,ql),e(co,xn),e(xn,jl),e(co,zl),e(Q,El),e(Q,po),e(po,Pl),e(po,ho),e(ho,Sl),e(po,Ll),e(Q,Nl),e(Q,J),b(uo,J,null),e(J,Wl),e(J,Ie),e(Ie,Il),e(Ie,Dn),e(Dn,Ol),e(Ie,Bl),e(Ie,xs),e(xs,Hl),e(Ie,Rl),e(J,Ql),b(bt,J,null),e(J,Gl),e(J,Ds),e(Ds,Xl),e(J,Ul),b(mo,J,null),f(t,si,h),f(t,Oe,h),e(Oe,Tt),e(Tt,Vs),b(fo,Vs,null),e(Oe,Jl),e(Oe,$s),e($s,Kl),f(t,ri,h),f(t,M,h),b(go,M,null),e(M,Yl),e(M,As),e(As,Zl),e(M,ec),e(M,_o),e(_o,tc),e(_o,vo),e(vo,oc),e(_o,ac),e(M,nc),e(M,bo),e(bo,sc),e(bo,Vn),e(Vn,rc),e(bo,ic),e(M,dc),e(M,To),e(To,lc),e(To,ko),e(ko,cc),e(To,pc),e(M,hc),e(M,K),b(wo,K,null),e(K,uc),e(K,Be),e(Be,mc),e(Be,$n),e($n,fc),e(Be,gc),e(Be,Fs),e(Fs,_c),e(Be,vc),e(K,bc),b(kt,K,null),e(K,Tc),e(K,Cs),e(Cs,kc),e(K,wc),b(yo,K,null),f(t,ii,h),f(t,He,h),e(He,wt),e(wt,Ms),b(xo,Ms,null),e(He,yc),e(He,qs),e(qs,xc),f(t,di,h),f(t,G,h),b(Do,G,null),e(G,Dc),e(G,Re),e(Re,Vc),e(Re,js),e(js,$c),e(Re,Ac),e(Re,Vo),e(Vo,Fc),e(Re,Cc),e(G,Mc),e(G,$o),e($o,qc),e($o,An),e(An,jc),e($o,zc),e(G,Ec),e(G,Ao),e(Ao,Pc),e(Ao,Fo),e(Fo,Sc),e(Ao,Lc),e(G,Nc),e(G,W),b(Co,W,null),e(W,Wc),e(W,Qe),e(Qe,Ic),e(Qe,Fn),e(Fn,Oc),e(Qe,Bc),e(Qe,zs),e(zs,Hc),e(Qe,Rc),e(W,Qc),b(yt,W,null),e(W,Gc),e(W,Es),e(Es,Xc),e(W,Uc),b(Mo,W,null),e(W,Jc),b(qo,W,null),f(t,li,h),f(t,Ge,h),e(Ge,xt),e(xt,Ps),b(jo,Ps,null),e(Ge,Kc),e(Ge,Ss),e(Ss,Yc),f(t,ci,h),f(t,q,h),b(zo,q,null),e(q,Zc),e(q,Ls),e(Ls,ep),e(q,tp),e(q,Eo),e(Eo,op),e(Eo,Po),e(Po,ap),e(Eo,np),e(q,sp),e(q,So),e(So,rp),e(So,Cn),e(Cn,ip),e(So,dp),e(q,lp),e(q,Lo),e(Lo,cp),e(Lo,No),e(No,pp),e(Lo,hp),e(q,up),e(q,I),b(Wo,I,null),e(I,mp),e(I,Xe),e(Xe,fp),e(Xe,Mn),e(Mn,gp),e(Xe,_p),e(Xe,Ns),e(Ns,vp),e(Xe,bp),e(I,Tp),b(Dt,I,null),e(I,kp),e(I,Ws),e(Ws,wp),e(I,yp),b(Io,I,null),e(I,xp),b(Oo,I,null),f(t,pi,h),f(t,Ue,h),e(Ue,Vt),e(Vt,Is),b(Bo,Is,null),e(Ue,Dp),e(Ue,Os),e(Os,Vp),f(t,hi,h),f(t,j,h),b(Ho,j,null),e(j,$p),e(j,Bs),e(Bs,Ap),e(j,Fp),e(j,Ro),e(Ro,Cp),e(Ro,Qo),e(Qo,Mp),e(Ro,qp),e(j,jp),e(j,Go),e(Go,zp),e(Go,qn),e(qn,Ep),e(Go,Pp),e(j,Sp),e(j,Xo),e(Xo,Lp),e(Xo,Uo),e(Uo,Np),e(Xo,Wp),e(j,Ip),e(j,Y),b(Jo,Y,null),e(Y,Op),e(Y,Je),e(Je,Bp),e(Je,jn),e(jn,Hp),e(Je,Rp),e(Je,Hs),e(Hs,Qp),e(Je,Gp),e(Y,Xp),b($t,Y,null),e(Y,Up),e(Y,Rs),e(Rs,Jp),e(Y,Kp),b(Ko,Y,null),f(t,ui,h),f(t,Ke,h),e(Ke,At),e(At,Qs),b(Yo,Qs,null),e(Ke,Yp),e(Ke,Gs),e(Gs,Zp),f(t,mi,h),f(t,F,h),b(Zo,F,null),e(F,eh),e(F,ea),e(ea,th),e(ea,ta),e(ta,oh),e(ea,ah),e(F,nh),e(F,oa),e(oa,sh),e(oa,zn),e(zn,rh),e(oa,ih),e(F,dh),e(F,aa),e(aa,lh),e(aa,na),e(na,ch),e(aa,ph),e(F,hh),e(F,sa),e(sa,uh),e(sa,Xs),e(Xs,mh),e(sa,fh),e(F,gh),e(F,z),e(z,_h),e(z,Us),e(Us,vh),e(z,bh),e(z,Js),e(Js,Th),e(z,kh),e(z,Ks),e(Ks,wh),e(z,yh),e(z,Ys),e(Ys,xh),e(z,Dh),e(z,Zs),e(Zs,Vh),e(z,$h),e(z,er),e(er,Ah),e(z,Fh),e(F,Ch),e(F,Ft),e(Ft,Mh),e(Ft,tr),e(tr,qh),e(Ft,jh),e(Ft,ra),e(ra,zh),e(F,Eh),e(F,Z),b(ia,Z,null),e(Z,Ph),e(Z,Ye),e(Ye,Sh),e(Ye,En),e(En,Lh),e(Ye,Nh),e(Ye,or),e(or,Wh),e(Ye,Ih),e(Z,Oh),b(Ct,Z,null),e(Z,Bh),e(Z,ar),e(ar,Hh),e(Z,Rh),b(da,Z,null),f(t,fi,h),f(t,Ze,h),e(Ze,Mt),e(Mt,nr),b(la,nr,null),e(Ze,Qh),e(Ze,sr),e(sr,Gh),f(t,gi,h),f(t,X,h),b(ca,X,null),e(X,Xh),e(X,et),e(et,Uh),e(et,rr),e(rr,Jh),e(et,Kh),e(et,pa),e(pa,Yh),e(et,Zh),e(X,eu),e(X,ha),e(ha,tu),e(ha,Pn),e(Pn,ou),e(ha,au),e(X,nu),e(X,ua),e(ua,su),e(ua,ma),e(ma,ru),e(ua,iu),e(X,du),e(X,ee),b(fa,ee,null),e(ee,lu),e(ee,tt),e(tt,cu),e(tt,Sn),e(Sn,pu),e(tt,hu),e(tt,ir),e(ir,uu),e(tt,mu),e(ee,fu),b(qt,ee,null),e(ee,gu),e(ee,dr),e(dr,_u),e(ee,vu),b(ga,ee,null),f(t,_i,h),f(t,ot,h),e(ot,jt),e(jt,lr),b(_a,lr,null),e(ot,bu),e(ot,cr),e(cr,Tu),f(t,vi,h),f(t,U,h),b(va,U,null),e(U,ku),e(U,at),e(at,wu),e(at,pr),e(pr,yu),e(at,xu),e(at,ba),e(ba,Du),e(at,Vu),e(U,$u),e(U,Ta),e(Ta,Au),e(Ta,Ln),e(Ln,Fu),e(Ta,Cu),e(U,Mu),e(U,ka),e(ka,qu),e(ka,wa),e(wa,ju),e(ka,zu),e(U,Eu),e(U,te),b(ya,te,null),e(te,Pu),e(te,nt),e(nt,Su),e(nt,Nn),e(Nn,Lu),e(nt,Nu),e(nt,hr),e(hr,Wu),e(nt,Iu),e(te,Ou),b(zt,te,null),e(te,Bu),e(te,ur),e(ur,Hu),e(te,Ru),b(xa,te,null),f(t,bi,h),f(t,st,h),e(st,Et),e(Et,mr),b(Da,mr,null),e(st,Qu),e(st,fr),e(fr,Gu),f(t,Ti,h),f(t,E,h),b(Va,E,null),e(E,Xu),e(E,gr),e(gr,Uu),e(E,Ju),e(E,$a),e($a,Ku),e($a,Aa),e(Aa,Yu),e($a,Zu),e(E,em),e(E,Fa),e(Fa,tm),e(Fa,Wn),e(Wn,om),e(Fa,am),e(E,nm),e(E,Ca),e(Ca,sm),e(Ca,Ma),e(Ma,rm),e(Ca,im),e(E,dm),e(E,C),b(qa,C,null),e(C,lm),e(C,rt),e(rt,cm),e(rt,In),e(In,pm),e(rt,hm),e(rt,_r),e(_r,um),e(rt,mm),e(C,fm),b(Pt,C,null),e(C,gm),e(C,vr),e(vr,_m),e(C,vm),b(ja,C,null),e(C,bm),e(C,br),e(br,Tm),e(C,km),b(za,C,null),f(t,ki,h),f(t,it,h),e(it,St),e(St,Tr),b(Ea,Tr,null),e(it,wm),e(it,kr),e(kr,ym),f(t,wi,h),f(t,P,h),b(Pa,P,null),e(P,xm),e(P,wr),e(wr,Dm),e(P,Vm),e(P,Sa),e(Sa,$m),e(Sa,La),e(La,Am),e(Sa,Fm),e(P,Cm),e(P,Na),e(Na,Mm),e(Na,On),e(On,qm),e(Na,jm),e(P,zm),e(P,Wa),e(Wa,Em),e(Wa,Ia),e(Ia,Pm),e(Wa,Sm),e(P,Lm),e(P,oe),b(Oa,oe,null),e(oe,Nm),e(oe,dt),e(dt,Wm),e(dt,Bn),e(Bn,Im),e(dt,Om),e(dt,yr),e(yr,Bm),e(dt,Hm),e(oe,Rm),b(Lt,oe,null),e(oe,Qm),e(oe,xr),e(xr,Gm),e(oe,Xm),b(Ba,oe,null),f(t,yi,h),f(t,lt,h),e(lt,Nt),e(Nt,Dr),b(Ha,Dr,null),e(lt,Um),e(lt,Vr),e(Vr,Jm),f(t,xi,h),f(t,S,h),b(Ra,S,null),e(S,Km),e(S,$r),e($r,Ym),e(S,Zm),e(S,Qa),e(Qa,ef),e(Qa,Ga),e(Ga,tf),e(Qa,of),e(S,af),e(S,Xa),e(Xa,nf),e(Xa,Hn),e(Hn,sf),e(Xa,rf),e(S,df),e(S,Ua),e(Ua,lf),e(Ua,Ja),e(Ja,cf),e(Ua,pf),e(S,hf),e(S,ae),b(Ka,ae,null),e(ae,uf),e(ae,ct),e(ct,mf),e(ct,Rn),e(Rn,ff),e(ct,gf),e(ct,Ar),e(Ar,_f),e(ct,vf),e(ae,bf),b(Wt,ae,null),e(ae,Tf),e(ae,Fr),e(Fr,kf),e(ae,wf),b(Ya,ae,null),f(t,Di,h),f(t,pt,h),e(pt,It),e(It,Cr),b(Za,Cr,null),e(pt,yf),e(pt,Mr),e(Mr,xf),f(t,Vi,h),f(t,L,h),b(en,L,null),e(L,Df),e(L,ht),e(ht,Vf),e(ht,qr),e(qr,$f),e(ht,Af),e(ht,jr),e(jr,Ff),e(ht,Cf),e(L,Mf),e(L,tn),e(tn,qf),e(tn,on),e(on,jf),e(tn,zf),e(L,Ef),e(L,an),e(an,Pf),e(an,Qn),e(Qn,Sf),e(an,Lf),e(L,Nf),e(L,nn),e(nn,Wf),e(nn,sn),e(sn,If),e(nn,Of),e(L,Bf),e(L,ne),b(rn,ne,null),e(ne,Hf),e(ne,ut),e(ut,Rf),e(ut,Gn),e(Gn,Qf),e(ut,Gf),e(ut,zr),e(zr,Xf),e(ut,Uf),e(ne,Jf),b(Ot,ne,null),e(ne,Kf),e(ne,Er),e(Er,Yf),e(ne,Zf),b(dn,ne,null),$i=!0},p(t,[h]){const ln={};h&2&&(ln.$$scope={dirty:h,ctx:t}),bt.$set(ln);const Pr={};h&2&&(Pr.$$scope={dirty:h,ctx:t}),kt.$set(Pr);const Sr={};h&2&&(Sr.$$scope={dirty:h,ctx:t}),yt.$set(Sr);const Lr={};h&2&&(Lr.$$scope={dirty:h,ctx:t}),Dt.$set(Lr);const cn={};h&2&&(cn.$$scope={dirty:h,ctx:t}),$t.$set(cn);const Nr={};h&2&&(Nr.$$scope={dirty:h,ctx:t}),Ct.$set(Nr);const Wr={};h&2&&(Wr.$$scope={dirty:h,ctx:t}),qt.$set(Wr);const Ir={};h&2&&(Ir.$$scope={dirty:h,ctx:t}),zt.$set(Ir);const pn={};h&2&&(pn.$$scope={dirty:h,ctx:t}),Pt.$set(pn);const Or={};h&2&&(Or.$$scope={dirty:h,ctx:t}),Lt.$set(Or);const Br={};h&2&&(Br.$$scope={dirty:h,ctx:t}),Wt.$set(Br);const Hr={};h&2&&(Hr.$$scope={dirty:h,ctx:t}),Ot.$set(Hr)},i(t){$i||(T(g.$$.fragment,t),T(Ht.$$.fragment,t),T(Kt.$$.fragment,t),T(Yt.$$.fragment,t),T(eo.$$.fragment,t),T(to.$$.fragment,t),T(oo.$$.fragment,t),T(no.$$.fragment,t),T(so.$$.fragment,t),T(ro.$$.fragment,t),T(uo.$$.fragment,t),T(bt.$$.fragment,t),T(mo.$$.fragment,t),T(fo.$$.fragment,t),T(go.$$.fragment,t),T(wo.$$.fragment,t),T(kt.$$.fragment,t),T(yo.$$.fragment,t),T(xo.$$.fragment,t),T(Do.$$.fragment,t),T(Co.$$.fragment,t),T(yt.$$.fragment,t),T(Mo.$$.fragment,t),T(qo.$$.fragment,t),T(jo.$$.fragment,t),T(zo.$$.fragment,t),T(Wo.$$.fragment,t),T(Dt.$$.fragment,t),T(Io.$$.fragment,t),T(Oo.$$.fragment,t),T(Bo.$$.fragment,t),T(Ho.$$.fragment,t),T(Jo.$$.fragment,t),T($t.$$.fragment,t),T(Ko.$$.fragment,t),T(Yo.$$.fragment,t),T(Zo.$$.fragment,t),T(ia.$$.fragment,t),T(Ct.$$.fragment,t),T(da.$$.fragment,t),T(la.$$.fragment,t),T(ca.$$.fragment,t),T(fa.$$.fragment,t),T(qt.$$.fragment,t),T(ga.$$.fragment,t),T(_a.$$.fragment,t),T(va.$$.fragment,t),T(ya.$$.fragment,t),T(zt.$$.fragment,t),T(xa.$$.fragment,t),T(Da.$$.fragment,t),T(Va.$$.fragment,t),T(qa.$$.fragment,t),T(Pt.$$.fragment,t),T(ja.$$.fragment,t),T(za.$$.fragment,t),T(Ea.$$.fragment,t),T(Pa.$$.fragment,t),T(Oa.$$.fragment,t),T(Lt.$$.fragment,t),T(Ba.$$.fragment,t),T(Ha.$$.fragment,t),T(Ra.$$.fragment,t),T(Ka.$$.fragment,t),T(Wt.$$.fragment,t),T(Ya.$$.fragment,t),T(Za.$$.fragment,t),T(en.$$.fragment,t),T(rn.$$.fragment,t),T(Ot.$$.fragment,t),T(dn.$$.fragment,t),$i=!0)},o(t){k(g.$$.fragment,t),k(Ht.$$.fragment,t),k(Kt.$$.fragment,t),k(Yt.$$.fragment,t),k(eo.$$.fragment,t),k(to.$$.fragment,t),k(oo.$$.fragment,t),k(no.$$.fragment,t),k(so.$$.fragment,t),k(ro.$$.fragment,t),k(uo.$$.fragment,t),k(bt.$$.fragment,t),k(mo.$$.fragment,t),k(fo.$$.fragment,t),k(go.$$.fragment,t),k(wo.$$.fragment,t),k(kt.$$.fragment,t),k(yo.$$.fragment,t),k(xo.$$.fragment,t),k(Do.$$.fragment,t),k(Co.$$.fragment,t),k(yt.$$.fragment,t),k(Mo.$$.fragment,t),k(qo.$$.fragment,t),k(jo.$$.fragment,t),k(zo.$$.fragment,t),k(Wo.$$.fragment,t),k(Dt.$$.fragment,t),k(Io.$$.fragment,t),k(Oo.$$.fragment,t),k(Bo.$$.fragment,t),k(Ho.$$.fragment,t),k(Jo.$$.fragment,t),k($t.$$.fragment,t),k(Ko.$$.fragment,t),k(Yo.$$.fragment,t),k(Zo.$$.fragment,t),k(ia.$$.fragment,t),k(Ct.$$.fragment,t),k(da.$$.fragment,t),k(la.$$.fragment,t),k(ca.$$.fragment,t),k(fa.$$.fragment,t),k(qt.$$.fragment,t),k(ga.$$.fragment,t),k(_a.$$.fragment,t),k(va.$$.fragment,t),k(ya.$$.fragment,t),k(zt.$$.fragment,t),k(xa.$$.fragment,t),k(Da.$$.fragment,t),k(Va.$$.fragment,t),k(qa.$$.fragment,t),k(Pt.$$.fragment,t),k(ja.$$.fragment,t),k(za.$$.fragment,t),k(Ea.$$.fragment,t),k(Pa.$$.fragment,t),k(Oa.$$.fragment,t),k(Lt.$$.fragment,t),k(Ba.$$.fragment,t),k(Ha.$$.fragment,t),k(Ra.$$.fragment,t),k(Ka.$$.fragment,t),k(Wt.$$.fragment,t),k(Ya.$$.fragment,t),k(Za.$$.fragment,t),k(en.$$.fragment,t),k(rn.$$.fragment,t),k(Ot.$$.fragment,t),k(dn.$$.fragment,t),$i=!1},d(t){o(p),t&&o(x),t&&o(m),w(g),t&&o(Qr),t&&o(ze),w(Ht),t&&o(Gr),t&&o(ft),t&&o(Xr),t&&o(hn),t&&o(Ur),t&&o(un),t&&o(Jr),t&&o(mn),t&&o(Kr),t&&o(fn),t&&o(Yr),t&&o(ve),t&&o(Zr),t&&o(Ee),w(Kt),t&&o(ei),t&&o(H),w(Yt),w(eo),t&&o(ti),t&&o(Se),w(to),t&&o(oi),t&&o(R),w(oo),w(no),t&&o(ai),t&&o(We),w(so),t&&o(ni),t&&o(Q),w(ro),w(uo),w(bt),w(mo),t&&o(si),t&&o(Oe),w(fo),t&&o(ri),t&&o(M),w(go),w(wo),w(kt),w(yo),t&&o(ii),t&&o(He),w(xo),t&&o(di),t&&o(G),w(Do),w(Co),w(yt),w(Mo),w(qo),t&&o(li),t&&o(Ge),w(jo),t&&o(ci),t&&o(q),w(zo),w(Wo),w(Dt),w(Io),w(Oo),t&&o(pi),t&&o(Ue),w(Bo),t&&o(hi),t&&o(j),w(Ho),w(Jo),w($t),w(Ko),t&&o(ui),t&&o(Ke),w(Yo),t&&o(mi),t&&o(F),w(Zo),w(ia),w(Ct),w(da),t&&o(fi),t&&o(Ze),w(la),t&&o(gi),t&&o(X),w(ca),w(fa),w(qt),w(ga),t&&o(_i),t&&o(ot),w(_a),t&&o(vi),t&&o(U),w(va),w(ya),w(zt),w(xa),t&&o(bi),t&&o(st),w(Da),t&&o(Ti),t&&o(E),w(Va),w(qa),w(Pt),w(ja),w(za),t&&o(ki),t&&o(it),w(Ea),t&&o(wi),t&&o(P),w(Pa),w(Oa),w(Lt),w(Ba),t&&o(yi),t&&o(lt),w(Ha),t&&o(xi),t&&o(S),w(Ra),w(Ka),w(Wt),w(Ya),t&&o(Di),t&&o(pt),w(Za),t&&o(Vi),t&&o(L),w(en),w(rn),w(Ot),w(dn)}}}const iv={local:"data2vec",sections:[{local:"overview",title:"Overview"},{local:"transformers.Data2VecTextConfig",title:"Data2VecTextConfig"},{local:"transformers.Data2VecAudioConfig",title:"Data2VecAudioConfig"},{local:"transformers.Data2VecAudioModel",title:"Data2VecAudioModel"},{local:"transformers.Data2VecAudioForAudioFrameClassification",title:"Data2VecAudioForAudioFrameClassification"},{local:"transformers.Data2VecAudioForCTC",title:"Data2VecAudioForCTC"},{local:"transformers.Data2VecAudioForSequenceClassification",title:"Data2VecAudioForSequenceClassification"},{local:"transformers.Data2VecAudioForXVector",title:"Data2VecAudioForXVector"},{local:"transformers.Data2VecTextModel",title:"Data2VecTextModel"},{local:"transformers.Data2VecTextForCausalLM",title:"Data2VecTextForCausalLM"},{local:"transformers.Data2VecTextForMaskedLM",title:"Data2VecTextForMaskedLM"},{local:"transformers.Data2VecTextForSequenceClassification",title:"Data2VecTextForSequenceClassification"},{local:"transformers.Data2VecTextForMultipleChoice",title:"Data2VecTextForMultipleChoice"},{local:"transformers.Data2VecTextForTokenClassification",title:"Data2VecTextForTokenClassification"},{local:"transformers.Data2VecTextForQuestionAnswering",title:"Data2VecTextForQuestionAnswering"}],title:"Data2Vec"};function dv($,p,x){let{fw:m}=p;return $.$$set=y=>{"fw"in y&&x(0,m=y.fw)},[m]}class fv extends H2{constructor(p){super();R2(this,p,dv,rv,Q2,{fw:0})}}export{fv as default,iv as metadata};
