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 a,d as t,m as c,a as r,x as b,h as i,b as d,G as e,g as p,y,q as k,o as w,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 $a}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as D}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as km}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function wm(x){let m,$,g,_,M;return _=new $a({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=a(f,"P",{});var u=r(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||(k(_.$$.fragment,f),M=!0)},o(f){w(_.$$.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=a(f,"P",{});var u=r(m);$=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(u,"CODE",{});var X=r(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=a(f,"P",{});var u=r(m);$=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(u,"CODE",{});var X=r(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=a(f,"P",{});var u=r(m);$=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(u,"CODE",{});var X=r(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=a(f,"P",{});var u=r(m);$=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(u,"CODE",{});var X=r(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=a(f,"P",{});var u=r(m);$=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(u,"CODE",{});var X=r(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=a(f,"P",{});var u=r(m);$=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(u,"CODE",{});var X=r(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=a(f,"P",{});var u=r(m);$=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(u,"CODE",{});var X=r(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,Sr,Xa,ae,xe,cn,oo,Wr,hn,jr,Ea,W,Ur,to,Br,Zr,gt,Qr,Gr,mn,Rr,Vr,xa,_t,Yr,Ca,vt,pn,Hr,Fa,bt,Kr,za,Ce,no,es,yt,os,ts,ns,fn,as,Aa,j,rs,ao,ss,is,ro,ds,ls,so,cs,hs,Pa,re,Fe,un,io,ms,gn,ps,Ia,se,ze,_n,lo,fs,vn,us,La,kt,gs,Oa,wt,bn,_s,Na,co,qa,ho,yn,vs,Da,mo,Ja,ie,Ae,kn,po,bs,wn,ys,Sa,fo,Wa,de,Pe,Tn,uo,ks,Mn,ws,ja,go,Ua,le,Ie,$n,_o,Ts,Xn,Ms,Ba,F,En,Tt,$s,Xs,xn,Mt,Es,xs,Cn,$t,Cs,Fs,Fn,Xt,zs,As,zn,Et,Ps,Is,An,xt,Ls,Za,ce,Le,Pn,vo,Os,In,Ns,Qa,S,bo,qs,he,Ds,Ct,Js,Ss,yo,Ws,js,Us,me,Bs,Ft,Zs,Qs,zt,Gs,Rs,Vs,Oe,Ga,pe,Ne,Ln,ko,Ys,On,Hs,Ra,E,wo,Ks,Nn,ei,oi,To,ti,At,ni,ai,ri,Mo,si,$o,ii,di,li,Xo,ci,qn,hi,mi,pi,C,fi,Dn,ui,gi,Jn,_i,vi,Sn,bi,yi,Wn,ki,wi,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,Va,ue,Je,Qn,Co,Ji,Gn,Si,Ya,A,Fo,Wi,zo,ji,Rn,Ui,Bi,Zi,Ao,Qi,It,Gi,Ri,Vi,Po,Yi,Io,Hi,Ki,ed,Z,Lo,od,ge,td,Lt,nd,ad,Vn,rd,sd,id,Se,Ha,_e,We,Yn,Oo,dd,Hn,ld,Ka,P,No,cd,qo,hd,Kn,md,pd,fd,Do,ud,Ot,gd,_d,vd,Jo,bd,So,yd,kd,wd,Q,Wo,Td,ve,Md,Nt,$d,Xd,ea,Ed,xd,Cd,je,er,be,Ue,oa,jo,Fd,ta,zd,or,I,Uo,Ad,na,Pd,Id,Bo,Ld,qt,Od,Nd,qd,Zo,Dd,Qo,Jd,Sd,Wd,G,Go,jd,ye,Ud,Dt,Bd,Zd,aa,Qd,Gd,Rd,Be,tr,ke,Ze,ra,Ro,Vd,sa,Yd,nr,L,Vo,Hd,ia,Kd,el,Yo,ol,Jt,tl,nl,al,Ho,rl,Ko,sl,il,dl,R,et,ll,we,cl,St,hl,ml,da,pl,fl,ul,Qe,ar,Te,Ge,la,ot,gl,ca,_l,rr,O,tt,vl,ha,bl,yl,nt,kl,Wt,wl,Tl,Ml,at,$l,rt,Xl,El,xl,V,st,Cl,Me,Fl,jt,zl,Al,ma,Pl,Il,Ll,Re,sr,$e,Ve,pa,it,Ol,fa,Nl,ir,N,dt,ql,Xe,Dl,ua,Jl,Sl,ga,Wl,jl,Ul,lt,Bl,Ut,Zl,Ql,Gl,ct,Rl,ht,Vl,Yl,Hl,Y,mt,Kl,Ee,ec,Bt,oc,tc,_a,nc,ac,rc,Ye,dr;return f=new D({}),oo=new D({}),io=new D({}),lo=new D({}),co=new $a({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 $a({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 $a({props:{code:"bW9kZWwuZnJlZXplX2VtYmVkZGluZ3NfYW5kX2xhbmd1YWdlX2FkYXB0ZXJzKCklMEElMjMlMjBGaW5lLXR1bmUlMjB0aGUlMjBtb2RlbCUyMC4uLg==",highlighted:`model.freeze_embeddings_and_language_adapters()
<span class="hljs-comment"># Fine-tune the model ...</span>`}}),uo=new D({}),go=new $a({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/main/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/main/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/main/src/transformers/models/xmod/configuration_xmod.py#L40"}}),Oe=new km({props:{anchor:"transformers.XmodConfig.example",$$slots:{default:[wm]},$$scope:{ctx:x}}}),ko=new D({}),wo=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/main/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/main/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/main/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/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/main/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/main/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/main/src/transformers/models/xmod/modeling_xmod.py#L982"}}),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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/xmod/modeling_xmod.py#L1006"}}),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/main/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/main/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/main/src/transformers/models/xmod/modeling_xmod.py#L1139"}}),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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/xmod/modeling_xmod.py#L1166"}}),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/main/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/main/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/main/src/transformers/models/xmod/modeling_xmod.py#L1266"}}),Go=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/xmod/modeling_xmod.py#L1279"}}),Be=new ut({props:{$$slots:{default:[Xm]},$$scope:{ctx:x}}}),Ro=new D({}),Vo=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/main/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/main/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/main/src/transformers/models/xmod/modeling_xmod.py#L1359"}}),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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/xmod/modeling_xmod.py#L1371"}}),Qe=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/main/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/main/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/main/src/transformers/models/xmod/modeling_xmod.py#L1448"}}),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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/xmod/modeling_xmod.py#L1464"}}),Re=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/main/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/main/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/main/src/transformers/models/xmod/modeling_xmod.py#L1550"}}),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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/xmod/modeling_xmod.py#L1562"}}),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"),Sr=s("X-MOD"),Xa=l(),ae=n("h2"),xe=n("a"),cn=n("span"),v(oo.$$.fragment),Wr=l(),hn=n("span"),jr=s("Overview"),Ea=l(),W=n("p"),Ur=s("The X-MOD model was proposed in "),to=n("a"),Br=s("Lifting the Curse of Multilinguality by Pre-training Modular Transformers"),Zr=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"),Qr=s("XLM-R"),Gr=s(" to include language-specific modular components ("),mn=n("em"),Rr=s("language adapters"),Vr=s(") during pre-training. For fine-tuning, the language adapters in each transformer layer are frozen."),xa=l(),_t=n("p"),Yr=s("The abstract from the paper is the following:"),Ca=l(),vt=n("p"),pn=n("em"),Hr=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."),Fa=l(),bt=n("p"),Kr=s("Tips:"),za=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"),as=s("The main models \u2013 base and large \u2013 have adapters for 81 languages."),Aa=l(),j=n("p"),rs=s("This model was contributed by "),ao=n("a"),ss=s("jvamvas"),is=s(`.
The original code can be found `),ro=n("a"),ds=s("here"),ls=s(" and the original documentation is found "),so=n("a"),cs=s("here"),hs=s("."),Pa=l(),re=n("h2"),Fe=n("a"),un=n("span"),v(io.$$.fragment),ms=l(),gn=n("span"),ps=s("Adapter Usage"),Ia=l(),se=n("h3"),ze=n("a"),_n=n("span"),v(lo.$$.fragment),fs=l(),vn=n("span"),us=s("Input language"),La=l(),kt=n("p"),gs=s("There are two ways to specify the input language:"),Oa=l(),wt=n("ol"),bn=n("li"),_s=s("By setting a default language before using the model:"),Na=l(),v(co.$$.fragment),qa=l(),ho=n("ol"),yn=n("li"),vs=s("By explicitly passing the index of the language adapter for each sample:"),Da=l(),v(mo.$$.fragment),Ja=l(),ie=n("h3"),Ae=n("a"),kn=n("span"),v(po.$$.fragment),bs=l(),wn=n("span"),ys=s("Fine-tuning"),Sa=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),Wa=l(),de=n("h3"),Pe=n("a"),Tn=n("span"),v(uo.$$.fragment),ks=l(),Mn=n("span"),ws=s("Cross-lingual transfer"),ja=s(`

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

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