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

# Initializing an X-MOD facebook/xmod-base style configuration
configuration = XmodConfig()

# Initializing a model (with random weights) from the facebook/xmod-base style configuration
model = XmodModel(configuration)

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

model = XmodModel.from_pretrained("facebook/xmod-base")
model.set_default_language("en_XX")`,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 Mr({props:{code:`import torch

input_ids = torch.tensor(
    [
        [0, 581, 10269, 83, 99942, 136, 60742, 23, 70, 80583, 18276, 2],
        [0, 1310, 49083, 443, 269, 71, 5486, 165, 60429, 660, 23, 2],
    ]
)
lang_ids = torch.LongTensor(
    [
        0,  # en_XX
        8,  # de_DE
    ]
)
output = model(input_ids, lang_ids=lang_ids)`,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 I({}),fo=new Mr({props:{code:`model.freeze_embeddings_and_language_adapters()
# Fine-tune the model ...`,highlighted:`model.freeze_embeddings_and_language_adapters()
<span class="hljs-comment"># Fine-tune the model ...</span>`}}),uo=new I({}),go=new Mr({props:{code:`model.set_default_language("de_DE")
# Evaluate the model on German examples ...`,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 I({}),vo=new I({}),bo=new D({props:{name:"class transformers.XmodConfig",anchor:"transformers.XmodConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"use_cache",val:" = True"},{name:"classifier_dropout",val:" = None"},{name:"pre_norm",val:" = False"},{name:"adapter_reduction_factor",val:" = 2"},{name:"adapter_layer_norm",val:" = False"},{name:"adapter_reuse_layer_norm",val:" = True"},{name:"ln_before_adapter",val:" = True"},{name:"languages",val:" = ('en_XX',)"},{name:"default_language",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XmodConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the X-MOD model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.29.0/en/model_doc/xmod#transformers.XmodModel">XmodModel</a>.`,name:"vocab_size"},{anchor:"transformers.XmodConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.XmodConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.XmodConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.XmodConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.XmodConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.XmodConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.XmodConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.XmodConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.XmodConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/v4.29.0/en/model_doc/xmod#transformers.XmodModel">XmodModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.XmodConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.XmodConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.XmodConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;</code>. For
positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.XmodConfig.is_decoder",description:`<strong>is_decoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the model is used as a decoder or not. If <code>False</code>, the model is used as an encoder.`,name:"is_decoder"},{anchor:"transformers.XmodConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.XmodConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The dropout ratio for the classification head.`,name:"classifier_dropout"},{anchor:"transformers.XmodConfig.pre_norm",description:`<strong>pre_norm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to apply layer normalization before each block.`,name:"pre_norm"},{anchor:"transformers.XmodConfig.adapter_reduction_factor",description:`<strong>adapter_reduction_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to 2) &#x2014;
The factor by which the dimensionality of the adapter is reduced relative to <code>hidden_size</code>.`,name:"adapter_reduction_factor"},{anchor:"transformers.XmodConfig.adapter_layer_norm",description:`<strong>adapter_layer_norm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to apply a new layer normalization before the adapter modules (shared across all adapters).`,name:"adapter_layer_norm"},{anchor:"transformers.XmodConfig.adapter_reuse_layer_norm",description:`<strong>adapter_reuse_layer_norm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to reuse the second layer normalization and apply it before the adapter modules as well.`,name:"adapter_reuse_layer_norm"},{anchor:"transformers.XmodConfig.ln_before_adapter",description:`<strong>ln_before_adapter</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to apply the layer normalization before the residual connection around the adapter module.`,name:"ln_before_adapter"},{anchor:"transformers.XmodConfig.languages",description:`<strong>languages</strong> (<code>Iterable[str]</code>, <em>optional</em>, defaults to <code>[&quot;en_XX&quot;]</code>) &#x2014;
An iterable of language codes for which adapter modules should be initialized.`,name:"languages"},{anchor:"transformers.XmodConfig.default_language",description:`<strong>default_language</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Language code of a default language. It will be assumed that the input is in this language if no language
codes are explicitly passed to the forward method.`,name:"default_language"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/xmod/configuration_xmod.py#L40"}}),qe=new ym({props:{anchor:"transformers.XmodConfig.example",$$slots:{default:[wm]},$$scope:{ctx:E}}}),yo=new I({}),wo=new D({props:{name:"class transformers.XmodModel",anchor:"transformers.XmodModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.XmodModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/xmod#transformers.XmodConfig">XmodConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/xmod/modeling_xmod.py#L798"}}),Eo=new D({props:{name:"forward",anchor:"transformers.XmodModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"lang_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XmodModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XmodModel.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XmodModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.XmodModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XmodModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.XmodModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.XmodModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.XmodModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.XmodModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XmodModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.XmodModel.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.XmodModel.forward.past_key_values",description:"<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors &#x2014;",name:"past_key_values"},{anchor:"transformers.XmodModel.forward.of",description:`<strong>of</strong> shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"of"},{anchor:"transformers.XmodModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/xmod/modeling_xmod.py#L846"}}),Ie=new ut({props:{$$slots:{default:[Tm]},$$scope:{ctx:E}}}),Fo=new I({}),Co=new D({props:{name:"class transformers.XmodForCausalLM",anchor:"transformers.XmodForCausalLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XmodForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/xmod#transformers.XmodConfig">XmodConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/xmod/modeling_xmod.py#L991"}}),Ao=new D({props:{name:"forward",anchor:"transformers.XmodForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"lang_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Tuple[typing.Tuple[torch.FloatTensor]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XmodForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XmodForCausalLM.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XmodForCausalLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.XmodForCausalLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XmodForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.XmodForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.XmodForCausalLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.XmodForCausalLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.XmodForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XmodForCausalLM.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.XmodForCausalLM.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.XmodForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the left-to-right language modeling loss (next word prediction). Indices should be in
<code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are
ignored (masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.XmodForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.XmodForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).</p>
<p>Returns &#x2014; <code>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</code> or <code>tuple(torch.FloatTensor)</code></p>
<p>Example &#x2014;`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/xmod/modeling_xmod.py#L1020"}}),We=new ut({props:{$$slots:{default:[$m]},$$scope:{ctx:E}}}),qo=new I({}),No=new D({props:{name:"class transformers.XmodForMaskedLM",anchor:"transformers.XmodForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XmodForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/xmod#transformers.XmodConfig">XmodConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/xmod/modeling_xmod.py#L1153"}}),jo=new D({props:{name:"forward",anchor:"transformers.XmodForMaskedLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"lang_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XmodForMaskedLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XmodForMaskedLM.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForMaskedLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XmodForMaskedLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.XmodForMaskedLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XmodForMaskedLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.XmodForMaskedLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.XmodForMaskedLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.XmodForMaskedLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.XmodForMaskedLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XmodForMaskedLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.XmodForMaskedLM.forward.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, any]</code>, optional, defaults to <em>{}</em>) &#x2014;
Used to hide legacy arguments that have been deprecated.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/xmod/modeling_xmod.py#L1185"}}),Qe=new ut({props:{$$slots:{default:[Mm]},$$scope:{ctx:E}}}),Qo=new I({}),Uo=new D({props:{name:"class transformers.XmodForSequenceClassification",anchor:"transformers.XmodForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XmodForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/xmod#transformers.XmodConfig">XmodConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/xmod/modeling_xmod.py#L1285"}}),Bo=new D({props:{name:"forward",anchor:"transformers.XmodForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"lang_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XmodForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XmodForSequenceClassification.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XmodForSequenceClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.XmodForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XmodForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.XmodForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.XmodForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.XmodForSequenceClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.XmodForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XmodForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/xmod/modeling_xmod.py#L1300"}}),Re=new ut({props:{$$slots:{default:[Xm]},$$scope:{ctx:E}}}),Go=new I({}),Jo=new D({props:{name:"class transformers.XmodForMultipleChoice",anchor:"transformers.XmodForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XmodForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/xmod#transformers.XmodConfig">XmodConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/xmod/modeling_xmod.py#L1380"}}),et=new D({props:{name:"forward",anchor:"transformers.XmodForMultipleChoice.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"lang_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XmodForMultipleChoice.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XmodForMultipleChoice.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForMultipleChoice.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XmodForMultipleChoice.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.XmodForMultipleChoice.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XmodForMultipleChoice.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.XmodForMultipleChoice.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.XmodForMultipleChoice.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.XmodForMultipleChoice.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.XmodForMultipleChoice.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XmodForMultipleChoice.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the multiple choice classification loss. Indices should be in <code>[0, ..., num_choices-1]</code> where <code>num_choices</code> is the size of the second dimension of the input tensors. (See
<code>input_ids</code> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/xmod/modeling_xmod.py#L1394"}}),He=new ut({props:{$$slots:{default:[xm]},$$scope:{ctx:E}}}),ot=new I({}),tt=new D({props:{name:"class transformers.XmodForTokenClassification",anchor:"transformers.XmodForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XmodForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/xmod#transformers.XmodConfig">XmodConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/xmod/modeling_xmod.py#L1471"}}),st=new D({props:{name:"forward",anchor:"transformers.XmodForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"lang_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XmodForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XmodForTokenClassification.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XmodForTokenClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.XmodForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XmodForTokenClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.XmodForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.XmodForTokenClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.XmodForTokenClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.XmodForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XmodForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/xmod/modeling_xmod.py#L1490"}}),Ge=new ut({props:{$$slots:{default:[Em]},$$scope:{ctx:E}}}),it=new I({}),dt=new D({props:{name:"class transformers.XmodForQuestionAnswering",anchor:"transformers.XmodForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XmodForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/xmod#transformers.XmodConfig">XmodConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/xmod/modeling_xmod.py#L1576"}}),mt=new D({props:{name:"forward",anchor:"transformers.XmodForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"lang_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XmodForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XmodForQuestionAnswering.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XmodForQuestionAnswering.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.XmodForQuestionAnswering.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XmodForQuestionAnswering.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.XmodForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.XmodForQuestionAnswering.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.XmodForQuestionAnswering.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.XmodForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XmodForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.XmodForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/xmod/modeling_xmod.py#L1591"}}),Ke=new ut({props:{$$slots:{default:[Fm]},$$scope:{ctx:E}}}),{c(){m=n("meta"),M=l(),g=n("h1"),_=n("a"),$=n("span"),v(f.$$.fragment),u=l(),X=n("span"),Wa=s("X-MOD"),Xr=l(),re=n("h2"),Ee=n("a"),cn=n("span"),v(oo.$$.fragment),ja=l(),hn=n("span"),Qa=s("Overview"),xr=l(),j=n("p"),Ua=s("The X-MOD model was proposed in "),to=n("a"),Ra=s("Lifting the Curse of Multilinguality by Pre-training Modular Transformers"),Va=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"),Ha=s("XLM-R"),Ba=s(" to include language-specific modular components ("),mn=n("em"),Ga=s("language adapters"),Ja=s(") during pre-training. For fine-tuning, the language adapters in each transformer layer are frozen."),Er=l(),_t=n("p"),Ka=s("The abstract from the paper is the following:"),Fr=l(),vt=n("p"),pn=n("em"),Ya=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."),Cr=l(),bt=n("p"),Za=s("Tips:"),zr=l(),Fe=n("ul"),no=n("li"),es=s("X-MOD is similar to "),kt=n("a"),os=s("XLM-R"),ts=s(", but a difference is that the input language needs to be specified so that the correct language adapter can be activated."),ns=l(),fn=n("li"),rs=s("The main models \u2013 base and large \u2013 have adapters for 81 languages."),Pr=l(),Q=n("p"),as=s("This model was contributed by "),ro=n("a"),ss=s("jvamvas"),is=s(`.
The original code can be found `),ao=n("a"),ds=s("here"),ls=s(" and the original documentation is found "),so=n("a"),cs=s("here"),hs=s("."),Lr=l(),ae=n("h2"),Ce=n("a"),un=n("span"),v(io.$$.fragment),ms=l(),gn=n("span"),ps=s("Adapter Usage"),Or=l(),se=n("h3"),ze=n("a"),_n=n("span"),v(lo.$$.fragment),fs=l(),vn=n("span"),us=s("Input language"),Ar=l(),yt=n("p"),gs=s("There are two ways to specify the input language:"),qr=l(),wt=n("ol"),bn=n("li"),_s=s("By setting a default language before using the model:"),Nr=l(),v(co.$$.fragment),Dr=l(),ho=n("ol"),kn=n("li"),vs=s("By explicitly passing the index of the language adapter for each sample:"),Ir=l(),v(mo.$$.fragment),Sr=l(),ie=n("h3"),Pe=n("a"),yn=n("span"),v(po.$$.fragment),bs=l(),wn=n("span"),ks=s("Fine-tuning"),Wr=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),jr=l(),de=n("h3"),Le=n("a"),Tn=n("span"),v(uo.$$.fragment),ys=l(),$n=n("span"),ws=s("Cross-lingual transfer"),Qr=s(`

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

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

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

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