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 Cm(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,_,$,f,u,X,Wa,Xr,re,Ee,cn,oo,ja,hn,Ba,xr,j,Qa,to,Ua,Ra,gt,Va,Ha,mn,Ga,Ja,Er,_t,Ka,Cr,vt,pn,Ya,Fr,bt,Za,zr,Ce,no,es,kt,os,ts,ns,fn,rs,Pr,B,as,ro,ss,is,ao,ds,ls,so,cs,hs,Lr,ae,Fe,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,Br,go,Qr,le,Oe,Mn,_o,Ts,Xn,$s,Ur,F,xn,Tt,Ms,Xs,En,$t,xs,Es,Cn,Mt,Cs,Fs,Fn,Xt,zs,Ps,zn,xt,Ls,Os,Pn,Et,As,Rr,ce,Ae,Ln,vo,qs,On,Ns,Vr,W,bo,Ds,he,Is,Ct,Ss,Ws,ko,js,Bs,Qs,me,Us,Ft,Rs,Vs,zt,Hs,Gs,Js,qe,Hr,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,C,fi,In,ui,gi,Sn,_i,vi,Wn,bi,ki,jn,yi,wi,Bn,Ti,$i,Qn,Mi,Xi,xi,De,Ei,Un,Ci,Fi,xo,zi,Pi,U,Eo,Li,fe,Oi,Lt,Ai,qi,Rn,Ni,Di,Ii,Ie,Jr,ue,Se,Vn,Co,Si,Hn,Wi,Kr,P,Fo,ji,zo,Bi,Gn,Qi,Ui,Ri,Po,Vi,Ot,Hi,Gi,Ji,Lo,Ki,Oo,Yi,Zi,ed,R,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,V,jo,Td,ve,$d,Nt,Md,Xd,er,xd,Ed,Cd,Be,ea,be,Qe,or,Bo,Fd,tr,zd,oa,O,Qo,Pd,nr,Ld,Od,Uo,Ad,Dt,qd,Nd,Dd,Ro,Id,Vo,Sd,Wd,jd,H,Ho,Bd,ke,Qd,It,Ud,Rd,rr,Vd,Hd,Gd,Ue,ta,ye,Re,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,Ve,ra,Te,He,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,Cl,$e,Fl,Bt,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,Bl,Ql,lt,Ul,Qt,Rl,Vl,Hl,ct,Gl,ht,Jl,Kl,Yl,K,mt,Zl,xe,ec,Ut,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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XmodModel.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XmodModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.XmodModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XmodModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.XmodModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.XmodModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.XmodModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.XmodModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/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.27.1/src/transformers/models/xmod/modeling_xmod.py#L846"}}),Ie=new ut({props:{$$slots:{default:[Tm]},$$scope:{ctx:E}}}),Co=new I({}),Fo=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.27.1/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.27.1/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.27.1/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XmodForCausalLM.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XmodForCausalLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.XmodForCausalLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XmodForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.XmodForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.XmodForCausalLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.XmodForCausalLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.XmodForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XmodForMaskedLM.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForMaskedLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XmodForMaskedLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.XmodForMaskedLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XmodForMaskedLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.XmodForMaskedLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.XmodForMaskedLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.XmodForMaskedLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.XmodForMaskedLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/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.27.1/src/transformers/models/xmod/modeling_xmod.py#L1185"}}),Be=new ut({props:{$$slots:{default:[Mm]},$$scope:{ctx:E}}}),Bo=new I({}),Qo=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.27.1/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.27.1/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.27.1/src/transformers/models/xmod/modeling_xmod.py#L1285"}}),Ho=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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XmodForSequenceClassification.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XmodForSequenceClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.XmodForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XmodForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.XmodForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.XmodForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.XmodForSequenceClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.XmodForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/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.27.1/src/transformers/models/xmod/modeling_xmod.py#L1300"}}),Ue=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.27.1/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.27.1/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.27.1/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XmodForMultipleChoice.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForMultipleChoice.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XmodForMultipleChoice.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.XmodForMultipleChoice.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XmodForMultipleChoice.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.XmodForMultipleChoice.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.XmodForMultipleChoice.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.XmodForMultipleChoice.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.XmodForMultipleChoice.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/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.27.1/src/transformers/models/xmod/modeling_xmod.py#L1394"}}),Ve=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.27.1/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.27.1/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.27.1/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XmodForTokenClassification.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XmodForTokenClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.XmodForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XmodForTokenClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.XmodForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.XmodForTokenClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.XmodForTokenClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.XmodForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XmodForQuestionAnswering.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XmodForQuestionAnswering.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.XmodForQuestionAnswering.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XmodForQuestionAnswering.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.XmodForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.XmodForQuestionAnswering.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.XmodForQuestionAnswering.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.XmodForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/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.27.1/src/transformers/models/xmod/modeling_xmod.py#L1591"}}),Ke=new ut({props:{$$slots:{default:[Cm]},$$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"),Ba=s("Overview"),xr=l(),j=n("p"),Qa=s("The X-MOD model was proposed in "),to=n("a"),Ua=s("Lifting the Curse of Multilinguality by Pre-training Modular Transformers"),Ra=s(` by Jonas Pfeiffer, Naman Goyal, Xi Lin, Xian Li, James Cross, Sebastian Riedel, and Mikel Artetxe.
X-MOD extends multilingual masked language models like `),gt=n("a"),Va=s("XLM-R"),Ha=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:"),Cr=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."),Fr=l(),bt=n("p"),Za=s("Tips:"),zr=l(),Ce=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(),B=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"),Fe=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"),Br=s(`

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

	`),v(go.$$.fragment),Qr=l(),le=n("h2"),Oe=n("a"),Mn=n("span"),v(_o.$$.fragment),Ts=l(),Xn=n("span"),$s=s("Resources"),Ur=l(),F=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(),Cn=n("li"),Mt=n("a"),Cs=s("Question answering task guide"),Fs=l(),Fn=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"),Rr=l(),ce=n("h2"),Ae=n("a"),Ln=n("span"),v(vo.$$.fragment),qs=l(),On=n("span"),Ns=s("XmodConfig"),Vr=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 "),Ct=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"),Bs=s(" architecture."),Qs=l(),me=n("p"),Us=s("Configuration objects inherit from "),Ft=n("a"),Rs=s("PretrainedConfig"),Vs=s(` and can be used to control the model outputs. Read the
documentation from `),zt=n("a"),Hs=s("PretrainedConfig"),Gs=s(" for more information."),Js=l(),v(qe.$$.fragment),Hr=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(),C=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 "),Bn=n("code"),Ti=s("True"),$i=s("; an "),Qn=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(".. _"),Un=n("em"),Ci=s("Attention is all you need"),Fi=s(": "),xo=n("a"),zi=s("https://arxiv.org/abs/1706.03762"),Pi=l(),U=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 "),Rn=n("code"),Ni=s("__call__"),Di=s(" special method."),Ii=l(),v(Ie.$$.fragment),Jr=l(),ue=n("h2"),Se=n("a"),Vn=n("span"),v(Co.$$.fragment),Si=l(),Hn=n("span"),Wi=s("XmodForCausalLM"),Kr=l(),P=n("div"),v(Fo.$$.fragment),ji=l(),zo=n("p"),Bi=s("X-MOD Model with a "),Gn=n("code"),Qi=s("language modeling"),Ui=s(" head on top for CLM fine-tuning."),Ri=l(),Po=n("p"),Vi=s("This model inherits from "),Ot=n("a"),Hi=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(),R=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(),V=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."),Cd=l(),v(Be.$$.fragment),ea=l(),be=n("h2"),Qe=n("a"),or=n("span"),v(Bo.$$.fragment),Fd=l(),tr=n("span"),zd=s("XmodForSequenceClassification"),oa=l(),O=n("div"),v(Qo.$$.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(),Uo=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(),Ro=n("p"),Id=s("This model is also a PyTorch "),Vo=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(),H=n("div"),v(Ho.$$.fragment),Bd=l(),ke=n("p"),Qd=s("The "),It=n("a"),Ud=s("XmodForSequenceClassification"),Rd=s(" forward method, overrides the "),rr=n("code"),Vd=s("__call__"),Hd=s(" special method."),Gd=l(),v(Ue.$$.fragment),ta=l(),ye=n("h2"),Re=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(Ve.$$.fragment),ra=l(),Te=n("h2"),He=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),Cl=l(),$e=n("p"),Fl=s("The "),Bt=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"),Bl=s(")."),Ql=l(),lt=n("p"),Ul=s("This model inherits from "),Qt=n("a"),Rl=s("PreTrainedModel"),Vl=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Hl=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 "),Ut=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);Ba=i(Tr,"Overview"),Tr.forEach(t),ft.forEach(t),xr=c(o),j=r(o,"P",{});var Ye=a(j);Qa=i(Ye,"The X-MOD model was proposed in "),to=r(Ye,"A",{href:!0,rel:!0});var sc=a(to);Ua=i(sc,"Lifting the Curse of Multilinguality by Pre-training Modular Transformers"),sc.forEach(t),Ra=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);Va=i(ic,"XLM-R"),ic.forEach(t),Ha=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),Cr=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),Fr=c(o),bt=r(o,"P",{});var mc=a(bt);Za=i(mc,"Tips:"),mc.forEach(t),zr=c(o),Ce=r(o,"UL",{});var la=a(Ce);no=r(la,"LI",{});var ca=a(no);es=i(ca,"X-MOD is similar to "),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),B=r(o,"P",{});var Ze=a(B);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);Fe=r(ha,"A",{id:!0,class:!0,href:!0});var vc=a(Fe);un=r(vc,"SPAN",{});var bc=a(un);b(io.$$.fragment,bc),bc.forEach(t),vc.forEach(t),ms=c(ha),gn=r(ha,"SPAN",{});var 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 Cc=a(Pe);yn=r(Cc,"SPAN",{});var Fc=a(yn);b(po.$$.fragment,Fc),Fc.forEach(t),Cc.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),Br=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),Qr=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),Ur=c(o),F=r(o,"UL",{});var Q=a(F);xn=r(Q,"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(Q),En=r(Q,"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(Q),Cn=r(Q,"LI",{});var jc=a(Cn);Mt=r(jc,"A",{href:!0});var Bc=a(Mt);Cs=i(Bc,"Question answering task guide"),Bc.forEach(t),jc.forEach(t),Fs=c(Q),Fn=r(Q,"LI",{});var Qc=a(Fn);Xt=r(Qc,"A",{href:!0});var Uc=a(Xt);zs=i(Uc,"Causal language modeling task guide"),Uc.forEach(t),Qc.forEach(t),Ps=c(Q),zn=r(Q,"LI",{});var Rc=a(zn);xt=r(Rc,"A",{href:!0});var Vc=a(xt);Ls=i(Vc,"Masked language modeling task guide"),Vc.forEach(t),Rc.forEach(t),Os=c(Q),Pn=r(Q,"LI",{});var Hc=a(Pn);Et=r(Hc,"A",{href:!0});var Gc=a(Et);As=i(Gc,"Multiple choice task guide"),Gc.forEach(t),Hc.forEach(t),Q.forEach(t),Rr=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),Vr=c(o),W=r(o,"DIV",{class:!0});var eo=a(W);b(bo.$$.fragment,eo),Ds=c(eo),he=r(eo,"P",{});var Rt=a(he);Is=i(Rt,"This is the configuration class to store the configuration of a "),Ct=r(Rt,"A",{href:!0});var Zc=a(Ct);Ss=i(Zc,"XmodModel"),Zc.forEach(t),Ws=i(Rt,`. 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(Rt,"A",{href:!0,rel:!0});var eh=a(ko);js=i(eh,"facebook/xmod-base"),eh.forEach(t),Bs=i(Rt," architecture."),Rt.forEach(t),Qs=c(eo),me=r(eo,"P",{});var Vt=a(me);Us=i(Vt,"Configuration objects inherit from "),Ft=r(Vt,"A",{href:!0});var oh=a(Ft);Rs=i(oh,"PretrainedConfig"),oh.forEach(t),Vs=i(Vt,` and can be used to control the model outputs. Read the
documentation from `),zt=r(Vt,"A",{href:!0});var th=a(zt);Hs=i(th,"PretrainedConfig"),th.forEach(t),Gs=i(Vt," for more information."),Vt.forEach(t),Js=c(eo),b(qe.$$.fragment,eo),eo.forEach(t),Hr=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),C=r(z,"P",{});var S=a(C);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 "),Bn=r(S,"CODE",{});var fh=a(Bn);Ti=i(fh,"True"),fh.forEach(t),$i=i(S,"; an "),Qn=r(S,"CODE",{});var uh=a(Qn);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,".. _"),Un=r($r,"EM",{});var gh=a(Un);Ci=i(gh,"Attention is all you need"),gh.forEach(t),Fi=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),U=r(z,"DIV",{class:!0});var Ht=a(U);b(Eo.$$.fragment,Ht),Li=c(Ht),fe=r(Ht,"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 "),Rn=r(Gt,"CODE",{});var bh=a(Rn);Ni=i(bh,"__call__"),bh.forEach(t),Di=i(Gt," special method."),Gt.forEach(t),Ii=c(Ht),b(Ie.$$.fragment,Ht),Ht.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);Vn=r(kh,"SPAN",{});var yh=a(Vn);b(Co.$$.fragment,yh),yh.forEach(t),kh.forEach(t),Si=c(ya),Hn=r(ya,"SPAN",{});var wh=a(Hn);Wi=i(wh,"XmodForCausalLM"),wh.forEach(t),ya.forEach(t),Kr=c(o),P=r(o,"DIV",{class:!0});var Y=a(P);b(Fo.$$.fragment,Y),ji=c(Y),zo=r(Y,"P",{});var wa=a(zo);Bi=i(wa,"X-MOD Model with a "),Gn=r(wa,"CODE",{});var Th=a(Gn);Qi=i(Th,"language modeling"),Th.forEach(t),Ui=i(wa," head on top for CLM fine-tuning."),wa.forEach(t),Ri=c(Y),Po=r(Y,"P",{});var Ta=a(Po);Vi=i(Ta,"This model inherits from "),Ot=r(Ta,"A",{href:!0});var $h=a(Ot);Hi=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),R=r(Y,"DIV",{class:!0});var Jt=a(R);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 Ch=a(Kn);b(qo.$$.fragment,Ch),Ch.forEach(t),Eh.forEach(t),dd=c(Ma),Yn=r(Ma,"SPAN",{});var Fh=a(Yn);ld=i(Fh,"XmodForMaskedLM"),Fh.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),V=r(Z,"DIV",{class:!0});var Yt=a(V);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),Cd=c(Yt),b(Be.$$.fragment,Yt),Yt.forEach(t),Z.forEach(t),ea=c(o),be=r(o,"H2",{class:!0});var Ca=a(be);Qe=r(Ca,"A",{id:!0,class:!0,href:!0});var qh=a(Qe);or=r(qh,"SPAN",{});var Nh=a(or);b(Bo.$$.fragment,Nh),Nh.forEach(t),qh.forEach(t),Fd=c(Ca),tr=r(Ca,"SPAN",{});var Dh=a(tr);zd=i(Dh,"XmodForSequenceClassification"),Dh.forEach(t),Ca.forEach(t),oa=c(o),O=r(o,"DIV",{class:!0});var ee=a(O);b(Qo.$$.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),Uo=r(ee,"P",{});var Fa=a(Uo);Ad=i(Fa,"This model inherits from "),Dt=r(Fa,"A",{href:!0});var Sh=a(Dt);qd=i(Sh,"PreTrainedModel"),Sh.forEach(t),Nd=i(Fa,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Fa.forEach(t),Dd=c(ee),Ro=r(ee,"P",{});var za=a(Ro);Id=i(za,"This model is also a PyTorch "),Vo=r(za,"A",{href:!0,rel:!0});var Wh=a(Vo);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),H=r(ee,"DIV",{class:!0});var en=a(H);b(Ho.$$.fragment,en),Bd=c(en),ke=r(en,"P",{});var on=a(ke);Qd=i(on,"The "),It=r(on,"A",{href:!0});var jh=a(It);Ud=i(jh,"XmodForSequenceClassification"),jh.forEach(t),Rd=i(on," forward method, overrides the "),rr=r(on,"CODE",{});var Bh=a(rr);Vd=i(Bh,"__call__"),Bh.forEach(t),Hd=i(on," special method."),on.forEach(t),Gd=c(en),b(Ue.$$.fragment,en),en.forEach(t),ee.forEach(t),ta=c(o),ye=r(o,"H2",{class:!0});var Pa=a(ye);Re=r(Pa,"A",{id:!0,class:!0,href:!0});var Qh=a(Re);ar=r(Qh,"SPAN",{});var Uh=a(ar);b(Go.$$.fragment,Uh),Uh.forEach(t),Qh.forEach(t),Jd=c(Pa),sr=r(Pa,"SPAN",{});var Rh=a(sr);Kd=i(Rh,"XmodForMultipleChoice"),Rh.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 Vh=a(ir);Zd=i(Vh,`X-MOD Model with a multiple choice classification head on top (a linear layer on top of the pooled output and a
softmax) e.g. for RocStories/SWAG tasks.`),Vh.forEach(t),el=c(oe),Ko=r(oe,"P",{});var La=a(Ko);ol=i(La,"This model inherits from "),St=r(La,"A",{href:!0});var Hh=a(St);tl=i(Hh,"PreTrainedModel"),Hh.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(Ve.$$.fragment,tn),tn.forEach(t),oe.forEach(t),ra=c(o),Te=r(o,"H2",{class:!0});var Aa=a(Te);He=r(Aa,"A",{id:!0,class:!0,href:!0});var Yh=a(He);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),Cl=c(rn),$e=r(rn,"P",{});var an=a($e);Fl=i(an,"The "),Bt=r(an,"A",{href:!0});var rm=a(Bt);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),Bl=i(sn,")."),sn.forEach(t),Ql=c(ne),lt=r(ne,"P",{});var Ia=a(lt);Ul=i(Ia,"This model inherits from "),Qt=r(Ia,"A",{href:!0});var hm=a(Qt);Rl=i(hm,"PreTrainedModel"),hm.forEach(t),Vl=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),Hl=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 "),Ut=r(ln,"A",{href:!0});var pm=a(Ut);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(Fe,"id","adapter-usage"),d(Fe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Fe,"href","#adapter-usage"),d(ae,"class","relative group"),d(ze,"id","input-language"),d(ze,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ze,"href","#input-language"),d(se,"class","relative group"),d(ho,"start","2"),d(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(Ct,"href","/docs/transformers/v4.27.1/en/model_doc/xmod#transformers.XmodModel"),d(ko,"href","https://huggingface.co/facebook/xmod-base"),d(ko,"rel","nofollow"),d(Ft,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(zt,"href","/docs/transformers/v4.27.1/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.27.1/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.27.1/en/model_doc/xmod#transformers.XmodModel"),d(U,"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.27.1/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.27.1/en/model_doc/xmod#transformers.XmodForCausalLM"),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(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.27.1/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.27.1/en/model_doc/xmod#transformers.XmodForMaskedLM"),d(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Qe,"id","transformers.XmodForSequenceClassification"),d(Qe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Qe,"href","#transformers.XmodForSequenceClassification"),d(be,"class","relative group"),d(Dt,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),d(Vo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Vo,"rel","nofollow"),d(It,"href","/docs/transformers/v4.27.1/en/model_doc/xmod#transformers.XmodForSequenceClassification"),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(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Re,"id","transformers.XmodForMultipleChoice"),d(Re,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Re,"href","#transformers.XmodForMultipleChoice"),d(ye,"class","relative group"),d(St,"href","/docs/transformers/v4.27.1/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.27.1/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(He,"id","transformers.XmodForTokenClassification"),d(He,"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(He,"href","#transformers.XmodForTokenClassification"),d(Te,"class","relative group"),d(jt,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),d(at,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(at,"rel","nofollow"),d(Bt,"href","/docs/transformers/v4.27.1/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(Qt,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),d(ht,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(ht,"rel","nofollow"),d(Ut,"href","/docs/transformers/v4.27.1/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,Ba),p(o,xr,h),p(o,j,h),e(j,Qa),e(j,to),e(to,Ua),e(j,Ra),e(j,gt),e(gt,Va),e(j,Ha),e(j,mn),e(mn,Ga),e(j,Ja),p(o,Er,h),p(o,_t,h),e(_t,Ka),p(o,Cr,h),p(o,vt,h),e(vt,pn),e(pn,Ya),p(o,Fr,h),p(o,bt,h),e(bt,Za),p(o,zr,h),p(o,Ce,h),e(Ce,no),e(no,es),e(no,kt),e(kt,os),e(no,ts),e(Ce,ns),e(Ce,fn),e(fn,rs),p(o,Pr,h),p(o,B,h),e(B,as),e(B,ro),e(ro,ss),e(B,is),e(B,ao),e(ao,ds),e(B,ls),e(B,so),e(so,cs),e(B,hs),p(o,Lr,h),p(o,ae,h),e(ae,Fe),e(Fe,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,Br,h),k(go,o,h),p(o,Qr,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,Ur,h),p(o,F,h),e(F,xn),e(xn,Tt),e(Tt,Ms),e(F,Xs),e(F,En),e(En,$t),e($t,xs),e(F,Es),e(F,Cn),e(Cn,Mt),e(Mt,Cs),e(F,Fs),e(F,Fn),e(Fn,Xt),e(Xt,zs),e(F,Ps),e(F,zn),e(zn,xt),e(xt,Ls),e(F,Os),e(F,Pn),e(Pn,Et),e(Et,As),p(o,Rr,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,Vr,h),p(o,W,h),k(bo,W,null),e(W,Ds),e(W,he),e(he,Is),e(he,Ct),e(Ct,Ss),e(he,Ws),e(he,ko),e(ko,js),e(he,Bs),e(W,Qs),e(W,me),e(me,Us),e(me,Ft),e(Ft,Rs),e(me,Vs),e(me,zt),e(zt,Hs),e(me,Gs),e(W,Js),k(qe,W,null),p(o,Hr,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,C),e(C,fi),e(C,In),e(In,ui),e(C,gi),e(C,Sn),e(Sn,_i),e(C,vi),e(C,Wn),e(Wn,bi),e(C,ki),e(C,jn),e(jn,yi),e(C,wi),e(C,Bn),e(Bn,Ti),e(C,$i),e(C,Qn),e(Qn,Mi),e(C,Xi),e(x,xi),e(x,De),e(De,Ei),e(De,Un),e(Un,Ci),e(De,Fi),e(De,xo),e(xo,zi),e(x,Pi),e(x,U),k(Eo,U,null),e(U,Li),e(U,fe),e(fe,Oi),e(fe,Lt),e(Lt,Ai),e(fe,qi),e(fe,Rn),e(Rn,Ni),e(fe,Di),e(U,Ii),k(Ie,U,null),p(o,Jr,h),p(o,ue,h),e(ue,Se),e(Se,Vn),k(Co,Vn,null),e(ue,Si),e(ue,Hn),e(Hn,Wi),p(o,Kr,h),p(o,P,h),k(Fo,P,null),e(P,ji),e(P,zo),e(zo,Bi),e(zo,Gn),e(Gn,Qi),e(zo,Ui),e(P,Ri),e(P,Po),e(Po,Vi),e(Po,Ot),e(Ot,Hi),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,R),k(Ao,R,null),e(R,od),e(R,ge),e(ge,td),e(ge,At),e(At,nd),e(ge,rd),e(ge,Jn),e(Jn,ad),e(ge,sd),e(R,id),k(We,R,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,V),k(jo,V,null),e(V,Td),e(V,ve),e(ve,$d),e(ve,Nt),e(Nt,Md),e(ve,Xd),e(ve,er),e(er,xd),e(ve,Ed),e(V,Cd),k(Be,V,null),p(o,ea,h),p(o,be,h),e(be,Qe),e(Qe,or),k(Bo,or,null),e(be,Fd),e(be,tr),e(tr,zd),p(o,oa,h),p(o,O,h),k(Qo,O,null),e(O,Pd),e(O,nr),e(nr,Ld),e(O,Od),e(O,Uo),e(Uo,Ad),e(Uo,Dt),e(Dt,qd),e(Uo,Nd),e(O,Dd),e(O,Ro),e(Ro,Id),e(Ro,Vo),e(Vo,Sd),e(Ro,Wd),e(O,jd),e(O,H),k(Ho,H,null),e(H,Bd),e(H,ke),e(ke,Qd),e(ke,It),e(It,Ud),e(ke,Rd),e(ke,rr),e(rr,Vd),e(ke,Hd),e(H,Gd),k(Ue,H,null),p(o,ta,h),p(o,ye,h),e(ye,Re),e(Re,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(Ve,G,null),p(o,ra,h),p(o,Te,h),e(Te,He),e(He,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,Cl),e(J,$e),e($e,Fl),e($e,Bt),e(Bt,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,Bl),e(N,Ql),e(N,lt),e(lt,Ul),e(lt,Qt),e(Qt,Rl),e(lt,Vl),e(N,Hl),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,Ut),e(Ut,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}),Be.$set(kr);const ft={};h&2&&(ft.$$scope={dirty:h,ctx:o}),Ue.$set(ft);const yr={};h&2&&(yr.$$scope={dirty:h,ctx:o}),Ve.$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(Co.$$.fragment,o),y(Fo.$$.fragment,o),y(Ao.$$.fragment,o),y(We.$$.fragment,o),y(qo.$$.fragment,o),y(No.$$.fragment,o),y(jo.$$.fragment,o),y(Be.$$.fragment,o),y(Bo.$$.fragment,o),y(Qo.$$.fragment,o),y(Ho.$$.fragment,o),y(Ue.$$.fragment,o),y(Go.$$.fragment,o),y(Jo.$$.fragment,o),y(et.$$.fragment,o),y(Ve.$$.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(Co.$$.fragment,o),w(Fo.$$.fragment,o),w(Ao.$$.fragment,o),w(We.$$.fragment,o),w(qo.$$.fragment,o),w(No.$$.fragment,o),w(jo.$$.fragment,o),w(Be.$$.fragment,o),w(Bo.$$.fragment,o),w(Qo.$$.fragment,o),w(Ho.$$.fragment,o),w(Ue.$$.fragment,o),w(Go.$$.fragment,o),w(Jo.$$.fragment,o),w(et.$$.fragment,o),w(Ve.$$.fragment,o),w(ot.$$.fragment,o),w(tt.$$.fragment,o),w(st.$$.fragment,o),w(Ge.$$.fragment,o),w(it.$$.fragment,o),w(dt.$$.fragment,o),w(mt.$$.fragment,o),w(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(Cr),o&&t(vt),o&&t(Fr),o&&t(bt),o&&t(zr),o&&t(Ce),o&&t(Pr),o&&t(B),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(Br),T(go,o),o&&t(Qr),o&&t(le),T(_o),o&&t(Ur),o&&t(F),o&&t(Rr),o&&t(ce),T(vo),o&&t(Vr),o&&t(W),T(bo),T(qe),o&&t(Hr),o&&t(pe),T(yo),o&&t(Gr),o&&t(x),T(wo),T(Eo),T(Ie),o&&t(Jr),o&&t(ue),T(Co),o&&t(Kr),o&&t(P),T(Fo),T(Ao),T(We),o&&t(Yr),o&&t(_e),T(qo),o&&t(Zr),o&&t(L),T(No),T(jo),T(Be),o&&t(ea),o&&t(be),T(Bo),o&&t(oa),o&&t(O),T(Qo),T(Ho),T(Ue),o&&t(ta),o&&t(ye),T(Go),o&&t(na),o&&t(A),T(Jo),T(et),T(Ve),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,Fm,_m,{})}}export{Im as default,zm as metadata};
