import{S as um,i as gm,s as _m,e as n,k as l,w as v,t as s,M as vm,c as r,d as t,m as c,a,x as b,h as i,b as d,G as e,g as p,y,q as w,o as k,B as T,v as bm,L as ym}from"../../chunks/vendor-hf-doc-builder.js";import{T as ut}from"../../chunks/Tip-hf-doc-builder.js";import{D as q}from"../../chunks/Docstring-hf-doc-builder.js";import{C as $r}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as D}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as wm}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function km(x){let m,$,g,_,M;return _=new $r({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFhtb2RDb25maWclMkMlMjBYbW9kTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhbiUyMFgtTU9EJTIwZmFjZWJvb2slMkZ4bW9kLWJhc2UlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwWG1vZENvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBmYWNlYm9vayUyRnhtb2QtYmFzZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwWG1vZE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> XmodConfig, XmodModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing an X-MOD facebook/xmod-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = XmodConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the facebook/xmod-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XmodModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){m=n("p"),$=s("Examples:"),g=l(),v(_.$$.fragment)},l(f){m=r(f,"P",{});var u=a(m);$=i(u,"Examples:"),u.forEach(t),g=c(f),b(_.$$.fragment,f)},m(f,u){p(f,m,u),e(m,$),p(f,g,u),y(_,f,u),M=!0},p:ym,i(f){M||(w(_.$$.fragment,f),M=!0)},o(f){k(_.$$.fragment,f),M=!1},d(f){f&&t(m),f&&t(g),T(_,f)}}}function Tm(x){let m,$,g,_,M;return{c(){m=n("p"),$=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=s("Module"),M=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(f){m=r(f,"P",{});var u=a(m);$=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(u,"CODE",{});var X=a(g);_=i(X,"Module"),X.forEach(t),M=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(f,u){p(f,m,u),e(m,$),e(m,g),e(g,_),e(m,M)},d(f){f&&t(m)}}}function Mm(x){let m,$,g,_,M;return{c(){m=n("p"),$=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=s("Module"),M=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(f){m=r(f,"P",{});var u=a(m);$=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(u,"CODE",{});var X=a(g);_=i(X,"Module"),X.forEach(t),M=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(f,u){p(f,m,u),e(m,$),e(m,g),e(g,_),e(m,M)},d(f){f&&t(m)}}}function $m(x){let m,$,g,_,M;return{c(){m=n("p"),$=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=s("Module"),M=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(f){m=r(f,"P",{});var u=a(m);$=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(u,"CODE",{});var X=a(g);_=i(X,"Module"),X.forEach(t),M=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(f,u){p(f,m,u),e(m,$),e(m,g),e(g,_),e(m,M)},d(f){f&&t(m)}}}function Xm(x){let m,$,g,_,M;return{c(){m=n("p"),$=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=s("Module"),M=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(f){m=r(f,"P",{});var u=a(m);$=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(u,"CODE",{});var X=a(g);_=i(X,"Module"),X.forEach(t),M=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(f,u){p(f,m,u),e(m,$),e(m,g),e(g,_),e(m,M)},d(f){f&&t(m)}}}function Em(x){let m,$,g,_,M;return{c(){m=n("p"),$=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=s("Module"),M=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(f){m=r(f,"P",{});var u=a(m);$=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(u,"CODE",{});var X=a(g);_=i(X,"Module"),X.forEach(t),M=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(f,u){p(f,m,u),e(m,$),e(m,g),e(g,_),e(m,M)},d(f){f&&t(m)}}}function xm(x){let m,$,g,_,M;return{c(){m=n("p"),$=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=s("Module"),M=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(f){m=r(f,"P",{});var u=a(m);$=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(u,"CODE",{});var X=a(g);_=i(X,"Module"),X.forEach(t),M=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(f,u){p(f,m,u),e(m,$),e(m,g),e(g,_),e(m,M)},d(f){f&&t(m)}}}function Cm(x){let m,$,g,_,M;return{c(){m=n("p"),$=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=s("Module"),M=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(f){m=r(f,"P",{});var u=a(m);$=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(u,"CODE",{});var X=a(g);_=i(X,"Module"),X.forEach(t),M=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(f,u){p(f,m,u),e(m,$),e(m,g),e(g,_),e(m,M)},d(f){f&&t(m)}}}function Fm(x){let m,$,g,_,M,f,u,X,Sa,Xr,re,xe,cn,oo,Wa,hn,ja,Er,W,Ua,to,Ba,Za,gt,Va,Qa,mn,Ga,Ra,xr,_t,Ya,Cr,vt,pn,Ha,Fr,bt,Ka,zr,Ce,no,es,yt,os,ts,ns,fn,rs,Ar,j,as,ro,ss,is,ao,ds,ls,so,cs,hs,Pr,ae,Fe,un,io,ms,gn,ps,Ir,se,ze,_n,lo,fs,vn,us,Lr,wt,gs,Or,kt,bn,_s,Nr,co,qr,ho,yn,vs,Dr,mo,Jr,ie,Ae,wn,po,bs,kn,ys,Sr,fo,Wr,de,Pe,Tn,uo,ws,Mn,ks,jr,go,Ur,le,Ie,$n,_o,Ts,Xn,Ms,Br,F,En,Tt,$s,Xs,xn,Mt,Es,xs,Cn,$t,Cs,Fs,Fn,Xt,zs,As,zn,Et,Ps,Is,An,xt,Ls,Zr,ce,Le,Pn,vo,Os,In,Ns,Vr,S,bo,qs,he,Ds,Ct,Js,Ss,yo,Ws,js,Us,me,Bs,Ft,Zs,Vs,zt,Qs,Gs,Rs,Oe,Qr,pe,Ne,Ln,wo,Ys,On,Hs,Gr,E,ko,Ks,Nn,ei,oi,To,ti,At,ni,ri,ai,Mo,si,$o,ii,di,li,Xo,ci,qn,hi,mi,pi,C,fi,Dn,ui,gi,Jn,_i,vi,Sn,bi,yi,Wn,wi,ki,jn,Ti,Mi,Un,$i,Xi,Ei,qe,xi,Bn,Ci,Fi,Eo,zi,Ai,B,xo,Pi,fe,Ii,Pt,Li,Oi,Zn,Ni,qi,Di,De,Rr,ue,Je,Vn,Co,Ji,Qn,Si,Yr,A,Fo,Wi,zo,ji,Gn,Ui,Bi,Zi,Ao,Vi,It,Qi,Gi,Ri,Po,Yi,Io,Hi,Ki,ed,Z,Lo,od,ge,td,Lt,nd,rd,Rn,ad,sd,id,Se,Hr,_e,We,Yn,Oo,dd,Hn,ld,Kr,P,No,cd,qo,hd,Kn,md,pd,fd,Do,ud,Ot,gd,_d,vd,Jo,bd,So,yd,wd,kd,V,Wo,Td,ve,Md,Nt,$d,Xd,er,Ed,xd,Cd,je,ea,be,Ue,or,jo,Fd,tr,zd,oa,I,Uo,Ad,nr,Pd,Id,Bo,Ld,qt,Od,Nd,qd,Zo,Dd,Vo,Jd,Sd,Wd,Q,Qo,jd,ye,Ud,Dt,Bd,Zd,rr,Vd,Qd,Gd,Be,ta,we,Ze,ar,Go,Rd,sr,Yd,na,L,Ro,Hd,ir,Kd,el,Yo,ol,Jt,tl,nl,rl,Ho,al,Ko,sl,il,dl,G,et,ll,ke,cl,St,hl,ml,dr,pl,fl,ul,Ve,ra,Te,Qe,lr,ot,gl,cr,_l,aa,O,tt,vl,hr,bl,yl,nt,wl,Wt,kl,Tl,Ml,rt,$l,at,Xl,El,xl,R,st,Cl,Me,Fl,jt,zl,Al,mr,Pl,Il,Ll,Ge,sa,$e,Re,pr,it,Ol,fr,Nl,ia,N,dt,ql,Xe,Dl,ur,Jl,Sl,gr,Wl,jl,Ul,lt,Bl,Ut,Zl,Vl,Ql,ct,Gl,ht,Rl,Yl,Hl,Y,mt,Kl,Ee,ec,Bt,oc,tc,_r,nc,rc,ac,Ye,da;return f=new D({}),oo=new D({}),io=new D({}),lo=new D({}),co=new $r({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFhtb2RNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwWG1vZE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRnhtb2QtYmFzZSUyMiklMEFtb2RlbC5zZXRfZGVmYXVsdF9sYW5ndWFnZSglMjJlbl9YWCUyMik=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> XmodModel

model = XmodModel.from_pretrained(<span class="hljs-string">&quot;facebook/xmod-base&quot;</span>)
model.set_default_language(<span class="hljs-string">&quot;en_XX&quot;</span>)`}}),mo=new $r({props:{code:"aW1wb3J0JTIwdG9yY2glMEElMEFpbnB1dF9pZHMlMjAlM0QlMjB0b3JjaC50ZW5zb3IoJTBBJTIwJTIwJTIwJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVCMCUyQyUyMDU4MSUyQyUyMDEwMjY5JTJDJTIwODMlMkMlMjA5OTk0MiUyQyUyMDEzNiUyQyUyMDYwNzQyJTJDJTIwMjMlMkMlMjA3MCUyQyUyMDgwNTgzJTJDJTIwMTgyNzYlMkMlMjAyJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVCMCUyQyUyMDEzMTAlMkMlMjA0OTA4MyUyQyUyMDQ0MyUyQyUyMDI2OSUyQyUyMDcxJTJDJTIwNTQ4NiUyQyUyMDE2NSUyQyUyMDYwNDI5JTJDJTIwNjYwJTJDJTIwMjMlMkMlMjAyJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTVEJTBBKSUwQWxhbmdfaWRzJTIwJTNEJTIwdG9yY2guTG9uZ1RlbnNvciglMEElMjAlMjAlMjAlMjAlNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAwJTJDJTIwJTIwJTIzJTIwZW5fWFglMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjA4JTJDJTIwJTIwJTIzJTIwZGVfREUlMEElMjAlMjAlMjAlMjAlNUQlMEEpJTBBb3V0cHV0JTIwJTNEJTIwbW9kZWwoaW5wdXRfaWRzJTJDJTIwbGFuZ19pZHMlM0RsYW5nX2lkcyk=",highlighted:`<span class="hljs-keyword">import</span> torch

input_ids = torch.tensor(
    [
        [<span class="hljs-number">0</span>, <span class="hljs-number">581</span>, <span class="hljs-number">10269</span>, <span class="hljs-number">83</span>, <span class="hljs-number">99942</span>, <span class="hljs-number">136</span>, <span class="hljs-number">60742</span>, <span class="hljs-number">23</span>, <span class="hljs-number">70</span>, <span class="hljs-number">80583</span>, <span class="hljs-number">18276</span>, <span class="hljs-number">2</span>],
        [<span class="hljs-number">0</span>, <span class="hljs-number">1310</span>, <span class="hljs-number">49083</span>, <span class="hljs-number">443</span>, <span class="hljs-number">269</span>, <span class="hljs-number">71</span>, <span class="hljs-number">5486</span>, <span class="hljs-number">165</span>, <span class="hljs-number">60429</span>, <span class="hljs-number">660</span>, <span class="hljs-number">23</span>, <span class="hljs-number">2</span>],
    ]
)
lang_ids = torch.LongTensor(
    [
        <span class="hljs-number">0</span>,  <span class="hljs-comment"># en_XX</span>
        <span class="hljs-number">8</span>,  <span class="hljs-comment"># de_DE</span>
    ]
)
output = model(input_ids, lang_ids=lang_ids)`}}),po=new D({}),fo=new $r({props:{code:"bW9kZWwuZnJlZXplX2VtYmVkZGluZ3NfYW5kX2xhbmd1YWdlX2FkYXB0ZXJzKCklMEElMjMlMjBGaW5lLXR1bmUlMjB0aGUlMjBtb2RlbCUyMC4uLg==",highlighted:`model.freeze_embeddings_and_language_adapters()
<span class="hljs-comment"># Fine-tune the model ...</span>`}}),uo=new D({}),go=new $r({props:{code:"bW9kZWwuc2V0X2RlZmF1bHRfbGFuZ3VhZ2UoJTIyZGVfREUlMjIpJTBBJTIzJTIwRXZhbHVhdGUlMjB0aGUlMjBtb2RlbCUyMG9uJTIwR2VybWFuJTIwZXhhbXBsZXMlMjAuLi4=",highlighted:`model.set_default_language(<span class="hljs-string">&quot;de_DE&quot;</span>)
<span class="hljs-comment"># Evaluate the model on German examples ...</span>`}}),_o=new D({}),vo=new D({}),bo=new q({props:{name:"class transformers.XmodConfig",anchor:"transformers.XmodConfig",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:"pre_norm",val:" = False"},{name:"adapter_reduction_factor",val:" = 2"},{name:"adapter_layer_norm",val:" = False"},{name:"adapter_reuse_layer_norm",val:" = True"},{name:"ln_before_adapter",val:" = True"},{name:"languages",val:" = ('en_XX',)"},{name:"default_language",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XmodConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the X-MOD model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.31.0/en/model_doc/xmod#transformers.XmodModel">XmodModel</a>.`,name:"vocab_size"},{anchor:"transformers.XmodConfig.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.XmodConfig.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.XmodConfig.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.XmodConfig.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.XmodConfig.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.XmodConfig.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.XmodConfig.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.XmodConfig.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.XmodConfig.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 <a href="/docs/transformers/v4.31.0/en/model_doc/xmod#transformers.XmodModel">XmodModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.XmodConfig.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.XmodConfig.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.XmodConfig.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.XmodConfig.is_decoder",description:`<strong>is_decoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the model is used as a decoder or not. If <code>False</code>, the model is used as an encoder.`,name:"is_decoder"},{anchor:"transformers.XmodConfig.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.XmodConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The dropout ratio for the classification head.`,name:"classifier_dropout"},{anchor:"transformers.XmodConfig.pre_norm",description:`<strong>pre_norm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to apply layer normalization before each block.`,name:"pre_norm"},{anchor:"transformers.XmodConfig.adapter_reduction_factor",description:`<strong>adapter_reduction_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to 2) &#x2014;
The factor by which the dimensionality of the adapter is reduced relative to <code>hidden_size</code>.`,name:"adapter_reduction_factor"},{anchor:"transformers.XmodConfig.adapter_layer_norm",description:`<strong>adapter_layer_norm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to apply a new layer normalization before the adapter modules (shared across all adapters).`,name:"adapter_layer_norm"},{anchor:"transformers.XmodConfig.adapter_reuse_layer_norm",description:`<strong>adapter_reuse_layer_norm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to reuse the second layer normalization and apply it before the adapter modules as well.`,name:"adapter_reuse_layer_norm"},{anchor:"transformers.XmodConfig.ln_before_adapter",description:`<strong>ln_before_adapter</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to apply the layer normalization before the residual connection around the adapter module.`,name:"ln_before_adapter"},{anchor:"transformers.XmodConfig.languages",description:`<strong>languages</strong> (<code>Iterable[str]</code>, <em>optional</em>, defaults to <code>[&quot;en_XX&quot;]</code>) &#x2014;
An iterable of language codes for which adapter modules should be initialized.`,name:"languages"},{anchor:"transformers.XmodConfig.default_language",description:`<strong>default_language</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Language code of a default language. It will be assumed that the input is in this language if no language
codes are explicitly passed to the forward method.`,name:"default_language"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/xmod/configuration_xmod.py#L40"}}),Oe=new wm({props:{anchor:"transformers.XmodConfig.example",$$slots:{default:[km]},$$scope:{ctx:x}}}),wo=new D({}),ko=new q({props:{name:"class transformers.XmodModel",anchor:"transformers.XmodModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.XmodModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/xmod#transformers.XmodConfig">XmodConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/xmod/modeling_xmod.py#L790"}}),xo=new q({props:{name:"forward",anchor:"transformers.XmodModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"lang_ids",val:": typing.Optional[torch.LongTensor] = 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"}],parametersDescription:[{anchor:"transformers.XmodModel.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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.XmodModel.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodModel.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.XmodModel.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.XmodModel.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.XmodModel.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.XmodModel.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.XmodModel.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.XmodModel.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.XmodModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XmodModel.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.XmodModel.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.XmodModel.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 &#x2014;",name:"past_key_values"},{anchor:"transformers.XmodModel.forward.of",description:`<strong>of</strong> 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:"of"},{anchor:"transformers.XmodModel.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"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/xmod/modeling_xmod.py#L836"}}),De=new ut({props:{$$slots:{default:[Tm]},$$scope:{ctx:x}}}),Co=new D({}),Fo=new q({props:{name:"class transformers.XmodForCausalLM",anchor:"transformers.XmodForCausalLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XmodForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/xmod#transformers.XmodConfig">XmodConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/xmod/modeling_xmod.py#L981"}}),Lo=new q({props:{name:"forward",anchor:"transformers.XmodForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"lang_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Tuple[typing.Tuple[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"}],parametersDescription:[{anchor:"transformers.XmodForCausalLM.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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.XmodForCausalLM.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForCausalLM.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.XmodForCausalLM.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.XmodForCausalLM.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.XmodForCausalLM.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.XmodForCausalLM.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.XmodForCausalLM.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.XmodForCausalLM.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.XmodForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XmodForCausalLM.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.XmodForCausalLM.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.XmodForCausalLM.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.XmodForCausalLM.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.XmodForCausalLM.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>).</p>
<p>Returns &#x2014; <code>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</code> or <code>tuple(torch.FloatTensor)</code></p>
<p>Example &#x2014;`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/xmod/modeling_xmod.py#L1005"}}),Se=new ut({props:{$$slots:{default:[Mm]},$$scope:{ctx:x}}}),Oo=new D({}),No=new q({props:{name:"class transformers.XmodForMaskedLM",anchor:"transformers.XmodForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XmodForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/xmod#transformers.XmodConfig">XmodConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/xmod/modeling_xmod.py#L1138"}}),Wo=new q({props:{name:"forward",anchor:"transformers.XmodForMaskedLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"lang_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XmodForMaskedLM.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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.XmodForMaskedLM.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForMaskedLM.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.XmodForMaskedLM.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.XmodForMaskedLM.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.XmodForMaskedLM.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.XmodForMaskedLM.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.XmodForMaskedLM.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.XmodForMaskedLM.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.XmodForMaskedLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XmodForMaskedLM.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.XmodForMaskedLM.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"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/xmod/modeling_xmod.py#L1165"}}),je=new ut({props:{$$slots:{default:[$m]},$$scope:{ctx:x}}}),jo=new D({}),Uo=new q({props:{name:"class transformers.XmodForSequenceClassification",anchor:"transformers.XmodForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XmodForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/xmod#transformers.XmodConfig">XmodConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/xmod/modeling_xmod.py#L1265"}}),Qo=new q({props:{name:"forward",anchor:"transformers.XmodForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"lang_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XmodForSequenceClassification.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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.XmodForSequenceClassification.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForSequenceClassification.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.XmodForSequenceClassification.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.XmodForSequenceClassification.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.XmodForSequenceClassification.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.XmodForSequenceClassification.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.XmodForSequenceClassification.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.XmodForSequenceClassification.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.XmodForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XmodForSequenceClassification.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"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/xmod/modeling_xmod.py#L1278"}}),Be=new ut({props:{$$slots:{default:[Xm]},$$scope:{ctx:x}}}),Go=new D({}),Ro=new q({props:{name:"class transformers.XmodForMultipleChoice",anchor:"transformers.XmodForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XmodForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/xmod#transformers.XmodConfig">XmodConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/xmod/modeling_xmod.py#L1358"}}),et=new q({props:{name:"forward",anchor:"transformers.XmodForMultipleChoice.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"lang_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XmodForMultipleChoice.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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.XmodForMultipleChoice.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForMultipleChoice.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.XmodForMultipleChoice.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.XmodForMultipleChoice.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.XmodForMultipleChoice.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.XmodForMultipleChoice.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.XmodForMultipleChoice.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.XmodForMultipleChoice.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.XmodForMultipleChoice.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XmodForMultipleChoice.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"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/xmod/modeling_xmod.py#L1370"}}),Ve=new ut({props:{$$slots:{default:[Em]},$$scope:{ctx:x}}}),ot=new D({}),tt=new q({props:{name:"class transformers.XmodForTokenClassification",anchor:"transformers.XmodForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XmodForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/xmod#transformers.XmodConfig">XmodConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/xmod/modeling_xmod.py#L1447"}}),st=new q({props:{name:"forward",anchor:"transformers.XmodForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"lang_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XmodForTokenClassification.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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.XmodForTokenClassification.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForTokenClassification.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.XmodForTokenClassification.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.XmodForTokenClassification.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.XmodForTokenClassification.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.XmodForTokenClassification.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.XmodForTokenClassification.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.XmodForTokenClassification.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.XmodForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XmodForTokenClassification.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"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/xmod/modeling_xmod.py#L1463"}}),Ge=new ut({props:{$$slots:{default:[xm]},$$scope:{ctx:x}}}),it=new D({}),dt=new q({props:{name:"class transformers.XmodForQuestionAnswering",anchor:"transformers.XmodForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XmodForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/xmod#transformers.XmodConfig">XmodConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/xmod/modeling_xmod.py#L1549"}}),mt=new q({props:{name:"forward",anchor:"transformers.XmodForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"lang_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XmodForQuestionAnswering.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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.XmodForQuestionAnswering.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForQuestionAnswering.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.XmodForQuestionAnswering.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.XmodForQuestionAnswering.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.XmodForQuestionAnswering.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.XmodForQuestionAnswering.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.XmodForQuestionAnswering.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.XmodForQuestionAnswering.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.XmodForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XmodForQuestionAnswering.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.XmodForQuestionAnswering.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"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/xmod/modeling_xmod.py#L1561"}}),Ye=new ut({props:{$$slots:{default:[Cm]},$$scope:{ctx:x}}}),{c(){m=n("meta"),$=l(),g=n("h1"),_=n("a"),M=n("span"),v(f.$$.fragment),u=l(),X=n("span"),Sa=s("X-MOD"),Xr=l(),re=n("h2"),xe=n("a"),cn=n("span"),v(oo.$$.fragment),Wa=l(),hn=n("span"),ja=s("Overview"),Er=l(),W=n("p"),Ua=s("The X-MOD model was proposed in "),to=n("a"),Ba=s("Lifting the Curse of Multilinguality by Pre-training Modular Transformers"),Za=s(` by Jonas Pfeiffer, Naman Goyal, Xi Lin, Xian Li, James Cross, Sebastian Riedel, and Mikel Artetxe.
X-MOD extends multilingual masked language models like `),gt=n("a"),Va=s("XLM-R"),Qa=s(" to include language-specific modular components ("),mn=n("em"),Ga=s("language adapters"),Ra=s(") during pre-training. For fine-tuning, the language adapters in each transformer layer are frozen."),xr=l(),_t=n("p"),Ya=s("The abstract from the paper is the following:"),Cr=l(),vt=n("p"),pn=n("em"),Ha=s("Multilingual pre-trained models are known to suffer from the curse of multilinguality, which causes per-language performance to drop as they cover more languages. We address this issue by introducing language-specific modules, which allows us to grow the total capacity of the model, while keeping the total number of trainable parameters per language constant. In contrast with prior work that learns language-specific components post-hoc, we pre-train the modules of our Cross-lingual Modular (X-MOD) models from the start. Our experiments on natural language inference, named entity recognition and question answering show that our approach not only mitigates the negative interference between languages, but also enables positive transfer, resulting in improved monolingual and cross-lingual performance. Furthermore, our approach enables adding languages post-hoc with no measurable drop in performance, no longer limiting the model usage to the set of pre-trained languages."),Fr=l(),bt=n("p"),Ka=s("Tips:"),zr=l(),Ce=n("ul"),no=n("li"),es=s("X-MOD is similar to "),yt=n("a"),os=s("XLM-R"),ts=s(", but a difference is that the input language needs to be specified so that the correct language adapter can be activated."),ns=l(),fn=n("li"),rs=s("The main models \u2013 base and large \u2013 have adapters for 81 languages."),Ar=l(),j=n("p"),as=s("This model was contributed by "),ro=n("a"),ss=s("jvamvas"),is=s(`.
The original code can be found `),ao=n("a"),ds=s("here"),ls=s(" and the original documentation is found "),so=n("a"),cs=s("here"),hs=s("."),Pr=l(),ae=n("h2"),Fe=n("a"),un=n("span"),v(io.$$.fragment),ms=l(),gn=n("span"),ps=s("Adapter Usage"),Ir=l(),se=n("h3"),ze=n("a"),_n=n("span"),v(lo.$$.fragment),fs=l(),vn=n("span"),us=s("Input language"),Lr=l(),wt=n("p"),gs=s("There are two ways to specify the input language:"),Or=l(),kt=n("ol"),bn=n("li"),_s=s("By setting a default language before using the model:"),Nr=l(),v(co.$$.fragment),qr=l(),ho=n("ol"),yn=n("li"),vs=s("By explicitly passing the index of the language adapter for each sample:"),Dr=l(),v(mo.$$.fragment),Jr=l(),ie=n("h3"),Ae=n("a"),wn=n("span"),v(po.$$.fragment),bs=l(),kn=n("span"),ys=s("Fine-tuning"),Sr=s(`

The paper recommends that the embedding layer and the language adapters are frozen during fine-tuning. A method for doing this is provided:

	`),v(fo.$$.fragment),Wr=l(),de=n("h3"),Pe=n("a"),Tn=n("span"),v(uo.$$.fragment),ws=l(),Mn=n("span"),ks=s("Cross-lingual transfer"),jr=s(`

After fine-tuning, zero-shot cross-lingual transfer can be tested by activating the language adapter of the target language:

	`),v(go.$$.fragment),Ur=l(),le=n("h2"),Ie=n("a"),$n=n("span"),v(_o.$$.fragment),Ts=l(),Xn=n("span"),Ms=s("Resources"),Br=l(),F=n("ul"),En=n("li"),Tt=n("a"),$s=s("Text classification task guide"),Xs=l(),xn=n("li"),Mt=n("a"),Es=s("Token classification task guide"),xs=l(),Cn=n("li"),$t=n("a"),Cs=s("Question answering task guide"),Fs=l(),Fn=n("li"),Xt=n("a"),zs=s("Causal language modeling task guide"),As=l(),zn=n("li"),Et=n("a"),Ps=s("Masked language modeling task guide"),Is=l(),An=n("li"),xt=n("a"),Ls=s("Multiple choice task guide"),Zr=l(),ce=n("h2"),Le=n("a"),Pn=n("span"),v(vo.$$.fragment),Os=l(),In=n("span"),Ns=s("XmodConfig"),Vr=l(),S=n("div"),v(bo.$$.fragment),qs=l(),he=n("p"),Ds=s("This is the configuration class to store the configuration of a "),Ct=n("a"),Js=s("XmodModel"),Ss=s(`. It is used to instantiate an X-MOD
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
`),yo=n("a"),Ws=s("facebook/xmod-base"),js=s(" architecture."),Us=l(),me=n("p"),Bs=s("Configuration objects inherit from "),Ft=n("a"),Zs=s("PretrainedConfig"),Vs=s(` and can be used to control the model outputs. Read the
documentation from `),zt=n("a"),Qs=s("PretrainedConfig"),Gs=s(" for more information."),Rs=l(),v(Oe.$$.fragment),Qr=l(),pe=n("h2"),Ne=n("a"),Ln=n("span"),v(wo.$$.fragment),Ys=l(),On=n("span"),Hs=s("XmodModel"),Gr=l(),E=n("div"),v(ko.$$.fragment),Ks=l(),Nn=n("p"),ei=s("The bare X-MOD Model transformer outputting raw hidden-states without any specific head on top."),oi=l(),To=n("p"),ti=s("This model inherits from "),At=n("a"),ni=s("PreTrainedModel"),ri=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ai=l(),Mo=n("p"),si=s("This model is also a PyTorch "),$o=n("a"),ii=s("torch.nn.Module"),di=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),li=l(),Xo=n("p"),ci=s(`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 `),qn=n("em"),hi=s(`Attention is
all you need`),mi=s(`_ by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz
Kaiser and Illia Polosukhin.`),pi=l(),C=n("p"),fi=s("To behave as an decoder the model needs to be initialized with the "),Dn=n("code"),ui=s("is_decoder"),gi=s(` argument of the configuration set
to `),Jn=n("code"),_i=s("True"),vi=s(". To be used in a Seq2Seq model, the model needs to initialized with both "),Sn=n("code"),bi=s("is_decoder"),yi=s(` argument and
`),Wn=n("code"),wi=s("add_cross_attention"),ki=s(" set to "),jn=n("code"),Ti=s("True"),Mi=s("; an "),Un=n("code"),$i=s("encoder_hidden_states"),Xi=s(" is then expected as an input to the forward pass."),Ei=l(),qe=n("p"),xi=s(".. _"),Bn=n("em"),Ci=s("Attention is all you need"),Fi=s(": "),Eo=n("a"),zi=s("https://arxiv.org/abs/1706.03762"),Ai=l(),B=n("div"),v(xo.$$.fragment),Pi=l(),fe=n("p"),Ii=s("The "),Pt=n("a"),Li=s("XmodModel"),Oi=s(" forward method, overrides the "),Zn=n("code"),Ni=s("__call__"),qi=s(" special method."),Di=l(),v(De.$$.fragment),Rr=l(),ue=n("h2"),Je=n("a"),Vn=n("span"),v(Co.$$.fragment),Ji=l(),Qn=n("span"),Si=s("XmodForCausalLM"),Yr=l(),A=n("div"),v(Fo.$$.fragment),Wi=l(),zo=n("p"),ji=s("X-MOD Model with a "),Gn=n("code"),Ui=s("language modeling"),Bi=s(" head on top for CLM fine-tuning."),Zi=l(),Ao=n("p"),Vi=s("This model inherits from "),It=n("a"),Qi=s("PreTrainedModel"),Gi=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ri=l(),Po=n("p"),Yi=s("This model is also a PyTorch "),Io=n("a"),Hi=s("torch.nn.Module"),Ki=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ed=l(),Z=n("div"),v(Lo.$$.fragment),od=l(),ge=n("p"),td=s("The "),Lt=n("a"),nd=s("XmodForCausalLM"),rd=s(" forward method, overrides the "),Rn=n("code"),ad=s("__call__"),sd=s(" special method."),id=l(),v(Se.$$.fragment),Hr=l(),_e=n("h2"),We=n("a"),Yn=n("span"),v(Oo.$$.fragment),dd=l(),Hn=n("span"),ld=s("XmodForMaskedLM"),Kr=l(),P=n("div"),v(No.$$.fragment),cd=l(),qo=n("p"),hd=s("X-MOD Model with a "),Kn=n("code"),md=s("language modeling"),pd=s(" head on top."),fd=l(),Do=n("p"),ud=s("This model inherits from "),Ot=n("a"),gd=s("PreTrainedModel"),_d=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),vd=l(),Jo=n("p"),bd=s("This model is also a PyTorch "),So=n("a"),yd=s("torch.nn.Module"),wd=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),kd=l(),V=n("div"),v(Wo.$$.fragment),Td=l(),ve=n("p"),Md=s("The "),Nt=n("a"),$d=s("XmodForMaskedLM"),Xd=s(" forward method, overrides the "),er=n("code"),Ed=s("__call__"),xd=s(" special method."),Cd=l(),v(je.$$.fragment),ea=l(),be=n("h2"),Ue=n("a"),or=n("span"),v(jo.$$.fragment),Fd=l(),tr=n("span"),zd=s("XmodForSequenceClassification"),oa=l(),I=n("div"),v(Uo.$$.fragment),Ad=l(),nr=n("p"),Pd=s(`X-MOD Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),Id=l(),Bo=n("p"),Ld=s("This model inherits from "),qt=n("a"),Od=s("PreTrainedModel"),Nd=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),qd=l(),Zo=n("p"),Dd=s("This model is also a PyTorch "),Vo=n("a"),Jd=s("torch.nn.Module"),Sd=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Wd=l(),Q=n("div"),v(Qo.$$.fragment),jd=l(),ye=n("p"),Ud=s("The "),Dt=n("a"),Bd=s("XmodForSequenceClassification"),Zd=s(" forward method, overrides the "),rr=n("code"),Vd=s("__call__"),Qd=s(" special method."),Gd=l(),v(Be.$$.fragment),ta=l(),we=n("h2"),Ze=n("a"),ar=n("span"),v(Go.$$.fragment),Rd=l(),sr=n("span"),Yd=s("XmodForMultipleChoice"),na=l(),L=n("div"),v(Ro.$$.fragment),Hd=l(),ir=n("p"),Kd=s(`X-MOD 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.`),el=l(),Yo=n("p"),ol=s("This model inherits from "),Jt=n("a"),tl=s("PreTrainedModel"),nl=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),rl=l(),Ho=n("p"),al=s("This model is also a PyTorch "),Ko=n("a"),sl=s("torch.nn.Module"),il=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),dl=l(),G=n("div"),v(et.$$.fragment),ll=l(),ke=n("p"),cl=s("The "),St=n("a"),hl=s("XmodForMultipleChoice"),ml=s(" forward method, overrides the "),dr=n("code"),pl=s("__call__"),fl=s(" special method."),ul=l(),v(Ve.$$.fragment),ra=l(),Te=n("h2"),Qe=n("a"),lr=n("span"),v(ot.$$.fragment),gl=l(),cr=n("span"),_l=s("XmodForTokenClassification"),aa=l(),O=n("div"),v(tt.$$.fragment),vl=l(),hr=n("p"),bl=s(`X-MOD 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.`),yl=l(),nt=n("p"),wl=s("This model inherits from "),Wt=n("a"),kl=s("PreTrainedModel"),Tl=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ml=l(),rt=n("p"),$l=s("This model is also a PyTorch "),at=n("a"),Xl=s("torch.nn.Module"),El=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),xl=l(),R=n("div"),v(st.$$.fragment),Cl=l(),Me=n("p"),Fl=s("The "),jt=n("a"),zl=s("XmodForTokenClassification"),Al=s(" forward method, overrides the "),mr=n("code"),Pl=s("__call__"),Il=s(" special method."),Ll=l(),v(Ge.$$.fragment),sa=l(),$e=n("h2"),Re=n("a"),pr=n("span"),v(it.$$.fragment),Ol=l(),fr=n("span"),Nl=s("XmodForQuestionAnswering"),ia=l(),N=n("div"),v(dt.$$.fragment),ql=l(),Xe=n("p"),Dl=s(`X-MOD 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 `),ur=n("code"),Jl=s("span start logits"),Sl=s(" and "),gr=n("code"),Wl=s("span end logits"),jl=s(")."),Ul=l(),lt=n("p"),Bl=s("This model inherits from "),Ut=n("a"),Zl=s("PreTrainedModel"),Vl=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ql=l(),ct=n("p"),Gl=s("This model is also a PyTorch "),ht=n("a"),Rl=s("torch.nn.Module"),Yl=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Hl=l(),Y=n("div"),v(mt.$$.fragment),Kl=l(),Ee=n("p"),ec=s("The "),Bt=n("a"),oc=s("XmodForQuestionAnswering"),tc=s(" forward method, overrides the "),_r=n("code"),nc=s("__call__"),rc=s(" special method."),ac=l(),v(Ye.$$.fragment),this.h()},l(o){const h=vm('[data-svelte="svelte-1phssyn"]',document.head);m=r(h,"META",{name:!0,content:!0}),h.forEach(t),$=c(o),g=r(o,"H1",{class:!0});var pt=a(g);_=r(pt,"A",{id:!0,class:!0,href:!0});var vr=a(_);M=r(vr,"SPAN",{});var br=a(M);b(f.$$.fragment,br),br.forEach(t),vr.forEach(t),u=c(pt),X=r(pt,"SPAN",{});var yr=a(X);Sa=i(yr,"X-MOD"),yr.forEach(t),pt.forEach(t),Xr=c(o),re=r(o,"H2",{class:!0});var ft=a(re);xe=r(ft,"A",{id:!0,class:!0,href:!0});var wr=a(xe);cn=r(wr,"SPAN",{});var kr=a(cn);b(oo.$$.fragment,kr),kr.forEach(t),wr.forEach(t),Wa=c(ft),hn=r(ft,"SPAN",{});var Tr=a(hn);ja=i(Tr,"Overview"),Tr.forEach(t),ft.forEach(t),Er=c(o),W=r(o,"P",{});var He=a(W);Ua=i(He,"The X-MOD model was proposed in "),to=r(He,"A",{href:!0,rel:!0});var sc=a(to);Ba=i(sc,"Lifting the Curse of Multilinguality by Pre-training Modular Transformers"),sc.forEach(t),Za=i(He,` by Jonas Pfeiffer, Naman Goyal, Xi Lin, Xian Li, James Cross, Sebastian Riedel, and Mikel Artetxe.
X-MOD extends multilingual masked language models like `),gt=r(He,"A",{href:!0});var ic=a(gt);Va=i(ic,"XLM-R"),ic.forEach(t),Qa=i(He," to include language-specific modular components ("),mn=r(He,"EM",{});var dc=a(mn);Ga=i(dc,"language adapters"),dc.forEach(t),Ra=i(He,") during pre-training. For fine-tuning, the language adapters in each transformer layer are frozen."),He.forEach(t),xr=c(o),_t=r(o,"P",{});var lc=a(_t);Ya=i(lc,"The abstract from the paper is the following:"),lc.forEach(t),Cr=c(o),vt=r(o,"P",{});var cc=a(vt);pn=r(cc,"EM",{});var hc=a(pn);Ha=i(hc,"Multilingual pre-trained models are known to suffer from the curse of multilinguality, which causes per-language performance to drop as they cover more languages. We address this issue by introducing language-specific modules, which allows us to grow the total capacity of the model, while keeping the total number of trainable parameters per language constant. In contrast with prior work that learns language-specific components post-hoc, we pre-train the modules of our Cross-lingual Modular (X-MOD) models from the start. Our experiments on natural language inference, named entity recognition and question answering show that our approach not only mitigates the negative interference between languages, but also enables positive transfer, resulting in improved monolingual and cross-lingual performance. Furthermore, our approach enables adding languages post-hoc with no measurable drop in performance, no longer limiting the model usage to the set of pre-trained languages."),hc.forEach(t),cc.forEach(t),Fr=c(o),bt=r(o,"P",{});var mc=a(bt);Ka=i(mc,"Tips:"),mc.forEach(t),zr=c(o),Ce=r(o,"UL",{});var la=a(Ce);no=r(la,"LI",{});var ca=a(no);es=i(ca,"X-MOD is similar to "),yt=r(ca,"A",{href:!0});var pc=a(yt);os=i(pc,"XLM-R"),pc.forEach(t),ts=i(ca,", but a difference is that the input language needs to be specified so that the correct language adapter can be activated."),ca.forEach(t),ns=c(la),fn=r(la,"LI",{});var fc=a(fn);rs=i(fc,"The main models \u2013 base and large \u2013 have adapters for 81 languages."),fc.forEach(t),la.forEach(t),Ar=c(o),j=r(o,"P",{});var Ke=a(j);as=i(Ke,"This model was contributed by "),ro=r(Ke,"A",{href:!0,rel:!0});var uc=a(ro);ss=i(uc,"jvamvas"),uc.forEach(t),is=i(Ke,`.
The original code can be found `),ao=r(Ke,"A",{href:!0,rel:!0});var gc=a(ao);ds=i(gc,"here"),gc.forEach(t),ls=i(Ke," and the original documentation is found "),so=r(Ke,"A",{href:!0,rel:!0});var _c=a(so);cs=i(_c,"here"),_c.forEach(t),hs=i(Ke,"."),Ke.forEach(t),Pr=c(o),ae=r(o,"H2",{class:!0});var ha=a(ae);Fe=r(ha,"A",{id:!0,class:!0,href:!0});var vc=a(Fe);un=r(vc,"SPAN",{});var bc=a(un);b(io.$$.fragment,bc),bc.forEach(t),vc.forEach(t),ms=c(ha),gn=r(ha,"SPAN",{});var yc=a(gn);ps=i(yc,"Adapter Usage"),yc.forEach(t),ha.forEach(t),Ir=c(o),se=r(o,"H3",{class:!0});var ma=a(se);ze=r(ma,"A",{id:!0,class:!0,href:!0});var wc=a(ze);_n=r(wc,"SPAN",{});var kc=a(_n);b(lo.$$.fragment,kc),kc.forEach(t),wc.forEach(t),fs=c(ma),vn=r(ma,"SPAN",{});var Tc=a(vn);us=i(Tc,"Input language"),Tc.forEach(t),ma.forEach(t),Lr=c(o),wt=r(o,"P",{});var Mc=a(wt);gs=i(Mc,"There are two ways to specify the input language:"),Mc.forEach(t),Or=c(o),kt=r(o,"OL",{});var $c=a(kt);bn=r($c,"LI",{});var Xc=a(bn);_s=i(Xc,"By setting a default language before using the model:"),Xc.forEach(t),$c.forEach(t),Nr=c(o),b(co.$$.fragment,o),qr=c(o),ho=r(o,"OL",{start:!0});var Ec=a(ho);yn=r(Ec,"LI",{});var xc=a(yn);vs=i(xc,"By explicitly passing the index of the language adapter for each sample:"),xc.forEach(t),Ec.forEach(t),Dr=c(o),b(mo.$$.fragment,o),Jr=c(o),ie=r(o,"H3",{class:!0});var pa=a(ie);Ae=r(pa,"A",{id:!0,class:!0,href:!0});var Cc=a(Ae);wn=r(Cc,"SPAN",{});var Fc=a(wn);b(po.$$.fragment,Fc),Fc.forEach(t),Cc.forEach(t),bs=c(pa),kn=r(pa,"SPAN",{});var zc=a(kn);ys=i(zc,"Fine-tuning"),zc.forEach(t),pa.forEach(t),Sr=i(o,`

The paper recommends that the embedding layer and the language adapters are frozen during fine-tuning. A method for doing this is provided:

	`),b(fo.$$.fragment,o),Wr=c(o),de=r(o,"H3",{class:!0});var fa=a(de);Pe=r(fa,"A",{id:!0,class:!0,href:!0});var Ac=a(Pe);Tn=r(Ac,"SPAN",{});var Pc=a(Tn);b(uo.$$.fragment,Pc),Pc.forEach(t),Ac.forEach(t),ws=c(fa),Mn=r(fa,"SPAN",{});var Ic=a(Mn);ks=i(Ic,"Cross-lingual transfer"),Ic.forEach(t),fa.forEach(t),jr=i(o,`

After fine-tuning, zero-shot cross-lingual transfer can be tested by activating the language adapter of the target language:

	`),b(go.$$.fragment,o),Ur=c(o),le=r(o,"H2",{class:!0});var ua=a(le);Ie=r(ua,"A",{id:!0,class:!0,href:!0});var Lc=a(Ie);$n=r(Lc,"SPAN",{});var Oc=a($n);b(_o.$$.fragment,Oc),Oc.forEach(t),Lc.forEach(t),Ts=c(ua),Xn=r(ua,"SPAN",{});var Nc=a(Xn);Ms=i(Nc,"Resources"),Nc.forEach(t),ua.forEach(t),Br=c(o),F=r(o,"UL",{});var U=a(F);En=r(U,"LI",{});var qc=a(En);Tt=r(qc,"A",{href:!0});var Dc=a(Tt);$s=i(Dc,"Text classification task guide"),Dc.forEach(t),qc.forEach(t),Xs=c(U),xn=r(U,"LI",{});var Jc=a(xn);Mt=r(Jc,"A",{href:!0});var Sc=a(Mt);Es=i(Sc,"Token classification task guide"),Sc.forEach(t),Jc.forEach(t),xs=c(U),Cn=r(U,"LI",{});var Wc=a(Cn);$t=r(Wc,"A",{href:!0});var jc=a($t);Cs=i(jc,"Question answering task guide"),jc.forEach(t),Wc.forEach(t),Fs=c(U),Fn=r(U,"LI",{});var Uc=a(Fn);Xt=r(Uc,"A",{href:!0});var Bc=a(Xt);zs=i(Bc,"Causal language modeling task guide"),Bc.forEach(t),Uc.forEach(t),As=c(U),zn=r(U,"LI",{});var Zc=a(zn);Et=r(Zc,"A",{href:!0});var Vc=a(Et);Ps=i(Vc,"Masked language modeling task guide"),Vc.forEach(t),Zc.forEach(t),Is=c(U),An=r(U,"LI",{});var Qc=a(An);xt=r(Qc,"A",{href:!0});var Gc=a(xt);Ls=i(Gc,"Multiple choice task guide"),Gc.forEach(t),Qc.forEach(t),U.forEach(t),Zr=c(o),ce=r(o,"H2",{class:!0});var ga=a(ce);Le=r(ga,"A",{id:!0,class:!0,href:!0});var Rc=a(Le);Pn=r(Rc,"SPAN",{});var Yc=a(Pn);b(vo.$$.fragment,Yc),Yc.forEach(t),Rc.forEach(t),Os=c(ga),In=r(ga,"SPAN",{});var Hc=a(In);Ns=i(Hc,"XmodConfig"),Hc.forEach(t),ga.forEach(t),Vr=c(o),S=r(o,"DIV",{class:!0});var eo=a(S);b(bo.$$.fragment,eo),qs=c(eo),he=r(eo,"P",{});var Zt=a(he);Ds=i(Zt,"This is the configuration class to store the configuration of a "),Ct=r(Zt,"A",{href:!0});var Kc=a(Ct);Js=i(Kc,"XmodModel"),Kc.forEach(t),Ss=i(Zt,`. It is used to instantiate an X-MOD
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
`),yo=r(Zt,"A",{href:!0,rel:!0});var eh=a(yo);Ws=i(eh,"facebook/xmod-base"),eh.forEach(t),js=i(Zt," architecture."),Zt.forEach(t),Us=c(eo),me=r(eo,"P",{});var Vt=a(me);Bs=i(Vt,"Configuration objects inherit from "),Ft=r(Vt,"A",{href:!0});var oh=a(Ft);Zs=i(oh,"PretrainedConfig"),oh.forEach(t),Vs=i(Vt,` and can be used to control the model outputs. Read the
documentation from `),zt=r(Vt,"A",{href:!0});var th=a(zt);Qs=i(th,"PretrainedConfig"),th.forEach(t),Gs=i(Vt," for more information."),Vt.forEach(t),Rs=c(eo),b(Oe.$$.fragment,eo),eo.forEach(t),Qr=c(o),pe=r(o,"H2",{class:!0});var _a=a(pe);Ne=r(_a,"A",{id:!0,class:!0,href:!0});var nh=a(Ne);Ln=r(nh,"SPAN",{});var rh=a(Ln);b(wo.$$.fragment,rh),rh.forEach(t),nh.forEach(t),Ys=c(_a),On=r(_a,"SPAN",{});var ah=a(On);Hs=i(ah,"XmodModel"),ah.forEach(t),_a.forEach(t),Gr=c(o),E=r(o,"DIV",{class:!0});var z=a(E);b(ko.$$.fragment,z),Ks=c(z),Nn=r(z,"P",{});var sh=a(Nn);ei=i(sh,"The bare X-MOD Model transformer outputting raw hidden-states without any specific head on top."),sh.forEach(t),oi=c(z),To=r(z,"P",{});var va=a(To);ti=i(va,"This model inherits from "),At=r(va,"A",{href:!0});var ih=a(At);ni=i(ih,"PreTrainedModel"),ih.forEach(t),ri=i(va,`. 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.)`),va.forEach(t),ai=c(z),Mo=r(z,"P",{});var ba=a(Mo);si=i(ba,"This model is also a PyTorch "),$o=r(ba,"A",{href:!0,rel:!0});var dh=a($o);ii=i(dh,"torch.nn.Module"),dh.forEach(t),di=i(ba,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ba.forEach(t),li=c(z),Xo=r(z,"P",{});var ya=a(Xo);ci=i(ya,`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 `),qn=r(ya,"EM",{});var lh=a(qn);hi=i(lh,`Attention is
all you need`),lh.forEach(t),mi=i(ya,`_ by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz
Kaiser and Illia Polosukhin.`),ya.forEach(t),pi=c(z),C=r(z,"P",{});var J=a(C);fi=i(J,"To behave as an decoder the model needs to be initialized with the "),Dn=r(J,"CODE",{});var ch=a(Dn);ui=i(ch,"is_decoder"),ch.forEach(t),gi=i(J,` argument of the configuration set
to `),Jn=r(J,"CODE",{});var hh=a(Jn);_i=i(hh,"True"),hh.forEach(t),vi=i(J,". To be used in a Seq2Seq model, the model needs to initialized with both "),Sn=r(J,"CODE",{});var mh=a(Sn);bi=i(mh,"is_decoder"),mh.forEach(t),yi=i(J,` argument and
`),Wn=r(J,"CODE",{});var ph=a(Wn);wi=i(ph,"add_cross_attention"),ph.forEach(t),ki=i(J," set to "),jn=r(J,"CODE",{});var fh=a(jn);Ti=i(fh,"True"),fh.forEach(t),Mi=i(J,"; an "),Un=r(J,"CODE",{});var uh=a(Un);$i=i(uh,"encoder_hidden_states"),uh.forEach(t),Xi=i(J," is then expected as an input to the forward pass."),J.forEach(t),Ei=c(z),qe=r(z,"P",{});var Mr=a(qe);xi=i(Mr,".. _"),Bn=r(Mr,"EM",{});var gh=a(Bn);Ci=i(gh,"Attention is all you need"),gh.forEach(t),Fi=i(Mr,": "),Eo=r(Mr,"A",{href:!0,rel:!0});var _h=a(Eo);zi=i(_h,"https://arxiv.org/abs/1706.03762"),_h.forEach(t),Mr.forEach(t),Ai=c(z),B=r(z,"DIV",{class:!0});var Qt=a(B);b(xo.$$.fragment,Qt),Pi=c(Qt),fe=r(Qt,"P",{});var Gt=a(fe);Ii=i(Gt,"The "),Pt=r(Gt,"A",{href:!0});var vh=a(Pt);Li=i(vh,"XmodModel"),vh.forEach(t),Oi=i(Gt," forward method, overrides the "),Zn=r(Gt,"CODE",{});var bh=a(Zn);Ni=i(bh,"__call__"),bh.forEach(t),qi=i(Gt," special method."),Gt.forEach(t),Di=c(Qt),b(De.$$.fragment,Qt),Qt.forEach(t),z.forEach(t),Rr=c(o),ue=r(o,"H2",{class:!0});var wa=a(ue);Je=r(wa,"A",{id:!0,class:!0,href:!0});var yh=a(Je);Vn=r(yh,"SPAN",{});var wh=a(Vn);b(Co.$$.fragment,wh),wh.forEach(t),yh.forEach(t),Ji=c(wa),Qn=r(wa,"SPAN",{});var kh=a(Qn);Si=i(kh,"XmodForCausalLM"),kh.forEach(t),wa.forEach(t),Yr=c(o),A=r(o,"DIV",{class:!0});var H=a(A);b(Fo.$$.fragment,H),Wi=c(H),zo=r(H,"P",{});var ka=a(zo);ji=i(ka,"X-MOD Model with a "),Gn=r(ka,"CODE",{});var Th=a(Gn);Ui=i(Th,"language modeling"),Th.forEach(t),Bi=i(ka," head on top for CLM fine-tuning."),ka.forEach(t),Zi=c(H),Ao=r(H,"P",{});var Ta=a(Ao);Vi=i(Ta,"This model inherits from "),It=r(Ta,"A",{href:!0});var Mh=a(It);Qi=i(Mh,"PreTrainedModel"),Mh.forEach(t),Gi=i(Ta,`. 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.)`),Ta.forEach(t),Ri=c(H),Po=r(H,"P",{});var Ma=a(Po);Yi=i(Ma,"This model is also a PyTorch "),Io=r(Ma,"A",{href:!0,rel:!0});var $h=a(Io);Hi=i($h,"torch.nn.Module"),$h.forEach(t),Ki=i(Ma,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ma.forEach(t),ed=c(H),Z=r(H,"DIV",{class:!0});var Rt=a(Z);b(Lo.$$.fragment,Rt),od=c(Rt),ge=r(Rt,"P",{});var Yt=a(ge);td=i(Yt,"The "),Lt=r(Yt,"A",{href:!0});var Xh=a(Lt);nd=i(Xh,"XmodForCausalLM"),Xh.forEach(t),rd=i(Yt," forward method, overrides the "),Rn=r(Yt,"CODE",{});var Eh=a(Rn);ad=i(Eh,"__call__"),Eh.forEach(t),sd=i(Yt," special method."),Yt.forEach(t),id=c(Rt),b(Se.$$.fragment,Rt),Rt.forEach(t),H.forEach(t),Hr=c(o),_e=r(o,"H2",{class:!0});var $a=a(_e);We=r($a,"A",{id:!0,class:!0,href:!0});var xh=a(We);Yn=r(xh,"SPAN",{});var Ch=a(Yn);b(Oo.$$.fragment,Ch),Ch.forEach(t),xh.forEach(t),dd=c($a),Hn=r($a,"SPAN",{});var Fh=a(Hn);ld=i(Fh,"XmodForMaskedLM"),Fh.forEach(t),$a.forEach(t),Kr=c(o),P=r(o,"DIV",{class:!0});var K=a(P);b(No.$$.fragment,K),cd=c(K),qo=r(K,"P",{});var Xa=a(qo);hd=i(Xa,"X-MOD Model with a "),Kn=r(Xa,"CODE",{});var zh=a(Kn);md=i(zh,"language modeling"),zh.forEach(t),pd=i(Xa," head on top."),Xa.forEach(t),fd=c(K),Do=r(K,"P",{});var Ea=a(Do);ud=i(Ea,"This model inherits from "),Ot=r(Ea,"A",{href:!0});var Ah=a(Ot);gd=i(Ah,"PreTrainedModel"),Ah.forEach(t),_d=i(Ea,`. 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.)`),Ea.forEach(t),vd=c(K),Jo=r(K,"P",{});var xa=a(Jo);bd=i(xa,"This model is also a PyTorch "),So=r(xa,"A",{href:!0,rel:!0});var Ph=a(So);yd=i(Ph,"torch.nn.Module"),Ph.forEach(t),wd=i(xa,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),xa.forEach(t),kd=c(K),V=r(K,"DIV",{class:!0});var Ht=a(V);b(Wo.$$.fragment,Ht),Td=c(Ht),ve=r(Ht,"P",{});var Kt=a(ve);Md=i(Kt,"The "),Nt=r(Kt,"A",{href:!0});var Ih=a(Nt);$d=i(Ih,"XmodForMaskedLM"),Ih.forEach(t),Xd=i(Kt," forward method, overrides the "),er=r(Kt,"CODE",{});var Lh=a(er);Ed=i(Lh,"__call__"),Lh.forEach(t),xd=i(Kt," special method."),Kt.forEach(t),Cd=c(Ht),b(je.$$.fragment,Ht),Ht.forEach(t),K.forEach(t),ea=c(o),be=r(o,"H2",{class:!0});var Ca=a(be);Ue=r(Ca,"A",{id:!0,class:!0,href:!0});var Oh=a(Ue);or=r(Oh,"SPAN",{});var Nh=a(or);b(jo.$$.fragment,Nh),Nh.forEach(t),Oh.forEach(t),Fd=c(Ca),tr=r(Ca,"SPAN",{});var qh=a(tr);zd=i(qh,"XmodForSequenceClassification"),qh.forEach(t),Ca.forEach(t),oa=c(o),I=r(o,"DIV",{class:!0});var ee=a(I);b(Uo.$$.fragment,ee),Ad=c(ee),nr=r(ee,"P",{});var Dh=a(nr);Pd=i(Dh,`X-MOD Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),Dh.forEach(t),Id=c(ee),Bo=r(ee,"P",{});var Fa=a(Bo);Ld=i(Fa,"This model inherits from "),qt=r(Fa,"A",{href:!0});var Jh=a(qt);Od=i(Jh,"PreTrainedModel"),Jh.forEach(t),Nd=i(Fa,`. 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.)`),Fa.forEach(t),qd=c(ee),Zo=r(ee,"P",{});var za=a(Zo);Dd=i(za,"This model is also a PyTorch "),Vo=r(za,"A",{href:!0,rel:!0});var Sh=a(Vo);Jd=i(Sh,"torch.nn.Module"),Sh.forEach(t),Sd=i(za,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),za.forEach(t),Wd=c(ee),Q=r(ee,"DIV",{class:!0});var en=a(Q);b(Qo.$$.fragment,en),jd=c(en),ye=r(en,"P",{});var on=a(ye);Ud=i(on,"The "),Dt=r(on,"A",{href:!0});var Wh=a(Dt);Bd=i(Wh,"XmodForSequenceClassification"),Wh.forEach(t),Zd=i(on," forward method, overrides the "),rr=r(on,"CODE",{});var jh=a(rr);Vd=i(jh,"__call__"),jh.forEach(t),Qd=i(on," special method."),on.forEach(t),Gd=c(en),b(Be.$$.fragment,en),en.forEach(t),ee.forEach(t),ta=c(o),we=r(o,"H2",{class:!0});var Aa=a(we);Ze=r(Aa,"A",{id:!0,class:!0,href:!0});var Uh=a(Ze);ar=r(Uh,"SPAN",{});var Bh=a(ar);b(Go.$$.fragment,Bh),Bh.forEach(t),Uh.forEach(t),Rd=c(Aa),sr=r(Aa,"SPAN",{});var Zh=a(sr);Yd=i(Zh,"XmodForMultipleChoice"),Zh.forEach(t),Aa.forEach(t),na=c(o),L=r(o,"DIV",{class:!0});var oe=a(L);b(Ro.$$.fragment,oe),Hd=c(oe),ir=r(oe,"P",{});var Vh=a(ir);Kd=i(Vh,`X-MOD 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.`),Vh.forEach(t),el=c(oe),Yo=r(oe,"P",{});var Pa=a(Yo);ol=i(Pa,"This model inherits from "),Jt=r(Pa,"A",{href:!0});var Qh=a(Jt);tl=i(Qh,"PreTrainedModel"),Qh.forEach(t),nl=i(Pa,`. 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.)`),Pa.forEach(t),rl=c(oe),Ho=r(oe,"P",{});var Ia=a(Ho);al=i(Ia,"This model is also a PyTorch "),Ko=r(Ia,"A",{href:!0,rel:!0});var Gh=a(Ko);sl=i(Gh,"torch.nn.Module"),Gh.forEach(t),il=i(Ia,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ia.forEach(t),dl=c(oe),G=r(oe,"DIV",{class:!0});var tn=a(G);b(et.$$.fragment,tn),ll=c(tn),ke=r(tn,"P",{});var nn=a(ke);cl=i(nn,"The "),St=r(nn,"A",{href:!0});var Rh=a(St);hl=i(Rh,"XmodForMultipleChoice"),Rh.forEach(t),ml=i(nn," forward method, overrides the "),dr=r(nn,"CODE",{});var Yh=a(dr);pl=i(Yh,"__call__"),Yh.forEach(t),fl=i(nn," special method."),nn.forEach(t),ul=c(tn),b(Ve.$$.fragment,tn),tn.forEach(t),oe.forEach(t),ra=c(o),Te=r(o,"H2",{class:!0});var La=a(Te);Qe=r(La,"A",{id:!0,class:!0,href:!0});var Hh=a(Qe);lr=r(Hh,"SPAN",{});var Kh=a(lr);b(ot.$$.fragment,Kh),Kh.forEach(t),Hh.forEach(t),gl=c(La),cr=r(La,"SPAN",{});var em=a(cr);_l=i(em,"XmodForTokenClassification"),em.forEach(t),La.forEach(t),aa=c(o),O=r(o,"DIV",{class:!0});var te=a(O);b(tt.$$.fragment,te),vl=c(te),hr=r(te,"P",{});var om=a(hr);bl=i(om,`X-MOD 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.`),om.forEach(t),yl=c(te),nt=r(te,"P",{});var Oa=a(nt);wl=i(Oa,"This model inherits from "),Wt=r(Oa,"A",{href:!0});var tm=a(Wt);kl=i(tm,"PreTrainedModel"),tm.forEach(t),Tl=i(Oa,`. 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.)`),Oa.forEach(t),Ml=c(te),rt=r(te,"P",{});var Na=a(rt);$l=i(Na,"This model is also a PyTorch "),at=r(Na,"A",{href:!0,rel:!0});var nm=a(at);Xl=i(nm,"torch.nn.Module"),nm.forEach(t),El=i(Na,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Na.forEach(t),xl=c(te),R=r(te,"DIV",{class:!0});var rn=a(R);b(st.$$.fragment,rn),Cl=c(rn),Me=r(rn,"P",{});var an=a(Me);Fl=i(an,"The "),jt=r(an,"A",{href:!0});var rm=a(jt);zl=i(rm,"XmodForTokenClassification"),rm.forEach(t),Al=i(an," forward method, overrides the "),mr=r(an,"CODE",{});var am=a(mr);Pl=i(am,"__call__"),am.forEach(t),Il=i(an," special method."),an.forEach(t),Ll=c(rn),b(Ge.$$.fragment,rn),rn.forEach(t),te.forEach(t),sa=c(o),$e=r(o,"H2",{class:!0});var qa=a($e);Re=r(qa,"A",{id:!0,class:!0,href:!0});var sm=a(Re);pr=r(sm,"SPAN",{});var im=a(pr);b(it.$$.fragment,im),im.forEach(t),sm.forEach(t),Ol=c(qa),fr=r(qa,"SPAN",{});var dm=a(fr);Nl=i(dm,"XmodForQuestionAnswering"),dm.forEach(t),qa.forEach(t),ia=c(o),N=r(o,"DIV",{class:!0});var ne=a(N);b(dt.$$.fragment,ne),ql=c(ne),Xe=r(ne,"P",{});var sn=a(Xe);Dl=i(sn,`X-MOD 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 `),ur=r(sn,"CODE",{});var lm=a(ur);Jl=i(lm,"span start logits"),lm.forEach(t),Sl=i(sn," and "),gr=r(sn,"CODE",{});var cm=a(gr);Wl=i(cm,"span end logits"),cm.forEach(t),jl=i(sn,")."),sn.forEach(t),Ul=c(ne),lt=r(ne,"P",{});var Da=a(lt);Bl=i(Da,"This model inherits from "),Ut=r(Da,"A",{href:!0});var hm=a(Ut);Zl=i(hm,"PreTrainedModel"),hm.forEach(t),Vl=i(Da,`. 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.)`),Da.forEach(t),Ql=c(ne),ct=r(ne,"P",{});var Ja=a(ct);Gl=i(Ja,"This model is also a PyTorch "),ht=r(Ja,"A",{href:!0,rel:!0});var mm=a(ht);Rl=i(mm,"torch.nn.Module"),mm.forEach(t),Yl=i(Ja,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ja.forEach(t),Hl=c(ne),Y=r(ne,"DIV",{class:!0});var dn=a(Y);b(mt.$$.fragment,dn),Kl=c(dn),Ee=r(dn,"P",{});var ln=a(Ee);ec=i(ln,"The "),Bt=r(ln,"A",{href:!0});var pm=a(Bt);oc=i(pm,"XmodForQuestionAnswering"),pm.forEach(t),tc=i(ln," forward method, overrides the "),_r=r(ln,"CODE",{});var fm=a(_r);nc=i(fm,"__call__"),fm.forEach(t),rc=i(ln," special method."),ln.forEach(t),ac=c(dn),b(Ye.$$.fragment,dn),dn.forEach(t),ne.forEach(t),this.h()},h(){d(m,"name","hf:doc:metadata"),d(m,"content",JSON.stringify(zm)),d(_,"id","xmod"),d(_,"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(_,"href","#xmod"),d(g,"class","relative group"),d(xe,"id","overview"),d(xe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(xe,"href","#overview"),d(re,"class","relative group"),d(to,"href","http://dx.doi.org/10.18653/v1/2022.naacl-main.255"),d(to,"rel","nofollow"),d(gt,"href","xlm-roberta"),d(yt,"href","xlm-roberta"),d(ro,"href","https://huggingface.co/jvamvas"),d(ro,"rel","nofollow"),d(ao,"href","https://github.com/facebookresearch/fairseq/tree/58cc6cca18f15e6d56e3f60c959fe4f878960a60/fairseq/models/xmod"),d(ao,"rel","nofollow"),d(so,"href","https://github.com/facebookresearch/fairseq/tree/58cc6cca18f15e6d56e3f60c959fe4f878960a60/examples/xmod"),d(so,"rel","nofollow"),d(Fe,"id","adapter-usage"),d(Fe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Fe,"href","#adapter-usage"),d(ae,"class","relative group"),d(ze,"id","input-language"),d(ze,"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(ze,"href","#input-language"),d(se,"class","relative group"),d(ho,"start","2"),d(Ae,"id","finetuning"),d(Ae,"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(Ae,"href","#finetuning"),d(ie,"class","relative group"),d(Pe,"id","crosslingual-transfer"),d(Pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Pe,"href","#crosslingual-transfer"),d(de,"class","relative group"),d(Ie,"id","resources"),d(Ie,"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(Ie,"href","#resources"),d(le,"class","relative group"),d(Tt,"href","../tasks/sequence_classification"),d(Mt,"href","../tasks/token_classification"),d($t,"href","../tasks/question_answering"),d(Xt,"href","../tasks/language_modeling"),d(Et,"href","../tasks/masked_language_modeling"),d(xt,"href","../tasks/multiple_choice"),d(Le,"id","transformers.XmodConfig"),d(Le,"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(Le,"href","#transformers.XmodConfig"),d(ce,"class","relative group"),d(Ct,"href","/docs/transformers/v4.31.0/en/model_doc/xmod#transformers.XmodModel"),d(yo,"href","https://huggingface.co/facebook/xmod-base"),d(yo,"rel","nofollow"),d(Ft,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(zt,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ne,"id","transformers.XmodModel"),d(Ne,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ne,"href","#transformers.XmodModel"),d(pe,"class","relative group"),d(At,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),d($o,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d($o,"rel","nofollow"),d(Eo,"href","https://arxiv.org/abs/1706.03762"),d(Eo,"rel","nofollow"),d(Pt,"href","/docs/transformers/v4.31.0/en/model_doc/xmod#transformers.XmodModel"),d(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Je,"id","transformers.XmodForCausalLM"),d(Je,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Je,"href","#transformers.XmodForCausalLM"),d(ue,"class","relative group"),d(It,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),d(Io,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Io,"rel","nofollow"),d(Lt,"href","/docs/transformers/v4.31.0/en/model_doc/xmod#transformers.XmodForCausalLM"),d(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(We,"id","transformers.XmodForMaskedLM"),d(We,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(We,"href","#transformers.XmodForMaskedLM"),d(_e,"class","relative group"),d(Ot,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),d(So,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(So,"rel","nofollow"),d(Nt,"href","/docs/transformers/v4.31.0/en/model_doc/xmod#transformers.XmodForMaskedLM"),d(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ue,"id","transformers.XmodForSequenceClassification"),d(Ue,"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(Ue,"href","#transformers.XmodForSequenceClassification"),d(be,"class","relative group"),d(qt,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),d(Vo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Vo,"rel","nofollow"),d(Dt,"href","/docs/transformers/v4.31.0/en/model_doc/xmod#transformers.XmodForSequenceClassification"),d(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ze,"id","transformers.XmodForMultipleChoice"),d(Ze,"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(Ze,"href","#transformers.XmodForMultipleChoice"),d(we,"class","relative group"),d(Jt,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),d(Ko,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ko,"rel","nofollow"),d(St,"href","/docs/transformers/v4.31.0/en/model_doc/xmod#transformers.XmodForMultipleChoice"),d(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Qe,"id","transformers.XmodForTokenClassification"),d(Qe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Qe,"href","#transformers.XmodForTokenClassification"),d(Te,"class","relative group"),d(Wt,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),d(at,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(at,"rel","nofollow"),d(jt,"href","/docs/transformers/v4.31.0/en/model_doc/xmod#transformers.XmodForTokenClassification"),d(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Re,"id","transformers.XmodForQuestionAnswering"),d(Re,"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(Re,"href","#transformers.XmodForQuestionAnswering"),d($e,"class","relative group"),d(Ut,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),d(ht,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(ht,"rel","nofollow"),d(Bt,"href","/docs/transformers/v4.31.0/en/model_doc/xmod#transformers.XmodForQuestionAnswering"),d(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,h){e(document.head,m),p(o,$,h),p(o,g,h),e(g,_),e(_,M),y(f,M,null),e(g,u),e(g,X),e(X,Sa),p(o,Xr,h),p(o,re,h),e(re,xe),e(xe,cn),y(oo,cn,null),e(re,Wa),e(re,hn),e(hn,ja),p(o,Er,h),p(o,W,h),e(W,Ua),e(W,to),e(to,Ba),e(W,Za),e(W,gt),e(gt,Va),e(W,Qa),e(W,mn),e(mn,Ga),e(W,Ra),p(o,xr,h),p(o,_t,h),e(_t,Ya),p(o,Cr,h),p(o,vt,h),e(vt,pn),e(pn,Ha),p(o,Fr,h),p(o,bt,h),e(bt,Ka),p(o,zr,h),p(o,Ce,h),e(Ce,no),e(no,es),e(no,yt),e(yt,os),e(no,ts),e(Ce,ns),e(Ce,fn),e(fn,rs),p(o,Ar,h),p(o,j,h),e(j,as),e(j,ro),e(ro,ss),e(j,is),e(j,ao),e(ao,ds),e(j,ls),e(j,so),e(so,cs),e(j,hs),p(o,Pr,h),p(o,ae,h),e(ae,Fe),e(Fe,un),y(io,un,null),e(ae,ms),e(ae,gn),e(gn,ps),p(o,Ir,h),p(o,se,h),e(se,ze),e(ze,_n),y(lo,_n,null),e(se,fs),e(se,vn),e(vn,us),p(o,Lr,h),p(o,wt,h),e(wt,gs),p(o,Or,h),p(o,kt,h),e(kt,bn),e(bn,_s),p(o,Nr,h),y(co,o,h),p(o,qr,h),p(o,ho,h),e(ho,yn),e(yn,vs),p(o,Dr,h),y(mo,o,h),p(o,Jr,h),p(o,ie,h),e(ie,Ae),e(Ae,wn),y(po,wn,null),e(ie,bs),e(ie,kn),e(kn,ys),p(o,Sr,h),y(fo,o,h),p(o,Wr,h),p(o,de,h),e(de,Pe),e(Pe,Tn),y(uo,Tn,null),e(de,ws),e(de,Mn),e(Mn,ks),p(o,jr,h),y(go,o,h),p(o,Ur,h),p(o,le,h),e(le,Ie),e(Ie,$n),y(_o,$n,null),e(le,Ts),e(le,Xn),e(Xn,Ms),p(o,Br,h),p(o,F,h),e(F,En),e(En,Tt),e(Tt,$s),e(F,Xs),e(F,xn),e(xn,Mt),e(Mt,Es),e(F,xs),e(F,Cn),e(Cn,$t),e($t,Cs),e(F,Fs),e(F,Fn),e(Fn,Xt),e(Xt,zs),e(F,As),e(F,zn),e(zn,Et),e(Et,Ps),e(F,Is),e(F,An),e(An,xt),e(xt,Ls),p(o,Zr,h),p(o,ce,h),e(ce,Le),e(Le,Pn),y(vo,Pn,null),e(ce,Os),e(ce,In),e(In,Ns),p(o,Vr,h),p(o,S,h),y(bo,S,null),e(S,qs),e(S,he),e(he,Ds),e(he,Ct),e(Ct,Js),e(he,Ss),e(he,yo),e(yo,Ws),e(he,js),e(S,Us),e(S,me),e(me,Bs),e(me,Ft),e(Ft,Zs),e(me,Vs),e(me,zt),e(zt,Qs),e(me,Gs),e(S,Rs),y(Oe,S,null),p(o,Qr,h),p(o,pe,h),e(pe,Ne),e(Ne,Ln),y(wo,Ln,null),e(pe,Ys),e(pe,On),e(On,Hs),p(o,Gr,h),p(o,E,h),y(ko,E,null),e(E,Ks),e(E,Nn),e(Nn,ei),e(E,oi),e(E,To),e(To,ti),e(To,At),e(At,ni),e(To,ri),e(E,ai),e(E,Mo),e(Mo,si),e(Mo,$o),e($o,ii),e(Mo,di),e(E,li),e(E,Xo),e(Xo,ci),e(Xo,qn),e(qn,hi),e(Xo,mi),e(E,pi),e(E,C),e(C,fi),e(C,Dn),e(Dn,ui),e(C,gi),e(C,Jn),e(Jn,_i),e(C,vi),e(C,Sn),e(Sn,bi),e(C,yi),e(C,Wn),e(Wn,wi),e(C,ki),e(C,jn),e(jn,Ti),e(C,Mi),e(C,Un),e(Un,$i),e(C,Xi),e(E,Ei),e(E,qe),e(qe,xi),e(qe,Bn),e(Bn,Ci),e(qe,Fi),e(qe,Eo),e(Eo,zi),e(E,Ai),e(E,B),y(xo,B,null),e(B,Pi),e(B,fe),e(fe,Ii),e(fe,Pt),e(Pt,Li),e(fe,Oi),e(fe,Zn),e(Zn,Ni),e(fe,qi),e(B,Di),y(De,B,null),p(o,Rr,h),p(o,ue,h),e(ue,Je),e(Je,Vn),y(Co,Vn,null),e(ue,Ji),e(ue,Qn),e(Qn,Si),p(o,Yr,h),p(o,A,h),y(Fo,A,null),e(A,Wi),e(A,zo),e(zo,ji),e(zo,Gn),e(Gn,Ui),e(zo,Bi),e(A,Zi),e(A,Ao),e(Ao,Vi),e(Ao,It),e(It,Qi),e(Ao,Gi),e(A,Ri),e(A,Po),e(Po,Yi),e(Po,Io),e(Io,Hi),e(Po,Ki),e(A,ed),e(A,Z),y(Lo,Z,null),e(Z,od),e(Z,ge),e(ge,td),e(ge,Lt),e(Lt,nd),e(ge,rd),e(ge,Rn),e(Rn,ad),e(ge,sd),e(Z,id),y(Se,Z,null),p(o,Hr,h),p(o,_e,h),e(_e,We),e(We,Yn),y(Oo,Yn,null),e(_e,dd),e(_e,Hn),e(Hn,ld),p(o,Kr,h),p(o,P,h),y(No,P,null),e(P,cd),e(P,qo),e(qo,hd),e(qo,Kn),e(Kn,md),e(qo,pd),e(P,fd),e(P,Do),e(Do,ud),e(Do,Ot),e(Ot,gd),e(Do,_d),e(P,vd),e(P,Jo),e(Jo,bd),e(Jo,So),e(So,yd),e(Jo,wd),e(P,kd),e(P,V),y(Wo,V,null),e(V,Td),e(V,ve),e(ve,Md),e(ve,Nt),e(Nt,$d),e(ve,Xd),e(ve,er),e(er,Ed),e(ve,xd),e(V,Cd),y(je,V,null),p(o,ea,h),p(o,be,h),e(be,Ue),e(Ue,or),y(jo,or,null),e(be,Fd),e(be,tr),e(tr,zd),p(o,oa,h),p(o,I,h),y(Uo,I,null),e(I,Ad),e(I,nr),e(nr,Pd),e(I,Id),e(I,Bo),e(Bo,Ld),e(Bo,qt),e(qt,Od),e(Bo,Nd),e(I,qd),e(I,Zo),e(Zo,Dd),e(Zo,Vo),e(Vo,Jd),e(Zo,Sd),e(I,Wd),e(I,Q),y(Qo,Q,null),e(Q,jd),e(Q,ye),e(ye,Ud),e(ye,Dt),e(Dt,Bd),e(ye,Zd),e(ye,rr),e(rr,Vd),e(ye,Qd),e(Q,Gd),y(Be,Q,null),p(o,ta,h),p(o,we,h),e(we,Ze),e(Ze,ar),y(Go,ar,null),e(we,Rd),e(we,sr),e(sr,Yd),p(o,na,h),p(o,L,h),y(Ro,L,null),e(L,Hd),e(L,ir),e(ir,Kd),e(L,el),e(L,Yo),e(Yo,ol),e(Yo,Jt),e(Jt,tl),e(Yo,nl),e(L,rl),e(L,Ho),e(Ho,al),e(Ho,Ko),e(Ko,sl),e(Ho,il),e(L,dl),e(L,G),y(et,G,null),e(G,ll),e(G,ke),e(ke,cl),e(ke,St),e(St,hl),e(ke,ml),e(ke,dr),e(dr,pl),e(ke,fl),e(G,ul),y(Ve,G,null),p(o,ra,h),p(o,Te,h),e(Te,Qe),e(Qe,lr),y(ot,lr,null),e(Te,gl),e(Te,cr),e(cr,_l),p(o,aa,h),p(o,O,h),y(tt,O,null),e(O,vl),e(O,hr),e(hr,bl),e(O,yl),e(O,nt),e(nt,wl),e(nt,Wt),e(Wt,kl),e(nt,Tl),e(O,Ml),e(O,rt),e(rt,$l),e(rt,at),e(at,Xl),e(rt,El),e(O,xl),e(O,R),y(st,R,null),e(R,Cl),e(R,Me),e(Me,Fl),e(Me,jt),e(jt,zl),e(Me,Al),e(Me,mr),e(mr,Pl),e(Me,Il),e(R,Ll),y(Ge,R,null),p(o,sa,h),p(o,$e,h),e($e,Re),e(Re,pr),y(it,pr,null),e($e,Ol),e($e,fr),e(fr,Nl),p(o,ia,h),p(o,N,h),y(dt,N,null),e(N,ql),e(N,Xe),e(Xe,Dl),e(Xe,ur),e(ur,Jl),e(Xe,Sl),e(Xe,gr),e(gr,Wl),e(Xe,jl),e(N,Ul),e(N,lt),e(lt,Bl),e(lt,Ut),e(Ut,Zl),e(lt,Vl),e(N,Ql),e(N,ct),e(ct,Gl),e(ct,ht),e(ht,Rl),e(ct,Yl),e(N,Hl),e(N,Y),y(mt,Y,null),e(Y,Kl),e(Y,Ee),e(Ee,ec),e(Ee,Bt),e(Bt,oc),e(Ee,tc),e(Ee,_r),e(_r,nc),e(Ee,rc),e(Y,ac),y(Ye,Y,null),da=!0},p(o,[h]){const pt={};h&2&&(pt.$$scope={dirty:h,ctx:o}),Oe.$set(pt);const vr={};h&2&&(vr.$$scope={dirty:h,ctx:o}),De.$set(vr);const br={};h&2&&(br.$$scope={dirty:h,ctx:o}),Se.$set(br);const yr={};h&2&&(yr.$$scope={dirty:h,ctx:o}),je.$set(yr);const ft={};h&2&&(ft.$$scope={dirty:h,ctx:o}),Be.$set(ft);const wr={};h&2&&(wr.$$scope={dirty:h,ctx:o}),Ve.$set(wr);const kr={};h&2&&(kr.$$scope={dirty:h,ctx:o}),Ge.$set(kr);const Tr={};h&2&&(Tr.$$scope={dirty:h,ctx:o}),Ye.$set(Tr)},i(o){da||(w(f.$$.fragment,o),w(oo.$$.fragment,o),w(io.$$.fragment,o),w(lo.$$.fragment,o),w(co.$$.fragment,o),w(mo.$$.fragment,o),w(po.$$.fragment,o),w(fo.$$.fragment,o),w(uo.$$.fragment,o),w(go.$$.fragment,o),w(_o.$$.fragment,o),w(vo.$$.fragment,o),w(bo.$$.fragment,o),w(Oe.$$.fragment,o),w(wo.$$.fragment,o),w(ko.$$.fragment,o),w(xo.$$.fragment,o),w(De.$$.fragment,o),w(Co.$$.fragment,o),w(Fo.$$.fragment,o),w(Lo.$$.fragment,o),w(Se.$$.fragment,o),w(Oo.$$.fragment,o),w(No.$$.fragment,o),w(Wo.$$.fragment,o),w(je.$$.fragment,o),w(jo.$$.fragment,o),w(Uo.$$.fragment,o),w(Qo.$$.fragment,o),w(Be.$$.fragment,o),w(Go.$$.fragment,o),w(Ro.$$.fragment,o),w(et.$$.fragment,o),w(Ve.$$.fragment,o),w(ot.$$.fragment,o),w(tt.$$.fragment,o),w(st.$$.fragment,o),w(Ge.$$.fragment,o),w(it.$$.fragment,o),w(dt.$$.fragment,o),w(mt.$$.fragment,o),w(Ye.$$.fragment,o),da=!0)},o(o){k(f.$$.fragment,o),k(oo.$$.fragment,o),k(io.$$.fragment,o),k(lo.$$.fragment,o),k(co.$$.fragment,o),k(mo.$$.fragment,o),k(po.$$.fragment,o),k(fo.$$.fragment,o),k(uo.$$.fragment,o),k(go.$$.fragment,o),k(_o.$$.fragment,o),k(vo.$$.fragment,o),k(bo.$$.fragment,o),k(Oe.$$.fragment,o),k(wo.$$.fragment,o),k(ko.$$.fragment,o),k(xo.$$.fragment,o),k(De.$$.fragment,o),k(Co.$$.fragment,o),k(Fo.$$.fragment,o),k(Lo.$$.fragment,o),k(Se.$$.fragment,o),k(Oo.$$.fragment,o),k(No.$$.fragment,o),k(Wo.$$.fragment,o),k(je.$$.fragment,o),k(jo.$$.fragment,o),k(Uo.$$.fragment,o),k(Qo.$$.fragment,o),k(Be.$$.fragment,o),k(Go.$$.fragment,o),k(Ro.$$.fragment,o),k(et.$$.fragment,o),k(Ve.$$.fragment,o),k(ot.$$.fragment,o),k(tt.$$.fragment,o),k(st.$$.fragment,o),k(Ge.$$.fragment,o),k(it.$$.fragment,o),k(dt.$$.fragment,o),k(mt.$$.fragment,o),k(Ye.$$.fragment,o),da=!1},d(o){t(m),o&&t($),o&&t(g),T(f),o&&t(Xr),o&&t(re),T(oo),o&&t(Er),o&&t(W),o&&t(xr),o&&t(_t),o&&t(Cr),o&&t(vt),o&&t(Fr),o&&t(bt),o&&t(zr),o&&t(Ce),o&&t(Ar),o&&t(j),o&&t(Pr),o&&t(ae),T(io),o&&t(Ir),o&&t(se),T(lo),o&&t(Lr),o&&t(wt),o&&t(Or),o&&t(kt),o&&t(Nr),T(co,o),o&&t(qr),o&&t(ho),o&&t(Dr),T(mo,o),o&&t(Jr),o&&t(ie),T(po),o&&t(Sr),T(fo,o),o&&t(Wr),o&&t(de),T(uo),o&&t(jr),T(go,o),o&&t(Ur),o&&t(le),T(_o),o&&t(Br),o&&t(F),o&&t(Zr),o&&t(ce),T(vo),o&&t(Vr),o&&t(S),T(bo),T(Oe),o&&t(Qr),o&&t(pe),T(wo),o&&t(Gr),o&&t(E),T(ko),T(xo),T(De),o&&t(Rr),o&&t(ue),T(Co),o&&t(Yr),o&&t(A),T(Fo),T(Lo),T(Se),o&&t(Hr),o&&t(_e),T(Oo),o&&t(Kr),o&&t(P),T(No),T(Wo),T(je),o&&t(ea),o&&t(be),T(jo),o&&t(oa),o&&t(I),T(Uo),T(Qo),T(Be),o&&t(ta),o&&t(we),T(Go),o&&t(na),o&&t(L),T(Ro),T(et),T(Ve),o&&t(ra),o&&t(Te),T(ot),o&&t(aa),o&&t(O),T(tt),T(st),T(Ge),o&&t(sa),o&&t($e),T(it),o&&t(ia),o&&t(N),T(dt),T(mt),T(Ye)}}}const zm={local:"xmod",sections:[{local:"overview",title:"Overview"},{local:"adapter-usage",sections:[{local:"input-language",title:"Input language"},{local:"finetuning",title:"Fine-tuning"},{local:"crosslingual-transfer",title:"Cross-lingual transfer"}],title:"Adapter Usage"},{local:"resources",title:"Resources"},{local:"transformers.XmodConfig",title:"XmodConfig"},{local:"transformers.XmodModel",title:"XmodModel"},{local:"transformers.XmodForCausalLM",title:"XmodForCausalLM"},{local:"transformers.XmodForMaskedLM",title:"XmodForMaskedLM"},{local:"transformers.XmodForSequenceClassification",title:"XmodForSequenceClassification"},{local:"transformers.XmodForMultipleChoice",title:"XmodForMultipleChoice"},{local:"transformers.XmodForTokenClassification",title:"XmodForTokenClassification"},{local:"transformers.XmodForQuestionAnswering",title:"XmodForQuestionAnswering"}],title:"X-MOD"};function Am(x){return bm(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Dm extends um{constructor(m){super();gm(this,m,Am,Fm,_m,{})}}export{Dm as default,zm as metadata};
