import{s as us,o as gs,n as le}from"../chunks/scheduler.25b97de1.js";import{S as _s,i as bs,g as d,s as n,r as p,A as Ts,h as l,f as t,c as s,j as $,u as h,x as c,k as w,y as a,a as r,v as f,d as u,t as g,w as _}from"../chunks/index.d9030fc9.js";import{T as oo}from"../chunks/Tip.baa67368.js";import{D as q}from"../chunks/Docstring.ffac8efa.js";import{C as Ao}from"../chunks/CodeBlock.e6cd0d95.js";import{E as ks}from"../chunks/ExampleCodeBlock.22dfe688.js";import{H as x,E as ys}from"../chunks/EditOnGithub.91d95064.js";function vs(M){let i,b="Examples:",m,T,j;return T=new Ao({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFhtb2RDb25maWclMkMlMjBYbW9kTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhbiUyMFgtTU9EJTIwZmFjZWJvb2slMkZ4bW9kLWJhc2UlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwWG1vZENvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBmYWNlYm9vayUyRnhtb2QtYmFzZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwWG1vZE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> XmodConfig, XmodModel

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`,wrap:!1}}),{c(){i=d("p"),i.textContent=b,m=n(),p(T.$$.fragment)},l(y){i=l(y,"P",{"data-svelte-h":!0}),c(i)!=="svelte-kvfsh7"&&(i.textContent=b),m=s(y),h(T.$$.fragment,y)},m(y,W){r(y,i,W),r(y,m,W),f(T,y,W),j=!0},p:le,i(y){j||(u(T.$$.fragment,y),j=!0)},o(y){g(T.$$.fragment,y),j=!1},d(y){y&&(t(i),t(m)),_(T,y)}}}function Ms(M){let i,b=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){i=d("p"),i.innerHTML=b},l(m){i=l(m,"P",{"data-svelte-h":!0}),c(i)!=="svelte-fincs2"&&(i.innerHTML=b)},m(m,T){r(m,i,T)},p:le,d(m){m&&t(i)}}}function ws(M){let i,b=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){i=d("p"),i.innerHTML=b},l(m){i=l(m,"P",{"data-svelte-h":!0}),c(i)!=="svelte-fincs2"&&(i.innerHTML=b)},m(m,T){r(m,i,T)},p:le,d(m){m&&t(i)}}}function $s(M){let i,b=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){i=d("p"),i.innerHTML=b},l(m){i=l(m,"P",{"data-svelte-h":!0}),c(i)!=="svelte-fincs2"&&(i.innerHTML=b)},m(m,T){r(m,i,T)},p:le,d(m){m&&t(i)}}}function xs(M){let i,b=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){i=d("p"),i.innerHTML=b},l(m){i=l(m,"P",{"data-svelte-h":!0}),c(i)!=="svelte-fincs2"&&(i.innerHTML=b)},m(m,T){r(m,i,T)},p:le,d(m){m&&t(i)}}}function Cs(M){let i,b=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){i=d("p"),i.innerHTML=b},l(m){i=l(m,"P",{"data-svelte-h":!0}),c(i)!=="svelte-fincs2"&&(i.innerHTML=b)},m(m,T){r(m,i,T)},p:le,d(m){m&&t(i)}}}function Xs(M){let i,b=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){i=d("p"),i.innerHTML=b},l(m){i=l(m,"P",{"data-svelte-h":!0}),c(i)!=="svelte-fincs2"&&(i.innerHTML=b)},m(m,T){r(m,i,T)},p:le,d(m){m&&t(i)}}}function Ls(M){let i,b=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){i=d("p"),i.innerHTML=b},l(m){i=l(m,"P",{"data-svelte-h":!0}),c(i)!=="svelte-fincs2"&&(i.innerHTML=b)},m(m,T){r(m,i,T)},p:le,d(m){m&&t(i)}}}function Fs(M){let i,b,m,T,j,y,W,Ho,ce,wn=`The X-MOD model was proposed in <a href="http://dx.doi.org/10.18653/v1/2022.naacl-main.255" rel="nofollow">Lifting the Curse of Multilinguality by Pre-training Modular Transformers</a> by Jonas Pfeiffer, Naman Goyal, Xi Lin, Xian Li, James Cross, Sebastian Riedel, and Mikel Artetxe.
X-MOD extends multilingual masked language models like <a href="xlm-roberta">XLM-R</a> to include language-specific modular components (<em>language adapters</em>) during pre-training. For fine-tuning, the language adapters in each transformer layer are frozen.`,So,me,$n="The abstract from the paper is the following:",Uo,pe,xn="<em>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.</em>",Eo,he,Cn=`This model was contributed by <a href="https://huggingface.co/jvamvas" rel="nofollow">jvamvas</a>.
The original code can be found <a href="https://github.com/facebookresearch/fairseq/tree/58cc6cca18f15e6d56e3f60c959fe4f878960a60/fairseq/models/xmod" rel="nofollow">here</a> and the original documentation is found <a href="https://github.com/facebookresearch/fairseq/tree/58cc6cca18f15e6d56e3f60c959fe4f878960a60/examples/xmod" rel="nofollow">here</a>.`,Bo,fe,Zo,ue,Xn="Tips:",Qo,ge,Ln='<li>X-MOD is similar to <a href="xlm-roberta">XLM-R</a>, but a difference is that the input language needs to be specified so that the correct language adapter can be activated.</li> <li>The main models – base and large – have adapters for 81 languages.</li>',Go,_e,Vo,be,Ro,Te,Fn="There are two ways to specify the input language:",Yo,ke,zn="<li>By setting a default language before using the model:</li>",Ko,ye,et,ee,In="<li>By explicitly passing the index of the language adapter for each sample:</li>",ot,ve,tt,Me,nt,we,qn="The paper recommends that the embedding layer and the language adapters are frozen during fine-tuning. A method for doing this is provided:",st,$e,at,xe,rt,Ce,Pn="After fine-tuning, zero-shot cross-lingual transfer can be tested by activating the language adapter of the target language:",it,Xe,dt,Le,lt,Fe,On='<li><a href="../tasks/sequence_classification">Text classification task guide</a></li> <li><a href="../tasks/token_classification">Token classification task guide</a></li> <li><a href="../tasks/question_answering">Question answering task guide</a></li> <li><a href="../tasks/language_modeling">Causal language modeling task guide</a></li> <li><a href="../tasks/masked_language_modeling">Masked language modeling task guide</a></li> <li><a href="../tasks/multiple_choice">Multiple choice task guide</a></li>',ct,ze,mt,P,Ie,Lt,to,Jn=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/xmod#transformers.XmodModel">XmodModel</a>. 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
<a href="https://huggingface.co/facebook/xmod-base" rel="nofollow">facebook/xmod-base</a> architecture.`,Ft,no,Nn=`Configuration objects inherit from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,zt,oe,pt,qe,ht,k,Pe,It,so,jn="The bare X-MOD Model transformer outputting raw hidden-states without any specific head on top.",qt,ao,Wn=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Pt,ro,Dn=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Ot,io,An=`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 <em>Attention is
all you need</em>_ by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz
Kaiser and Illia Polosukhin.`,Jt,lo,Hn=`To behave as an decoder the model needs to be initialized with the <code>is_decoder</code> argument of the configuration set
to <code>True</code>. To be used in a Seq2Seq model, the model needs to initialized with both <code>is_decoder</code> argument and
<code>add_cross_attention</code> set to <code>True</code>; an <code>encoder_hidden_states</code> is then expected as an input to the forward pass.`,Nt,co,Sn='.. _<em>Attention is all you need</em>: <a href="https://arxiv.org/abs/1706.03762" rel="nofollow">https://arxiv.org/abs/1706.03762</a>',jt,A,Oe,Wt,mo,Un='The <a href="/docs/transformers/main/en/model_doc/xmod#transformers.XmodModel">XmodModel</a> forward method, overrides the <code>__call__</code> special method.',Dt,te,ft,Je,ut,C,Ne,At,po,En="X-MOD Model with a <code>language modeling</code> head on top for CLM fine-tuning.",Ht,ho,Bn=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,St,fo,Zn=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Ut,H,je,Et,uo,Qn='The <a href="/docs/transformers/main/en/model_doc/xmod#transformers.XmodForCausalLM">XmodForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',Bt,ne,gt,We,_t,X,De,Zt,go,Gn="X-MOD Model with a <code>language modeling</code> head on top.",Qt,_o,Vn=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Gt,bo,Rn=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Vt,S,Ae,Rt,To,Yn='The <a href="/docs/transformers/main/en/model_doc/xmod#transformers.XmodForMaskedLM">XmodForMaskedLM</a> forward method, overrides the <code>__call__</code> special method.',Yt,se,bt,He,Tt,L,Se,Kt,ko,Kn=`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.`,en,yo,es=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,on,vo,os=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,tn,U,Ue,nn,Mo,ts='The <a href="/docs/transformers/main/en/model_doc/xmod#transformers.XmodForSequenceClassification">XmodForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',sn,ae,kt,Ee,yt,F,Be,an,wo,ns=`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.`,rn,$o,ss=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,dn,xo,as=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,ln,E,Ze,cn,Co,rs='The <a href="/docs/transformers/main/en/model_doc/xmod#transformers.XmodForMultipleChoice">XmodForMultipleChoice</a> forward method, overrides the <code>__call__</code> special method.',mn,re,vt,Qe,Mt,z,Ge,pn,Xo,is=`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.`,hn,Lo,ds=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,fn,Fo,ls=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,un,B,Ve,gn,zo,cs='The <a href="/docs/transformers/main/en/model_doc/xmod#transformers.XmodForTokenClassification">XmodForTokenClassification</a> forward method, overrides the <code>__call__</code> special method.',_n,ie,wt,Re,$t,I,Ye,bn,Io,ms=`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 <code>span start logits</code> and <code>span end logits</code>).`,Tn,qo,ps=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,kn,Po,hs=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,yn,Z,Ke,vn,Oo,fs='The <a href="/docs/transformers/main/en/model_doc/xmod#transformers.XmodForQuestionAnswering">XmodForQuestionAnswering</a> forward method, overrides the <code>__call__</code> special method.',Mn,de,xt,eo,Ct,Do,Xt;return j=new x({props:{title:"X-MOD",local:"x-mod",headingTag:"h1"}}),W=new x({props:{title:"Overview",local:"overview",headingTag:"h2"}}),fe=new x({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),_e=new x({props:{title:"Adapter Usage",local:"adapter-usage",headingTag:"h2"}}),be=new x({props:{title:"Input language",local:"input-language",headingTag:"h3"}}),ye=new Ao({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFhtb2RNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwWG1vZE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRnhtb2QtYmFzZSUyMiklMEFtb2RlbC5zZXRfZGVmYXVsdF9sYW5ndWFnZSglMjJlbl9YWCUyMik=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> XmodModel

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

input_ids = torch.tensor(
    [
        [<span class="hljs-number">0</span>, <span class="hljs-number">581</span>, <span class="hljs-number">10269</span>, <span class="hljs-number">83</span>, <span class="hljs-number">99942</span>, <span class="hljs-number">136</span>, <span class="hljs-number">60742</span>, <span class="hljs-number">23</span>, <span class="hljs-number">70</span>, <span class="hljs-number">80583</span>, <span class="hljs-number">18276</span>, <span class="hljs-number">2</span>],
        [<span class="hljs-number">0</span>, <span class="hljs-number">1310</span>, <span class="hljs-number">49083</span>, <span class="hljs-number">443</span>, <span class="hljs-number">269</span>, <span class="hljs-number">71</span>, <span class="hljs-number">5486</span>, <span class="hljs-number">165</span>, <span class="hljs-number">60429</span>, <span class="hljs-number">660</span>, <span class="hljs-number">23</span>, <span class="hljs-number">2</span>],
    ]
)
lang_ids = torch.LongTensor(
    [
        <span class="hljs-number">0</span>,  <span class="hljs-comment"># en_XX</span>
        <span class="hljs-number">8</span>,  <span class="hljs-comment"># de_DE</span>
    ]
)
output = model(input_ids, lang_ids=lang_ids)`,wrap:!1}}),Me=new x({props:{title:"Fine-tuning",local:"fine-tuning",headingTag:"h3"}}),$e=new Ao({props:{code:"bW9kZWwuZnJlZXplX2VtYmVkZGluZ3NfYW5kX2xhbmd1YWdlX2FkYXB0ZXJzKCklMEElMjMlMjBGaW5lLXR1bmUlMjB0aGUlMjBtb2RlbCUyMC4uLg==",highlighted:`model.freeze_embeddings_and_language_adapters()
<span class="hljs-comment"># Fine-tune the model ...</span>`,wrap:!1}}),xe=new x({props:{title:"Cross-lingual transfer",local:"cross-lingual-transfer",headingTag:"h3"}}),Xe=new Ao({props:{code:"bW9kZWwuc2V0X2RlZmF1bHRfbGFuZ3VhZ2UoJTIyZGVfREUlMjIpJTBBJTIzJTIwRXZhbHVhdGUlMjB0aGUlMjBtb2RlbCUyMG9uJTIwR2VybWFuJTIwZXhhbXBsZXMlMjAuLi4=",highlighted:`model.set_default_language(<span class="hljs-string">&quot;de_DE&quot;</span>)
<span class="hljs-comment"># Evaluate the model on German examples ...</span>`,wrap:!1}}),Le=new x({props:{title:"Resources",local:"resources",headingTag:"h2"}}),ze=new x({props:{title:"XmodConfig",local:"transformers.XmodConfig",headingTag:"h2"}}),Ie=new q({props:{name:"class transformers.XmodConfig",anchor:"transformers.XmodConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"use_cache",val:" = True"},{name:"classifier_dropout",val:" = None"},{name:"pre_norm",val:" = False"},{name:"adapter_reduction_factor",val:" = 2"},{name:"adapter_layer_norm",val:" = False"},{name:"adapter_reuse_layer_norm",val:" = True"},{name:"ln_before_adapter",val:" = True"},{name:"languages",val:" = ('en_XX',)"},{name:"default_language",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XmodConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the X-MOD model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/xmod#transformers.XmodModel">XmodModel</a>.`,name:"vocab_size"},{anchor:"transformers.XmodConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.XmodConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.XmodConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.XmodConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.XmodConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.XmodConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.XmodConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.XmodConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.XmodConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/xmod#transformers.XmodModel">XmodModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.XmodConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.XmodConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.XmodConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;</code>. For
positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.XmodConfig.is_decoder",description:`<strong>is_decoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the model is used as a decoder or not. If <code>False</code>, the model is used as an encoder.`,name:"is_decoder"},{anchor:"transformers.XmodConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.XmodConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The dropout ratio for the classification head.`,name:"classifier_dropout"},{anchor:"transformers.XmodConfig.pre_norm",description:`<strong>pre_norm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to apply layer normalization before each block.`,name:"pre_norm"},{anchor:"transformers.XmodConfig.adapter_reduction_factor",description:`<strong>adapter_reduction_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to 2) &#x2014;
The factor by which the dimensionality of the adapter is reduced relative to <code>hidden_size</code>.`,name:"adapter_reduction_factor"},{anchor:"transformers.XmodConfig.adapter_layer_norm",description:`<strong>adapter_layer_norm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to apply a new layer normalization before the adapter modules (shared across all adapters).`,name:"adapter_layer_norm"},{anchor:"transformers.XmodConfig.adapter_reuse_layer_norm",description:`<strong>adapter_reuse_layer_norm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to reuse the second layer normalization and apply it before the adapter modules as well.`,name:"adapter_reuse_layer_norm"},{anchor:"transformers.XmodConfig.ln_before_adapter",description:`<strong>ln_before_adapter</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to apply the layer normalization before the residual connection around the adapter module.`,name:"ln_before_adapter"},{anchor:"transformers.XmodConfig.languages",description:`<strong>languages</strong> (<code>Iterable[str]</code>, <em>optional</em>, defaults to <code>[&quot;en_XX&quot;]</code>) &#x2014;
An iterable of language codes for which adapter modules should be initialized.`,name:"languages"},{anchor:"transformers.XmodConfig.default_language",description:`<strong>default_language</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Language code of a default language. It will be assumed that the input is in this language if no language
codes are explicitly passed to the forward method.`,name:"default_language"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xmod/configuration_xmod.py#L29"}}),oe=new ks({props:{anchor:"transformers.XmodConfig.example",$$slots:{default:[vs]},$$scope:{ctx:M}}}),qe=new x({props:{title:"XmodModel",local:"transformers.XmodModel",headingTag:"h2"}}),Pe=new q({props:{name:"class transformers.XmodModel",anchor:"transformers.XmodModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.XmodModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xmod#transformers.XmodConfig">XmodConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xmod/modeling_xmod.py#L764"}}),Oe=new q({props:{name:"forward",anchor:"transformers.XmodModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"lang_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XmodModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XmodModel.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XmodModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.XmodModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XmodModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.XmodModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.XmodModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.XmodModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.XmodModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XmodModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.XmodModel.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.XmodModel.forward.past_key_values",description:"<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors &#x2014;",name:"past_key_values"},{anchor:"transformers.XmodModel.forward.of",description:`<strong>of</strong> shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"of"},{anchor:"transformers.XmodModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xmod/modeling_xmod.py#L814"}}),te=new oo({props:{$$slots:{default:[Ms]},$$scope:{ctx:M}}}),Je=new x({props:{title:"XmodForCausalLM",local:"transformers.XmodForCausalLM",headingTag:"h2"}}),Ne=new q({props:{name:"class transformers.XmodForCausalLM",anchor:"transformers.XmodForCausalLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XmodForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xmod#transformers.XmodConfig">XmodConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xmod/modeling_xmod.py#L956"}}),je=new q({props:{name:"forward",anchor:"transformers.XmodForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"lang_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Tuple[typing.Tuple[torch.FloatTensor]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XmodForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XmodForCausalLM.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XmodForCausalLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.XmodForCausalLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XmodForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.XmodForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.XmodForCausalLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.XmodForCausalLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.XmodForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XmodForCausalLM.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.XmodForCausalLM.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.XmodForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the left-to-right language modeling loss (next word prediction). Indices should be in
<code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are
ignored (masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.XmodForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.XmodForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.XmodForCausalLM.forward.Returns",description:"<strong>Returns</strong> &#x2014; <code>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</code> or <code>tuple(torch.FloatTensor)</code>",name:"Returns"},{anchor:"transformers.XmodForCausalLM.forward.Example",description:"<strong>Example</strong> &#x2014;",name:"Example"},{anchor:"transformers.XmodForCausalLM.forward.```python",description:`<strong>\`\`\`python</strong> &#x2014;</p>
<blockquote>
<blockquote>
<blockquote>
<p>from transformers import AutoTokenizer, XmodForCausalLM, AutoConfig
import torch</p>
</blockquote>
</blockquote>
</blockquote>`,name:"```python"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xmod/modeling_xmod.py#L984"}}),ne=new oo({props:{$$slots:{default:[ws]},$$scope:{ctx:M}}}),We=new x({props:{title:"XmodForMaskedLM",local:"transformers.XmodForMaskedLM",headingTag:"h2"}}),De=new q({props:{name:"class transformers.XmodForMaskedLM",anchor:"transformers.XmodForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XmodForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xmod#transformers.XmodConfig">XmodConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xmod/modeling_xmod.py#L1104"}}),Ae=new q({props:{name:"forward",anchor:"transformers.XmodForMaskedLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"lang_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XmodForMaskedLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XmodForMaskedLM.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForMaskedLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XmodForMaskedLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.XmodForMaskedLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XmodForMaskedLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.XmodForMaskedLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.XmodForMaskedLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.XmodForMaskedLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.XmodForMaskedLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XmodForMaskedLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.XmodForMaskedLM.forward.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, any]</code>, <em>optional</em>, defaults to <em>{}</em>) &#x2014;
Used to hide legacy arguments that have been deprecated.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xmod/modeling_xmod.py#L1135"}}),se=new oo({props:{$$slots:{default:[$s]},$$scope:{ctx:M}}}),He=new x({props:{title:"XmodForSequenceClassification",local:"transformers.XmodForSequenceClassification",headingTag:"h2"}}),Se=new q({props:{name:"class transformers.XmodForSequenceClassification",anchor:"transformers.XmodForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XmodForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xmod#transformers.XmodConfig">XmodConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xmod/modeling_xmod.py#L1228"}}),Ue=new q({props:{name:"forward",anchor:"transformers.XmodForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"lang_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XmodForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XmodForSequenceClassification.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XmodForSequenceClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.XmodForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XmodForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.XmodForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.XmodForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.XmodForSequenceClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.XmodForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XmodForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xmod/modeling_xmod.py#L1248"}}),ae=new oo({props:{$$slots:{default:[xs]},$$scope:{ctx:M}}}),Ee=new x({props:{title:"XmodForMultipleChoice",local:"transformers.XmodForMultipleChoice",headingTag:"h2"}}),Be=new q({props:{name:"class transformers.XmodForMultipleChoice",anchor:"transformers.XmodForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XmodForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xmod#transformers.XmodConfig">XmodConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xmod/modeling_xmod.py#L1321"}}),Ze=new q({props:{name:"forward",anchor:"transformers.XmodForMultipleChoice.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"lang_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XmodForMultipleChoice.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XmodForMultipleChoice.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForMultipleChoice.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XmodForMultipleChoice.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.XmodForMultipleChoice.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XmodForMultipleChoice.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.XmodForMultipleChoice.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.XmodForMultipleChoice.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.XmodForMultipleChoice.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.XmodForMultipleChoice.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XmodForMultipleChoice.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the multiple choice classification loss. Indices should be in <code>[0, ..., num_choices-1]</code> where <code>num_choices</code> is the size of the second dimension of the input tensors. (See
<code>input_ids</code> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xmod/modeling_xmod.py#L1340"}}),re=new oo({props:{$$slots:{default:[Cs]},$$scope:{ctx:M}}}),Qe=new x({props:{title:"XmodForTokenClassification",local:"transformers.XmodForTokenClassification",headingTag:"h2"}}),Ge=new q({props:{name:"class transformers.XmodForTokenClassification",anchor:"transformers.XmodForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XmodForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xmod#transformers.XmodConfig">XmodConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xmod/modeling_xmod.py#L1410"}}),Ve=new q({props:{name:"forward",anchor:"transformers.XmodForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"lang_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XmodForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XmodForTokenClassification.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XmodForTokenClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.XmodForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XmodForTokenClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.XmodForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.XmodForTokenClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.XmodForTokenClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.XmodForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XmodForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xmod/modeling_xmod.py#L1433"}}),ie=new oo({props:{$$slots:{default:[Xs]},$$scope:{ctx:M}}}),Re=new x({props:{title:"XmodForQuestionAnswering",local:"transformers.XmodForQuestionAnswering",headingTag:"h2"}}),Ye=new q({props:{name:"class transformers.XmodForQuestionAnswering",anchor:"transformers.XmodForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XmodForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xmod#transformers.XmodConfig">XmodConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xmod/modeling_xmod.py#L1512"}}),Ke=new q({props:{name:"forward",anchor:"transformers.XmodForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"lang_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XmodForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XmodForQuestionAnswering.forward.lang_ids",description:`<strong>lang_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of the language adapters that should be activated for each sample, respectively. Default: the index
that corresponds to <code>self.config.default_language</code>.`,name:"lang_ids"},{anchor:"transformers.XmodForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XmodForQuestionAnswering.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.XmodForQuestionAnswering.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XmodForQuestionAnswering.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.XmodForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.XmodForQuestionAnswering.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.XmodForQuestionAnswering.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.XmodForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XmodForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.XmodForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xmod/modeling_xmod.py#L1531"}}),de=new oo({props:{$$slots:{default:[Ls]},$$scope:{ctx:M}}}),eo=new ys({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/xmod.md"}}),{c(){i=d("meta"),b=n(),m=d("p"),T=n(),p(j.$$.fragment),y=n(),p(W.$$.fragment),Ho=n(),ce=d("p"),ce.innerHTML=wn,So=n(),me=d("p"),me.textContent=$n,Uo=n(),pe=d("p"),pe.innerHTML=xn,Eo=n(),he=d("p"),he.innerHTML=Cn,Bo=n(),p(fe.$$.fragment),Zo=n(),ue=d("p"),ue.textContent=Xn,Qo=n(),ge=d("ul"),ge.innerHTML=Ln,Go=n(),p(_e.$$.fragment),Vo=n(),p(be.$$.fragment),Ro=n(),Te=d("p"),Te.textContent=Fn,Yo=n(),ke=d("ol"),ke.innerHTML=zn,Ko=n(),p(ye.$$.fragment),et=n(),ee=d("ol"),ee.innerHTML=In,ot=n(),p(ve.$$.fragment),tt=n(),p(Me.$$.fragment),nt=n(),we=d("p"),we.textContent=qn,st=n(),p($e.$$.fragment),at=n(),p(xe.$$.fragment),rt=n(),Ce=d("p"),Ce.textContent=Pn,it=n(),p(Xe.$$.fragment),dt=n(),p(Le.$$.fragment),lt=n(),Fe=d("ul"),Fe.innerHTML=On,ct=n(),p(ze.$$.fragment),mt=n(),P=d("div"),p(Ie.$$.fragment),Lt=n(),to=d("p"),to.innerHTML=Jn,Ft=n(),no=d("p"),no.innerHTML=Nn,zt=n(),p(oe.$$.fragment),pt=n(),p(qe.$$.fragment),ht=n(),k=d("div"),p(Pe.$$.fragment),It=n(),so=d("p"),so.textContent=jn,qt=n(),ao=d("p"),ao.innerHTML=Wn,Pt=n(),ro=d("p"),ro.innerHTML=Dn,Ot=n(),io=d("p"),io.innerHTML=An,Jt=n(),lo=d("p"),lo.innerHTML=Hn,Nt=n(),co=d("p"),co.innerHTML=Sn,jt=n(),A=d("div"),p(Oe.$$.fragment),Wt=n(),mo=d("p"),mo.innerHTML=Un,Dt=n(),p(te.$$.fragment),ft=n(),p(Je.$$.fragment),ut=n(),C=d("div"),p(Ne.$$.fragment),At=n(),po=d("p"),po.innerHTML=En,Ht=n(),ho=d("p"),ho.innerHTML=Bn,St=n(),fo=d("p"),fo.innerHTML=Zn,Ut=n(),H=d("div"),p(je.$$.fragment),Et=n(),uo=d("p"),uo.innerHTML=Qn,Bt=n(),p(ne.$$.fragment),gt=n(),p(We.$$.fragment),_t=n(),X=d("div"),p(De.$$.fragment),Zt=n(),go=d("p"),go.innerHTML=Gn,Qt=n(),_o=d("p"),_o.innerHTML=Vn,Gt=n(),bo=d("p"),bo.innerHTML=Rn,Vt=n(),S=d("div"),p(Ae.$$.fragment),Rt=n(),To=d("p"),To.innerHTML=Yn,Yt=n(),p(se.$$.fragment),bt=n(),p(He.$$.fragment),Tt=n(),L=d("div"),p(Se.$$.fragment),Kt=n(),ko=d("p"),ko.textContent=Kn,en=n(),yo=d("p"),yo.innerHTML=es,on=n(),vo=d("p"),vo.innerHTML=os,tn=n(),U=d("div"),p(Ue.$$.fragment),nn=n(),Mo=d("p"),Mo.innerHTML=ts,sn=n(),p(ae.$$.fragment),kt=n(),p(Ee.$$.fragment),yt=n(),F=d("div"),p(Be.$$.fragment),an=n(),wo=d("p"),wo.textContent=ns,rn=n(),$o=d("p"),$o.innerHTML=ss,dn=n(),xo=d("p"),xo.innerHTML=as,ln=n(),E=d("div"),p(Ze.$$.fragment),cn=n(),Co=d("p"),Co.innerHTML=rs,mn=n(),p(re.$$.fragment),vt=n(),p(Qe.$$.fragment),Mt=n(),z=d("div"),p(Ge.$$.fragment),pn=n(),Xo=d("p"),Xo.textContent=is,hn=n(),Lo=d("p"),Lo.innerHTML=ds,fn=n(),Fo=d("p"),Fo.innerHTML=ls,un=n(),B=d("div"),p(Ve.$$.fragment),gn=n(),zo=d("p"),zo.innerHTML=cs,_n=n(),p(ie.$$.fragment),wt=n(),p(Re.$$.fragment),$t=n(),I=d("div"),p(Ye.$$.fragment),bn=n(),Io=d("p"),Io.innerHTML=ms,Tn=n(),qo=d("p"),qo.innerHTML=ps,kn=n(),Po=d("p"),Po.innerHTML=hs,yn=n(),Z=d("div"),p(Ke.$$.fragment),vn=n(),Oo=d("p"),Oo.innerHTML=fs,Mn=n(),p(de.$$.fragment),xt=n(),p(eo.$$.fragment),Ct=n(),Do=d("p"),this.h()},l(e){const o=Ts("svelte-u9bgzb",document.head);i=l(o,"META",{name:!0,content:!0}),o.forEach(t),b=s(e),m=l(e,"P",{}),$(m).forEach(t),T=s(e),h(j.$$.fragment,e),y=s(e),h(W.$$.fragment,e),Ho=s(e),ce=l(e,"P",{"data-svelte-h":!0}),c(ce)!=="svelte-1vmoovo"&&(ce.innerHTML=wn),So=s(e),me=l(e,"P",{"data-svelte-h":!0}),c(me)!=="svelte-vfdo9a"&&(me.textContent=$n),Uo=s(e),pe=l(e,"P",{"data-svelte-h":!0}),c(pe)!=="svelte-1ce41kp"&&(pe.innerHTML=xn),Eo=s(e),he=l(e,"P",{"data-svelte-h":!0}),c(he)!=="svelte-17wcokr"&&(he.innerHTML=Cn),Bo=s(e),h(fe.$$.fragment,e),Zo=s(e),ue=l(e,"P",{"data-svelte-h":!0}),c(ue)!=="svelte-axv494"&&(ue.textContent=Xn),Qo=s(e),ge=l(e,"UL",{"data-svelte-h":!0}),c(ge)!=="svelte-gqhdug"&&(ge.innerHTML=Ln),Go=s(e),h(_e.$$.fragment,e),Vo=s(e),h(be.$$.fragment,e),Ro=s(e),Te=l(e,"P",{"data-svelte-h":!0}),c(Te)!=="svelte-1bi3hxf"&&(Te.textContent=Fn),Yo=s(e),ke=l(e,"OL",{"data-svelte-h":!0}),c(ke)!=="svelte-1nun6oj"&&(ke.innerHTML=zn),Ko=s(e),h(ye.$$.fragment,e),et=s(e),ee=l(e,"OL",{start:!0,"data-svelte-h":!0}),c(ee)!=="svelte-1m276jh"&&(ee.innerHTML=In),ot=s(e),h(ve.$$.fragment,e),tt=s(e),h(Me.$$.fragment,e),nt=s(e),we=l(e,"P",{"data-svelte-h":!0}),c(we)!=="svelte-1p51yb4"&&(we.textContent=qn),st=s(e),h($e.$$.fragment,e),at=s(e),h(xe.$$.fragment,e),rt=s(e),Ce=l(e,"P",{"data-svelte-h":!0}),c(Ce)!=="svelte-1fqdbu1"&&(Ce.textContent=Pn),it=s(e),h(Xe.$$.fragment,e),dt=s(e),h(Le.$$.fragment,e),lt=s(e),Fe=l(e,"UL",{"data-svelte-h":!0}),c(Fe)!=="svelte-p1b16m"&&(Fe.innerHTML=On),ct=s(e),h(ze.$$.fragment,e),mt=s(e),P=l(e,"DIV",{class:!0});var D=$(P);h(Ie.$$.fragment,D),Lt=s(D),to=l(D,"P",{"data-svelte-h":!0}),c(to)!=="svelte-8cr86i"&&(to.innerHTML=Jn),Ft=s(D),no=l(D,"P",{"data-svelte-h":!0}),c(no)!=="svelte-o55m63"&&(no.innerHTML=Nn),zt=s(D),h(oe.$$.fragment,D),D.forEach(t),pt=s(e),h(qe.$$.fragment,e),ht=s(e),k=l(e,"DIV",{class:!0});var v=$(k);h(Pe.$$.fragment,v),It=s(v),so=l(v,"P",{"data-svelte-h":!0}),c(so)!=="svelte-1534uvs"&&(so.textContent=jn),qt=s(v),ao=l(v,"P",{"data-svelte-h":!0}),c(ao)!=="svelte-6pahdo"&&(ao.innerHTML=Wn),Pt=s(v),ro=l(v,"P",{"data-svelte-h":!0}),c(ro)!=="svelte-hswkmf"&&(ro.innerHTML=Dn),Ot=s(v),io=l(v,"P",{"data-svelte-h":!0}),c(io)!=="svelte-rehfhh"&&(io.innerHTML=An),Jt=s(v),lo=l(v,"P",{"data-svelte-h":!0}),c(lo)!=="svelte-174erte"&&(lo.innerHTML=Hn),Nt=s(v),co=l(v,"P",{"data-svelte-h":!0}),c(co)!=="svelte-p9qvd1"&&(co.innerHTML=Sn),jt=s(v),A=l(v,"DIV",{class:!0});var R=$(A);h(Oe.$$.fragment,R),Wt=s(R),mo=l(R,"P",{"data-svelte-h":!0}),c(mo)!=="svelte-1hj8fgv"&&(mo.innerHTML=Un),Dt=s(R),h(te.$$.fragment,R),R.forEach(t),v.forEach(t),ft=s(e),h(Je.$$.fragment,e),ut=s(e),C=l(e,"DIV",{class:!0});var O=$(C);h(Ne.$$.fragment,O),At=s(O),po=l(O,"P",{"data-svelte-h":!0}),c(po)!=="svelte-dygsvo"&&(po.innerHTML=En),Ht=s(O),ho=l(O,"P",{"data-svelte-h":!0}),c(ho)!=="svelte-6pahdo"&&(ho.innerHTML=Bn),St=s(O),fo=l(O,"P",{"data-svelte-h":!0}),c(fo)!=="svelte-hswkmf"&&(fo.innerHTML=Zn),Ut=s(O),H=l(O,"DIV",{class:!0});var Y=$(H);h(je.$$.fragment,Y),Et=s(Y),uo=l(Y,"P",{"data-svelte-h":!0}),c(uo)!=="svelte-jxragb"&&(uo.innerHTML=Qn),Bt=s(Y),h(ne.$$.fragment,Y),Y.forEach(t),O.forEach(t),gt=s(e),h(We.$$.fragment,e),_t=s(e),X=l(e,"DIV",{class:!0});var J=$(X);h(De.$$.fragment,J),Zt=s(J),go=l(J,"P",{"data-svelte-h":!0}),c(go)!=="svelte-aus8gn"&&(go.innerHTML=Gn),Qt=s(J),_o=l(J,"P",{"data-svelte-h":!0}),c(_o)!=="svelte-6pahdo"&&(_o.innerHTML=Vn),Gt=s(J),bo=l(J,"P",{"data-svelte-h":!0}),c(bo)!=="svelte-hswkmf"&&(bo.innerHTML=Rn),Vt=s(J),S=l(J,"DIV",{class:!0});var K=$(S);h(Ae.$$.fragment,K),Rt=s(K),To=l(K,"P",{"data-svelte-h":!0}),c(To)!=="svelte-8aupv"&&(To.innerHTML=Yn),Yt=s(K),h(se.$$.fragment,K),K.forEach(t),J.forEach(t),bt=s(e),h(He.$$.fragment,e),Tt=s(e),L=l(e,"DIV",{class:!0});var N=$(L);h(Se.$$.fragment,N),Kt=s(N),ko=l(N,"P",{"data-svelte-h":!0}),c(ko)!=="svelte-1vluxlz"&&(ko.textContent=Kn),en=s(N),yo=l(N,"P",{"data-svelte-h":!0}),c(yo)!=="svelte-6pahdo"&&(yo.innerHTML=es),on=s(N),vo=l(N,"P",{"data-svelte-h":!0}),c(vo)!=="svelte-hswkmf"&&(vo.innerHTML=os),tn=s(N),U=l(N,"DIV",{class:!0});var Jo=$(U);h(Ue.$$.fragment,Jo),nn=s(Jo),Mo=l(Jo,"P",{"data-svelte-h":!0}),c(Mo)!=="svelte-1lpmrm7"&&(Mo.innerHTML=ts),sn=s(Jo),h(ae.$$.fragment,Jo),Jo.forEach(t),N.forEach(t),kt=s(e),h(Ee.$$.fragment,e),yt=s(e),F=l(e,"DIV",{class:!0});var Q=$(F);h(Be.$$.fragment,Q),an=s(Q),wo=l(Q,"P",{"data-svelte-h":!0}),c(wo)!=="svelte-1mpcjkj"&&(wo.textContent=ns),rn=s(Q),$o=l(Q,"P",{"data-svelte-h":!0}),c($o)!=="svelte-6pahdo"&&($o.innerHTML=ss),dn=s(Q),xo=l(Q,"P",{"data-svelte-h":!0}),c(xo)!=="svelte-hswkmf"&&(xo.innerHTML=as),ln=s(Q),E=l(Q,"DIV",{class:!0});var No=$(E);h(Ze.$$.fragment,No),cn=s(No),Co=l(No,"P",{"data-svelte-h":!0}),c(Co)!=="svelte-1s8fbc3"&&(Co.innerHTML=rs),mn=s(No),h(re.$$.fragment,No),No.forEach(t),Q.forEach(t),vt=s(e),h(Qe.$$.fragment,e),Mt=s(e),z=l(e,"DIV",{class:!0});var G=$(z);h(Ge.$$.fragment,G),pn=s(G),Xo=l(G,"P",{"data-svelte-h":!0}),c(Xo)!=="svelte-1lcpzd2"&&(Xo.textContent=is),hn=s(G),Lo=l(G,"P",{"data-svelte-h":!0}),c(Lo)!=="svelte-6pahdo"&&(Lo.innerHTML=ds),fn=s(G),Fo=l(G,"P",{"data-svelte-h":!0}),c(Fo)!=="svelte-hswkmf"&&(Fo.innerHTML=ls),un=s(G),B=l(G,"DIV",{class:!0});var jo=$(B);h(Ve.$$.fragment,jo),gn=s(jo),zo=l(jo,"P",{"data-svelte-h":!0}),c(zo)!=="svelte-1vg3ajr"&&(zo.innerHTML=cs),_n=s(jo),h(ie.$$.fragment,jo),jo.forEach(t),G.forEach(t),wt=s(e),h(Re.$$.fragment,e),$t=s(e),I=l(e,"DIV",{class:!0});var V=$(I);h(Ye.$$.fragment,V),bn=s(V),Io=l(V,"P",{"data-svelte-h":!0}),c(Io)!=="svelte-pvcgqo"&&(Io.innerHTML=ms),Tn=s(V),qo=l(V,"P",{"data-svelte-h":!0}),c(qo)!=="svelte-6pahdo"&&(qo.innerHTML=ps),kn=s(V),Po=l(V,"P",{"data-svelte-h":!0}),c(Po)!=="svelte-hswkmf"&&(Po.innerHTML=hs),yn=s(V),Z=l(V,"DIV",{class:!0});var Wo=$(Z);h(Ke.$$.fragment,Wo),vn=s(Wo),Oo=l(Wo,"P",{"data-svelte-h":!0}),c(Oo)!=="svelte-3d9ra5"&&(Oo.innerHTML=fs),Mn=s(Wo),h(de.$$.fragment,Wo),Wo.forEach(t),V.forEach(t),xt=s(e),h(eo.$$.fragment,e),Ct=s(e),Do=l(e,"P",{}),$(Do).forEach(t),this.h()},h(){w(i,"name","hf:doc:metadata"),w(i,"content",zs),w(ee,"start","2"),w(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,o){a(document.head,i),r(e,b,o),r(e,m,o),r(e,T,o),f(j,e,o),r(e,y,o),f(W,e,o),r(e,Ho,o),r(e,ce,o),r(e,So,o),r(e,me,o),r(e,Uo,o),r(e,pe,o),r(e,Eo,o),r(e,he,o),r(e,Bo,o),f(fe,e,o),r(e,Zo,o),r(e,ue,o),r(e,Qo,o),r(e,ge,o),r(e,Go,o),f(_e,e,o),r(e,Vo,o),f(be,e,o),r(e,Ro,o),r(e,Te,o),r(e,Yo,o),r(e,ke,o),r(e,Ko,o),f(ye,e,o),r(e,et,o),r(e,ee,o),r(e,ot,o),f(ve,e,o),r(e,tt,o),f(Me,e,o),r(e,nt,o),r(e,we,o),r(e,st,o),f($e,e,o),r(e,at,o),f(xe,e,o),r(e,rt,o),r(e,Ce,o),r(e,it,o),f(Xe,e,o),r(e,dt,o),f(Le,e,o),r(e,lt,o),r(e,Fe,o),r(e,ct,o),f(ze,e,o),r(e,mt,o),r(e,P,o),f(Ie,P,null),a(P,Lt),a(P,to),a(P,Ft),a(P,no),a(P,zt),f(oe,P,null),r(e,pt,o),f(qe,e,o),r(e,ht,o),r(e,k,o),f(Pe,k,null),a(k,It),a(k,so),a(k,qt),a(k,ao),a(k,Pt),a(k,ro),a(k,Ot),a(k,io),a(k,Jt),a(k,lo),a(k,Nt),a(k,co),a(k,jt),a(k,A),f(Oe,A,null),a(A,Wt),a(A,mo),a(A,Dt),f(te,A,null),r(e,ft,o),f(Je,e,o),r(e,ut,o),r(e,C,o),f(Ne,C,null),a(C,At),a(C,po),a(C,Ht),a(C,ho),a(C,St),a(C,fo),a(C,Ut),a(C,H),f(je,H,null),a(H,Et),a(H,uo),a(H,Bt),f(ne,H,null),r(e,gt,o),f(We,e,o),r(e,_t,o),r(e,X,o),f(De,X,null),a(X,Zt),a(X,go),a(X,Qt),a(X,_o),a(X,Gt),a(X,bo),a(X,Vt),a(X,S),f(Ae,S,null),a(S,Rt),a(S,To),a(S,Yt),f(se,S,null),r(e,bt,o),f(He,e,o),r(e,Tt,o),r(e,L,o),f(Se,L,null),a(L,Kt),a(L,ko),a(L,en),a(L,yo),a(L,on),a(L,vo),a(L,tn),a(L,U),f(Ue,U,null),a(U,nn),a(U,Mo),a(U,sn),f(ae,U,null),r(e,kt,o),f(Ee,e,o),r(e,yt,o),r(e,F,o),f(Be,F,null),a(F,an),a(F,wo),a(F,rn),a(F,$o),a(F,dn),a(F,xo),a(F,ln),a(F,E),f(Ze,E,null),a(E,cn),a(E,Co),a(E,mn),f(re,E,null),r(e,vt,o),f(Qe,e,o),r(e,Mt,o),r(e,z,o),f(Ge,z,null),a(z,pn),a(z,Xo),a(z,hn),a(z,Lo),a(z,fn),a(z,Fo),a(z,un),a(z,B),f(Ve,B,null),a(B,gn),a(B,zo),a(B,_n),f(ie,B,null),r(e,wt,o),f(Re,e,o),r(e,$t,o),r(e,I,o),f(Ye,I,null),a(I,bn),a(I,Io),a(I,Tn),a(I,qo),a(I,kn),a(I,Po),a(I,yn),a(I,Z),f(Ke,Z,null),a(Z,vn),a(Z,Oo),a(Z,Mn),f(de,Z,null),r(e,xt,o),f(eo,e,o),r(e,Ct,o),r(e,Do,o),Xt=!0},p(e,[o]){const D={};o&2&&(D.$$scope={dirty:o,ctx:e}),oe.$set(D);const v={};o&2&&(v.$$scope={dirty:o,ctx:e}),te.$set(v);const R={};o&2&&(R.$$scope={dirty:o,ctx:e}),ne.$set(R);const O={};o&2&&(O.$$scope={dirty:o,ctx:e}),se.$set(O);const Y={};o&2&&(Y.$$scope={dirty:o,ctx:e}),ae.$set(Y);const J={};o&2&&(J.$$scope={dirty:o,ctx:e}),re.$set(J);const K={};o&2&&(K.$$scope={dirty:o,ctx:e}),ie.$set(K);const N={};o&2&&(N.$$scope={dirty:o,ctx:e}),de.$set(N)},i(e){Xt||(u(j.$$.fragment,e),u(W.$$.fragment,e),u(fe.$$.fragment,e),u(_e.$$.fragment,e),u(be.$$.fragment,e),u(ye.$$.fragment,e),u(ve.$$.fragment,e),u(Me.$$.fragment,e),u($e.$$.fragment,e),u(xe.$$.fragment,e),u(Xe.$$.fragment,e),u(Le.$$.fragment,e),u(ze.$$.fragment,e),u(Ie.$$.fragment,e),u(oe.$$.fragment,e),u(qe.$$.fragment,e),u(Pe.$$.fragment,e),u(Oe.$$.fragment,e),u(te.$$.fragment,e),u(Je.$$.fragment,e),u(Ne.$$.fragment,e),u(je.$$.fragment,e),u(ne.$$.fragment,e),u(We.$$.fragment,e),u(De.$$.fragment,e),u(Ae.$$.fragment,e),u(se.$$.fragment,e),u(He.$$.fragment,e),u(Se.$$.fragment,e),u(Ue.$$.fragment,e),u(ae.$$.fragment,e),u(Ee.$$.fragment,e),u(Be.$$.fragment,e),u(Ze.$$.fragment,e),u(re.$$.fragment,e),u(Qe.$$.fragment,e),u(Ge.$$.fragment,e),u(Ve.$$.fragment,e),u(ie.$$.fragment,e),u(Re.$$.fragment,e),u(Ye.$$.fragment,e),u(Ke.$$.fragment,e),u(de.$$.fragment,e),u(eo.$$.fragment,e),Xt=!0)},o(e){g(j.$$.fragment,e),g(W.$$.fragment,e),g(fe.$$.fragment,e),g(_e.$$.fragment,e),g(be.$$.fragment,e),g(ye.$$.fragment,e),g(ve.$$.fragment,e),g(Me.$$.fragment,e),g($e.$$.fragment,e),g(xe.$$.fragment,e),g(Xe.$$.fragment,e),g(Le.$$.fragment,e),g(ze.$$.fragment,e),g(Ie.$$.fragment,e),g(oe.$$.fragment,e),g(qe.$$.fragment,e),g(Pe.$$.fragment,e),g(Oe.$$.fragment,e),g(te.$$.fragment,e),g(Je.$$.fragment,e),g(Ne.$$.fragment,e),g(je.$$.fragment,e),g(ne.$$.fragment,e),g(We.$$.fragment,e),g(De.$$.fragment,e),g(Ae.$$.fragment,e),g(se.$$.fragment,e),g(He.$$.fragment,e),g(Se.$$.fragment,e),g(Ue.$$.fragment,e),g(ae.$$.fragment,e),g(Ee.$$.fragment,e),g(Be.$$.fragment,e),g(Ze.$$.fragment,e),g(re.$$.fragment,e),g(Qe.$$.fragment,e),g(Ge.$$.fragment,e),g(Ve.$$.fragment,e),g(ie.$$.fragment,e),g(Re.$$.fragment,e),g(Ye.$$.fragment,e),g(Ke.$$.fragment,e),g(de.$$.fragment,e),g(eo.$$.fragment,e),Xt=!1},d(e){e&&(t(b),t(m),t(T),t(y),t(Ho),t(ce),t(So),t(me),t(Uo),t(pe),t(Eo),t(he),t(Bo),t(Zo),t(ue),t(Qo),t(ge),t(Go),t(Vo),t(Ro),t(Te),t(Yo),t(ke),t(Ko),t(et),t(ee),t(ot),t(tt),t(nt),t(we),t(st),t(at),t(rt),t(Ce),t(it),t(dt),t(lt),t(Fe),t(ct),t(mt),t(P),t(pt),t(ht),t(k),t(ft),t(ut),t(C),t(gt),t(_t),t(X),t(bt),t(Tt),t(L),t(kt),t(yt),t(F),t(vt),t(Mt),t(z),t(wt),t($t),t(I),t(xt),t(Ct),t(Do)),t(i),_(j,e),_(W,e),_(fe,e),_(_e,e),_(be,e),_(ye,e),_(ve,e),_(Me,e),_($e,e),_(xe,e),_(Xe,e),_(Le,e),_(ze,e),_(Ie),_(oe),_(qe,e),_(Pe),_(Oe),_(te),_(Je,e),_(Ne),_(je),_(ne),_(We,e),_(De),_(Ae),_(se),_(He,e),_(Se),_(Ue),_(ae),_(Ee,e),_(Be),_(Ze),_(re),_(Qe,e),_(Ge),_(Ve),_(ie),_(Re,e),_(Ye),_(Ke),_(de),_(eo,e)}}}const zs='{"title":"X-MOD","local":"x-mod","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Adapter Usage","local":"adapter-usage","sections":[{"title":"Input language","local":"input-language","sections":[],"depth":3},{"title":"Fine-tuning","local":"fine-tuning","sections":[],"depth":3},{"title":"Cross-lingual transfer","local":"cross-lingual-transfer","sections":[],"depth":3}],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"XmodConfig","local":"transformers.XmodConfig","sections":[],"depth":2},{"title":"XmodModel","local":"transformers.XmodModel","sections":[],"depth":2},{"title":"XmodForCausalLM","local":"transformers.XmodForCausalLM","sections":[],"depth":2},{"title":"XmodForMaskedLM","local":"transformers.XmodForMaskedLM","sections":[],"depth":2},{"title":"XmodForSequenceClassification","local":"transformers.XmodForSequenceClassification","sections":[],"depth":2},{"title":"XmodForMultipleChoice","local":"transformers.XmodForMultipleChoice","sections":[],"depth":2},{"title":"XmodForTokenClassification","local":"transformers.XmodForTokenClassification","sections":[],"depth":2},{"title":"XmodForQuestionAnswering","local":"transformers.XmodForQuestionAnswering","sections":[],"depth":2}],"depth":1}';function Is(M){return gs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ds extends _s{constructor(i){super(),bs(this,i,Is,Fs,us,{})}}export{Ds as component};
