import{S as Yb,i as Kb,s as eT,e as a,k as p,w as T,t as o,M as tT,c as r,d as t,m as h,a as i,x as v,h as n,b as f,N as Hb,G as e,g,y as w,q as k,o as $,B as L,v as oT,L as Ye}from"../../chunks/vendor-hf-doc-builder.js";import{T as Oe}from"../../chunks/Tip-hf-doc-builder.js";import{D as ae}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ke}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Pe}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as He}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function nT(j){let d,b,m,u,y;return u=new Ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFhMTUNvbmZpZyUyQyUyMFhMTU1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMFhMTSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwWExNQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMFhMTU1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> XLMConfig, XLMModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a XLM configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = XLMConfig()

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){d=a("p"),b=o("Examples:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Examples:"),c.forEach(t),m=h(l),v(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,m,c),w(u,l,c),y=!0},p:Ye,i(l){y||(k(u.$$.fragment,l),y=!0)},o(l){$(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function sT(j){let d,b,m,u,y;return u=new Ke({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMEElN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTIwJTIwJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){d=a("p"),b=o("pair mask has the following format:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"pair mask has the following format:"),c.forEach(t),m=h(l),v(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,m,c),w(u,l,c),y=!0},p:Ye,i(l){y||(k(u.$$.fragment,l),y=!0)},o(l){$(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function aT(j){let d,b,m,u,y;return{c(){d=a("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=o("Module"),y=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var x=i(m);u=n(x,"Module"),x.forEach(t),y=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function rT(j){let d,b,m,u,y;return u=new Ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBYTE1Nb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyeGxtLW1sbS1lbi0yMDQ4JTIyKSUwQW1vZGVsJTIwJTNEJTIwWExNTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMnhsbS1tbG0tZW4tMjA0OCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, XLMModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMModel.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){d=a("p"),b=o("Example:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),m=h(l),v(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,m,c),w(u,l,c),y=!0},p:Ye,i(l){y||(k(u.$$.fragment,l),y=!0)},o(l){$(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function iT(j){let d,b,m,u,y;return{c(){d=a("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=o("Module"),y=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var x=i(m);u=n(x,"Module"),x.forEach(t),y=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function lT(j){let d,b,m,u,y;return u=new Ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBYTE1XaXRoTE1IZWFkTW9kZWwlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnhsbS1tbG0tZW4tMjA0OCUyMiklMEFtb2RlbCUyMCUzRCUyMFhMTVdpdGhMTUhlYWRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyeGxtLW1sbS1lbi0yMDQ4JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJUaGUlMjBjYXBpdGFsJTIwb2YlMjBGcmFuY2UlMjBpcyUyMCUzQ3NwZWNpYWwxJTNFLiUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjByZXRyaWV2ZSUyMGluZGV4JTIwb2YlMjAlM0NzcGVjaWFsMSUzRSUwQW1hc2tfdG9rZW5faW5kZXglMjAlM0QlMjAoaW5wdXRzLmlucHV0X2lkcyUyMCUzRCUzRCUyMHRva2VuaXplci5tYXNrX3Rva2VuX2lkKSU1QjAlNUQubm9uemVybyhhc190dXBsZSUzRFRydWUpJTVCMCU1RCUwQSUwQXByZWRpY3RlZF90b2tlbl9pZCUyMCUzRCUyMGxvZ2l0cyU1QjAlMkMlMjBtYXNrX3Rva2VuX2luZGV4JTVELmFyZ21heChheGlzJTNELTEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9rZW5pemVyKCUyMlRoZSUyMGNhcGl0YWwlMjBvZiUyMEZyYW5jZSUyMGlzJTIwUGFyaXMuJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklNUIlMjJpbnB1dF9pZHMlMjIlNUQlMEElMjMlMjBtYXNrJTIwbGFiZWxzJTIwb2YlMjBub24tJTNDc3BlY2lhbDElM0UlMjB0b2tlbnMlMEFsYWJlbHMlMjAlM0QlMjB0b3JjaC53aGVyZShpbnB1dHMuaW5wdXRfaWRzJTIwJTNEJTNEJTIwdG9rZW5pemVyLm1hc2tfdG9rZW5faWQlMkMlMjBsYWJlbHMlMkMlMjAtMTAwKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, XLMWithLMHeadModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMWithLMHeadModel.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The capital of France is &lt;special1&gt;.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># retrieve index of &lt;special1&gt;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_token_index = (inputs.input_ids == tokenizer.mask_token_id)[<span class="hljs-number">0</span>].nonzero(as_tuple=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_id = logits[<span class="hljs-number">0</span>, mask_token_index].argmax(axis=-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tokenizer(<span class="hljs-string">&quot;The capital of France is Paris.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># mask labels of non-&lt;special1&gt; tokens</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.where(inputs.input_ids == tokenizer.mask_token_id, labels, -<span class="hljs-number">100</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)`}}),{c(){d=a("p"),b=o("Example:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),m=h(l),v(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,m,c),w(u,l,c),y=!0},p:Ye,i(l){y||(k(u.$$.fragment,l),y=!0)},o(l){$(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function dT(j){let d,b,m,u,y;return{c(){d=a("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=o("Module"),y=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var x=i(m);u=n(x,"Module"),x.forEach(t),y=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function cT(j){let d,b,m,u,y;return u=new Ke({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMFhMTUZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ4bG0tbWxtLWVuLTIwNDglMjIpJTBBbW9kZWwlMjAlM0QlMjBYTE1Gb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ4bG0tbWxtLWVuLTIwNDglMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX2NsYXNzX2lkJTIwJTNEJTIwbG9naXRzLmFyZ21heCgpLml0ZW0oKSUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyMFhMTUZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMnhsbS1tbG0tZW4tMjA0OCUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, XLMForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = logits.argmax().item()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=a("p"),b=o("Example of single-label classification:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example of single-label classification:"),c.forEach(t),m=h(l),v(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,m,c),w(u,l,c),y=!0},p:Ye,i(l){y||(k(u.$$.fragment,l),y=!0)},o(l){$(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function pT(j){let d,b,m,u,y;return u=new Ke({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMFhMTUZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ4bG0tbWxtLWVuLTIwNDglMjIpJTBBbW9kZWwlMjAlM0QlMjBYTE1Gb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ4bG0tbWxtLWVuLTIwNDglMjIlMkMlMjBwcm9ibGVtX3R5cGUlM0QlMjJtdWx0aV9sYWJlbF9jbGFzc2lmaWNhdGlvbiUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWRzJTIwJTNEJTIwdG9yY2guYXJhbmdlKDAlMkMlMjBsb2dpdHMuc2hhcGUlNUItMSU1RCklNUJ0b3JjaC5zaWdtb2lkKGxvZ2l0cykuc3F1ZWV6ZShkaW0lM0QwKSUyMCUzRSUyMDAuNSU1RCUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyMFhMTUZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnhsbS1tbG0tZW4tMjA0OCUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIlMEEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2guc3VtKCUwQSUyMCUyMCUyMCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwub25lX2hvdChwcmVkaWN0ZWRfY2xhc3NfaWRzJTVCTm9uZSUyQyUyMCUzQSU1RC5jbG9uZSgpJTJDJTIwbnVtX2NsYXNzZXMlM0RudW1fbGFiZWxzKSUyQyUyMGRpbSUzRDElMEEpLnRvKHRvcmNoLmZsb2F0KSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, XLMForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_ids = torch.arange(<span class="hljs-number">0</span>, logits.shape[-<span class="hljs-number">1</span>])[torch.sigmoid(logits).squeeze(dim=<span class="hljs-number">0</span>) &gt; <span class="hljs-number">0.5</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>, num_labels=num_labels, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.<span class="hljs-built_in">sum</span>(
<span class="hljs-meta">... </span>    torch.nn.functional.one_hot(predicted_class_ids[<span class="hljs-literal">None</span>, :].clone(), num_classes=num_labels), dim=<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>).to(torch.<span class="hljs-built_in">float</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=a("p"),b=o("Example of multi-label classification:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example of multi-label classification:"),c.forEach(t),m=h(l),v(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,m,c),w(u,l,c),y=!0},p:Ye,i(l){y||(k(u.$$.fragment,l),y=!0)},o(l){$(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function hT(j){let d,b,m,u,y;return{c(){d=a("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=o("Module"),y=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var x=i(m);u=n(x,"Module"),x.forEach(t),y=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function mT(j){let d,b,m,u,y;return u=new Ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBYTE1Gb3JNdWx0aXBsZUNob2ljZSUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyeGxtLW1sbS1lbi0yMDQ4JTIyKSUwQW1vZGVsJTIwJTNEJTIwWExNRm9yTXVsdGlwbGVDaG9pY2UuZnJvbV9wcmV0cmFpbmVkKCUyMnhsbS1tbG0tZW4tMjA0OCUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJJbiUyMEl0YWx5JTJDJTIwcGl6emElMjBzZXJ2ZWQlMjBpbiUyMGZvcm1hbCUyMHNldHRpbmdzJTJDJTIwc3VjaCUyMGFzJTIwYXQlMjBhJTIwcmVzdGF1cmFudCUyQyUyMGlzJTIwcHJlc2VudGVkJTIwdW5zbGljZWQuJTIyJTBBY2hvaWNlMCUyMCUzRCUyMCUyMkl0JTIwaXMlMjBlYXRlbiUyMHdpdGglMjBhJTIwZm9yayUyMGFuZCUyMGElMjBrbmlmZS4lMjIlMEFjaG9pY2UxJTIwJTNEJTIwJTIySXQlMjBpcyUyMGVhdGVuJTIwd2hpbGUlMjBoZWxkJTIwaW4lMjB0aGUlMjBoYW5kLiUyMiUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvcigwKS51bnNxdWVlemUoMCklMjAlMjAlMjMlMjBjaG9pY2UwJTIwaXMlMjBjb3JyZWN0JTIwKGFjY29yZGluZyUyMHRvJTIwV2lraXBlZGlhJTIwJTNCKSklMkMlMjBiYXRjaCUyMHNpemUlMjAxJTBBJTBBZW5jb2RpbmclMjAlM0QlMjB0b2tlbml6ZXIoJTVCcHJvbXB0JTJDJTIwcHJvbXB0JTVEJTJDJTIwJTVCY2hvaWNlMCUyQyUyMGNob2ljZTElNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTJDJTIwcGFkZGluZyUzRFRydWUpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqJTdCayUzQSUyMHYudW5zcXVlZXplKDApJTIwZm9yJTIwayUyQyUyMHYlMjBpbiUyMGVuY29kaW5nLml0ZW1zKCklN0QlMkMlMjBsYWJlbHMlM0RsYWJlbHMpJTIwJTIwJTIzJTIwYmF0Y2glMjBzaXplJTIwaXMlMjAxJTBBJTBBJTIzJTIwdGhlJTIwbGluZWFyJTIwY2xhc3NpZmllciUyMHN0aWxsJTIwbmVlZHMlMjB0byUyMGJlJTIwdHJhaW5lZCUwQWxvc3MlMjAlM0QlMjBvdXRwdXRzLmxvc3MlMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, XLMForMultipleChoice
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice0 = <span class="hljs-string">&quot;It is eaten with a fork and a knife.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice1 = <span class="hljs-string">&quot;It is eaten while held in the hand.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor(<span class="hljs-number">0</span>).unsqueeze(<span class="hljs-number">0</span>)  <span class="hljs-comment"># choice0 is correct (according to Wikipedia ;)), batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**{k: v.unsqueeze(<span class="hljs-number">0</span>) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> encoding.items()}, labels=labels)  <span class="hljs-comment"># batch size is 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the linear classifier still needs to be trained</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=a("p"),b=o("Example:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),m=h(l),v(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,m,c),w(u,l,c),y=!0},p:Ye,i(l){y||(k(u.$$.fragment,l),y=!0)},o(l){$(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function uT(j){let d,b,m,u,y;return{c(){d=a("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=o("Module"),y=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var x=i(m);u=n(x,"Module"),x.forEach(t),y=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function fT(j){let d,b,m,u,y;return u=new Ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBYTE1Gb3JUb2tlbkNsYXNzaWZpY2F0aW9uJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ4bG0tbWxtLWVuLTIwNDglMjIpJTBBbW9kZWwlMjAlM0QlMjBYTE1Gb3JUb2tlbkNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ4bG0tbWxtLWVuLTIwNDglMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUwQSUyMCUyMCUyMCUyMCUyMkh1Z2dpbmdGYWNlJTIwaXMlMjBhJTIwY29tcGFueSUyMGJhc2VkJTIwaW4lMjBQYXJpcyUyMGFuZCUyME5ldyUyMFlvcmslMjIlMkMlMjBhZGRfc3BlY2lhbF90b2tlbnMlM0RGYWxzZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMEEpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfdG9rZW5fY2xhc3NfaWRzJTIwJTNEJTIwbG9naXRzLmFyZ21heCgtMSklMEElMEElMjMlMjBOb3RlJTIwdGhhdCUyMHRva2VucyUyMGFyZSUyMGNsYXNzaWZpZWQlMjByYXRoZXIlMjB0aGVuJTIwaW5wdXQlMjB3b3JkcyUyMHdoaWNoJTIwbWVhbnMlMjB0aGF0JTBBJTIzJTIwdGhlcmUlMjBtaWdodCUyMGJlJTIwbW9yZSUyMHByZWRpY3RlZCUyMHRva2VuJTIwY2xhc3NlcyUyMHRoYW4lMjB3b3Jkcy4lMEElMjMlMjBNdWx0aXBsZSUyMHRva2VuJTIwY2xhc3NlcyUyMG1pZ2h0JTIwYWNjb3VudCUyMGZvciUyMHRoZSUyMHNhbWUlMjB3b3JkJTBBcHJlZGljdGVkX3Rva2Vuc19jbGFzc2VzJTIwJTNEJTIwJTVCbW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCdC5pdGVtKCklNUQlMjBmb3IlMjB0JTIwaW4lMjBwcmVkaWN0ZWRfdG9rZW5fY2xhc3NfaWRzJTVCMCU1RCU1RCUwQSUwQWxhYmVscyUyMCUzRCUyMHByZWRpY3RlZF90b2tlbl9jbGFzc19pZHMlMEFsb3NzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBsYWJlbHMlM0RsYWJlbHMpLmxvc3M=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, XLMForTokenClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMForTokenClassification.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;HuggingFace is a company based in Paris and New York&quot;</span>, add_special_tokens=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_class_ids = logits.argmax(-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Note that tokens are classified rather then input words which means that</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># there might be more predicted token classes than words.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Multiple token classes might account for the same word</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_tokens_classes = [model.config.id2label[t.item()] <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> predicted_token_class_ids[<span class="hljs-number">0</span>]]

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=a("p"),b=o("Example:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),m=h(l),v(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,m,c),w(u,l,c),y=!0},p:Ye,i(l){y||(k(u.$$.fragment,l),y=!0)},o(l){$(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function gT(j){let d,b,m,u,y;return{c(){d=a("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=o("Module"),y=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var x=i(m);u=n(x,"Module"),x.forEach(t),y=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function _T(j){let d,b,m,u,y;return u=new Ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBYTE1Gb3JRdWVzdGlvbkFuc3dlcmluZ1NpbXBsZSUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyeGxtLW1sbS1lbi0yMDQ4JTIyKSUwQW1vZGVsJTIwJTNEJTIwWExNRm9yUXVlc3Rpb25BbnN3ZXJpbmdTaW1wbGUuZnJvbV9wcmV0cmFpbmVkKCUyMnhsbS1tbG0tZW4tMjA0OCUyMiklMEElMEFxdWVzdGlvbiUyQyUyMHRleHQlMjAlM0QlMjAlMjJXaG8lMjB3YXMlMjBKaW0lMjBIZW5zb24lM0YlMjIlMkMlMjAlMjJKaW0lMjBIZW5zb24lMjB3YXMlMjBhJTIwbmljZSUyMHB1cHBldCUyMiUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihxdWVzdGlvbiUyQyUyMHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBYW5zd2VyX3N0YXJ0X2luZGV4JTIwJTNEJTIwb3V0cHV0cy5zdGFydF9sb2dpdHMuYXJnbWF4KCklMEFhbnN3ZXJfZW5kX2luZGV4JTIwJTNEJTIwb3V0cHV0cy5lbmRfbG9naXRzLmFyZ21heCgpJTBBJTBBcHJlZGljdF9hbnN3ZXJfdG9rZW5zJTIwJTNEJTIwaW5wdXRzLmlucHV0X2lkcyU1QjAlMkMlMjBhbnN3ZXJfc3RhcnRfaW5kZXglMjAlM0ElMjBhbnN3ZXJfZW5kX2luZGV4JTIwJTJCJTIwMSU1RCUwQSUwQSUyMyUyMHRhcmdldCUyMGlzJTIwJTIybmljZSUyMHB1cHBldCUyMiUwQXRhcmdldF9zdGFydF9pbmRleCUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxNCU1RCklMEF0YXJnZXRfZW5kX2luZGV4JTIwJTNEJTIwdG9yY2gudGVuc29yKCU1QjE1JTVEKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMHN0YXJ0X3Bvc2l0aW9ucyUzRHRhcmdldF9zdGFydF9pbmRleCUyQyUyMGVuZF9wb3NpdGlvbnMlM0R0YXJnZXRfZW5kX2luZGV4KSUwQWxvc3MlMjAlM0QlMjBvdXRwdXRzLmxvc3M=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, XLMForQuestionAnsweringSimple
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMForQuestionAnsweringSimple.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>question, text = <span class="hljs-string">&quot;Who was Jim Henson?&quot;</span>, <span class="hljs-string">&quot;Jim Henson was a nice puppet&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(question, text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>answer_start_index = outputs.start_logits.argmax()
<span class="hljs-meta">&gt;&gt;&gt; </span>answer_end_index = outputs.end_logits.argmax()

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># target is &quot;nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_start_index = torch.tensor([<span class="hljs-number">14</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = torch.tensor([<span class="hljs-number">15</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss`}}),{c(){d=a("p"),b=o("Example:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),m=h(l),v(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,m,c),w(u,l,c),y=!0},p:Ye,i(l){y||(k(u.$$.fragment,l),y=!0)},o(l){$(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function MT(j){let d,b,m,u,y;return{c(){d=a("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=o("Module"),y=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var x=i(m);u=n(x,"Module"),x.forEach(t),y=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function yT(j){let d,b,m,u,y;return u=new Ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBYTE1Gb3JRdWVzdGlvbkFuc3dlcmluZyUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyeGxtLW1sbS1lbi0yMDQ4JTIyKSUwQW1vZGVsJTIwJTNEJTIwWExNRm9yUXVlc3Rpb25BbnN3ZXJpbmcuZnJvbV9wcmV0cmFpbmVkKCUyMnhsbS1tbG0tZW4tMjA0OCUyMiklMEElMEFpbnB1dF9pZHMlMjAlM0QlMjB0b3JjaC50ZW5zb3IodG9rZW5pemVyLmVuY29kZSglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwYWRkX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSkpLnVuc3F1ZWV6ZSglMEElMjAlMjAlMjAlMjAwJTBBKSUyMCUyMCUyMyUyMEJhdGNoJTIwc2l6ZSUyMDElMEFzdGFydF9wb3NpdGlvbnMlMjAlM0QlMjB0b3JjaC50ZW5zb3IoJTVCMSU1RCklMEFlbmRfcG9zaXRpb25zJTIwJTNEJTIwdG9yY2gudGVuc29yKCU1QjMlNUQpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0X2lkcyUyQyUyMHN0YXJ0X3Bvc2l0aW9ucyUzRHN0YXJ0X3Bvc2l0aW9ucyUyQyUyMGVuZF9wb3NpdGlvbnMlM0RlbmRfcG9zaXRpb25zKSUwQWxvc3MlMjAlM0QlMjBvdXRwdXRzLmxvc3M=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, XLMForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLMForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = torch.tensor(tokenizer.encode(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, add_special_tokens=<span class="hljs-literal">True</span>)).unsqueeze(
<span class="hljs-meta">... </span>    <span class="hljs-number">0</span>
<span class="hljs-meta">... </span>)  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>start_positions = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>end_positions = torch.tensor([<span class="hljs-number">3</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids, start_positions=start_positions, end_positions=end_positions)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss`}}),{c(){d=a("p"),b=o("Example:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),m=h(l),v(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,m,c),w(u,l,c),y=!0},p:Ye,i(l){y||(k(u.$$.fragment,l),y=!0)},o(l){$(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function bT(j){let d,b,m,u,y,l,c,x,Me,fe,W,de,Y,F,ye,Z,ce,Je,Q,ne,re,B,ie,be,G,Te,ge,A,ve,le,se,C,U,te,R,we,ke,V,$e,Le,J,Fe,D,pe,Xe,O,he,me,N,_e,S,Ee,oe,z,ue,I,xe,je;return{c(){d=a("p"),b=o("TensorFlow models and layers in "),m=a("code"),u=o("transformers"),y=o(" accept two formats as input:"),l=p(),c=a("ul"),x=a("li"),Me=o("having all inputs as keyword arguments (like PyTorch models), or"),fe=p(),W=a("li"),de=o("having all inputs as a list, tuple or dict in the first positional argument."),Y=p(),F=a("p"),ye=o(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Z=a("code"),ce=o("model.fit()"),Je=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=a("code"),ne=o("model.fit()"),re=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),B=a("code"),ie=o("fit()"),be=o(" and "),G=a("code"),Te=o("predict()"),ge=o(`, such as when creating your own layers or models with
the Keras `),A=a("code"),ve=o("Functional"),le=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),se=p(),C=a("ul"),U=a("li"),te=o("a single Tensor with "),R=a("code"),we=o("input_ids"),ke=o(" only and nothing else: "),V=a("code"),$e=o("model(input_ids)"),Le=p(),J=a("li"),Fe=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),D=a("code"),pe=o("model([input_ids, attention_mask])"),Xe=o(" or "),O=a("code"),he=o("model([input_ids, attention_mask, token_type_ids])"),me=p(),N=a("li"),_e=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),S=a("code"),Ee=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),oe=p(),z=a("p"),ue=o(`Note that when creating models and layers with
`),I=a("a"),xe=o("subclassing"),je=o(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(_){d=r(_,"P",{});var X=i(d);b=n(X,"TensorFlow models and layers in "),m=r(X,"CODE",{});var qe=i(m);u=n(qe,"transformers"),qe.forEach(t),y=n(X," accept two formats as input:"),X.forEach(t),l=h(_),c=r(_,"UL",{});var K=i(c);x=r(K,"LI",{});var Ae=i(x);Me=n(Ae,"having all inputs as keyword arguments (like PyTorch models), or"),Ae.forEach(t),fe=h(K),W=r(K,"LI",{});var Ze=i(W);de=n(Ze,"having all inputs as a list, tuple or dict in the first positional argument."),Ze.forEach(t),K.forEach(t),Y=h(_),F=r(_,"P",{});var E=i(F);ye=n(E,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Z=r(E,"CODE",{});var Se=i(Z);ce=n(Se,"model.fit()"),Se.forEach(t),Je=n(E,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=r(E,"CODE",{});var Be=i(Q);ne=n(Be,"model.fit()"),Be.forEach(t),re=n(E,` supports! If, however, you want to use the second
format outside of Keras methods like `),B=r(E,"CODE",{});var Ge=i(B);ie=n(Ge,"fit()"),Ge.forEach(t),be=n(E," and "),G=r(E,"CODE",{});var Ue=i(G);Te=n(Ue,"predict()"),Ue.forEach(t),ge=n(E,`, such as when creating your own layers or models with
the Keras `),A=r(E,"CODE",{});var Ie=i(A);ve=n(Ie,"Functional"),Ie.forEach(t),le=n(E,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),E.forEach(t),se=h(_),C=r(_,"UL",{});var q=i(C);U=r(q,"LI",{});var P=i(U);te=n(P,"a single Tensor with "),R=r(P,"CODE",{});var Ce=i(R);we=n(Ce,"input_ids"),Ce.forEach(t),ke=n(P," only and nothing else: "),V=r(P,"CODE",{});var We=i(V);$e=n(We,"model(input_ids)"),We.forEach(t),P.forEach(t),Le=h(q),J=r(q,"LI",{});var H=i(J);Fe=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),D=r(H,"CODE",{});var Re=i(D);pe=n(Re,"model([input_ids, attention_mask])"),Re.forEach(t),Xe=n(H," or "),O=r(H,"CODE",{});var Ne=i(O);he=n(Ne,"model([input_ids, attention_mask, token_type_ids])"),Ne.forEach(t),H.forEach(t),me=h(q),N=r(q,"LI",{});var ze=i(N);_e=n(ze,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),S=r(ze,"CODE",{});var Ve=i(S);Ee=n(Ve,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ve.forEach(t),ze.forEach(t),q.forEach(t),oe=h(_),z=r(_,"P",{});var ee=i(z);ue=n(ee,`Note that when creating models and layers with
`),I=r(ee,"A",{href:!0,rel:!0});var Qe=i(I);xe=n(Qe,"subclassing"),Qe.forEach(t),je=n(ee,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),ee.forEach(t),this.h()},h(){f(I,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),f(I,"rel","nofollow")},m(_,X){g(_,d,X),e(d,b),e(d,m),e(m,u),e(d,y),g(_,l,X),g(_,c,X),e(c,x),e(x,Me),e(c,fe),e(c,W),e(W,de),g(_,Y,X),g(_,F,X),e(F,ye),e(F,Z),e(Z,ce),e(F,Je),e(F,Q),e(Q,ne),e(F,re),e(F,B),e(B,ie),e(F,be),e(F,G),e(G,Te),e(F,ge),e(F,A),e(A,ve),e(F,le),g(_,se,X),g(_,C,X),e(C,U),e(U,te),e(U,R),e(R,we),e(U,ke),e(U,V),e(V,$e),e(C,Le),e(C,J),e(J,Fe),e(J,D),e(D,pe),e(J,Xe),e(J,O),e(O,he),e(C,me),e(C,N),e(N,_e),e(N,S),e(S,Ee),g(_,oe,X),g(_,z,X),e(z,ue),e(z,I),e(I,xe),e(z,je)},d(_){_&&t(d),_&&t(l),_&&t(c),_&&t(Y),_&&t(F),_&&t(se),_&&t(C),_&&t(oe),_&&t(z)}}}function TT(j){let d,b,m,u,y;return{c(){d=a("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=o("Module"),y=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var x=i(m);u=n(x,"Module"),x.forEach(t),y=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function vT(j){let d,b,m,u,y;return u=new Ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURlhMTU1vZGVsJTBBaW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ4bG0tbWxtLWVuLTIwNDglMjIpJTBBbW9kZWwlMjAlM0QlMjBURlhMTU1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJ4bG0tbWxtLWVuLTIwNDglMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbChpbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFXLMModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFXLMModel.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){d=a("p"),b=o("Example:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),m=h(l),v(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,m,c),w(u,l,c),y=!0},p:Ye,i(l){y||(k(u.$$.fragment,l),y=!0)},o(l){$(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function wT(j){let d,b,m,u,y,l,c,x,Me,fe,W,de,Y,F,ye,Z,ce,Je,Q,ne,re,B,ie,be,G,Te,ge,A,ve,le,se,C,U,te,R,we,ke,V,$e,Le,J,Fe,D,pe,Xe,O,he,me,N,_e,S,Ee,oe,z,ue,I,xe,je;return{c(){d=a("p"),b=o("TensorFlow models and layers in "),m=a("code"),u=o("transformers"),y=o(" accept two formats as input:"),l=p(),c=a("ul"),x=a("li"),Me=o("having all inputs as keyword arguments (like PyTorch models), or"),fe=p(),W=a("li"),de=o("having all inputs as a list, tuple or dict in the first positional argument."),Y=p(),F=a("p"),ye=o(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Z=a("code"),ce=o("model.fit()"),Je=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=a("code"),ne=o("model.fit()"),re=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),B=a("code"),ie=o("fit()"),be=o(" and "),G=a("code"),Te=o("predict()"),ge=o(`, such as when creating your own layers or models with
the Keras `),A=a("code"),ve=o("Functional"),le=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),se=p(),C=a("ul"),U=a("li"),te=o("a single Tensor with "),R=a("code"),we=o("input_ids"),ke=o(" only and nothing else: "),V=a("code"),$e=o("model(input_ids)"),Le=p(),J=a("li"),Fe=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),D=a("code"),pe=o("model([input_ids, attention_mask])"),Xe=o(" or "),O=a("code"),he=o("model([input_ids, attention_mask, token_type_ids])"),me=p(),N=a("li"),_e=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),S=a("code"),Ee=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),oe=p(),z=a("p"),ue=o(`Note that when creating models and layers with
`),I=a("a"),xe=o("subclassing"),je=o(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(_){d=r(_,"P",{});var X=i(d);b=n(X,"TensorFlow models and layers in "),m=r(X,"CODE",{});var qe=i(m);u=n(qe,"transformers"),qe.forEach(t),y=n(X," accept two formats as input:"),X.forEach(t),l=h(_),c=r(_,"UL",{});var K=i(c);x=r(K,"LI",{});var Ae=i(x);Me=n(Ae,"having all inputs as keyword arguments (like PyTorch models), or"),Ae.forEach(t),fe=h(K),W=r(K,"LI",{});var Ze=i(W);de=n(Ze,"having all inputs as a list, tuple or dict in the first positional argument."),Ze.forEach(t),K.forEach(t),Y=h(_),F=r(_,"P",{});var E=i(F);ye=n(E,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Z=r(E,"CODE",{});var Se=i(Z);ce=n(Se,"model.fit()"),Se.forEach(t),Je=n(E,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=r(E,"CODE",{});var Be=i(Q);ne=n(Be,"model.fit()"),Be.forEach(t),re=n(E,` supports! If, however, you want to use the second
format outside of Keras methods like `),B=r(E,"CODE",{});var Ge=i(B);ie=n(Ge,"fit()"),Ge.forEach(t),be=n(E," and "),G=r(E,"CODE",{});var Ue=i(G);Te=n(Ue,"predict()"),Ue.forEach(t),ge=n(E,`, such as when creating your own layers or models with
the Keras `),A=r(E,"CODE",{});var Ie=i(A);ve=n(Ie,"Functional"),Ie.forEach(t),le=n(E,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),E.forEach(t),se=h(_),C=r(_,"UL",{});var q=i(C);U=r(q,"LI",{});var P=i(U);te=n(P,"a single Tensor with "),R=r(P,"CODE",{});var Ce=i(R);we=n(Ce,"input_ids"),Ce.forEach(t),ke=n(P," only and nothing else: "),V=r(P,"CODE",{});var We=i(V);$e=n(We,"model(input_ids)"),We.forEach(t),P.forEach(t),Le=h(q),J=r(q,"LI",{});var H=i(J);Fe=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),D=r(H,"CODE",{});var Re=i(D);pe=n(Re,"model([input_ids, attention_mask])"),Re.forEach(t),Xe=n(H," or "),O=r(H,"CODE",{});var Ne=i(O);he=n(Ne,"model([input_ids, attention_mask, token_type_ids])"),Ne.forEach(t),H.forEach(t),me=h(q),N=r(q,"LI",{});var ze=i(N);_e=n(ze,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),S=r(ze,"CODE",{});var Ve=i(S);Ee=n(Ve,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ve.forEach(t),ze.forEach(t),q.forEach(t),oe=h(_),z=r(_,"P",{});var ee=i(z);ue=n(ee,`Note that when creating models and layers with
`),I=r(ee,"A",{href:!0,rel:!0});var Qe=i(I);xe=n(Qe,"subclassing"),Qe.forEach(t),je=n(ee,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),ee.forEach(t),this.h()},h(){f(I,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),f(I,"rel","nofollow")},m(_,X){g(_,d,X),e(d,b),e(d,m),e(m,u),e(d,y),g(_,l,X),g(_,c,X),e(c,x),e(x,Me),e(c,fe),e(c,W),e(W,de),g(_,Y,X),g(_,F,X),e(F,ye),e(F,Z),e(Z,ce),e(F,Je),e(F,Q),e(Q,ne),e(F,re),e(F,B),e(B,ie),e(F,be),e(F,G),e(G,Te),e(F,ge),e(F,A),e(A,ve),e(F,le),g(_,se,X),g(_,C,X),e(C,U),e(U,te),e(U,R),e(R,we),e(U,ke),e(U,V),e(V,$e),e(C,Le),e(C,J),e(J,Fe),e(J,D),e(D,pe),e(J,Xe),e(J,O),e(O,he),e(C,me),e(C,N),e(N,_e),e(N,S),e(S,Ee),g(_,oe,X),g(_,z,X),e(z,ue),e(z,I),e(I,xe),e(z,je)},d(_){_&&t(d),_&&t(l),_&&t(c),_&&t(Y),_&&t(F),_&&t(se),_&&t(C),_&&t(oe),_&&t(z)}}}function kT(j){let d,b,m,u,y;return{c(){d=a("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=o("Module"),y=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var x=i(m);u=n(x,"Module"),x.forEach(t),y=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function $T(j){let d,b,m,u,y;return u=new Ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURlhMTVdpdGhMTUhlYWRNb2RlbCUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyeGxtLW1sbS1lbi0yMDQ4JTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZYTE1XaXRoTE1IZWFkTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMnhsbS1tbG0tZW4tMjA0OCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0cyklMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFXLMWithLMHeadModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFXLMWithLMHeadModel.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=a("p"),b=o("Example:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),m=h(l),v(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,m,c),w(u,l,c),y=!0},p:Ye,i(l){y||(k(u.$$.fragment,l),y=!0)},o(l){$(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function LT(j){let d,b,m,u,y,l,c,x,Me,fe,W,de,Y,F,ye,Z,ce,Je,Q,ne,re,B,ie,be,G,Te,ge,A,ve,le,se,C,U,te,R,we,ke,V,$e,Le,J,Fe,D,pe,Xe,O,he,me,N,_e,S,Ee,oe,z,ue,I,xe,je;return{c(){d=a("p"),b=o("TensorFlow models and layers in "),m=a("code"),u=o("transformers"),y=o(" accept two formats as input:"),l=p(),c=a("ul"),x=a("li"),Me=o("having all inputs as keyword arguments (like PyTorch models), or"),fe=p(),W=a("li"),de=o("having all inputs as a list, tuple or dict in the first positional argument."),Y=p(),F=a("p"),ye=o(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Z=a("code"),ce=o("model.fit()"),Je=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=a("code"),ne=o("model.fit()"),re=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),B=a("code"),ie=o("fit()"),be=o(" and "),G=a("code"),Te=o("predict()"),ge=o(`, such as when creating your own layers or models with
the Keras `),A=a("code"),ve=o("Functional"),le=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),se=p(),C=a("ul"),U=a("li"),te=o("a single Tensor with "),R=a("code"),we=o("input_ids"),ke=o(" only and nothing else: "),V=a("code"),$e=o("model(input_ids)"),Le=p(),J=a("li"),Fe=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),D=a("code"),pe=o("model([input_ids, attention_mask])"),Xe=o(" or "),O=a("code"),he=o("model([input_ids, attention_mask, token_type_ids])"),me=p(),N=a("li"),_e=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),S=a("code"),Ee=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),oe=p(),z=a("p"),ue=o(`Note that when creating models and layers with
`),I=a("a"),xe=o("subclassing"),je=o(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(_){d=r(_,"P",{});var X=i(d);b=n(X,"TensorFlow models and layers in "),m=r(X,"CODE",{});var qe=i(m);u=n(qe,"transformers"),qe.forEach(t),y=n(X," accept two formats as input:"),X.forEach(t),l=h(_),c=r(_,"UL",{});var K=i(c);x=r(K,"LI",{});var Ae=i(x);Me=n(Ae,"having all inputs as keyword arguments (like PyTorch models), or"),Ae.forEach(t),fe=h(K),W=r(K,"LI",{});var Ze=i(W);de=n(Ze,"having all inputs as a list, tuple or dict in the first positional argument."),Ze.forEach(t),K.forEach(t),Y=h(_),F=r(_,"P",{});var E=i(F);ye=n(E,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Z=r(E,"CODE",{});var Se=i(Z);ce=n(Se,"model.fit()"),Se.forEach(t),Je=n(E,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=r(E,"CODE",{});var Be=i(Q);ne=n(Be,"model.fit()"),Be.forEach(t),re=n(E,` supports! If, however, you want to use the second
format outside of Keras methods like `),B=r(E,"CODE",{});var Ge=i(B);ie=n(Ge,"fit()"),Ge.forEach(t),be=n(E," and "),G=r(E,"CODE",{});var Ue=i(G);Te=n(Ue,"predict()"),Ue.forEach(t),ge=n(E,`, such as when creating your own layers or models with
the Keras `),A=r(E,"CODE",{});var Ie=i(A);ve=n(Ie,"Functional"),Ie.forEach(t),le=n(E,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),E.forEach(t),se=h(_),C=r(_,"UL",{});var q=i(C);U=r(q,"LI",{});var P=i(U);te=n(P,"a single Tensor with "),R=r(P,"CODE",{});var Ce=i(R);we=n(Ce,"input_ids"),Ce.forEach(t),ke=n(P," only and nothing else: "),V=r(P,"CODE",{});var We=i(V);$e=n(We,"model(input_ids)"),We.forEach(t),P.forEach(t),Le=h(q),J=r(q,"LI",{});var H=i(J);Fe=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),D=r(H,"CODE",{});var Re=i(D);pe=n(Re,"model([input_ids, attention_mask])"),Re.forEach(t),Xe=n(H," or "),O=r(H,"CODE",{});var Ne=i(O);he=n(Ne,"model([input_ids, attention_mask, token_type_ids])"),Ne.forEach(t),H.forEach(t),me=h(q),N=r(q,"LI",{});var ze=i(N);_e=n(ze,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),S=r(ze,"CODE",{});var Ve=i(S);Ee=n(Ve,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ve.forEach(t),ze.forEach(t),q.forEach(t),oe=h(_),z=r(_,"P",{});var ee=i(z);ue=n(ee,`Note that when creating models and layers with
`),I=r(ee,"A",{href:!0,rel:!0});var Qe=i(I);xe=n(Qe,"subclassing"),Qe.forEach(t),je=n(ee,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),ee.forEach(t),this.h()},h(){f(I,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),f(I,"rel","nofollow")},m(_,X){g(_,d,X),e(d,b),e(d,m),e(m,u),e(d,y),g(_,l,X),g(_,c,X),e(c,x),e(x,Me),e(c,fe),e(c,W),e(W,de),g(_,Y,X),g(_,F,X),e(F,ye),e(F,Z),e(Z,ce),e(F,Je),e(F,Q),e(Q,ne),e(F,re),e(F,B),e(B,ie),e(F,be),e(F,G),e(G,Te),e(F,ge),e(F,A),e(A,ve),e(F,le),g(_,se,X),g(_,C,X),e(C,U),e(U,te),e(U,R),e(R,we),e(U,ke),e(U,V),e(V,$e),e(C,Le),e(C,J),e(J,Fe),e(J,D),e(D,pe),e(J,Xe),e(J,O),e(O,he),e(C,me),e(C,N),e(N,_e),e(N,S),e(S,Ee),g(_,oe,X),g(_,z,X),e(z,ue),e(z,I),e(I,xe),e(z,je)},d(_){_&&t(d),_&&t(l),_&&t(c),_&&t(Y),_&&t(F),_&&t(se),_&&t(C),_&&t(oe),_&&t(z)}}}function FT(j){let d,b,m,u,y;return{c(){d=a("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=o("Module"),y=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var x=i(m);u=n(x,"Module"),x.forEach(t),y=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function XT(j){let d,b,m,u,y;return u=new Ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURlhMTUZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0ZW5zb3JmbG93JTIwYXMlMjB0ZiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnhsbS1tbG0tZW4tMjA0OCUyMiklMEFtb2RlbCUyMCUzRCUyMFRGWExNRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyeGxtLW1sbS1lbi0yMDQ4JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEElMEFsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX2NsYXNzX2lkJTIwJTNEJTIwaW50KHRmLm1hdGguYXJnbWF4KGxvZ2l0cyUyQyUyMGF4aXMlM0QtMSklNUIwJTVEKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFXLMForSequenceClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFXLMForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>])`}}),{c(){d=a("p"),b=o("Example:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),m=h(l),v(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,m,c),w(u,l,c),y=!0},p:Ye,i(l){y||(k(u.$$.fragment,l),y=!0)},o(l){$(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function ET(j){let d,b;return d=new Ke({props:{code:"JTIzJTIwVG8lMjB0cmFpbiUyMGElMjBtb2RlbCUyMG9uJTIwJTYwbnVtX2xhYmVscyU2MCUyMGNsYXNzZXMlMkMlMjB5b3UlMjBjYW4lMjBwYXNzJTIwJTYwbnVtX2xhYmVscyUzRG51bV9sYWJlbHMlNjAlMjB0byUyMCU2MC5mcm9tX3ByZXRyYWluZWQoLi4uKSU2MCUwQW51bV9sYWJlbHMlMjAlM0QlMjBsZW4obW9kZWwuY29uZmlnLmlkMmxhYmVsKSUwQW1vZGVsJTIwJTNEJTIwVEZYTE1Gb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ4bG0tbWxtLWVuLTIwNDglMjIlMkMlMjBudW1fbGFiZWxzJTNEbnVtX2xhYmVscyklMEElMEFsYWJlbHMlMjAlM0QlMjB0Zi5jb25zdGFudCgxKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on `num_labels` classes, you can pass `num_labels=num_labels` to `.from_pretrained(...)`</span>\n<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)\n<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFXLMForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>, num_labels=num_labels)\n\n<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tf.constant(<span class="hljs-number">1</span>)\n<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss'}}),{c(){T(d.$$.fragment)},l(m){v(d.$$.fragment,m)},m(m,u){w(d,m,u),b=!0},p:Ye,i(m){b||(k(d.$$.fragment,m),b=!0)},o(m){$(d.$$.fragment,m),b=!1},d(m){L(d,m)}}}function xT(j){let d,b,m,u,y,l,c,x,Me,fe,W,de,Y,F,ye,Z,ce,Je,Q,ne,re,B,ie,be,G,Te,ge,A,ve,le,se,C,U,te,R,we,ke,V,$e,Le,J,Fe,D,pe,Xe,O,he,me,N,_e,S,Ee,oe,z,ue,I,xe,je;return{c(){d=a("p"),b=o("TensorFlow models and layers in "),m=a("code"),u=o("transformers"),y=o(" accept two formats as input:"),l=p(),c=a("ul"),x=a("li"),Me=o("having all inputs as keyword arguments (like PyTorch models), or"),fe=p(),W=a("li"),de=o("having all inputs as a list, tuple or dict in the first positional argument."),Y=p(),F=a("p"),ye=o(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Z=a("code"),ce=o("model.fit()"),Je=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=a("code"),ne=o("model.fit()"),re=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),B=a("code"),ie=o("fit()"),be=o(" and "),G=a("code"),Te=o("predict()"),ge=o(`, such as when creating your own layers or models with
the Keras `),A=a("code"),ve=o("Functional"),le=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),se=p(),C=a("ul"),U=a("li"),te=o("a single Tensor with "),R=a("code"),we=o("input_ids"),ke=o(" only and nothing else: "),V=a("code"),$e=o("model(input_ids)"),Le=p(),J=a("li"),Fe=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),D=a("code"),pe=o("model([input_ids, attention_mask])"),Xe=o(" or "),O=a("code"),he=o("model([input_ids, attention_mask, token_type_ids])"),me=p(),N=a("li"),_e=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),S=a("code"),Ee=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),oe=p(),z=a("p"),ue=o(`Note that when creating models and layers with
`),I=a("a"),xe=o("subclassing"),je=o(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(_){d=r(_,"P",{});var X=i(d);b=n(X,"TensorFlow models and layers in "),m=r(X,"CODE",{});var qe=i(m);u=n(qe,"transformers"),qe.forEach(t),y=n(X," accept two formats as input:"),X.forEach(t),l=h(_),c=r(_,"UL",{});var K=i(c);x=r(K,"LI",{});var Ae=i(x);Me=n(Ae,"having all inputs as keyword arguments (like PyTorch models), or"),Ae.forEach(t),fe=h(K),W=r(K,"LI",{});var Ze=i(W);de=n(Ze,"having all inputs as a list, tuple or dict in the first positional argument."),Ze.forEach(t),K.forEach(t),Y=h(_),F=r(_,"P",{});var E=i(F);ye=n(E,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Z=r(E,"CODE",{});var Se=i(Z);ce=n(Se,"model.fit()"),Se.forEach(t),Je=n(E,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=r(E,"CODE",{});var Be=i(Q);ne=n(Be,"model.fit()"),Be.forEach(t),re=n(E,` supports! If, however, you want to use the second
format outside of Keras methods like `),B=r(E,"CODE",{});var Ge=i(B);ie=n(Ge,"fit()"),Ge.forEach(t),be=n(E," and "),G=r(E,"CODE",{});var Ue=i(G);Te=n(Ue,"predict()"),Ue.forEach(t),ge=n(E,`, such as when creating your own layers or models with
the Keras `),A=r(E,"CODE",{});var Ie=i(A);ve=n(Ie,"Functional"),Ie.forEach(t),le=n(E,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),E.forEach(t),se=h(_),C=r(_,"UL",{});var q=i(C);U=r(q,"LI",{});var P=i(U);te=n(P,"a single Tensor with "),R=r(P,"CODE",{});var Ce=i(R);we=n(Ce,"input_ids"),Ce.forEach(t),ke=n(P," only and nothing else: "),V=r(P,"CODE",{});var We=i(V);$e=n(We,"model(input_ids)"),We.forEach(t),P.forEach(t),Le=h(q),J=r(q,"LI",{});var H=i(J);Fe=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),D=r(H,"CODE",{});var Re=i(D);pe=n(Re,"model([input_ids, attention_mask])"),Re.forEach(t),Xe=n(H," or "),O=r(H,"CODE",{});var Ne=i(O);he=n(Ne,"model([input_ids, attention_mask, token_type_ids])"),Ne.forEach(t),H.forEach(t),me=h(q),N=r(q,"LI",{});var ze=i(N);_e=n(ze,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),S=r(ze,"CODE",{});var Ve=i(S);Ee=n(Ve,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ve.forEach(t),ze.forEach(t),q.forEach(t),oe=h(_),z=r(_,"P",{});var ee=i(z);ue=n(ee,`Note that when creating models and layers with
`),I=r(ee,"A",{href:!0,rel:!0});var Qe=i(I);xe=n(Qe,"subclassing"),Qe.forEach(t),je=n(ee,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),ee.forEach(t),this.h()},h(){f(I,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),f(I,"rel","nofollow")},m(_,X){g(_,d,X),e(d,b),e(d,m),e(m,u),e(d,y),g(_,l,X),g(_,c,X),e(c,x),e(x,Me),e(c,fe),e(c,W),e(W,de),g(_,Y,X),g(_,F,X),e(F,ye),e(F,Z),e(Z,ce),e(F,Je),e(F,Q),e(Q,ne),e(F,re),e(F,B),e(B,ie),e(F,be),e(F,G),e(G,Te),e(F,ge),e(F,A),e(A,ve),e(F,le),g(_,se,X),g(_,C,X),e(C,U),e(U,te),e(U,R),e(R,we),e(U,ke),e(U,V),e(V,$e),e(C,Le),e(C,J),e(J,Fe),e(J,D),e(D,pe),e(J,Xe),e(J,O),e(O,he),e(C,me),e(C,N),e(N,_e),e(N,S),e(S,Ee),g(_,oe,X),g(_,z,X),e(z,ue),e(z,I),e(I,xe),e(z,je)},d(_){_&&t(d),_&&t(l),_&&t(c),_&&t(Y),_&&t(F),_&&t(se),_&&t(C),_&&t(oe),_&&t(z)}}}function jT(j){let d,b,m,u,y;return{c(){d=a("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=o("Module"),y=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var x=i(m);u=n(x,"Module"),x.forEach(t),y=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function CT(j){let d,b,m,u,y;return u=new Ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURlhMTUZvck11bHRpcGxlQ2hvaWNlJTBBaW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ4bG0tbWxtLWVuLTIwNDglMjIpJTBBbW9kZWwlMjAlM0QlMjBURlhMTUZvck11bHRpcGxlQ2hvaWNlLmZyb21fcHJldHJhaW5lZCglMjJ4bG0tbWxtLWVuLTIwNDglMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIySW4lMjBJdGFseSUyQyUyMHBpenphJTIwc2VydmVkJTIwaW4lMjBmb3JtYWwlMjBzZXR0aW5ncyUyQyUyMHN1Y2glMjBhcyUyMGF0JTIwYSUyMHJlc3RhdXJhbnQlMkMlMjBpcyUyMHByZXNlbnRlZCUyMHVuc2xpY2VkLiUyMiUwQWNob2ljZTAlMjAlM0QlMjAlMjJJdCUyMGlzJTIwZWF0ZW4lMjB3aXRoJTIwYSUyMGZvcmslMjBhbmQlMjBhJTIwa25pZmUuJTIyJTBBY2hvaWNlMSUyMCUzRCUyMCUyMkl0JTIwaXMlMjBlYXRlbiUyMHdoaWxlJTIwaGVsZCUyMGluJTIwdGhlJTIwaGFuZC4lMjIlMEElMEFlbmNvZGluZyUyMCUzRCUyMHRva2VuaXplciglNUJwcm9tcHQlMkMlMjBwcm9tcHQlNUQlMkMlMjAlNUJjaG9pY2UwJTJDJTIwY2hvaWNlMSU1RCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIlMkMlMjBwYWRkaW5nJTNEVHJ1ZSklMEFpbnB1dHMlMjAlM0QlMjAlN0JrJTNBJTIwdGYuZXhwYW5kX2RpbXModiUyQyUyMDApJTIwZm9yJTIwayUyQyUyMHYlMjBpbiUyMGVuY29kaW5nLml0ZW1zKCklN0QlMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRzKSUyMCUyMCUyMyUyMGJhdGNoJTIwc2l6ZSUyMGlzJTIwMSUwQSUwQSUyMyUyMHRoZSUyMGxpbmVhciUyMGNsYXNzaWZpZXIlMjBzdGlsbCUyMG5lZWRzJTIwdG8lMjBiZSUyMHRyYWluZWQlMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFXLMForMultipleChoice
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFXLMForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice0 = <span class="hljs-string">&quot;It is eaten with a fork and a knife.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice1 = <span class="hljs-string">&quot;It is eaten while held in the hand.&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors=<span class="hljs-string">&quot;tf&quot;</span>, padding=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = {k: tf.expand_dims(v, <span class="hljs-number">0</span>) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> encoding.items()}
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)  <span class="hljs-comment"># batch size is 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the linear classifier still needs to be trained</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=a("p"),b=o("Example:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),m=h(l),v(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,m,c),w(u,l,c),y=!0},p:Ye,i(l){y||(k(u.$$.fragment,l),y=!0)},o(l){$(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function zT(j){let d,b,m,u,y,l,c,x,Me,fe,W,de,Y,F,ye,Z,ce,Je,Q,ne,re,B,ie,be,G,Te,ge,A,ve,le,se,C,U,te,R,we,ke,V,$e,Le,J,Fe,D,pe,Xe,O,he,me,N,_e,S,Ee,oe,z,ue,I,xe,je;return{c(){d=a("p"),b=o("TensorFlow models and layers in "),m=a("code"),u=o("transformers"),y=o(" accept two formats as input:"),l=p(),c=a("ul"),x=a("li"),Me=o("having all inputs as keyword arguments (like PyTorch models), or"),fe=p(),W=a("li"),de=o("having all inputs as a list, tuple or dict in the first positional argument."),Y=p(),F=a("p"),ye=o(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Z=a("code"),ce=o("model.fit()"),Je=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=a("code"),ne=o("model.fit()"),re=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),B=a("code"),ie=o("fit()"),be=o(" and "),G=a("code"),Te=o("predict()"),ge=o(`, such as when creating your own layers or models with
the Keras `),A=a("code"),ve=o("Functional"),le=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),se=p(),C=a("ul"),U=a("li"),te=o("a single Tensor with "),R=a("code"),we=o("input_ids"),ke=o(" only and nothing else: "),V=a("code"),$e=o("model(input_ids)"),Le=p(),J=a("li"),Fe=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),D=a("code"),pe=o("model([input_ids, attention_mask])"),Xe=o(" or "),O=a("code"),he=o("model([input_ids, attention_mask, token_type_ids])"),me=p(),N=a("li"),_e=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),S=a("code"),Ee=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),oe=p(),z=a("p"),ue=o(`Note that when creating models and layers with
`),I=a("a"),xe=o("subclassing"),je=o(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(_){d=r(_,"P",{});var X=i(d);b=n(X,"TensorFlow models and layers in "),m=r(X,"CODE",{});var qe=i(m);u=n(qe,"transformers"),qe.forEach(t),y=n(X," accept two formats as input:"),X.forEach(t),l=h(_),c=r(_,"UL",{});var K=i(c);x=r(K,"LI",{});var Ae=i(x);Me=n(Ae,"having all inputs as keyword arguments (like PyTorch models), or"),Ae.forEach(t),fe=h(K),W=r(K,"LI",{});var Ze=i(W);de=n(Ze,"having all inputs as a list, tuple or dict in the first positional argument."),Ze.forEach(t),K.forEach(t),Y=h(_),F=r(_,"P",{});var E=i(F);ye=n(E,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Z=r(E,"CODE",{});var Se=i(Z);ce=n(Se,"model.fit()"),Se.forEach(t),Je=n(E,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=r(E,"CODE",{});var Be=i(Q);ne=n(Be,"model.fit()"),Be.forEach(t),re=n(E,` supports! If, however, you want to use the second
format outside of Keras methods like `),B=r(E,"CODE",{});var Ge=i(B);ie=n(Ge,"fit()"),Ge.forEach(t),be=n(E," and "),G=r(E,"CODE",{});var Ue=i(G);Te=n(Ue,"predict()"),Ue.forEach(t),ge=n(E,`, such as when creating your own layers or models with
the Keras `),A=r(E,"CODE",{});var Ie=i(A);ve=n(Ie,"Functional"),Ie.forEach(t),le=n(E,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),E.forEach(t),se=h(_),C=r(_,"UL",{});var q=i(C);U=r(q,"LI",{});var P=i(U);te=n(P,"a single Tensor with "),R=r(P,"CODE",{});var Ce=i(R);we=n(Ce,"input_ids"),Ce.forEach(t),ke=n(P," only and nothing else: "),V=r(P,"CODE",{});var We=i(V);$e=n(We,"model(input_ids)"),We.forEach(t),P.forEach(t),Le=h(q),J=r(q,"LI",{});var H=i(J);Fe=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),D=r(H,"CODE",{});var Re=i(D);pe=n(Re,"model([input_ids, attention_mask])"),Re.forEach(t),Xe=n(H," or "),O=r(H,"CODE",{});var Ne=i(O);he=n(Ne,"model([input_ids, attention_mask, token_type_ids])"),Ne.forEach(t),H.forEach(t),me=h(q),N=r(q,"LI",{});var ze=i(N);_e=n(ze,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),S=r(ze,"CODE",{});var Ve=i(S);Ee=n(Ve,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ve.forEach(t),ze.forEach(t),q.forEach(t),oe=h(_),z=r(_,"P",{});var ee=i(z);ue=n(ee,`Note that when creating models and layers with
`),I=r(ee,"A",{href:!0,rel:!0});var Qe=i(I);xe=n(Qe,"subclassing"),Qe.forEach(t),je=n(ee,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),ee.forEach(t),this.h()},h(){f(I,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),f(I,"rel","nofollow")},m(_,X){g(_,d,X),e(d,b),e(d,m),e(m,u),e(d,y),g(_,l,X),g(_,c,X),e(c,x),e(x,Me),e(c,fe),e(c,W),e(W,de),g(_,Y,X),g(_,F,X),e(F,ye),e(F,Z),e(Z,ce),e(F,Je),e(F,Q),e(Q,ne),e(F,re),e(F,B),e(B,ie),e(F,be),e(F,G),e(G,Te),e(F,ge),e(F,A),e(A,ve),e(F,le),g(_,se,X),g(_,C,X),e(C,U),e(U,te),e(U,R),e(R,we),e(U,ke),e(U,V),e(V,$e),e(C,Le),e(C,J),e(J,Fe),e(J,D),e(D,pe),e(J,Xe),e(J,O),e(O,he),e(C,me),e(C,N),e(N,_e),e(N,S),e(S,Ee),g(_,oe,X),g(_,z,X),e(z,ue),e(z,I),e(I,xe),e(z,je)},d(_){_&&t(d),_&&t(l),_&&t(c),_&&t(Y),_&&t(F),_&&t(se),_&&t(C),_&&t(oe),_&&t(z)}}}function JT(j){let d,b,m,u,y;return{c(){d=a("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=o("Module"),y=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var x=i(m);u=n(x,"Module"),x.forEach(t),y=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function UT(j){let d,b,m,u,y;return u=new Ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURlhMTUZvclRva2VuQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0ZW5zb3JmbG93JTIwYXMlMjB0ZiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnhsbS1tbG0tZW4tMjA0OCUyMiklMEFtb2RlbCUyMCUzRCUyMFRGWExNRm9yVG9rZW5DbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyeGxtLW1sbS1lbi0yMDQ4JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMEElMjAlMjAlMjAlMjAlMjJIdWdnaW5nRmFjZSUyMGlzJTIwYSUyMGNvbXBhbnklMjBiYXNlZCUyMGluJTIwUGFyaXMlMjBhbmQlMjBOZXclMjBZb3JrJTIyJTJDJTIwYWRkX3NwZWNpYWxfdG9rZW5zJTNERmFsc2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyJTBBKSUwQSUwQWxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEFwcmVkaWN0ZWRfdG9rZW5fY2xhc3NfaWRzJTIwJTNEJTIwdGYubWF0aC5hcmdtYXgobG9naXRzJTJDJTIwYXhpcyUzRC0xKSUwQSUwQSUyMyUyME5vdGUlMjB0aGF0JTIwdG9rZW5zJTIwYXJlJTIwY2xhc3NpZmllZCUyMHJhdGhlciUyMHRoZW4lMjBpbnB1dCUyMHdvcmRzJTIwd2hpY2glMjBtZWFucyUyMHRoYXQlMEElMjMlMjB0aGVyZSUyMG1pZ2h0JTIwYmUlMjBtb3JlJTIwcHJlZGljdGVkJTIwdG9rZW4lMjBjbGFzc2VzJTIwdGhhbiUyMHdvcmRzLiUwQSUyMyUyME11bHRpcGxlJTIwdG9rZW4lMjBjbGFzc2VzJTIwbWlnaHQlMjBhY2NvdW50JTIwZm9yJTIwdGhlJTIwc2FtZSUyMHdvcmQlMEFwcmVkaWN0ZWRfdG9rZW5zX2NsYXNzZXMlMjAlM0QlMjAlNUJtb2RlbC5jb25maWcuaWQybGFiZWwlNUJ0JTVEJTIwZm9yJTIwdCUyMGluJTIwcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyU1QjAlNUQubnVtcHkoKS50b2xpc3QoKSU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFXLMForTokenClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFXLMForTokenClassification.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;HuggingFace is a company based in Paris and New York&quot;</span>, add_special_tokens=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_class_ids = tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Note that tokens are classified rather then input words which means that</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># there might be more predicted token classes than words.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Multiple token classes might account for the same word</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_tokens_classes = [model.config.id2label[t] <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> predicted_token_class_ids[<span class="hljs-number">0</span>].numpy().tolist()]`}}),{c(){d=a("p"),b=o("Example:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),m=h(l),v(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,m,c),w(u,l,c),y=!0},p:Ye,i(l){y||(k(u.$$.fragment,l),y=!0)},o(l){$(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function IT(j){let d,b;return d=new Ke({props:{code:"bGFiZWxzJTIwJTNEJTIwcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyUwQWxvc3MlMjAlM0QlMjB0Zi5tYXRoLnJlZHVjZV9tZWFuKG1vZGVsKCoqaW5wdXRzJTJDJTIwbGFiZWxzJTNEbGFiZWxzKS5sb3NzKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = tf.math.reduce_mean(model(**inputs, labels=labels).loss)`}}),{c(){T(d.$$.fragment)},l(m){v(d.$$.fragment,m)},m(m,u){w(d,m,u),b=!0},p:Ye,i(m){b||(k(d.$$.fragment,m),b=!0)},o(m){$(d.$$.fragment,m),b=!1},d(m){L(d,m)}}}function WT(j){let d,b,m,u,y,l,c,x,Me,fe,W,de,Y,F,ye,Z,ce,Je,Q,ne,re,B,ie,be,G,Te,ge,A,ve,le,se,C,U,te,R,we,ke,V,$e,Le,J,Fe,D,pe,Xe,O,he,me,N,_e,S,Ee,oe,z,ue,I,xe,je;return{c(){d=a("p"),b=o("TensorFlow models and layers in "),m=a("code"),u=o("transformers"),y=o(" accept two formats as input:"),l=p(),c=a("ul"),x=a("li"),Me=o("having all inputs as keyword arguments (like PyTorch models), or"),fe=p(),W=a("li"),de=o("having all inputs as a list, tuple or dict in the first positional argument."),Y=p(),F=a("p"),ye=o(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Z=a("code"),ce=o("model.fit()"),Je=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=a("code"),ne=o("model.fit()"),re=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),B=a("code"),ie=o("fit()"),be=o(" and "),G=a("code"),Te=o("predict()"),ge=o(`, such as when creating your own layers or models with
the Keras `),A=a("code"),ve=o("Functional"),le=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),se=p(),C=a("ul"),U=a("li"),te=o("a single Tensor with "),R=a("code"),we=o("input_ids"),ke=o(" only and nothing else: "),V=a("code"),$e=o("model(input_ids)"),Le=p(),J=a("li"),Fe=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),D=a("code"),pe=o("model([input_ids, attention_mask])"),Xe=o(" or "),O=a("code"),he=o("model([input_ids, attention_mask, token_type_ids])"),me=p(),N=a("li"),_e=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),S=a("code"),Ee=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),oe=p(),z=a("p"),ue=o(`Note that when creating models and layers with
`),I=a("a"),xe=o("subclassing"),je=o(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(_){d=r(_,"P",{});var X=i(d);b=n(X,"TensorFlow models and layers in "),m=r(X,"CODE",{});var qe=i(m);u=n(qe,"transformers"),qe.forEach(t),y=n(X," accept two formats as input:"),X.forEach(t),l=h(_),c=r(_,"UL",{});var K=i(c);x=r(K,"LI",{});var Ae=i(x);Me=n(Ae,"having all inputs as keyword arguments (like PyTorch models), or"),Ae.forEach(t),fe=h(K),W=r(K,"LI",{});var Ze=i(W);de=n(Ze,"having all inputs as a list, tuple or dict in the first positional argument."),Ze.forEach(t),K.forEach(t),Y=h(_),F=r(_,"P",{});var E=i(F);ye=n(E,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Z=r(E,"CODE",{});var Se=i(Z);ce=n(Se,"model.fit()"),Se.forEach(t),Je=n(E,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=r(E,"CODE",{});var Be=i(Q);ne=n(Be,"model.fit()"),Be.forEach(t),re=n(E,` supports! If, however, you want to use the second
format outside of Keras methods like `),B=r(E,"CODE",{});var Ge=i(B);ie=n(Ge,"fit()"),Ge.forEach(t),be=n(E," and "),G=r(E,"CODE",{});var Ue=i(G);Te=n(Ue,"predict()"),Ue.forEach(t),ge=n(E,`, such as when creating your own layers or models with
the Keras `),A=r(E,"CODE",{});var Ie=i(A);ve=n(Ie,"Functional"),Ie.forEach(t),le=n(E,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),E.forEach(t),se=h(_),C=r(_,"UL",{});var q=i(C);U=r(q,"LI",{});var P=i(U);te=n(P,"a single Tensor with "),R=r(P,"CODE",{});var Ce=i(R);we=n(Ce,"input_ids"),Ce.forEach(t),ke=n(P," only and nothing else: "),V=r(P,"CODE",{});var We=i(V);$e=n(We,"model(input_ids)"),We.forEach(t),P.forEach(t),Le=h(q),J=r(q,"LI",{});var H=i(J);Fe=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),D=r(H,"CODE",{});var Re=i(D);pe=n(Re,"model([input_ids, attention_mask])"),Re.forEach(t),Xe=n(H," or "),O=r(H,"CODE",{});var Ne=i(O);he=n(Ne,"model([input_ids, attention_mask, token_type_ids])"),Ne.forEach(t),H.forEach(t),me=h(q),N=r(q,"LI",{});var ze=i(N);_e=n(ze,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),S=r(ze,"CODE",{});var Ve=i(S);Ee=n(Ve,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ve.forEach(t),ze.forEach(t),q.forEach(t),oe=h(_),z=r(_,"P",{});var ee=i(z);ue=n(ee,`Note that when creating models and layers with
`),I=r(ee,"A",{href:!0,rel:!0});var Qe=i(I);xe=n(Qe,"subclassing"),Qe.forEach(t),je=n(ee,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),ee.forEach(t),this.h()},h(){f(I,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),f(I,"rel","nofollow")},m(_,X){g(_,d,X),e(d,b),e(d,m),e(m,u),e(d,y),g(_,l,X),g(_,c,X),e(c,x),e(x,Me),e(c,fe),e(c,W),e(W,de),g(_,Y,X),g(_,F,X),e(F,ye),e(F,Z),e(Z,ce),e(F,Je),e(F,Q),e(Q,ne),e(F,re),e(F,B),e(B,ie),e(F,be),e(F,G),e(G,Te),e(F,ge),e(F,A),e(A,ve),e(F,le),g(_,se,X),g(_,C,X),e(C,U),e(U,te),e(U,R),e(R,we),e(U,ke),e(U,V),e(V,$e),e(C,Le),e(C,J),e(J,Fe),e(J,D),e(D,pe),e(J,Xe),e(J,O),e(O,he),e(C,me),e(C,N),e(N,_e),e(N,S),e(S,Ee),g(_,oe,X),g(_,z,X),e(z,ue),e(z,I),e(I,xe),e(z,je)},d(_){_&&t(d),_&&t(l),_&&t(c),_&&t(Y),_&&t(F),_&&t(se),_&&t(C),_&&t(oe),_&&t(z)}}}function NT(j){let d,b,m,u,y;return{c(){d=a("p"),b=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=o("Module"),y=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var x=i(m);u=n(x,"Module"),x.forEach(t),y=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function qT(j){let d,b,m,u,y;return u=new Ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURlhMTUZvclF1ZXN0aW9uQW5zd2VyaW5nU2ltcGxlJTBBaW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ4bG0tbWxtLWVuLTIwNDglMjIpJTBBbW9kZWwlMjAlM0QlMjBURlhMTUZvclF1ZXN0aW9uQW5zd2VyaW5nU2ltcGxlLmZyb21fcHJldHJhaW5lZCglMjJ4bG0tbWxtLWVuLTIwNDglMjIpJTBBJTBBcXVlc3Rpb24lMkMlMjB0ZXh0JTIwJTNEJTIwJTIyV2hvJTIwd2FzJTIwSmltJTIwSGVuc29uJTNGJTIyJTJDJTIwJTIySmltJTIwSGVuc29uJTIwd2FzJTIwYSUyMG5pY2UlMjBwdXBwZXQlMjIlMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIocXVlc3Rpb24lMkMlMjB0ZXh0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBYW5zd2VyX3N0YXJ0X2luZGV4JTIwJTNEJTIwaW50KHRmLm1hdGguYXJnbWF4KG91dHB1dHMuc3RhcnRfbG9naXRzJTJDJTIwYXhpcyUzRC0xKSU1QjAlNUQpJTBBYW5zd2VyX2VuZF9pbmRleCUyMCUzRCUyMGludCh0Zi5tYXRoLmFyZ21heChvdXRwdXRzLmVuZF9sb2dpdHMlMkMlMjBheGlzJTNELTEpJTVCMCU1RCklMEElMEFwcmVkaWN0X2Fuc3dlcl90b2tlbnMlMjAlM0QlMjBpbnB1dHMuaW5wdXRfaWRzJTVCMCUyQyUyMGFuc3dlcl9zdGFydF9pbmRleCUyMCUzQSUyMGFuc3dlcl9lbmRfaW5kZXglMjAlMkIlMjAxJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFXLMForQuestionAnsweringSimple
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFXLMForQuestionAnsweringSimple.from_pretrained(<span class="hljs-string">&quot;xlm-mlm-en-2048&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>question, text = <span class="hljs-string">&quot;Who was Jim Henson?&quot;</span>, <span class="hljs-string">&quot;Jim Henson was a nice puppet&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(question, text, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>answer_start_index = <span class="hljs-built_in">int</span>(tf.math.argmax(outputs.start_logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>answer_end_index = <span class="hljs-built_in">int</span>(tf.math.argmax(outputs.end_logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]`}}),{c(){d=a("p"),b=o("Example:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),m=h(l),v(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,m,c),w(u,l,c),y=!0},p:Ye,i(l){y||(k(u.$$.fragment,l),y=!0)},o(l){$(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function AT(j){let d,b;return d=new Ke({props:{code:"JTIzJTIwdGFyZ2V0JTIwaXMlMjAlMjJuaWNlJTIwcHVwcGV0JTIyJTBBdGFyZ2V0X3N0YXJ0X2luZGV4JTIwJTNEJTIwdGYuY29uc3RhbnQoJTVCMTQlNUQpJTBBdGFyZ2V0X2VuZF9pbmRleCUyMCUzRCUyMHRmLmNvbnN0YW50KCU1QjE1JTVEKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMHN0YXJ0X3Bvc2l0aW9ucyUzRHRhcmdldF9zdGFydF9pbmRleCUyQyUyMGVuZF9wb3NpdGlvbnMlM0R0YXJnZXRfZW5kX2luZGV4KSUwQWxvc3MlMjAlM0QlMjB0Zi5tYXRoLnJlZHVjZV9tZWFuKG91dHB1dHMubG9zcyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># target is &quot;nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_start_index = tf.constant([<span class="hljs-number">14</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = tf.constant([<span class="hljs-number">15</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = tf.math.reduce_mean(outputs.loss)`}}),{c(){T(d.$$.fragment)},l(m){v(d.$$.fragment,m)},m(m,u){w(d,m,u),b=!0},p:Ye,i(m){b||(k(d.$$.fragment,m),b=!0)},o(m){$(d.$$.fragment,m),b=!1},d(m){L(d,m)}}}function ZT(j){let d,b,m,u,y,l,c,x,Me,fe,W,de,Y,F,ye,Z,ce,Je,Q,ne,re,B,ie,be,G,Te,ge,A,ve,le,se,C,U,te,R,we,ke,V,$e,Le,J,Fe,D,pe,Xe,O,he,me,N,_e,S,Ee,oe,z,ue,I,xe,je,_,X,qe,K,Ae,Ze,E,Se,Be,Ge,Ue,Ie,q,P,Ce,We,H,Re,Ne,ze,Ve,ee,Qe,cd,Zt,Sc,ss,Bc,Gc,as,Rc,Vc,pd,eo,So,ai,rs,Qc,ri,Dc,hd,rt,ii,er,Oc,Pc,li,tr,Hc,Yc,di,or,Kc,ep,ci,nr,tp,op,pi,sr,np,sp,hi,ar,ap,md,to,Bo,mi,is,rp,ui,ip,ud,bt,ls,lp,qt,dp,rr,cp,pp,ir,hp,mp,ds,up,fp,gp,oo,_p,lr,Mp,yp,dr,bp,Tp,vp,Go,fd,no,Ro,fi,cs,wp,gi,kp,gd,De,ps,$p,_i,Lp,Fp,lt,Mi,Xp,Ep,yi,xp,jp,bi,Cp,zp,At,Jp,Ti,Up,Ip,vi,Wp,Np,wi,qp,Ap,Zp,hs,Sp,ki,Bp,Gp,Rp,ms,Vp,$i,Qp,Dp,Op,us,Pp,cr,Hp,Yp,Kp,St,fs,eh,Li,th,oh,gs,pr,nh,Fi,sh,ah,hr,rh,Xi,ih,lh,Vo,_s,dh,Ms,ch,Ei,ph,hh,mh,Tt,ys,uh,xi,fh,gh,Qo,_h,so,Mh,ji,yh,bh,Ci,Th,vh,wh,mr,bs,_d,ao,Do,zi,Ts,kh,Ji,$h,Md,ro,vs,Lh,ws,Fh,Ui,Xh,Eh,yd,io,Oo,Ii,ks,xh,Wi,jh,bd,dt,$s,Ch,Ni,zh,Jh,Ls,Uh,ur,Ih,Wh,Nh,Fs,qh,Xs,Ah,Zh,Sh,vt,Es,Bh,lo,Gh,fr,Rh,Vh,qi,Qh,Dh,Oh,Po,Ph,Ho,Td,co,Yo,Ai,xs,Hh,Zi,Yh,vd,ct,js,Kh,Si,em,tm,Cs,om,gr,nm,sm,am,zs,rm,Js,im,lm,dm,wt,Us,cm,po,pm,_r,hm,mm,Bi,um,fm,gm,Ko,_m,en,wd,ho,tn,Gi,Is,Mm,Ri,ym,kd,pt,Ws,bm,Vi,Tm,vm,Ns,wm,Mr,km,$m,Lm,qs,Fm,As,Xm,Em,xm,gt,Zs,jm,mo,Cm,yr,zm,Jm,Qi,Um,Im,Wm,on,Nm,nn,qm,sn,$d,uo,an,Di,Ss,Am,Oi,Zm,Ld,ht,Bs,Sm,Pi,Bm,Gm,Gs,Rm,br,Vm,Qm,Dm,Rs,Om,Vs,Pm,Hm,Ym,kt,Qs,Km,fo,eu,Tr,tu,ou,Hi,nu,su,au,rn,ru,ln,Fd,go,dn,Yi,Ds,iu,Ki,lu,Xd,mt,Os,du,el,cu,pu,Ps,hu,vr,mu,uu,fu,Hs,gu,Ys,_u,Mu,yu,$t,Ks,bu,_o,Tu,wr,vu,wu,tl,ku,$u,Lu,cn,Fu,pn,Ed,Mo,hn,ol,ea,Xu,nl,Eu,xd,ut,ta,xu,yo,ju,sl,Cu,zu,al,Ju,Uu,Iu,oa,Wu,kr,Nu,qu,Au,na,Zu,sa,Su,Bu,Gu,Lt,aa,Ru,bo,Vu,$r,Qu,Du,rl,Ou,Pu,Hu,mn,Yu,un,jd,To,fn,il,ra,Ku,ll,ef,Cd,ft,ia,tf,vo,of,dl,nf,sf,cl,af,rf,lf,la,df,Lr,cf,pf,hf,da,mf,ca,uf,ff,gf,Ft,pa,_f,wo,Mf,Fr,yf,bf,pl,Tf,vf,wf,gn,kf,_n,zd,ko,Mn,hl,ha,$f,ml,Lf,Jd,et,ma,Ff,ul,Xf,Ef,ua,xf,Xr,jf,Cf,zf,fa,Jf,ga,Uf,If,Wf,yn,Nf,Xt,_a,qf,$o,Af,Er,Zf,Sf,fl,Bf,Gf,Rf,bn,Vf,Tn,Ud,Lo,vn,gl,Ma,Qf,_l,Df,Id,tt,ya,Of,Ml,Pf,Hf,ba,Yf,xr,Kf,eg,tg,Ta,og,va,ng,sg,ag,wn,rg,Et,wa,ig,Fo,lg,jr,dg,cg,yl,pg,hg,mg,kn,ug,$n,Wd,Xo,Ln,bl,ka,fg,Tl,gg,Nd,ot,$a,_g,vl,Mg,yg,La,bg,Cr,Tg,vg,wg,Fa,kg,Xa,$g,Lg,Fg,Fn,Xg,_t,Ea,Eg,Eo,xg,zr,jg,Cg,wl,zg,Jg,Ug,Xn,Ig,En,Wg,xn,qd,xo,jn,kl,xa,Ng,$l,qg,Ad,nt,ja,Ag,Ll,Zg,Sg,Ca,Bg,Jr,Gg,Rg,Vg,za,Qg,Ja,Dg,Og,Pg,Cn,Hg,xt,Ua,Yg,jo,Kg,Ur,e_,t_,Fl,o_,n_,s_,zn,a_,Jn,Zd,Co,Un,Xl,Ia,r_,El,i_,Sd,st,Wa,l_,xl,d_,c_,Na,p_,Ir,h_,m_,u_,qa,f_,Aa,g_,__,M_,In,y_,Mt,Za,b_,zo,T_,Wr,v_,w_,jl,k_,$_,L_,Wn,F_,Nn,X_,qn,Bd,Jo,An,Cl,Sa,E_,zl,x_,Gd,at,Ba,j_,Uo,C_,Jl,z_,J_,Ul,U_,I_,W_,Ga,N_,Nr,q_,A_,Z_,Ra,S_,Va,B_,G_,R_,Zn,V_,yt,Qa,Q_,Io,D_,qr,O_,P_,Il,H_,Y_,K_,Sn,eM,Bn,tM,Gn,Rd;return l=new Pe({}),ie=new Pe({}),rs=new Pe({}),is=new Pe({}),ls=new ae({props:{name:"class transformers.XLMConfig",anchor:"transformers.XLMConfig",parameters:[{name:"vocab_size",val:" = 30145"},{name:"emb_dim",val:" = 2048"},{name:"n_layers",val:" = 12"},{name:"n_heads",val:" = 16"},{name:"dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.1"},{name:"gelu_activation",val:" = True"},{name:"sinusoidal_embeddings",val:" = False"},{name:"causal",val:" = False"},{name:"asm",val:" = False"},{name:"n_langs",val:" = 1"},{name:"use_lang_emb",val:" = True"},{name:"max_position_embeddings",val:" = 512"},{name:"embed_init_std",val:" = 0.02209708691207961"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"init_std",val:" = 0.02"},{name:"bos_index",val:" = 0"},{name:"eos_index",val:" = 1"},{name:"pad_index",val:" = 2"},{name:"unk_index",val:" = 3"},{name:"mask_index",val:" = 5"},{name:"is_encoder",val:" = True"},{name:"summary_type",val:" = 'first'"},{name:"summary_use_proj",val:" = True"},{name:"summary_activation",val:" = None"},{name:"summary_proj_to_labels",val:" = True"},{name:"summary_first_dropout",val:" = 0.1"},{name:"start_n_top",val:" = 5"},{name:"end_n_top",val:" = 5"},{name:"mask_token_id",val:" = 0"},{name:"lang_id",val:" = 0"},{name:"pad_token_id",val:" = 2"},{name:"bos_token_id",val:" = 0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XLMConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30145) &#x2014;
Vocabulary size of the BERT model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMModel">XLMModel</a> or <a href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.TFXLMModel">TFXLMModel</a>.`,name:"vocab_size"},{anchor:"transformers.XLMConfig.emb_dim",description:`<strong>emb_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"emb_dim"},{anchor:"transformers.XLMConfig.n_layer",description:`<strong>n_layer</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"n_layer"},{anchor:"transformers.XLMConfig.n_head",description:`<strong>n_head</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"n_head"},{anchor:"transformers.XLMConfig.dropout",description:`<strong>dropout</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:"dropout"},{anchor:"transformers.XLMConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for the attention mechanism`,name:"attention_dropout"},{anchor:"transformers.XLMConfig.gelu_activation",description:`<strong>gelu_activation</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to use <em>gelu</em> for the activations instead of <em>relu</em>.`,name:"gelu_activation"},{anchor:"transformers.XLMConfig.sinusoidal_embeddings",description:`<strong>sinusoidal_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use sinusoidal positional embeddings instead of absolute positional embeddings.`,name:"sinusoidal_embeddings"},{anchor:"transformers.XLMConfig.causal",description:`<strong>causal</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the model should behave in a causal manner. Causal models use a triangular attention mask in
order to only attend to the left-side context instead if a bidirectional context.`,name:"causal"},{anchor:"transformers.XLMConfig.asm",description:`<strong>asm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use an adaptive log softmax projection layer instead of a linear layer for the prediction
layer.`,name:"asm"},{anchor:"transformers.XLMConfig.n_langs",description:`<strong>n_langs</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of languages the model handles. Set to 1 for monolingual models.`,name:"n_langs"},{anchor:"transformers.XLMConfig.use_lang_emb",description:`<strong>use_lang_emb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use language embeddings. Some models use additional language embeddings, see <a href="http://huggingface.co/transformers/multilingual.html#xlm-language-embeddings" rel="nofollow">the multilingual
models page</a> for information
on how to use them.`,name:"use_lang_emb"},{anchor:"transformers.XLMConfig.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.XLMConfig.embed_init_std",description:`<strong>embed_init_std</strong> (<code>float</code>, <em>optional</em>, defaults to 2048^-0.5) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing the embedding matrices.`,name:"embed_init_std"},{anchor:"transformers.XLMConfig.init_std",description:`<strong>init_std</strong> (<code>int</code>, <em>optional</em>, defaults to 50257) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices except the
embedding matrices.`,name:"init_std"},{anchor:"transformers.XLMConfig.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.XLMConfig.bos_index",description:`<strong>bos_index</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
The index of the beginning of sentence token in the vocabulary.`,name:"bos_index"},{anchor:"transformers.XLMConfig.eos_index",description:`<strong>eos_index</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The index of the end of sentence token in the vocabulary.`,name:"eos_index"},{anchor:"transformers.XLMConfig.pad_index",description:`<strong>pad_index</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The index of the padding token in the vocabulary.`,name:"pad_index"},{anchor:"transformers.XLMConfig.unk_index",description:`<strong>unk_index</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The index of the unknown token in the vocabulary.`,name:"unk_index"},{anchor:"transformers.XLMConfig.mask_index",description:`<strong>mask_index</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
The index of the masking token in the vocabulary.`,name:"mask_index"},{anchor:"transformers.XLMConfig.is_encoder(bool,",description:`<strong>is_encoder(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the initialized model should be a transformer encoder or decoder as seen in Vaswani et al.`,name:"is_encoder(bool,"},{anchor:"transformers.XLMConfig.summary_type",description:`<strong>summary_type</strong> (<code>string</code>, <em>optional</em>, defaults to &#x201C;first&#x201D;) &#x2014;
Argument used when doing sequence summary. Used in the sequence classification and multiple choice models.</p>
<p>Has to be one of the following options:</p>
<ul>
<li><code>&quot;last&quot;</code>: Take the last token hidden state (like XLNet).</li>
<li><code>&quot;first&quot;</code>: Take the first token hidden state (like BERT).</li>
<li><code>&quot;mean&quot;</code>: Take the mean of all tokens hidden states.</li>
<li><code>&quot;cls_index&quot;</code>: Supply a Tensor of classification token position (like GPT/GPT-2).</li>
<li><code>&quot;attn&quot;</code>: Not implemented now, use multi-head attention.</li>
</ul>`,name:"summary_type"},{anchor:"transformers.XLMConfig.summary_use_proj",description:`<strong>summary_use_proj</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Argument used when doing sequence summary. Used in the sequence classification and multiple choice models.</p>
<p>Whether or not to add a projection after the vector extraction.`,name:"summary_use_proj"},{anchor:"transformers.XLMConfig.summary_activation",description:`<strong>summary_activation</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Argument used when doing sequence summary. Used in the sequence classification and multiple choice models.</p>
<p>Pass <code>&quot;tanh&quot;</code> for a tanh activation to the output, any other value will result in no activation.`,name:"summary_activation"},{anchor:"transformers.XLMConfig.summary_proj_to_labels",description:`<strong>summary_proj_to_labels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Used in the sequence classification and multiple choice models.</p>
<p>Whether the projection outputs should have <code>config.num_labels</code> or <code>config.hidden_size</code> classes.`,name:"summary_proj_to_labels"},{anchor:"transformers.XLMConfig.summary_first_dropout",description:`<strong>summary_first_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
Used in the sequence classification and multiple choice models.</p>
<p>The dropout ratio to be used after the projection and activation.`,name:"summary_first_dropout"},{anchor:"transformers.XLMConfig.start_n_top",description:`<strong>start_n_top</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
Used in the SQuAD evaluation script.`,name:"start_n_top"},{anchor:"transformers.XLMConfig.end_n_top",description:`<strong>end_n_top</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
Used in the SQuAD evaluation script.`,name:"end_n_top"},{anchor:"transformers.XLMConfig.mask_token_id",description:`<strong>mask_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Model agnostic parameter to identify masked tokens when generating text in an MLM context.`,name:"mask_token_id"},{anchor:"transformers.XLMConfig.lang_id",description:`<strong>lang_id</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The ID of the language used by the model. This parameter is used when generating text in a given language.`,name:"lang_id"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/configuration_xlm.py#L40"}}),Go=new He({props:{anchor:"transformers.XLMConfig.example",$$slots:{default:[nT]},$$scope:{ctx:j}}}),cs=new Pe({}),ps=new ae({props:{name:"class transformers.XLMTokenizer",anchor:"transformers.XLMTokenizer",parameters:[{name:"vocab_file",val:""},{name:"merges_file",val:""},{name:"unk_token",val:" = '<unk>'"},{name:"bos_token",val:" = '<s>'"},{name:"sep_token",val:" = '</s>'"},{name:"pad_token",val:" = '<pad>'"},{name:"cls_token",val:" = '</s>'"},{name:"mask_token",val:" = '<special1>'"},{name:"additional_special_tokens",val:" = ['<special0>', '<special1>', '<special2>', '<special3>', '<special4>', '<special5>', '<special6>', '<special7>', '<special8>', '<special9>']"},{name:"lang2id",val:" = None"},{name:"id2lang",val:" = None"},{name:"do_lowercase_and_remove_accent",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XLMTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Vocabulary file.`,name:"vocab_file"},{anchor:"transformers.XLMTokenizer.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Merges file.`,name:"merges_file"},{anchor:"transformers.XLMTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.XLMTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the beginning of
sequence. The token used is the <code>cls_token</code>.</p>

					</div>`,name:"bos_token"},{anchor:"transformers.XLMTokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.XLMTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.XLMTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.XLMTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;special1&gt;&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.XLMTokenizer.additional_special_tokens",description:`<strong>additional_special_tokens</strong> (<code>List[str]</code>, <em>optional</em>, defaults to <code>[&quot;&lt;special0&gt;&quot;,&quot;&lt;special1&gt;&quot;,&quot;&lt;special2&gt;&quot;,&quot;&lt;special3&gt;&quot;,&quot;&lt;special4&gt;&quot;,&quot;&lt;special5&gt;&quot;,&quot;&lt;special6&gt;&quot;,&quot;&lt;special7&gt;&quot;,&quot;&lt;special8&gt;&quot;,&quot;&lt;special9&gt;&quot;]</code>) &#x2014;
List of additional special tokens.`,name:"additional_special_tokens"},{anchor:"transformers.XLMTokenizer.lang2id",description:`<strong>lang2id</strong> (<code>Dict[str, int]</code>, <em>optional</em>) &#x2014;
Dictionary mapping languages string identifiers to their IDs.`,name:"lang2id"},{anchor:"transformers.XLMTokenizer.id2lang",description:`<strong>id2lang</strong> (<code>Dict[int, str]</code>, <em>optional</em>) &#x2014;
Dictionary mapping language IDs to their string identifiers.`,name:"id2lang"},{anchor:"transformers.XLMTokenizer.do_lowercase_and_remove_accent",description:`<strong>do_lowercase_and_remove_accent</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to lowercase and remove accents when tokenizing.`,name:"do_lowercase_and_remove_accent"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/tokenization_xlm.py#L528"}}),fs=new ae({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.XLMTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.XLMTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.XLMTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/tokenization_xlm.py#L871",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),_s=new ae({props:{name:"get_special_tokens_mask",anchor:"transformers.XLMTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.XLMTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.XLMTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.XLMTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/tokenization_xlm.py#L898",returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),ys=new ae({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.XLMTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.XLMTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.XLMTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/tokenization_xlm.py#L926",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Qo=new He({props:{anchor:"transformers.XLMTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[sT]},$$scope:{ctx:j}}}),bs=new ae({props:{name:"save_vocabulary",anchor:"transformers.XLMTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/tokenization_xlm.py#L955"}}),Ts=new Pe({}),vs=new ae({props:{name:"class transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput",anchor:"transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_top_log_probs",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_top_index",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_top_log_probs",val:": typing.Optional[torch.FloatTensor] = None"},{name:"end_top_index",val:": typing.Optional[torch.LongTensor] = None"},{name:"cls_logits",val:": typing.Optional[torch.FloatTensor] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput.loss",description:`<strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned if both <code>start_positions</code> and <code>end_positions</code> are provided) &#x2014;
Classification loss as the sum of start token, end token (and is_impossible if provided) classification
losses.`,name:"loss"},{anchor:"transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput.start_top_log_probs",description:`<strong>start_top_log_probs</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.start_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) &#x2014;
Log probabilities for the top config.start_n_top start token possibilities (beam-search).`,name:"start_top_log_probs"},{anchor:"transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput.start_top_index",description:`<strong>start_top_index</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, config.start_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) &#x2014;
Indices for the top config.start_n_top start token possibilities (beam-search).`,name:"start_top_index"},{anchor:"transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput.end_top_log_probs",description:`<strong>end_top_log_probs</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.start_n_top * config.end_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) &#x2014;
Log probabilities for the top <code>config.start_n_top * config.end_n_top</code> end token possibilities
(beam-search).`,name:"end_top_log_probs"},{anchor:"transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput.end_top_index",description:`<strong>end_top_index</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, config.start_n_top * config.end_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) &#x2014;
Indices for the top <code>config.start_n_top * config.end_n_top</code> end token possibilities (beam-search).`,name:"end_top_index"},{anchor:"transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput.cls_logits",description:`<strong>cls_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) &#x2014;
Log probabilities for the <code>is_impossible</code> label of the answers.`,name:"cls_logits"},{anchor:"transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_xlm.py#L262"}}),ks=new Pe({}),$s=new ae({props:{name:"class transformers.XLMModel",anchor:"transformers.XLMModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XLMModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_xlm.py#L393"}}),Es=new ae({props:{name:"forward",anchor:"transformers.XLMModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"langs",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:"lengths",val:": typing.Optional[torch.Tensor] = None"},{name:"cache",val:": typing.Union[typing.Dict[str, torch.Tensor], NoneType] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = 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.XLMModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.XLMModel.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.XLMModel.forward.langs",description:`<strong>langs</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.XLMModel.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.XLMModel.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.XLMModel.forward.lengths",description:`<strong>lengths</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.XLMModel.forward.cache",description:`<strong>cache</strong> (<code>Dict[str, torch.FloatTensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.XLMModel.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.XLMModel.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.XLMModel.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.XLMModel.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.XLMModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_xlm.py#L480",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig"
>XLMConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Po=new Oe({props:{$$slots:{default:[aT]},$$scope:{ctx:j}}}),Ho=new He({props:{anchor:"transformers.XLMModel.forward.example",$$slots:{default:[rT]},$$scope:{ctx:j}}}),xs=new Pe({}),js=new ae({props:{name:"class transformers.XLMWithLMHeadModel",anchor:"transformers.XLMWithLMHeadModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XLMWithLMHeadModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_xlm.py#L672"}}),Us=new ae({props:{name:"forward",anchor:"transformers.XLMWithLMHeadModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"langs",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:"lengths",val:": typing.Optional[torch.Tensor] = None"},{name:"cache",val:": typing.Union[typing.Dict[str, torch.Tensor], NoneType] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = 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.XLMWithLMHeadModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.XLMWithLMHeadModel.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.XLMWithLMHeadModel.forward.langs",description:`<strong>langs</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.XLMWithLMHeadModel.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.XLMWithLMHeadModel.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.XLMWithLMHeadModel.forward.lengths",description:`<strong>lengths</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.XLMWithLMHeadModel.forward.cache",description:`<strong>cache</strong> (<code>Dict[str, torch.FloatTensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.XLMWithLMHeadModel.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.XLMWithLMHeadModel.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.XLMWithLMHeadModel.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.XLMWithLMHeadModel.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.XLMWithLMHeadModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XLMWithLMHeadModel.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for language modeling. Note that the labels <strong>are shifted</strong> inside the model, i.e. you can set
<code>labels = input_ids</code> Indices are selected in <code>[-100, 0, ..., config.vocab_size]</code> All labels set to <code>-100</code>
are ignored (masked), the loss is only computed for labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_xlm.py#L702",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig"
>XLMConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ko=new Oe({props:{$$slots:{default:[iT]},$$scope:{ctx:j}}}),en=new He({props:{anchor:"transformers.XLMWithLMHeadModel.forward.example",$$slots:{default:[lT]},$$scope:{ctx:j}}}),Is=new Pe({}),Ws=new ae({props:{name:"class transformers.XLMForSequenceClassification",anchor:"transformers.XLMForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XLMForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_xlm.py#L769"}}),Zs=new ae({props:{name:"forward",anchor:"transformers.XLMForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"langs",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:"lengths",val:": typing.Optional[torch.Tensor] = None"},{name:"cache",val:": typing.Union[typing.Dict[str, torch.Tensor], NoneType] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = 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.XLMForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.XLMForSequenceClassification.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.XLMForSequenceClassification.forward.langs",description:`<strong>langs</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.XLMForSequenceClassification.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.XLMForSequenceClassification.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.XLMForSequenceClassification.forward.lengths",description:`<strong>lengths</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.XLMForSequenceClassification.forward.cache",description:`<strong>cache</strong> (<code>Dict[str, torch.FloatTensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.XLMForSequenceClassification.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.XLMForSequenceClassification.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.XLMForSequenceClassification.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.XLMForSequenceClassification.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.XLMForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XLMForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_xlm.py#L781",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig"
>XLMConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),on=new Oe({props:{$$slots:{default:[dT]},$$scope:{ctx:j}}}),nn=new He({props:{anchor:"transformers.XLMForSequenceClassification.forward.example",$$slots:{default:[cT]},$$scope:{ctx:j}}}),sn=new He({props:{anchor:"transformers.XLMForSequenceClassification.forward.example-2",$$slots:{default:[pT]},$$scope:{ctx:j}}}),Ss=new Pe({}),Bs=new ae({props:{name:"class transformers.XLMForMultipleChoice",anchor:"transformers.XLMForMultipleChoice",parameters:[{name:"config",val:""},{name:"*inputs",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XLMForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_xlm.py#L1180"}}),Qs=new ae({props:{name:"forward",anchor:"transformers.XLMForMultipleChoice.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"langs",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:"lengths",val:": typing.Optional[torch.Tensor] = None"},{name:"cache",val:": typing.Union[typing.Dict[str, torch.Tensor], NoneType] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = 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.XLMForMultipleChoice.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.XLMForMultipleChoice.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.XLMForMultipleChoice.forward.langs",description:`<strong>langs</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.XLMForMultipleChoice.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.XLMForMultipleChoice.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.XLMForMultipleChoice.forward.lengths",description:`<strong>lengths</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.XLMForMultipleChoice.forward.cache",description:`<strong>cache</strong> (<code>Dict[str, torch.FloatTensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.XLMForMultipleChoice.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.XLMForMultipleChoice.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.XLMForMultipleChoice.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.XLMForMultipleChoice.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.XLMForMultipleChoice.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XLMForMultipleChoice.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the multiple choice classification loss. Indices should be in <code>[0, ..., num_choices-1]</code> where <code>num_choices</code> is the size of the second dimension of the input tensors. (See
<code>input_ids</code> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_xlm.py#L1191",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig"
>XLMConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <em>(1,)</em>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices)</code>) \u2014 <em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),rn=new Oe({props:{$$slots:{default:[hT]},$$scope:{ctx:j}}}),ln=new He({props:{anchor:"transformers.XLMForMultipleChoice.forward.example",$$slots:{default:[mT]},$$scope:{ctx:j}}}),Ds=new Pe({}),Os=new ae({props:{name:"class transformers.XLMForTokenClassification",anchor:"transformers.XLMForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XLMForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_xlm.py#L1096"}}),Ks=new ae({props:{name:"forward",anchor:"transformers.XLMForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"langs",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:"lengths",val:": typing.Optional[torch.Tensor] = None"},{name:"cache",val:": typing.Union[typing.Dict[str, torch.Tensor], NoneType] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = 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.XLMForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.XLMForTokenClassification.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.XLMForTokenClassification.forward.langs",description:`<strong>langs</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.XLMForTokenClassification.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.XLMForTokenClassification.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.XLMForTokenClassification.forward.lengths",description:`<strong>lengths</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.XLMForTokenClassification.forward.cache",description:`<strong>cache</strong> (<code>Dict[str, torch.FloatTensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.XLMForTokenClassification.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.XLMForTokenClassification.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.XLMForTokenClassification.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.XLMForTokenClassification.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.XLMForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XLMForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_xlm.py#L1108",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig"
>XLMConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),cn=new Oe({props:{$$slots:{default:[uT]},$$scope:{ctx:j}}}),pn=new He({props:{anchor:"transformers.XLMForTokenClassification.forward.example",$$slots:{default:[fT]},$$scope:{ctx:j}}}),ea=new Pe({}),ta=new ae({props:{name:"class transformers.XLMForQuestionAnsweringSimple",anchor:"transformers.XLMForQuestionAnsweringSimple",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XLMForQuestionAnsweringSimple.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_xlm.py#L871"}}),aa=new ae({props:{name:"forward",anchor:"transformers.XLMForQuestionAnsweringSimple.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"langs",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:"lengths",val:": typing.Optional[torch.Tensor] = None"},{name:"cache",val:": typing.Union[typing.Dict[str, torch.Tensor], NoneType] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"start_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"end_positions",val:": typing.Optional[torch.Tensor] = 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.XLMForQuestionAnsweringSimple.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.XLMForQuestionAnsweringSimple.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.XLMForQuestionAnsweringSimple.forward.langs",description:`<strong>langs</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.XLMForQuestionAnsweringSimple.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.XLMForQuestionAnsweringSimple.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.XLMForQuestionAnsweringSimple.forward.lengths",description:`<strong>lengths</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.XLMForQuestionAnsweringSimple.forward.cache",description:`<strong>cache</strong> (<code>Dict[str, torch.FloatTensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.XLMForQuestionAnsweringSimple.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.XLMForQuestionAnsweringSimple.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.XLMForQuestionAnsweringSimple.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.XLMForQuestionAnsweringSimple.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.XLMForQuestionAnsweringSimple.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XLMForQuestionAnsweringSimple.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.XLMForQuestionAnsweringSimple.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_xlm.py#L881",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig"
>XLMConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),mn=new Oe({props:{$$slots:{default:[gT]},$$scope:{ctx:j}}}),un=new He({props:{anchor:"transformers.XLMForQuestionAnsweringSimple.forward.example",$$slots:{default:[_T]},$$scope:{ctx:j}}}),ra=new Pe({}),ia=new ae({props:{name:"class transformers.XLMForQuestionAnswering",anchor:"transformers.XLMForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XLMForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_xlm.py#L975"}}),pa=new ae({props:{name:"forward",anchor:"transformers.XLMForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"langs",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:"lengths",val:": typing.Optional[torch.Tensor] = None"},{name:"cache",val:": typing.Union[typing.Dict[str, torch.Tensor], NoneType] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"start_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"end_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"is_impossible",val:": typing.Optional[torch.Tensor] = None"},{name:"cls_index",val:": typing.Optional[torch.Tensor] = None"},{name:"p_mask",val:": typing.Optional[torch.Tensor] = 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.XLMForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.XLMForQuestionAnswering.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.XLMForQuestionAnswering.forward.langs",description:`<strong>langs</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.XLMForQuestionAnswering.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.XLMForQuestionAnswering.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.XLMForQuestionAnswering.forward.lengths",description:`<strong>lengths</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.XLMForQuestionAnswering.forward.cache",description:`<strong>cache</strong> (<code>Dict[str, torch.FloatTensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.XLMForQuestionAnswering.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.XLMForQuestionAnswering.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.XLMForQuestionAnswering.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.XLMForQuestionAnswering.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.XLMForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XLMForQuestionAnswering.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.XLMForQuestionAnswering.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"},{anchor:"transformers.XLMForQuestionAnswering.forward.is_impossible",description:`<strong>is_impossible</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels whether a question has an answer or no answer (SQuAD 2.0)`,name:"is_impossible"},{anchor:"transformers.XLMForQuestionAnswering.forward.cls_index",description:`<strong>cls_index</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the classification token to use as input for computing plausibility of the
answer.`,name:"cls_index"},{anchor:"transformers.XLMForQuestionAnswering.forward.p_mask",description:`<strong>p_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Optional mask of tokens which can&#x2019;t be in answers (e.g. [CLS], [PAD], &#x2026;). 1.0 means token should be
masked. 0.0 mean token is not masked.`,name:"p_mask"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_xlm.py#L985",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput"
>transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig"
>XLMConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned if both <code>start_positions</code> and <code>end_positions</code> are provided) \u2014 Classification loss as the sum of start token, end token (and is_impossible if provided) classification
losses.</p>
</li>
<li>
<p><strong>start_top_log_probs</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.start_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) \u2014 Log probabilities for the top config.start_n_top start token possibilities (beam-search).</p>
</li>
<li>
<p><strong>start_top_index</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, config.start_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) \u2014 Indices for the top config.start_n_top start token possibilities (beam-search).</p>
</li>
<li>
<p><strong>end_top_log_probs</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.start_n_top * config.end_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) \u2014 Log probabilities for the top <code>config.start_n_top * config.end_n_top</code> end token possibilities
(beam-search).</p>
</li>
<li>
<p><strong>end_top_index</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, config.start_n_top * config.end_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) \u2014 Indices for the top <code>config.start_n_top * config.end_n_top</code> end token possibilities (beam-search).</p>
</li>
<li>
<p><strong>cls_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) \u2014 Log probabilities for the <code>is_impossible</code> label of the answers.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput"
>transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),gn=new Oe({props:{$$slots:{default:[MT]},$$scope:{ctx:j}}}),_n=new He({props:{anchor:"transformers.XLMForQuestionAnswering.forward.example",$$slots:{default:[yT]},$$scope:{ctx:j}}}),ha=new Pe({}),ma=new ae({props:{name:"class transformers.TFXLMModel",anchor:"transformers.TFXLMModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFXLMModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_tf_xlm.py#L689"}}),yn=new Oe({props:{$$slots:{default:[bT]},$$scope:{ctx:j}}}),_a=new ae({props:{name:"call",anchor:"transformers.TFXLMModel.call",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"langs",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"lengths",val:" = None"},{name:"cache",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"},{name:"training",val:" = False"}],parametersDescription:[{anchor:"transformers.TFXLMModel.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFXLMModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMModel.call.langs",description:`<strong>langs</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.TFXLMModel.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMModel.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMModel.call.lengths",description:`<strong>lengths</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.TFXLMModel.call.cache",description:`<strong>cache</strong> (<code>Dict[str, tf.Tensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.TFXLMModel.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMModel.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</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.TFXLMModel.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFXLMModel.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFXLMModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFXLMModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_tf_xlm.py#L694",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutput"
>transformers.modeling_tf_outputs.TFBaseModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig"
>XLMConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutput"
>transformers.modeling_tf_outputs.TFBaseModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),bn=new Oe({props:{$$slots:{default:[TT]},$$scope:{ctx:j}}}),Tn=new He({props:{anchor:"transformers.TFXLMModel.call.example",$$slots:{default:[vT]},$$scope:{ctx:j}}}),Ma=new Pe({}),ya=new ae({props:{name:"class transformers.TFXLMWithLMHeadModel",anchor:"transformers.TFXLMWithLMHeadModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFXLMWithLMHeadModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_tf_xlm.py#L794"}}),wn=new Oe({props:{$$slots:{default:[wT]},$$scope:{ctx:j}}}),wa=new ae({props:{name:"call",anchor:"transformers.TFXLMWithLMHeadModel.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"langs",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"lengths",val:": np.ndarray | tf.Tensor | None = None"},{name:"cache",val:": Optional[Dict[str, tf.Tensor]] = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFXLMWithLMHeadModel.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFXLMWithLMHeadModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMWithLMHeadModel.call.langs",description:`<strong>langs</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.TFXLMWithLMHeadModel.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMWithLMHeadModel.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMWithLMHeadModel.call.lengths",description:`<strong>lengths</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.TFXLMWithLMHeadModel.call.cache",description:`<strong>cache</strong> (<code>Dict[str, tf.Tensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.TFXLMWithLMHeadModel.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMWithLMHeadModel.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</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.TFXLMWithLMHeadModel.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFXLMWithLMHeadModel.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFXLMWithLMHeadModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFXLMWithLMHeadModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_tf_xlm.py#L823",returnDescription:`
<p>A <code>transformers.models.xlm.modeling_tf_xlm.TFXLMWithLMHeadModelOutput</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig"
>XLMConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.xlm.modeling_tf_xlm.TFXLMWithLMHeadModelOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),kn=new Oe({props:{$$slots:{default:[kT]},$$scope:{ctx:j}}}),$n=new He({props:{anchor:"transformers.TFXLMWithLMHeadModel.call.example",$$slots:{default:[$T]},$$scope:{ctx:j}}}),ka=new Pe({}),$a=new ae({props:{name:"class transformers.TFXLMForSequenceClassification",anchor:"transformers.TFXLMForSequenceClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFXLMForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_tf_xlm.py#L880"}}),Fn=new Oe({props:{$$slots:{default:[LT]},$$scope:{ctx:j}}}),Ea=new ae({props:{name:"call",anchor:"transformers.TFXLMForSequenceClassification.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"langs",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"lengths",val:": np.ndarray | tf.Tensor | None = None"},{name:"cache",val:": Optional[Dict[str, tf.Tensor]] = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFXLMForSequenceClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFXLMForSequenceClassification.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMForSequenceClassification.call.langs",description:`<strong>langs</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.TFXLMForSequenceClassification.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMForSequenceClassification.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMForSequenceClassification.call.lengths",description:`<strong>lengths</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.TFXLMForSequenceClassification.call.cache",description:`<strong>cache</strong> (<code>Dict[str, tf.Tensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.TFXLMForSequenceClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMForSequenceClassification.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</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.TFXLMForSequenceClassification.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFXLMForSequenceClassification.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFXLMForSequenceClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFXLMForSequenceClassification.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFXLMForSequenceClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_tf_xlm.py#L888",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig"
>XLMConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, )</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Xn=new Oe({props:{$$slots:{default:[FT]},$$scope:{ctx:j}}}),En=new He({props:{anchor:"transformers.TFXLMForSequenceClassification.call.example",$$slots:{default:[XT]},$$scope:{ctx:j}}}),xn=new He({props:{anchor:"transformers.TFXLMForSequenceClassification.call.example-2",$$slots:{default:[ET]},$$scope:{ctx:j}}}),xa=new Pe({}),ja=new ae({props:{name:"class transformers.TFXLMForMultipleChoice",anchor:"transformers.TFXLMForMultipleChoice",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFXLMForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_tf_xlm.py#L958"}}),Cn=new Oe({props:{$$slots:{default:[xT]},$$scope:{ctx:j}}}),Ua=new ae({props:{name:"call",anchor:"transformers.TFXLMForMultipleChoice.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"langs",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"lengths",val:": np.ndarray | tf.Tensor | None = None"},{name:"cache",val:": Optional[Dict[str, tf.Tensor]] = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFXLMForMultipleChoice.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFXLMForMultipleChoice.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMForMultipleChoice.call.langs",description:`<strong>langs</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.TFXLMForMultipleChoice.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMForMultipleChoice.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMForMultipleChoice.call.lengths",description:`<strong>lengths</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.TFXLMForMultipleChoice.call.cache",description:`<strong>cache</strong> (<code>Dict[str, tf.Tensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.TFXLMForMultipleChoice.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMForMultipleChoice.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</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.TFXLMForMultipleChoice.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFXLMForMultipleChoice.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFXLMForMultipleChoice.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFXLMForMultipleChoice.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_tf_xlm.py#L987",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput"
>transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig"
>XLMConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <em>(batch_size, )</em>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_choices)</code>) \u2014 <em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput"
>transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),zn=new Oe({props:{$$slots:{default:[jT]},$$scope:{ctx:j}}}),Jn=new He({props:{anchor:"transformers.TFXLMForMultipleChoice.call.example",$$slots:{default:[CT]},$$scope:{ctx:j}}}),Ia=new Pe({}),Wa=new ae({props:{name:"class transformers.TFXLMForTokenClassification",anchor:"transformers.TFXLMForTokenClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFXLMForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_tf_xlm.py#L1077"}}),In=new Oe({props:{$$slots:{default:[zT]},$$scope:{ctx:j}}}),Za=new ae({props:{name:"call",anchor:"transformers.TFXLMForTokenClassification.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"langs",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"lengths",val:": np.ndarray | tf.Tensor | None = None"},{name:"cache",val:": Optional[Dict[str, tf.Tensor]] = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFXLMForTokenClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFXLMForTokenClassification.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMForTokenClassification.call.langs",description:`<strong>langs</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.TFXLMForTokenClassification.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMForTokenClassification.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMForTokenClassification.call.lengths",description:`<strong>lengths</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.TFXLMForTokenClassification.call.cache",description:`<strong>cache</strong> (<code>Dict[str, tf.Tensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.TFXLMForTokenClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMForTokenClassification.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</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.TFXLMForTokenClassification.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFXLMForTokenClassification.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFXLMForTokenClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFXLMForTokenClassification.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFXLMForTokenClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_tf_xlm.py#L1088",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFTokenClassifierOutput"
>transformers.modeling_tf_outputs.TFTokenClassifierOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig"
>XLMConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of unmasked labels, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFTokenClassifierOutput"
>transformers.modeling_tf_outputs.TFTokenClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Wn=new Oe({props:{$$slots:{default:[JT]},$$scope:{ctx:j}}}),Nn=new He({props:{anchor:"transformers.TFXLMForTokenClassification.call.example",$$slots:{default:[UT]},$$scope:{ctx:j}}}),qn=new He({props:{anchor:"transformers.TFXLMForTokenClassification.call.example-2",$$slots:{default:[IT]},$$scope:{ctx:j}}}),Sa=new Pe({}),Ba=new ae({props:{name:"class transformers.TFXLMForQuestionAnsweringSimple",anchor:"transformers.TFXLMForQuestionAnsweringSimple",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFXLMForQuestionAnsweringSimple.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig">XLMConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_tf_xlm.py#L1157"}}),Zn=new Oe({props:{$$slots:{default:[WT]},$$scope:{ctx:j}}}),Qa=new ae({props:{name:"call",anchor:"transformers.TFXLMForQuestionAnsweringSimple.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"langs",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"lengths",val:": np.ndarray | tf.Tensor | None = None"},{name:"cache",val:": Optional[Dict[str, tf.Tensor]] = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"start_positions",val:": np.ndarray | tf.Tensor | None = None"},{name:"end_positions",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFXLMForQuestionAnsweringSimple.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFXLMForQuestionAnsweringSimple.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMForQuestionAnsweringSimple.call.langs",description:`<strong>langs</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
languages ids which can be obtained from the language names by using two conversion mappings provided in
the configuration of the model (only provided for multilingual models). More precisely, the <em>language name
to language id</em> mapping is in <code>model.config.lang2id</code> (which is a dictionary string to int) and the
<em>language id to language name</em> mapping is in <code>model.config.id2lang</code> (dictionary int to string).</p>
<p>See usage examples detailed in the <a href="../multilingual">multilingual documentation</a>.`,name:"langs"},{anchor:"transformers.TFXLMForQuestionAnsweringSimple.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMForQuestionAnsweringSimple.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMForQuestionAnsweringSimple.call.lengths",description:`<strong>lengths</strong> (<code>tf.Tensor</code> or <code>Numpy array</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Length of each sentence that can be used to avoid performing attention on padding token indices. You can
also use <em>attention_mask</em> for the same result (see above), kept here for compatibility. Indices selected in
<code>[0, ..., input_ids.size(-1)]</code>.`,name:"lengths"},{anchor:"transformers.TFXLMForQuestionAnsweringSimple.call.cache",description:`<strong>cache</strong> (<code>Dict[str, tf.Tensor]</code>, <em>optional</em>) &#x2014;
Dictionary string to <code>torch.FloatTensor</code> that contains precomputed hidden states (key and values in the
attention blocks) as computed by the model (see <code>cache</code> output below). Can be used to speed up sequential
decoding.</p>
<p>The dictionary object will be modified in-place during the forward pass to add newly computed
hidden-states.`,name:"cache"},{anchor:"transformers.TFXLMForQuestionAnsweringSimple.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</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.TFXLMForQuestionAnsweringSimple.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</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.TFXLMForQuestionAnsweringSimple.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFXLMForQuestionAnsweringSimple.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFXLMForQuestionAnsweringSimple.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFXLMForQuestionAnsweringSimple.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFXLMForQuestionAnsweringSimple.call.start_positions",description:`<strong>start_positions</strong> (<code>tf.Tensor</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.TFXLMForQuestionAnsweringSimple.call.end_positions",description:`<strong>end_positions</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/xlm/modeling_tf_xlm.py#L1165",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput"
>transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMConfig"
>XLMConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, )</code>, <em>optional</em>, returned when <code>start_positions</code> and <code>end_positions</code> are provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput"
>transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Sn=new Oe({props:{$$slots:{default:[NT]},$$scope:{ctx:j}}}),Bn=new He({props:{anchor:"transformers.TFXLMForQuestionAnsweringSimple.call.example",$$slots:{default:[qT]},$$scope:{ctx:j}}}),Gn=new He({props:{anchor:"transformers.TFXLMForQuestionAnsweringSimple.call.example-2",$$slots:{default:[AT]},$$scope:{ctx:j}}}),{c(){d=a("meta"),b=p(),m=a("h1"),u=a("a"),y=a("span"),T(l.$$.fragment),c=p(),x=a("span"),Me=o("XLM"),fe=p(),W=a("div"),de=a("a"),Y=a("img"),ye=p(),Z=a("a"),ce=a("img"),Q=p(),ne=a("h2"),re=a("a"),B=a("span"),T(ie.$$.fragment),be=p(),G=a("span"),Te=o("Overview"),ge=p(),A=a("p"),ve=o("The XLM model was proposed in "),le=a("a"),se=o("Cross-lingual Language Model Pretraining"),C=o(` by
Guillaume Lample, Alexis Conneau. It\u2019s a transformer pretrained using one of the following objectives:`),U=p(),te=a("ul"),R=a("li"),we=o("a causal language modeling (CLM) objective (next token prediction),"),ke=p(),V=a("li"),$e=o("a masked language modeling (MLM) objective (BERT-like), or"),Le=p(),J=a("li"),Fe=o("a Translation Language Modeling (TLM) object (extension of BERT\u2019s MLM to multiple language inputs)"),D=p(),pe=a("p"),Xe=o("The abstract from the paper is the following:"),O=p(),he=a("p"),me=a("em"),N=o(`Recent studies have demonstrated the efficiency of generative pretraining for English natural language understanding.
In this work, we extend this approach to multiple languages and show the effectiveness of cross-lingual pretraining. We
propose two methods to learn cross-lingual language models (XLMs): one unsupervised that only relies on monolingual
data, and one supervised that leverages parallel data with a new cross-lingual language model objective. We obtain
state-of-the-art results on cross-lingual classification, unsupervised and supervised machine translation. On XNLI, our
approach pushes the state of the art by an absolute gain of 4.9% accuracy. On unsupervised machine translation, we
obtain 34.3 BLEU on WMT\u201916 German-English, improving the previous state of the art by more than 9 BLEU. On supervised
machine translation, we obtain a new state of the art of 38.5 BLEU on WMT\u201916 Romanian-English, outperforming the
previous best approach by more than 4 BLEU. Our code and pretrained models will be made publicly available.`),_e=p(),S=a("p"),Ee=o("Tips:"),oe=p(),z=a("ul"),ue=a("li"),I=a("p"),xe=o(`XLM has many different checkpoints, which were trained using different objectives: CLM, MLM or TLM. Make sure to
select the correct objective for your task (e.g. MLM checkpoints are not suitable for generation).`),je=p(),_=a("li"),X=a("p"),qe=o("XLM has multilingual checkpoints which leverage a specific "),K=a("code"),Ae=o("lang"),Ze=o(" parameter. Check out the "),E=a("a"),Se=o("multi-lingual"),Be=o(" page for more information."),Ge=p(),Ue=a("li"),Ie=a("p"),q=o("A transformer model trained on several languages. There are three different type of training for this model and the library provides checkpoints for all of them:"),P=p(),Ce=a("ul"),We=a("li"),H=o("Causal language modeling (CLM) which is the traditional autoregressive training (so this model could be in the previous section as well). One of the languages is selected for each training sample, and the model input is a sentence of 256 tokens, that may span over several documents in one of those languages."),Re=p(),Ne=a("li"),ze=o("Masked language modeling (MLM) which is like RoBERTa. One of the languages is selected for each training sample, and the model input is a sentence of 256 tokens, that may span over several documents in one of those languages, with dynamic masking of the tokens."),Ve=p(),ee=a("li"),Qe=o("A combination of MLM and translation language modeling (TLM). This consists of concatenating a sentence in two different languages, with random masking. To predict one of the masked tokens, the model can use both, the surrounding context in language 1 and the context given by language 2."),cd=p(),Zt=a("p"),Sc=o("This model was contributed by "),ss=a("a"),Bc=o("thomwolf"),Gc=o(". The original code can be found "),as=a("a"),Rc=o("here"),Vc=o("."),pd=p(),eo=a("h2"),So=a("a"),ai=a("span"),T(rs.$$.fragment),Qc=p(),ri=a("span"),Dc=o("Documentation resources"),hd=p(),rt=a("ul"),ii=a("li"),er=a("a"),Oc=o("Text classification task guide"),Pc=p(),li=a("li"),tr=a("a"),Hc=o("Token classification task guide"),Yc=p(),di=a("li"),or=a("a"),Kc=o("Question answering task guide"),ep=p(),ci=a("li"),nr=a("a"),tp=o("Causal language modeling task guide"),op=p(),pi=a("li"),sr=a("a"),np=o("Masked language modeling task guide"),sp=p(),hi=a("li"),ar=a("a"),ap=o("Multiple choice task guide"),md=p(),to=a("h2"),Bo=a("a"),mi=a("span"),T(is.$$.fragment),rp=p(),ui=a("span"),ip=o("XLMConfig"),ud=p(),bt=a("div"),T(ls.$$.fragment),lp=p(),qt=a("p"),dp=o("This is the configuration class to store the configuration of a "),rr=a("a"),cp=o("XLMModel"),pp=o(" or a "),ir=a("a"),hp=o("TFXLMModel"),mp=o(`. It is used to
instantiate a XLM 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
`),ds=a("a"),up=o("xlm-mlm-en-2048"),fp=o(" architecture."),gp=p(),oo=a("p"),_p=o("Configuration objects inherit from "),lr=a("a"),Mp=o("PretrainedConfig"),yp=o(` and can be used to control the model outputs. Read the
documentation from `),dr=a("a"),bp=o("PretrainedConfig"),Tp=o(" for more information."),vp=p(),T(Go.$$.fragment),fd=p(),no=a("h2"),Ro=a("a"),fi=a("span"),T(cs.$$.fragment),wp=p(),gi=a("span"),kp=o("XLMTokenizer"),gd=p(),De=a("div"),T(ps.$$.fragment),$p=p(),_i=a("p"),Lp=o("Construct an XLM tokenizer. Based on Byte-Pair Encoding. The tokenization process is the following:"),Fp=p(),lt=a("ul"),Mi=a("li"),Xp=o("Moses preprocessing and tokenization for most supported languages."),Ep=p(),yi=a("li"),xp=o("Language specific tokenization for Chinese (Jieba), Japanese (KyTea) and Thai (PyThaiNLP)."),jp=p(),bi=a("li"),Cp=o("Optionally lowercases and normalizes all inputs text."),zp=p(),At=a("li"),Jp=o("The arguments "),Ti=a("code"),Up=o("special_tokens"),Ip=o(" and the function "),vi=a("code"),Wp=o("set_special_tokens"),Np=o(`, can be used to add additional symbols (like
\u201D`),wi=a("strong"),qp=o("classify"),Ap=o("\u201D) to a vocabulary."),Zp=p(),hs=a("li"),Sp=o("The "),ki=a("code"),Bp=o("lang2id"),Gp=o(` attribute maps the languages supported by the model with their IDs if provided (automatically set
for pretrained vocabularies).`),Rp=p(),ms=a("li"),Vp=o("The "),$i=a("code"),Qp=o("id2lang"),Dp=o(" attributes does reverse mapping if provided (automatically set for pretrained vocabularies)."),Op=p(),us=a("p"),Pp=o("This tokenizer inherits from "),cr=a("a"),Hp=o("PreTrainedTokenizer"),Yp=o(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Kp=p(),St=a("div"),T(fs.$$.fragment),eh=p(),Li=a("p"),th=o(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An XLM sequence has the following format:`),oh=p(),gs=a("ul"),pr=a("li"),nh=o("single sequence: "),Fi=a("code"),sh=o("<s> X </s>"),ah=p(),hr=a("li"),rh=o("pair of sequences: "),Xi=a("code"),ih=o("<s> A </s> B </s>"),lh=p(),Vo=a("div"),T(_s.$$.fragment),dh=p(),Ms=a("p"),ch=o(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Ei=a("code"),ph=o("prepare_for_model"),hh=o(" method."),mh=p(),Tt=a("div"),T(ys.$$.fragment),uh=p(),xi=a("p"),fh=o("Create a mask from the two sequences passed to be used in a sequence-pair classification task. An XLM sequence"),gh=p(),T(Qo.$$.fragment),_h=p(),so=a("p"),Mh=o("If "),ji=a("code"),yh=o("token_ids_1"),bh=o(" is "),Ci=a("code"),Th=o("None"),vh=o(", this method only returns the first portion of the mask (0s)."),wh=p(),mr=a("div"),T(bs.$$.fragment),_d=p(),ao=a("h2"),Do=a("a"),zi=a("span"),T(Ts.$$.fragment),kh=p(),Ji=a("span"),$h=o("XLM specific outputs"),Md=p(),ro=a("div"),T(vs.$$.fragment),Lh=p(),ws=a("p"),Fh=o("Base class for outputs of question answering models using a "),Ui=a("code"),Xh=o("SquadHead"),Eh=o("."),yd=p(),io=a("h2"),Oo=a("a"),Ii=a("span"),T(ks.$$.fragment),xh=p(),Wi=a("span"),jh=o("XLMModel"),bd=p(),dt=a("div"),T($s.$$.fragment),Ch=p(),Ni=a("p"),zh=o("The bare XLM Model transformer outputting raw hidden-states without any specific head on top."),Jh=p(),Ls=a("p"),Uh=o("This model inherits from "),ur=a("a"),Ih=o("PreTrainedModel"),Wh=o(`. 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.)`),Nh=p(),Fs=a("p"),qh=o("This model is also a PyTorch "),Xs=a("a"),Ah=o("torch.nn.Module"),Zh=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Sh=p(),vt=a("div"),T(Es.$$.fragment),Bh=p(),lo=a("p"),Gh=o("The "),fr=a("a"),Rh=o("XLMModel"),Vh=o(" forward method, overrides the "),qi=a("code"),Qh=o("__call__"),Dh=o(" special method."),Oh=p(),T(Po.$$.fragment),Ph=p(),T(Ho.$$.fragment),Td=p(),co=a("h2"),Yo=a("a"),Ai=a("span"),T(xs.$$.fragment),Hh=p(),Zi=a("span"),Yh=o("XLMWithLMHeadModel"),vd=p(),ct=a("div"),T(js.$$.fragment),Kh=p(),Si=a("p"),em=o(`The XLM Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),tm=p(),Cs=a("p"),om=o("This model inherits from "),gr=a("a"),nm=o("PreTrainedModel"),sm=o(`. 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.)`),am=p(),zs=a("p"),rm=o("This model is also a PyTorch "),Js=a("a"),im=o("torch.nn.Module"),lm=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),dm=p(),wt=a("div"),T(Us.$$.fragment),cm=p(),po=a("p"),pm=o("The "),_r=a("a"),hm=o("XLMWithLMHeadModel"),mm=o(" forward method, overrides the "),Bi=a("code"),um=o("__call__"),fm=o(" special method."),gm=p(),T(Ko.$$.fragment),_m=p(),T(en.$$.fragment),wd=p(),ho=a("h2"),tn=a("a"),Gi=a("span"),T(Is.$$.fragment),Mm=p(),Ri=a("span"),ym=o("XLMForSequenceClassification"),kd=p(),pt=a("div"),T(Ws.$$.fragment),bm=p(),Vi=a("p"),Tm=o(`XLM Model with a sequence classification/regression head on top (a linear layer on top of the pooled output) e.g.
for GLUE tasks.`),vm=p(),Ns=a("p"),wm=o("This model inherits from "),Mr=a("a"),km=o("PreTrainedModel"),$m=o(`. 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.)`),Lm=p(),qs=a("p"),Fm=o("This model is also a PyTorch "),As=a("a"),Xm=o("torch.nn.Module"),Em=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),xm=p(),gt=a("div"),T(Zs.$$.fragment),jm=p(),mo=a("p"),Cm=o("The "),yr=a("a"),zm=o("XLMForSequenceClassification"),Jm=o(" forward method, overrides the "),Qi=a("code"),Um=o("__call__"),Im=o(" special method."),Wm=p(),T(on.$$.fragment),Nm=p(),T(nn.$$.fragment),qm=p(),T(sn.$$.fragment),$d=p(),uo=a("h2"),an=a("a"),Di=a("span"),T(Ss.$$.fragment),Am=p(),Oi=a("span"),Zm=o("XLMForMultipleChoice"),Ld=p(),ht=a("div"),T(Bs.$$.fragment),Sm=p(),Pi=a("p"),Bm=o(`XLM 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.`),Gm=p(),Gs=a("p"),Rm=o("This model inherits from "),br=a("a"),Vm=o("PreTrainedModel"),Qm=o(`. 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.)`),Dm=p(),Rs=a("p"),Om=o("This model is also a PyTorch "),Vs=a("a"),Pm=o("torch.nn.Module"),Hm=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ym=p(),kt=a("div"),T(Qs.$$.fragment),Km=p(),fo=a("p"),eu=o("The "),Tr=a("a"),tu=o("XLMForMultipleChoice"),ou=o(" forward method, overrides the "),Hi=a("code"),nu=o("__call__"),su=o(" special method."),au=p(),T(rn.$$.fragment),ru=p(),T(ln.$$.fragment),Fd=p(),go=a("h2"),dn=a("a"),Yi=a("span"),T(Ds.$$.fragment),iu=p(),Ki=a("span"),lu=o("XLMForTokenClassification"),Xd=p(),mt=a("div"),T(Os.$$.fragment),du=p(),el=a("p"),cu=o(`XLM 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.`),pu=p(),Ps=a("p"),hu=o("This model inherits from "),vr=a("a"),mu=o("PreTrainedModel"),uu=o(`. 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.)`),fu=p(),Hs=a("p"),gu=o("This model is also a PyTorch "),Ys=a("a"),_u=o("torch.nn.Module"),Mu=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),yu=p(),$t=a("div"),T(Ks.$$.fragment),bu=p(),_o=a("p"),Tu=o("The "),wr=a("a"),vu=o("XLMForTokenClassification"),wu=o(" forward method, overrides the "),tl=a("code"),ku=o("__call__"),$u=o(" special method."),Lu=p(),T(cn.$$.fragment),Fu=p(),T(pn.$$.fragment),Ed=p(),Mo=a("h2"),hn=a("a"),ol=a("span"),T(ea.$$.fragment),Xu=p(),nl=a("span"),Eu=o("XLMForQuestionAnsweringSimple"),xd=p(),ut=a("div"),T(ta.$$.fragment),xu=p(),yo=a("p"),ju=o(`XLM 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 `),sl=a("code"),Cu=o("span start logits"),zu=o(" and "),al=a("code"),Ju=o("span end logits"),Uu=o(")."),Iu=p(),oa=a("p"),Wu=o("This model inherits from "),kr=a("a"),Nu=o("PreTrainedModel"),qu=o(`. 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.)`),Au=p(),na=a("p"),Zu=o("This model is also a PyTorch "),sa=a("a"),Su=o("torch.nn.Module"),Bu=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Gu=p(),Lt=a("div"),T(aa.$$.fragment),Ru=p(),bo=a("p"),Vu=o("The "),$r=a("a"),Qu=o("XLMForQuestionAnsweringSimple"),Du=o(" forward method, overrides the "),rl=a("code"),Ou=o("__call__"),Pu=o(" special method."),Hu=p(),T(mn.$$.fragment),Yu=p(),T(un.$$.fragment),jd=p(),To=a("h2"),fn=a("a"),il=a("span"),T(ra.$$.fragment),Ku=p(),ll=a("span"),ef=o("XLMForQuestionAnswering"),Cd=p(),ft=a("div"),T(ia.$$.fragment),tf=p(),vo=a("p"),of=o(`XLM Model with a beam-search span classification head on top for extractive question-answering tasks like SQuAD (a
linear layers on top of the hidden-states output to compute `),dl=a("code"),nf=o("span start logits"),sf=o(" and "),cl=a("code"),af=o("span end logits"),rf=o(")."),lf=p(),la=a("p"),df=o("This model inherits from "),Lr=a("a"),cf=o("PreTrainedModel"),pf=o(`. 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.)`),hf=p(),da=a("p"),mf=o("This model is also a PyTorch "),ca=a("a"),uf=o("torch.nn.Module"),ff=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),gf=p(),Ft=a("div"),T(pa.$$.fragment),_f=p(),wo=a("p"),Mf=o("The "),Fr=a("a"),yf=o("XLMForQuestionAnswering"),bf=o(" forward method, overrides the "),pl=a("code"),Tf=o("__call__"),vf=o(" special method."),wf=p(),T(gn.$$.fragment),kf=p(),T(_n.$$.fragment),zd=p(),ko=a("h2"),Mn=a("a"),hl=a("span"),T(ha.$$.fragment),$f=p(),ml=a("span"),Lf=o("TFXLMModel"),Jd=p(),et=a("div"),T(ma.$$.fragment),Ff=p(),ul=a("p"),Xf=o("The bare XLM Model transformer outputting raw hidden-states without any specific head on top."),Ef=p(),ua=a("p"),xf=o("This model inherits from "),Xr=a("a"),jf=o("TFPreTrainedModel"),Cf=o(`. 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.)`),zf=p(),fa=a("p"),Jf=o("This model is also a "),ga=a("a"),Uf=o("tf.keras.Model"),If=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Wf=p(),T(yn.$$.fragment),Nf=p(),Xt=a("div"),T(_a.$$.fragment),qf=p(),$o=a("p"),Af=o("The "),Er=a("a"),Zf=o("TFXLMModel"),Sf=o(" forward method, overrides the "),fl=a("code"),Bf=o("__call__"),Gf=o(" special method."),Rf=p(),T(bn.$$.fragment),Vf=p(),T(Tn.$$.fragment),Ud=p(),Lo=a("h2"),vn=a("a"),gl=a("span"),T(Ma.$$.fragment),Qf=p(),_l=a("span"),Df=o("TFXLMWithLMHeadModel"),Id=p(),tt=a("div"),T(ya.$$.fragment),Of=p(),Ml=a("p"),Pf=o(`The XLM Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),Hf=p(),ba=a("p"),Yf=o("This model inherits from "),xr=a("a"),Kf=o("TFPreTrainedModel"),eg=o(`. 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.)`),tg=p(),Ta=a("p"),og=o("This model is also a "),va=a("a"),ng=o("tf.keras.Model"),sg=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),ag=p(),T(wn.$$.fragment),rg=p(),Et=a("div"),T(wa.$$.fragment),ig=p(),Fo=a("p"),lg=o("The "),jr=a("a"),dg=o("TFXLMWithLMHeadModel"),cg=o(" forward method, overrides the "),yl=a("code"),pg=o("__call__"),hg=o(" special method."),mg=p(),T(kn.$$.fragment),ug=p(),T($n.$$.fragment),Wd=p(),Xo=a("h2"),Ln=a("a"),bl=a("span"),T(ka.$$.fragment),fg=p(),Tl=a("span"),gg=o("TFXLMForSequenceClassification"),Nd=p(),ot=a("div"),T($a.$$.fragment),_g=p(),vl=a("p"),Mg=o(`XLM Model with a sequence classification/regression head on top (a linear layer on top of the pooled output) e.g.
for GLUE tasks.`),yg=p(),La=a("p"),bg=o("This model inherits from "),Cr=a("a"),Tg=o("TFPreTrainedModel"),vg=o(`. 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.)`),wg=p(),Fa=a("p"),kg=o("This model is also a "),Xa=a("a"),$g=o("tf.keras.Model"),Lg=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Fg=p(),T(Fn.$$.fragment),Xg=p(),_t=a("div"),T(Ea.$$.fragment),Eg=p(),Eo=a("p"),xg=o("The "),zr=a("a"),jg=o("TFXLMForSequenceClassification"),Cg=o(" forward method, overrides the "),wl=a("code"),zg=o("__call__"),Jg=o(" special method."),Ug=p(),T(Xn.$$.fragment),Ig=p(),T(En.$$.fragment),Wg=p(),T(xn.$$.fragment),qd=p(),xo=a("h2"),jn=a("a"),kl=a("span"),T(xa.$$.fragment),Ng=p(),$l=a("span"),qg=o("TFXLMForMultipleChoice"),Ad=p(),nt=a("div"),T(ja.$$.fragment),Ag=p(),Ll=a("p"),Zg=o(`XLM 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.`),Sg=p(),Ca=a("p"),Bg=o("This model inherits from "),Jr=a("a"),Gg=o("TFPreTrainedModel"),Rg=o(`. 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.)`),Vg=p(),za=a("p"),Qg=o("This model is also a "),Ja=a("a"),Dg=o("tf.keras.Model"),Og=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Pg=p(),T(Cn.$$.fragment),Hg=p(),xt=a("div"),T(Ua.$$.fragment),Yg=p(),jo=a("p"),Kg=o("The "),Ur=a("a"),e_=o("TFXLMForMultipleChoice"),t_=o(" forward method, overrides the "),Fl=a("code"),o_=o("__call__"),n_=o(" special method."),s_=p(),T(zn.$$.fragment),a_=p(),T(Jn.$$.fragment),Zd=p(),Co=a("h2"),Un=a("a"),Xl=a("span"),T(Ia.$$.fragment),r_=p(),El=a("span"),i_=o("TFXLMForTokenClassification"),Sd=p(),st=a("div"),T(Wa.$$.fragment),l_=p(),xl=a("p"),d_=o(`XLM 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.`),c_=p(),Na=a("p"),p_=o("This model inherits from "),Ir=a("a"),h_=o("TFPreTrainedModel"),m_=o(`. 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.)`),u_=p(),qa=a("p"),f_=o("This model is also a "),Aa=a("a"),g_=o("tf.keras.Model"),__=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),M_=p(),T(In.$$.fragment),y_=p(),Mt=a("div"),T(Za.$$.fragment),b_=p(),zo=a("p"),T_=o("The "),Wr=a("a"),v_=o("TFXLMForTokenClassification"),w_=o(" forward method, overrides the "),jl=a("code"),k_=o("__call__"),$_=o(" special method."),L_=p(),T(Wn.$$.fragment),F_=p(),T(Nn.$$.fragment),X_=p(),T(qn.$$.fragment),Bd=p(),Jo=a("h2"),An=a("a"),Cl=a("span"),T(Sa.$$.fragment),E_=p(),zl=a("span"),x_=o("TFXLMForQuestionAnsweringSimple"),Gd=p(),at=a("div"),T(Ba.$$.fragment),j_=p(),Uo=a("p"),C_=o(`XLM Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear layer
on top of the hidden-states output to compute `),Jl=a("code"),z_=o("span start logits"),J_=o(" and "),Ul=a("code"),U_=o("span end logits"),I_=o(")."),W_=p(),Ga=a("p"),N_=o("This model inherits from "),Nr=a("a"),q_=o("TFPreTrainedModel"),A_=o(`. 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.)`),Z_=p(),Ra=a("p"),S_=o("This model is also a "),Va=a("a"),B_=o("tf.keras.Model"),G_=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),R_=p(),T(Zn.$$.fragment),V_=p(),yt=a("div"),T(Qa.$$.fragment),Q_=p(),Io=a("p"),D_=o("The "),qr=a("a"),O_=o("TFXLMForQuestionAnsweringSimple"),P_=o(" forward method, overrides the "),Il=a("code"),H_=o("__call__"),Y_=o(" special method."),K_=p(),T(Sn.$$.fragment),eM=p(),T(Bn.$$.fragment),tM=p(),T(Gn.$$.fragment),this.h()},l(s){const M=tT('[data-svelte="svelte-1phssyn"]',document.head);d=r(M,"META",{name:!0,content:!0}),M.forEach(t),b=h(s),m=r(s,"H1",{class:!0});var Da=i(m);u=r(Da,"A",{id:!0,class:!0,href:!0});var Wl=i(u);y=r(Wl,"SPAN",{});var Nl=i(y);v(l.$$.fragment,Nl),Nl.forEach(t),Wl.forEach(t),c=h(Da),x=r(Da,"SPAN",{});var ql=i(x);Me=n(ql,"XLM"),ql.forEach(t),Da.forEach(t),fe=h(s),W=r(s,"DIV",{class:!0});var Oa=i(W);de=r(Oa,"A",{href:!0});var Al=i(de);Y=r(Al,"IMG",{alt:!0,src:!0}),Al.forEach(t),ye=h(Oa),Z=r(Oa,"A",{href:!0});var Zl=i(Z);ce=r(Zl,"IMG",{alt:!0,src:!0}),Zl.forEach(t),Oa.forEach(t),Q=h(s),ne=r(s,"H2",{class:!0});var Pa=i(ne);re=r(Pa,"A",{id:!0,class:!0,href:!0});var Sl=i(re);B=r(Sl,"SPAN",{});var Bl=i(B);v(ie.$$.fragment,Bl),Bl.forEach(t),Sl.forEach(t),be=h(Pa),G=r(Pa,"SPAN",{});var Gl=i(G);Te=n(Gl,"Overview"),Gl.forEach(t),Pa.forEach(t),ge=h(s),A=r(s,"P",{});var Ha=i(A);ve=n(Ha,"The XLM model was proposed in "),le=r(Ha,"A",{href:!0,rel:!0});var Rl=i(le);se=n(Rl,"Cross-lingual Language Model Pretraining"),Rl.forEach(t),C=n(Ha,` by
Guillaume Lample, Alexis Conneau. It\u2019s a transformer pretrained using one of the following objectives:`),Ha.forEach(t),U=h(s),te=r(s,"UL",{});var Wo=i(te);R=r(Wo,"LI",{});var Vl=i(R);we=n(Vl,"a causal language modeling (CLM) objective (next token prediction),"),Vl.forEach(t),ke=h(Wo),V=r(Wo,"LI",{});var Ql=i(V);$e=n(Ql,"a masked language modeling (MLM) objective (BERT-like), or"),Ql.forEach(t),Le=h(Wo),J=r(Wo,"LI",{});var Dl=i(J);Fe=n(Dl,"a Translation Language Modeling (TLM) object (extension of BERT\u2019s MLM to multiple language inputs)"),Dl.forEach(t),Wo.forEach(t),D=h(s),pe=r(s,"P",{});var Ol=i(pe);Xe=n(Ol,"The abstract from the paper is the following:"),Ol.forEach(t),O=h(s),he=r(s,"P",{});var Pl=i(he);me=r(Pl,"EM",{});var Hl=i(me);N=n(Hl,`Recent studies have demonstrated the efficiency of generative pretraining for English natural language understanding.
In this work, we extend this approach to multiple languages and show the effectiveness of cross-lingual pretraining. We
propose two methods to learn cross-lingual language models (XLMs): one unsupervised that only relies on monolingual
data, and one supervised that leverages parallel data with a new cross-lingual language model objective. We obtain
state-of-the-art results on cross-lingual classification, unsupervised and supervised machine translation. On XNLI, our
approach pushes the state of the art by an absolute gain of 4.9% accuracy. On unsupervised machine translation, we
obtain 34.3 BLEU on WMT\u201916 German-English, improving the previous state of the art by more than 9 BLEU. On supervised
machine translation, we obtain a new state of the art of 38.5 BLEU on WMT\u201916 Romanian-English, outperforming the
previous best approach by more than 4 BLEU. Our code and pretrained models will be made publicly available.`),Hl.forEach(t),Pl.forEach(t),_e=h(s),S=r(s,"P",{});var Yl=i(S);Ee=n(Yl,"Tips:"),Yl.forEach(t),oe=h(s),z=r(s,"UL",{});var No=i(z);ue=r(No,"LI",{});var Kl=i(ue);I=r(Kl,"P",{});var ed=i(I);xe=n(ed,`XLM has many different checkpoints, which were trained using different objectives: CLM, MLM or TLM. Make sure to
select the correct objective for your task (e.g. MLM checkpoints are not suitable for generation).`),ed.forEach(t),Kl.forEach(t),je=h(No),_=r(No,"LI",{});var td=i(_);X=r(td,"P",{});var qo=i(X);qe=n(qo,"XLM has multilingual checkpoints which leverage a specific "),K=r(qo,"CODE",{});var od=i(K);Ae=n(od,"lang"),od.forEach(t),Ze=n(qo," parameter. Check out the "),E=r(qo,"A",{href:!0});var nd=i(E);Se=n(nd,"multi-lingual"),nd.forEach(t),Be=n(qo," page for more information."),qo.forEach(t),td.forEach(t),Ge=h(No),Ue=r(No,"LI",{});var Ya=i(Ue);Ie=r(Ya,"P",{});var sd=i(Ie);q=n(sd,"A transformer model trained on several languages. There are three different type of training for this model and the library provides checkpoints for all of them:"),sd.forEach(t),P=h(Ya),Ce=r(Ya,"UL",{});var Ao=i(Ce);We=r(Ao,"LI",{});var ad=i(We);H=n(ad,"Causal language modeling (CLM) which is the traditional autoregressive training (so this model could be in the previous section as well). One of the languages is selected for each training sample, and the model input is a sentence of 256 tokens, that may span over several documents in one of those languages."),ad.forEach(t),Re=h(Ao),Ne=r(Ao,"LI",{});var rd=i(Ne);ze=n(rd,"Masked language modeling (MLM) which is like RoBERTa. One of the languages is selected for each training sample, and the model input is a sentence of 256 tokens, that may span over several documents in one of those languages, with dynamic masking of the tokens."),rd.forEach(t),Ve=h(Ao),ee=r(Ao,"LI",{});var id=i(ee);Qe=n(id,"A combination of MLM and translation language modeling (TLM). This consists of concatenating a sentence in two different languages, with random masking. To predict one of the masked tokens, the model can use both, the surrounding context in language 1 and the context given by language 2."),id.forEach(t),Ao.forEach(t),Ya.forEach(t),No.forEach(t),cd=h(s),Zt=r(s,"P",{});var Zo=i(Zt);Sc=n(Zo,"This model was contributed by "),ss=r(Zo,"A",{href:!0,rel:!0});var ld=i(ss);Bc=n(ld,"thomwolf"),ld.forEach(t),Gc=n(Zo,". The original code can be found "),as=r(Zo,"A",{href:!0,rel:!0});var dd=i(as);Rc=n(dd,"here"),dd.forEach(t),Vc=n(Zo,"."),Zo.forEach(t),pd=h(s),eo=r(s,"H2",{class:!0});var Ka=i(eo);So=r(Ka,"A",{id:!0,class:!0,href:!0});var sM=i(So);ai=r(sM,"SPAN",{});var aM=i(ai);v(rs.$$.fragment,aM),aM.forEach(t),sM.forEach(t),Qc=h(Ka),ri=r(Ka,"SPAN",{});var rM=i(ri);Dc=n(rM,"Documentation resources"),rM.forEach(t),Ka.forEach(t),hd=h(s),rt=r(s,"UL",{});var jt=i(rt);ii=r(jt,"LI",{});var iM=i(ii);er=r(iM,"A",{href:!0});var lM=i(er);Oc=n(lM,"Text classification task guide"),lM.forEach(t),iM.forEach(t),Pc=h(jt),li=r(jt,"LI",{});var dM=i(li);tr=r(dM,"A",{href:!0});var cM=i(tr);Hc=n(cM,"Token classification task guide"),cM.forEach(t),dM.forEach(t),Yc=h(jt),di=r(jt,"LI",{});var pM=i(di);or=r(pM,"A",{href:!0});var hM=i(or);Kc=n(hM,"Question answering task guide"),hM.forEach(t),pM.forEach(t),ep=h(jt),ci=r(jt,"LI",{});var mM=i(ci);nr=r(mM,"A",{href:!0});var uM=i(nr);tp=n(uM,"Causal language modeling task guide"),uM.forEach(t),mM.forEach(t),op=h(jt),pi=r(jt,"LI",{});var fM=i(pi);sr=r(fM,"A",{href:!0});var gM=i(sr);np=n(gM,"Masked language modeling task guide"),gM.forEach(t),fM.forEach(t),sp=h(jt),hi=r(jt,"LI",{});var _M=i(hi);ar=r(_M,"A",{href:!0});var MM=i(ar);ap=n(MM,"Multiple choice task guide"),MM.forEach(t),_M.forEach(t),jt.forEach(t),md=h(s),to=r(s,"H2",{class:!0});var Vd=i(to);Bo=r(Vd,"A",{id:!0,class:!0,href:!0});var yM=i(Bo);mi=r(yM,"SPAN",{});var bM=i(mi);v(is.$$.fragment,bM),bM.forEach(t),yM.forEach(t),rp=h(Vd),ui=r(Vd,"SPAN",{});var TM=i(ui);ip=n(TM,"XLMConfig"),TM.forEach(t),Vd.forEach(t),ud=h(s),bt=r(s,"DIV",{class:!0});var Rn=i(bt);v(ls.$$.fragment,Rn),lp=h(Rn),qt=r(Rn,"P",{});var Vn=i(qt);dp=n(Vn,"This is the configuration class to store the configuration of a "),rr=r(Vn,"A",{href:!0});var vM=i(rr);cp=n(vM,"XLMModel"),vM.forEach(t),pp=n(Vn," or a "),ir=r(Vn,"A",{href:!0});var wM=i(ir);hp=n(wM,"TFXLMModel"),wM.forEach(t),mp=n(Vn,`. It is used to
instantiate a XLM 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
`),ds=r(Vn,"A",{href:!0,rel:!0});var kM=i(ds);up=n(kM,"xlm-mlm-en-2048"),kM.forEach(t),fp=n(Vn," architecture."),Vn.forEach(t),gp=h(Rn),oo=r(Rn,"P",{});var Ar=i(oo);_p=n(Ar,"Configuration objects inherit from "),lr=r(Ar,"A",{href:!0});var $M=i(lr);Mp=n($M,"PretrainedConfig"),$M.forEach(t),yp=n(Ar,` and can be used to control the model outputs. Read the
documentation from `),dr=r(Ar,"A",{href:!0});var LM=i(dr);bp=n(LM,"PretrainedConfig"),LM.forEach(t),Tp=n(Ar," for more information."),Ar.forEach(t),vp=h(Rn),v(Go.$$.fragment,Rn),Rn.forEach(t),fd=h(s),no=r(s,"H2",{class:!0});var Qd=i(no);Ro=r(Qd,"A",{id:!0,class:!0,href:!0});var FM=i(Ro);fi=r(FM,"SPAN",{});var XM=i(fi);v(cs.$$.fragment,XM),XM.forEach(t),FM.forEach(t),wp=h(Qd),gi=r(Qd,"SPAN",{});var EM=i(gi);kp=n(EM,"XLMTokenizer"),EM.forEach(t),Qd.forEach(t),gd=h(s),De=r(s,"DIV",{class:!0});var it=i(De);v(ps.$$.fragment,it),$p=h(it),_i=r(it,"P",{});var xM=i(_i);Lp=n(xM,"Construct an XLM tokenizer. Based on Byte-Pair Encoding. The tokenization process is the following:"),xM.forEach(t),Fp=h(it),lt=r(it,"UL",{});var Ct=i(lt);Mi=r(Ct,"LI",{});var jM=i(Mi);Xp=n(jM,"Moses preprocessing and tokenization for most supported languages."),jM.forEach(t),Ep=h(Ct),yi=r(Ct,"LI",{});var CM=i(yi);xp=n(CM,"Language specific tokenization for Chinese (Jieba), Japanese (KyTea) and Thai (PyThaiNLP)."),CM.forEach(t),jp=h(Ct),bi=r(Ct,"LI",{});var zM=i(bi);Cp=n(zM,"Optionally lowercases and normalizes all inputs text."),zM.forEach(t),zp=h(Ct),At=r(Ct,"LI",{});var Qn=i(At);Jp=n(Qn,"The arguments "),Ti=r(Qn,"CODE",{});var JM=i(Ti);Up=n(JM,"special_tokens"),JM.forEach(t),Ip=n(Qn," and the function "),vi=r(Qn,"CODE",{});var UM=i(vi);Wp=n(UM,"set_special_tokens"),UM.forEach(t),Np=n(Qn,`, can be used to add additional symbols (like
\u201D`),wi=r(Qn,"STRONG",{});var IM=i(wi);qp=n(IM,"classify"),IM.forEach(t),Ap=n(Qn,"\u201D) to a vocabulary."),Qn.forEach(t),Zp=h(Ct),hs=r(Ct,"LI",{});var Dd=i(hs);Sp=n(Dd,"The "),ki=r(Dd,"CODE",{});var WM=i(ki);Bp=n(WM,"lang2id"),WM.forEach(t),Gp=n(Dd,` attribute maps the languages supported by the model with their IDs if provided (automatically set
for pretrained vocabularies).`),Dd.forEach(t),Rp=h(Ct),ms=r(Ct,"LI",{});var Od=i(ms);Vp=n(Od,"The "),$i=r(Od,"CODE",{});var NM=i($i);Qp=n(NM,"id2lang"),NM.forEach(t),Dp=n(Od," attributes does reverse mapping if provided (automatically set for pretrained vocabularies)."),Od.forEach(t),Ct.forEach(t),Op=h(it),us=r(it,"P",{});var Pd=i(us);Pp=n(Pd,"This tokenizer inherits from "),cr=r(Pd,"A",{href:!0});var qM=i(cr);Hp=n(qM,"PreTrainedTokenizer"),qM.forEach(t),Yp=n(Pd,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Pd.forEach(t),Kp=h(it),St=r(it,"DIV",{class:!0});var Zr=i(St);v(fs.$$.fragment,Zr),eh=h(Zr),Li=r(Zr,"P",{});var AM=i(Li);th=n(AM,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An XLM sequence has the following format:`),AM.forEach(t),oh=h(Zr),gs=r(Zr,"UL",{});var Hd=i(gs);pr=r(Hd,"LI",{});var oM=i(pr);nh=n(oM,"single sequence: "),Fi=r(oM,"CODE",{});var ZM=i(Fi);sh=n(ZM,"<s> X </s>"),ZM.forEach(t),oM.forEach(t),ah=h(Hd),hr=r(Hd,"LI",{});var nM=i(hr);rh=n(nM,"pair of sequences: "),Xi=r(nM,"CODE",{});var SM=i(Xi);ih=n(SM,"<s> A </s> B </s>"),SM.forEach(t),nM.forEach(t),Hd.forEach(t),Zr.forEach(t),lh=h(it),Vo=r(it,"DIV",{class:!0});var Yd=i(Vo);v(_s.$$.fragment,Yd),dh=h(Yd),Ms=r(Yd,"P",{});var Kd=i(Ms);ch=n(Kd,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Ei=r(Kd,"CODE",{});var BM=i(Ei);ph=n(BM,"prepare_for_model"),BM.forEach(t),hh=n(Kd," method."),Kd.forEach(t),Yd.forEach(t),mh=h(it),Tt=r(it,"DIV",{class:!0});var Dn=i(Tt);v(ys.$$.fragment,Dn),uh=h(Dn),xi=r(Dn,"P",{});var GM=i(xi);fh=n(GM,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. An XLM sequence"),GM.forEach(t),gh=h(Dn),v(Qo.$$.fragment,Dn),_h=h(Dn),so=r(Dn,"P",{});var Sr=i(so);Mh=n(Sr,"If "),ji=r(Sr,"CODE",{});var RM=i(ji);yh=n(RM,"token_ids_1"),RM.forEach(t),bh=n(Sr," is "),Ci=r(Sr,"CODE",{});var VM=i(Ci);Th=n(VM,"None"),VM.forEach(t),vh=n(Sr,", this method only returns the first portion of the mask (0s)."),Sr.forEach(t),Dn.forEach(t),wh=h(it),mr=r(it,"DIV",{class:!0});var QM=i(mr);v(bs.$$.fragment,QM),QM.forEach(t),it.forEach(t),_d=h(s),ao=r(s,"H2",{class:!0});var ec=i(ao);Do=r(ec,"A",{id:!0,class:!0,href:!0});var DM=i(Do);zi=r(DM,"SPAN",{});var OM=i(zi);v(Ts.$$.fragment,OM),OM.forEach(t),DM.forEach(t),kh=h(ec),Ji=r(ec,"SPAN",{});var PM=i(Ji);$h=n(PM,"XLM specific outputs"),PM.forEach(t),ec.forEach(t),Md=h(s),ro=r(s,"DIV",{class:!0});var tc=i(ro);v(vs.$$.fragment,tc),Lh=h(tc),ws=r(tc,"P",{});var oc=i(ws);Fh=n(oc,"Base class for outputs of question answering models using a "),Ui=r(oc,"CODE",{});var HM=i(Ui);Xh=n(HM,"SquadHead"),HM.forEach(t),Eh=n(oc,"."),oc.forEach(t),tc.forEach(t),yd=h(s),io=r(s,"H2",{class:!0});var nc=i(io);Oo=r(nc,"A",{id:!0,class:!0,href:!0});var YM=i(Oo);Ii=r(YM,"SPAN",{});var KM=i(Ii);v(ks.$$.fragment,KM),KM.forEach(t),YM.forEach(t),xh=h(nc),Wi=r(nc,"SPAN",{});var ey=i(Wi);jh=n(ey,"XLMModel"),ey.forEach(t),nc.forEach(t),bd=h(s),dt=r(s,"DIV",{class:!0});var Bt=i(dt);v($s.$$.fragment,Bt),Ch=h(Bt),Ni=r(Bt,"P",{});var ty=i(Ni);zh=n(ty,"The bare XLM Model transformer outputting raw hidden-states without any specific head on top."),ty.forEach(t),Jh=h(Bt),Ls=r(Bt,"P",{});var sc=i(Ls);Uh=n(sc,"This model inherits from "),ur=r(sc,"A",{href:!0});var oy=i(ur);Ih=n(oy,"PreTrainedModel"),oy.forEach(t),Wh=n(sc,`. 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.)`),sc.forEach(t),Nh=h(Bt),Fs=r(Bt,"P",{});var ac=i(Fs);qh=n(ac,"This model is also a PyTorch "),Xs=r(ac,"A",{href:!0,rel:!0});var ny=i(Xs);Ah=n(ny,"torch.nn.Module"),ny.forEach(t),Zh=n(ac,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ac.forEach(t),Sh=h(Bt),vt=r(Bt,"DIV",{class:!0});var On=i(vt);v(Es.$$.fragment,On),Bh=h(On),lo=r(On,"P",{});var Br=i(lo);Gh=n(Br,"The "),fr=r(Br,"A",{href:!0});var sy=i(fr);Rh=n(sy,"XLMModel"),sy.forEach(t),Vh=n(Br," forward method, overrides the "),qi=r(Br,"CODE",{});var ay=i(qi);Qh=n(ay,"__call__"),ay.forEach(t),Dh=n(Br," special method."),Br.forEach(t),Oh=h(On),v(Po.$$.fragment,On),Ph=h(On),v(Ho.$$.fragment,On),On.forEach(t),Bt.forEach(t),Td=h(s),co=r(s,"H2",{class:!0});var rc=i(co);Yo=r(rc,"A",{id:!0,class:!0,href:!0});var ry=i(Yo);Ai=r(ry,"SPAN",{});var iy=i(Ai);v(xs.$$.fragment,iy),iy.forEach(t),ry.forEach(t),Hh=h(rc),Zi=r(rc,"SPAN",{});var ly=i(Zi);Yh=n(ly,"XLMWithLMHeadModel"),ly.forEach(t),rc.forEach(t),vd=h(s),ct=r(s,"DIV",{class:!0});var Gt=i(ct);v(js.$$.fragment,Gt),Kh=h(Gt),Si=r(Gt,"P",{});var dy=i(Si);em=n(dy,`The XLM Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),dy.forEach(t),tm=h(Gt),Cs=r(Gt,"P",{});var ic=i(Cs);om=n(ic,"This model inherits from "),gr=r(ic,"A",{href:!0});var cy=i(gr);nm=n(cy,"PreTrainedModel"),cy.forEach(t),sm=n(ic,`. 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.)`),ic.forEach(t),am=h(Gt),zs=r(Gt,"P",{});var lc=i(zs);rm=n(lc,"This model is also a PyTorch "),Js=r(lc,"A",{href:!0,rel:!0});var py=i(Js);im=n(py,"torch.nn.Module"),py.forEach(t),lm=n(lc,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),lc.forEach(t),dm=h(Gt),wt=r(Gt,"DIV",{class:!0});var Pn=i(wt);v(Us.$$.fragment,Pn),cm=h(Pn),po=r(Pn,"P",{});var Gr=i(po);pm=n(Gr,"The "),_r=r(Gr,"A",{href:!0});var hy=i(_r);hm=n(hy,"XLMWithLMHeadModel"),hy.forEach(t),mm=n(Gr," forward method, overrides the "),Bi=r(Gr,"CODE",{});var my=i(Bi);um=n(my,"__call__"),my.forEach(t),fm=n(Gr," special method."),Gr.forEach(t),gm=h(Pn),v(Ko.$$.fragment,Pn),_m=h(Pn),v(en.$$.fragment,Pn),Pn.forEach(t),Gt.forEach(t),wd=h(s),ho=r(s,"H2",{class:!0});var dc=i(ho);tn=r(dc,"A",{id:!0,class:!0,href:!0});var uy=i(tn);Gi=r(uy,"SPAN",{});var fy=i(Gi);v(Is.$$.fragment,fy),fy.forEach(t),uy.forEach(t),Mm=h(dc),Ri=r(dc,"SPAN",{});var gy=i(Ri);ym=n(gy,"XLMForSequenceClassification"),gy.forEach(t),dc.forEach(t),kd=h(s),pt=r(s,"DIV",{class:!0});var Rt=i(pt);v(Ws.$$.fragment,Rt),bm=h(Rt),Vi=r(Rt,"P",{});var _y=i(Vi);Tm=n(_y,`XLM Model with a sequence classification/regression head on top (a linear layer on top of the pooled output) e.g.
for GLUE tasks.`),_y.forEach(t),vm=h(Rt),Ns=r(Rt,"P",{});var cc=i(Ns);wm=n(cc,"This model inherits from "),Mr=r(cc,"A",{href:!0});var My=i(Mr);km=n(My,"PreTrainedModel"),My.forEach(t),$m=n(cc,`. 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.)`),cc.forEach(t),Lm=h(Rt),qs=r(Rt,"P",{});var pc=i(qs);Fm=n(pc,"This model is also a PyTorch "),As=r(pc,"A",{href:!0,rel:!0});var yy=i(As);Xm=n(yy,"torch.nn.Module"),yy.forEach(t),Em=n(pc,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),pc.forEach(t),xm=h(Rt),gt=r(Rt,"DIV",{class:!0});var Vt=i(gt);v(Zs.$$.fragment,Vt),jm=h(Vt),mo=r(Vt,"P",{});var Rr=i(mo);Cm=n(Rr,"The "),yr=r(Rr,"A",{href:!0});var by=i(yr);zm=n(by,"XLMForSequenceClassification"),by.forEach(t),Jm=n(Rr," forward method, overrides the "),Qi=r(Rr,"CODE",{});var Ty=i(Qi);Um=n(Ty,"__call__"),Ty.forEach(t),Im=n(Rr," special method."),Rr.forEach(t),Wm=h(Vt),v(on.$$.fragment,Vt),Nm=h(Vt),v(nn.$$.fragment,Vt),qm=h(Vt),v(sn.$$.fragment,Vt),Vt.forEach(t),Rt.forEach(t),$d=h(s),uo=r(s,"H2",{class:!0});var hc=i(uo);an=r(hc,"A",{id:!0,class:!0,href:!0});var vy=i(an);Di=r(vy,"SPAN",{});var wy=i(Di);v(Ss.$$.fragment,wy),wy.forEach(t),vy.forEach(t),Am=h(hc),Oi=r(hc,"SPAN",{});var ky=i(Oi);Zm=n(ky,"XLMForMultipleChoice"),ky.forEach(t),hc.forEach(t),Ld=h(s),ht=r(s,"DIV",{class:!0});var Qt=i(ht);v(Bs.$$.fragment,Qt),Sm=h(Qt),Pi=r(Qt,"P",{});var $y=i(Pi);Bm=n($y,`XLM 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.`),$y.forEach(t),Gm=h(Qt),Gs=r(Qt,"P",{});var mc=i(Gs);Rm=n(mc,"This model inherits from "),br=r(mc,"A",{href:!0});var Ly=i(br);Vm=n(Ly,"PreTrainedModel"),Ly.forEach(t),Qm=n(mc,`. 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.)`),mc.forEach(t),Dm=h(Qt),Rs=r(Qt,"P",{});var uc=i(Rs);Om=n(uc,"This model is also a PyTorch "),Vs=r(uc,"A",{href:!0,rel:!0});var Fy=i(Vs);Pm=n(Fy,"torch.nn.Module"),Fy.forEach(t),Hm=n(uc,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),uc.forEach(t),Ym=h(Qt),kt=r(Qt,"DIV",{class:!0});var Hn=i(kt);v(Qs.$$.fragment,Hn),Km=h(Hn),fo=r(Hn,"P",{});var Vr=i(fo);eu=n(Vr,"The "),Tr=r(Vr,"A",{href:!0});var Xy=i(Tr);tu=n(Xy,"XLMForMultipleChoice"),Xy.forEach(t),ou=n(Vr," forward method, overrides the "),Hi=r(Vr,"CODE",{});var Ey=i(Hi);nu=n(Ey,"__call__"),Ey.forEach(t),su=n(Vr," special method."),Vr.forEach(t),au=h(Hn),v(rn.$$.fragment,Hn),ru=h(Hn),v(ln.$$.fragment,Hn),Hn.forEach(t),Qt.forEach(t),Fd=h(s),go=r(s,"H2",{class:!0});var fc=i(go);dn=r(fc,"A",{id:!0,class:!0,href:!0});var xy=i(dn);Yi=r(xy,"SPAN",{});var jy=i(Yi);v(Ds.$$.fragment,jy),jy.forEach(t),xy.forEach(t),iu=h(fc),Ki=r(fc,"SPAN",{});var Cy=i(Ki);lu=n(Cy,"XLMForTokenClassification"),Cy.forEach(t),fc.forEach(t),Xd=h(s),mt=r(s,"DIV",{class:!0});var Dt=i(mt);v(Os.$$.fragment,Dt),du=h(Dt),el=r(Dt,"P",{});var zy=i(el);cu=n(zy,`XLM 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.`),zy.forEach(t),pu=h(Dt),Ps=r(Dt,"P",{});var gc=i(Ps);hu=n(gc,"This model inherits from "),vr=r(gc,"A",{href:!0});var Jy=i(vr);mu=n(Jy,"PreTrainedModel"),Jy.forEach(t),uu=n(gc,`. 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.)`),gc.forEach(t),fu=h(Dt),Hs=r(Dt,"P",{});var _c=i(Hs);gu=n(_c,"This model is also a PyTorch "),Ys=r(_c,"A",{href:!0,rel:!0});var Uy=i(Ys);_u=n(Uy,"torch.nn.Module"),Uy.forEach(t),Mu=n(_c,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),_c.forEach(t),yu=h(Dt),$t=r(Dt,"DIV",{class:!0});var Yn=i($t);v(Ks.$$.fragment,Yn),bu=h(Yn),_o=r(Yn,"P",{});var Qr=i(_o);Tu=n(Qr,"The "),wr=r(Qr,"A",{href:!0});var Iy=i(wr);vu=n(Iy,"XLMForTokenClassification"),Iy.forEach(t),wu=n(Qr," forward method, overrides the "),tl=r(Qr,"CODE",{});var Wy=i(tl);ku=n(Wy,"__call__"),Wy.forEach(t),$u=n(Qr," special method."),Qr.forEach(t),Lu=h(Yn),v(cn.$$.fragment,Yn),Fu=h(Yn),v(pn.$$.fragment,Yn),Yn.forEach(t),Dt.forEach(t),Ed=h(s),Mo=r(s,"H2",{class:!0});var Mc=i(Mo);hn=r(Mc,"A",{id:!0,class:!0,href:!0});var Ny=i(hn);ol=r(Ny,"SPAN",{});var qy=i(ol);v(ea.$$.fragment,qy),qy.forEach(t),Ny.forEach(t),Xu=h(Mc),nl=r(Mc,"SPAN",{});var Ay=i(nl);Eu=n(Ay,"XLMForQuestionAnsweringSimple"),Ay.forEach(t),Mc.forEach(t),xd=h(s),ut=r(s,"DIV",{class:!0});var Ot=i(ut);v(ta.$$.fragment,Ot),xu=h(Ot),yo=r(Ot,"P",{});var Dr=i(yo);ju=n(Dr,`XLM 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 `),sl=r(Dr,"CODE",{});var Zy=i(sl);Cu=n(Zy,"span start logits"),Zy.forEach(t),zu=n(Dr," and "),al=r(Dr,"CODE",{});var Sy=i(al);Ju=n(Sy,"span end logits"),Sy.forEach(t),Uu=n(Dr,")."),Dr.forEach(t),Iu=h(Ot),oa=r(Ot,"P",{});var yc=i(oa);Wu=n(yc,"This model inherits from "),kr=r(yc,"A",{href:!0});var By=i(kr);Nu=n(By,"PreTrainedModel"),By.forEach(t),qu=n(yc,`. 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.)`),yc.forEach(t),Au=h(Ot),na=r(Ot,"P",{});var bc=i(na);Zu=n(bc,"This model is also a PyTorch "),sa=r(bc,"A",{href:!0,rel:!0});var Gy=i(sa);Su=n(Gy,"torch.nn.Module"),Gy.forEach(t),Bu=n(bc,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),bc.forEach(t),Gu=h(Ot),Lt=r(Ot,"DIV",{class:!0});var Kn=i(Lt);v(aa.$$.fragment,Kn),Ru=h(Kn),bo=r(Kn,"P",{});var Or=i(bo);Vu=n(Or,"The "),$r=r(Or,"A",{href:!0});var Ry=i($r);Qu=n(Ry,"XLMForQuestionAnsweringSimple"),Ry.forEach(t),Du=n(Or," forward method, overrides the "),rl=r(Or,"CODE",{});var Vy=i(rl);Ou=n(Vy,"__call__"),Vy.forEach(t),Pu=n(Or," special method."),Or.forEach(t),Hu=h(Kn),v(mn.$$.fragment,Kn),Yu=h(Kn),v(un.$$.fragment,Kn),Kn.forEach(t),Ot.forEach(t),jd=h(s),To=r(s,"H2",{class:!0});var Tc=i(To);fn=r(Tc,"A",{id:!0,class:!0,href:!0});var Qy=i(fn);il=r(Qy,"SPAN",{});var Dy=i(il);v(ra.$$.fragment,Dy),Dy.forEach(t),Qy.forEach(t),Ku=h(Tc),ll=r(Tc,"SPAN",{});var Oy=i(ll);ef=n(Oy,"XLMForQuestionAnswering"),Oy.forEach(t),Tc.forEach(t),Cd=h(s),ft=r(s,"DIV",{class:!0});var Pt=i(ft);v(ia.$$.fragment,Pt),tf=h(Pt),vo=r(Pt,"P",{});var Pr=i(vo);of=n(Pr,`XLM Model with a beam-search span classification head on top for extractive question-answering tasks like SQuAD (a
linear layers on top of the hidden-states output to compute `),dl=r(Pr,"CODE",{});var Py=i(dl);nf=n(Py,"span start logits"),Py.forEach(t),sf=n(Pr," and "),cl=r(Pr,"CODE",{});var Hy=i(cl);af=n(Hy,"span end logits"),Hy.forEach(t),rf=n(Pr,")."),Pr.forEach(t),lf=h(Pt),la=r(Pt,"P",{});var vc=i(la);df=n(vc,"This model inherits from "),Lr=r(vc,"A",{href:!0});var Yy=i(Lr);cf=n(Yy,"PreTrainedModel"),Yy.forEach(t),pf=n(vc,`. 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.)`),vc.forEach(t),hf=h(Pt),da=r(Pt,"P",{});var wc=i(da);mf=n(wc,"This model is also a PyTorch "),ca=r(wc,"A",{href:!0,rel:!0});var Ky=i(ca);uf=n(Ky,"torch.nn.Module"),Ky.forEach(t),ff=n(wc,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),wc.forEach(t),gf=h(Pt),Ft=r(Pt,"DIV",{class:!0});var es=i(Ft);v(pa.$$.fragment,es),_f=h(es),wo=r(es,"P",{});var Hr=i(wo);Mf=n(Hr,"The "),Fr=r(Hr,"A",{href:!0});var eb=i(Fr);yf=n(eb,"XLMForQuestionAnswering"),eb.forEach(t),bf=n(Hr," forward method, overrides the "),pl=r(Hr,"CODE",{});var tb=i(pl);Tf=n(tb,"__call__"),tb.forEach(t),vf=n(Hr," special method."),Hr.forEach(t),wf=h(es),v(gn.$$.fragment,es),kf=h(es),v(_n.$$.fragment,es),es.forEach(t),Pt.forEach(t),zd=h(s),ko=r(s,"H2",{class:!0});var kc=i(ko);Mn=r(kc,"A",{id:!0,class:!0,href:!0});var ob=i(Mn);hl=r(ob,"SPAN",{});var nb=i(hl);v(ha.$$.fragment,nb),nb.forEach(t),ob.forEach(t),$f=h(kc),ml=r(kc,"SPAN",{});var sb=i(ml);Lf=n(sb,"TFXLMModel"),sb.forEach(t),kc.forEach(t),Jd=h(s),et=r(s,"DIV",{class:!0});var zt=i(et);v(ma.$$.fragment,zt),Ff=h(zt),ul=r(zt,"P",{});var ab=i(ul);Xf=n(ab,"The bare XLM Model transformer outputting raw hidden-states without any specific head on top."),ab.forEach(t),Ef=h(zt),ua=r(zt,"P",{});var $c=i(ua);xf=n($c,"This model inherits from "),Xr=r($c,"A",{href:!0});var rb=i(Xr);jf=n(rb,"TFPreTrainedModel"),rb.forEach(t),Cf=n($c,`. 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.)`),$c.forEach(t),zf=h(zt),fa=r(zt,"P",{});var Lc=i(fa);Jf=n(Lc,"This model is also a "),ga=r(Lc,"A",{href:!0,rel:!0});var ib=i(ga);Uf=n(ib,"tf.keras.Model"),ib.forEach(t),If=n(Lc,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Lc.forEach(t),Wf=h(zt),v(yn.$$.fragment,zt),Nf=h(zt),Xt=r(zt,"DIV",{class:!0});var ts=i(Xt);v(_a.$$.fragment,ts),qf=h(ts),$o=r(ts,"P",{});var Yr=i($o);Af=n(Yr,"The "),Er=r(Yr,"A",{href:!0});var lb=i(Er);Zf=n(lb,"TFXLMModel"),lb.forEach(t),Sf=n(Yr," forward method, overrides the "),fl=r(Yr,"CODE",{});var db=i(fl);Bf=n(db,"__call__"),db.forEach(t),Gf=n(Yr," special method."),Yr.forEach(t),Rf=h(ts),v(bn.$$.fragment,ts),Vf=h(ts),v(Tn.$$.fragment,ts),ts.forEach(t),zt.forEach(t),Ud=h(s),Lo=r(s,"H2",{class:!0});var Fc=i(Lo);vn=r(Fc,"A",{id:!0,class:!0,href:!0});var cb=i(vn);gl=r(cb,"SPAN",{});var pb=i(gl);v(Ma.$$.fragment,pb),pb.forEach(t),cb.forEach(t),Qf=h(Fc),_l=r(Fc,"SPAN",{});var hb=i(_l);Df=n(hb,"TFXLMWithLMHeadModel"),hb.forEach(t),Fc.forEach(t),Id=h(s),tt=r(s,"DIV",{class:!0});var Jt=i(tt);v(ya.$$.fragment,Jt),Of=h(Jt),Ml=r(Jt,"P",{});var mb=i(Ml);Pf=n(mb,`The XLM Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),mb.forEach(t),Hf=h(Jt),ba=r(Jt,"P",{});var Xc=i(ba);Yf=n(Xc,"This model inherits from "),xr=r(Xc,"A",{href:!0});var ub=i(xr);Kf=n(ub,"TFPreTrainedModel"),ub.forEach(t),eg=n(Xc,`. 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.)`),Xc.forEach(t),tg=h(Jt),Ta=r(Jt,"P",{});var Ec=i(Ta);og=n(Ec,"This model is also a "),va=r(Ec,"A",{href:!0,rel:!0});var fb=i(va);ng=n(fb,"tf.keras.Model"),fb.forEach(t),sg=n(Ec,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Ec.forEach(t),ag=h(Jt),v(wn.$$.fragment,Jt),rg=h(Jt),Et=r(Jt,"DIV",{class:!0});var os=i(Et);v(wa.$$.fragment,os),ig=h(os),Fo=r(os,"P",{});var Kr=i(Fo);lg=n(Kr,"The "),jr=r(Kr,"A",{href:!0});var gb=i(jr);dg=n(gb,"TFXLMWithLMHeadModel"),gb.forEach(t),cg=n(Kr," forward method, overrides the "),yl=r(Kr,"CODE",{});var _b=i(yl);pg=n(_b,"__call__"),_b.forEach(t),hg=n(Kr," special method."),Kr.forEach(t),mg=h(os),v(kn.$$.fragment,os),ug=h(os),v($n.$$.fragment,os),os.forEach(t),Jt.forEach(t),Wd=h(s),Xo=r(s,"H2",{class:!0});var xc=i(Xo);Ln=r(xc,"A",{id:!0,class:!0,href:!0});var Mb=i(Ln);bl=r(Mb,"SPAN",{});var yb=i(bl);v(ka.$$.fragment,yb),yb.forEach(t),Mb.forEach(t),fg=h(xc),Tl=r(xc,"SPAN",{});var bb=i(Tl);gg=n(bb,"TFXLMForSequenceClassification"),bb.forEach(t),xc.forEach(t),Nd=h(s),ot=r(s,"DIV",{class:!0});var Ut=i(ot);v($a.$$.fragment,Ut),_g=h(Ut),vl=r(Ut,"P",{});var Tb=i(vl);Mg=n(Tb,`XLM Model with a sequence classification/regression head on top (a linear layer on top of the pooled output) e.g.
for GLUE tasks.`),Tb.forEach(t),yg=h(Ut),La=r(Ut,"P",{});var jc=i(La);bg=n(jc,"This model inherits from "),Cr=r(jc,"A",{href:!0});var vb=i(Cr);Tg=n(vb,"TFPreTrainedModel"),vb.forEach(t),vg=n(jc,`. 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.)`),jc.forEach(t),wg=h(Ut),Fa=r(Ut,"P",{});var Cc=i(Fa);kg=n(Cc,"This model is also a "),Xa=r(Cc,"A",{href:!0,rel:!0});var wb=i(Xa);$g=n(wb,"tf.keras.Model"),wb.forEach(t),Lg=n(Cc,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Cc.forEach(t),Fg=h(Ut),v(Fn.$$.fragment,Ut),Xg=h(Ut),_t=r(Ut,"DIV",{class:!0});var Ht=i(_t);v(Ea.$$.fragment,Ht),Eg=h(Ht),Eo=r(Ht,"P",{});var ei=i(Eo);xg=n(ei,"The "),zr=r(ei,"A",{href:!0});var kb=i(zr);jg=n(kb,"TFXLMForSequenceClassification"),kb.forEach(t),Cg=n(ei," forward method, overrides the "),wl=r(ei,"CODE",{});var $b=i(wl);zg=n($b,"__call__"),$b.forEach(t),Jg=n(ei," special method."),ei.forEach(t),Ug=h(Ht),v(Xn.$$.fragment,Ht),Ig=h(Ht),v(En.$$.fragment,Ht),Wg=h(Ht),v(xn.$$.fragment,Ht),Ht.forEach(t),Ut.forEach(t),qd=h(s),xo=r(s,"H2",{class:!0});var zc=i(xo);jn=r(zc,"A",{id:!0,class:!0,href:!0});var Lb=i(jn);kl=r(Lb,"SPAN",{});var Fb=i(kl);v(xa.$$.fragment,Fb),Fb.forEach(t),Lb.forEach(t),Ng=h(zc),$l=r(zc,"SPAN",{});var Xb=i($l);qg=n(Xb,"TFXLMForMultipleChoice"),Xb.forEach(t),zc.forEach(t),Ad=h(s),nt=r(s,"DIV",{class:!0});var It=i(nt);v(ja.$$.fragment,It),Ag=h(It),Ll=r(It,"P",{});var Eb=i(Ll);Zg=n(Eb,`XLM 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.`),Eb.forEach(t),Sg=h(It),Ca=r(It,"P",{});var Jc=i(Ca);Bg=n(Jc,"This model inherits from "),Jr=r(Jc,"A",{href:!0});var xb=i(Jr);Gg=n(xb,"TFPreTrainedModel"),xb.forEach(t),Rg=n(Jc,`. 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.)`),Jc.forEach(t),Vg=h(It),za=r(It,"P",{});var Uc=i(za);Qg=n(Uc,"This model is also a "),Ja=r(Uc,"A",{href:!0,rel:!0});var jb=i(Ja);Dg=n(jb,"tf.keras.Model"),jb.forEach(t),Og=n(Uc,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Uc.forEach(t),Pg=h(It),v(Cn.$$.fragment,It),Hg=h(It),xt=r(It,"DIV",{class:!0});var ns=i(xt);v(Ua.$$.fragment,ns),Yg=h(ns),jo=r(ns,"P",{});var ti=i(jo);Kg=n(ti,"The "),Ur=r(ti,"A",{href:!0});var Cb=i(Ur);e_=n(Cb,"TFXLMForMultipleChoice"),Cb.forEach(t),t_=n(ti," forward method, overrides the "),Fl=r(ti,"CODE",{});var zb=i(Fl);o_=n(zb,"__call__"),zb.forEach(t),n_=n(ti," special method."),ti.forEach(t),s_=h(ns),v(zn.$$.fragment,ns),a_=h(ns),v(Jn.$$.fragment,ns),ns.forEach(t),It.forEach(t),Zd=h(s),Co=r(s,"H2",{class:!0});var Ic=i(Co);Un=r(Ic,"A",{id:!0,class:!0,href:!0});var Jb=i(Un);Xl=r(Jb,"SPAN",{});var Ub=i(Xl);v(Ia.$$.fragment,Ub),Ub.forEach(t),Jb.forEach(t),r_=h(Ic),El=r(Ic,"SPAN",{});var Ib=i(El);i_=n(Ib,"TFXLMForTokenClassification"),Ib.forEach(t),Ic.forEach(t),Sd=h(s),st=r(s,"DIV",{class:!0});var Wt=i(st);v(Wa.$$.fragment,Wt),l_=h(Wt),xl=r(Wt,"P",{});var Wb=i(xl);d_=n(Wb,`XLM 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.`),Wb.forEach(t),c_=h(Wt),Na=r(Wt,"P",{});var Wc=i(Na);p_=n(Wc,"This model inherits from "),Ir=r(Wc,"A",{href:!0});var Nb=i(Ir);h_=n(Nb,"TFPreTrainedModel"),Nb.forEach(t),m_=n(Wc,`. 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.)`),Wc.forEach(t),u_=h(Wt),qa=r(Wt,"P",{});var Nc=i(qa);f_=n(Nc,"This model is also a "),Aa=r(Nc,"A",{href:!0,rel:!0});var qb=i(Aa);g_=n(qb,"tf.keras.Model"),qb.forEach(t),__=n(Nc,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Nc.forEach(t),M_=h(Wt),v(In.$$.fragment,Wt),y_=h(Wt),Mt=r(Wt,"DIV",{class:!0});var Yt=i(Mt);v(Za.$$.fragment,Yt),b_=h(Yt),zo=r(Yt,"P",{});var oi=i(zo);T_=n(oi,"The "),Wr=r(oi,"A",{href:!0});var Ab=i(Wr);v_=n(Ab,"TFXLMForTokenClassification"),Ab.forEach(t),w_=n(oi," forward method, overrides the "),jl=r(oi,"CODE",{});var Zb=i(jl);k_=n(Zb,"__call__"),Zb.forEach(t),$_=n(oi," special method."),oi.forEach(t),L_=h(Yt),v(Wn.$$.fragment,Yt),F_=h(Yt),v(Nn.$$.fragment,Yt),X_=h(Yt),v(qn.$$.fragment,Yt),Yt.forEach(t),Wt.forEach(t),Bd=h(s),Jo=r(s,"H2",{class:!0});var qc=i(Jo);An=r(qc,"A",{id:!0,class:!0,href:!0});var Sb=i(An);Cl=r(Sb,"SPAN",{});var Bb=i(Cl);v(Sa.$$.fragment,Bb),Bb.forEach(t),Sb.forEach(t),E_=h(qc),zl=r(qc,"SPAN",{});var Gb=i(zl);x_=n(Gb,"TFXLMForQuestionAnsweringSimple"),Gb.forEach(t),qc.forEach(t),Gd=h(s),at=r(s,"DIV",{class:!0});var Nt=i(at);v(Ba.$$.fragment,Nt),j_=h(Nt),Uo=r(Nt,"P",{});var ni=i(Uo);C_=n(ni,`XLM Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear layer
on top of the hidden-states output to compute `),Jl=r(ni,"CODE",{});var Rb=i(Jl);z_=n(Rb,"span start logits"),Rb.forEach(t),J_=n(ni," and "),Ul=r(ni,"CODE",{});var Vb=i(Ul);U_=n(Vb,"span end logits"),Vb.forEach(t),I_=n(ni,")."),ni.forEach(t),W_=h(Nt),Ga=r(Nt,"P",{});var Ac=i(Ga);N_=n(Ac,"This model inherits from "),Nr=r(Ac,"A",{href:!0});var Qb=i(Nr);q_=n(Qb,"TFPreTrainedModel"),Qb.forEach(t),A_=n(Ac,`. 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.)`),Ac.forEach(t),Z_=h(Nt),Ra=r(Nt,"P",{});var Zc=i(Ra);S_=n(Zc,"This model is also a "),Va=r(Zc,"A",{href:!0,rel:!0});var Db=i(Va);B_=n(Db,"tf.keras.Model"),Db.forEach(t),G_=n(Zc,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Zc.forEach(t),R_=h(Nt),v(Zn.$$.fragment,Nt),V_=h(Nt),yt=r(Nt,"DIV",{class:!0});var Kt=i(yt);v(Qa.$$.fragment,Kt),Q_=h(Kt),Io=r(Kt,"P",{});var si=i(Io);D_=n(si,"The "),qr=r(si,"A",{href:!0});var Ob=i(qr);O_=n(Ob,"TFXLMForQuestionAnsweringSimple"),Ob.forEach(t),P_=n(si," forward method, overrides the "),Il=r(si,"CODE",{});var Pb=i(Il);H_=n(Pb,"__call__"),Pb.forEach(t),Y_=n(si," special method."),si.forEach(t),K_=h(Kt),v(Sn.$$.fragment,Kt),eM=h(Kt),v(Bn.$$.fragment,Kt),tM=h(Kt),v(Gn.$$.fragment,Kt),Kt.forEach(t),Nt.forEach(t),this.h()},h(){f(d,"name","hf:doc:metadata"),f(d,"content",JSON.stringify(ST)),f(u,"id","xlm"),f(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(u,"href","#xlm"),f(m,"class","relative group"),f(Y,"alt","Models"),Hb(Y.src,F="https://img.shields.io/badge/All_model_pages-xlm-blueviolet")||f(Y,"src",F),f(de,"href","https://huggingface.co/models?filter=xlm"),f(ce,"alt","Spaces"),Hb(ce.src,Je="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||f(ce,"src",Je),f(Z,"href","https://huggingface.co/spaces/docs-demos/xlm-mlm-en-2048"),f(W,"class","flex flex-wrap space-x-1"),f(re,"id","overview"),f(re,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(re,"href","#overview"),f(ne,"class","relative group"),f(le,"href","https://arxiv.org/abs/1901.07291"),f(le,"rel","nofollow"),f(E,"href","../multilingual"),f(ss,"href","https://huggingface.co/thomwolf"),f(ss,"rel","nofollow"),f(as,"href","https://github.com/facebookresearch/XLM/"),f(as,"rel","nofollow"),f(So,"id","documentation-resources"),f(So,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(So,"href","#documentation-resources"),f(eo,"class","relative group"),f(er,"href","../tasks/sequence_classification"),f(tr,"href","../tasks/token_classification"),f(or,"href","../tasks/question_answering"),f(nr,"href","../tasks/language_modeling"),f(sr,"href","../tasks/masked_language_modeling"),f(ar,"href","../tasks/multiple_choice"),f(Bo,"id","transformers.XLMConfig"),f(Bo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(Bo,"href","#transformers.XLMConfig"),f(to,"class","relative group"),f(rr,"href","/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMModel"),f(ir,"href","/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.TFXLMModel"),f(ds,"href","https://huggingface.co/xlm-mlm-en-2048"),f(ds,"rel","nofollow"),f(lr,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),f(dr,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),f(bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ro,"id","transformers.XLMTokenizer"),f(Ro,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(Ro,"href","#transformers.XLMTokenizer"),f(no,"class","relative group"),f(cr,"href","/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),f(St,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Vo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(mr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Do,"id","transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput"),f(Do,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(Do,"href","#transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput"),f(ao,"class","relative group"),f(ro,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Oo,"id","transformers.XLMModel"),f(Oo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(Oo,"href","#transformers.XLMModel"),f(io,"class","relative group"),f(ur,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),f(Xs,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(Xs,"rel","nofollow"),f(fr,"href","/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMModel"),f(vt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Yo,"id","transformers.XLMWithLMHeadModel"),f(Yo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(Yo,"href","#transformers.XLMWithLMHeadModel"),f(co,"class","relative group"),f(gr,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),f(Js,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(Js,"rel","nofollow"),f(_r,"href","/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMWithLMHeadModel"),f(wt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(tn,"id","transformers.XLMForSequenceClassification"),f(tn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(tn,"href","#transformers.XLMForSequenceClassification"),f(ho,"class","relative group"),f(Mr,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),f(As,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(As,"rel","nofollow"),f(yr,"href","/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMForSequenceClassification"),f(gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(an,"id","transformers.XLMForMultipleChoice"),f(an,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(an,"href","#transformers.XLMForMultipleChoice"),f(uo,"class","relative group"),f(br,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),f(Vs,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(Vs,"rel","nofollow"),f(Tr,"href","/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMForMultipleChoice"),f(kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(dn,"id","transformers.XLMForTokenClassification"),f(dn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(dn,"href","#transformers.XLMForTokenClassification"),f(go,"class","relative group"),f(vr,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),f(Ys,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(Ys,"rel","nofollow"),f(wr,"href","/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMForTokenClassification"),f($t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(hn,"id","transformers.XLMForQuestionAnsweringSimple"),f(hn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(hn,"href","#transformers.XLMForQuestionAnsweringSimple"),f(Mo,"class","relative group"),f(kr,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),f(sa,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(sa,"rel","nofollow"),f($r,"href","/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMForQuestionAnsweringSimple"),f(Lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(fn,"id","transformers.XLMForQuestionAnswering"),f(fn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(fn,"href","#transformers.XLMForQuestionAnswering"),f(To,"class","relative group"),f(Lr,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),f(ca,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(ca,"rel","nofollow"),f(Fr,"href","/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMForQuestionAnswering"),f(Ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Mn,"id","transformers.TFXLMModel"),f(Mn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(Mn,"href","#transformers.TFXLMModel"),f(ko,"class","relative group"),f(Xr,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel"),f(ga,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(ga,"rel","nofollow"),f(Er,"href","/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.TFXLMModel"),f(Xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(vn,"id","transformers.TFXLMWithLMHeadModel"),f(vn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(vn,"href","#transformers.TFXLMWithLMHeadModel"),f(Lo,"class","relative group"),f(xr,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel"),f(va,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(va,"rel","nofollow"),f(jr,"href","/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.TFXLMWithLMHeadModel"),f(Et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ln,"id","transformers.TFXLMForSequenceClassification"),f(Ln,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(Ln,"href","#transformers.TFXLMForSequenceClassification"),f(Xo,"class","relative group"),f(Cr,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel"),f(Xa,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(Xa,"rel","nofollow"),f(zr,"href","/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.TFXLMForSequenceClassification"),f(_t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(jn,"id","transformers.TFXLMForMultipleChoice"),f(jn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(jn,"href","#transformers.TFXLMForMultipleChoice"),f(xo,"class","relative group"),f(Jr,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel"),f(Ja,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(Ja,"rel","nofollow"),f(Ur,"href","/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.TFXLMForMultipleChoice"),f(xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Un,"id","transformers.TFXLMForTokenClassification"),f(Un,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(Un,"href","#transformers.TFXLMForTokenClassification"),f(Co,"class","relative group"),f(Ir,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel"),f(Aa,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(Aa,"rel","nofollow"),f(Wr,"href","/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.TFXLMForTokenClassification"),f(Mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(An,"id","transformers.TFXLMForQuestionAnsweringSimple"),f(An,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(An,"href","#transformers.TFXLMForQuestionAnsweringSimple"),f(Jo,"class","relative group"),f(Nr,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel"),f(Va,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(Va,"rel","nofollow"),f(qr,"href","/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.TFXLMForQuestionAnsweringSimple"),f(yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(s,M){e(document.head,d),g(s,b,M),g(s,m,M),e(m,u),e(u,y),w(l,y,null),e(m,c),e(m,x),e(x,Me),g(s,fe,M),g(s,W,M),e(W,de),e(de,Y),e(W,ye),e(W,Z),e(Z,ce),g(s,Q,M),g(s,ne,M),e(ne,re),e(re,B),w(ie,B,null),e(ne,be),e(ne,G),e(G,Te),g(s,ge,M),g(s,A,M),e(A,ve),e(A,le),e(le,se),e(A,C),g(s,U,M),g(s,te,M),e(te,R),e(R,we),e(te,ke),e(te,V),e(V,$e),e(te,Le),e(te,J),e(J,Fe),g(s,D,M),g(s,pe,M),e(pe,Xe),g(s,O,M),g(s,he,M),e(he,me),e(me,N),g(s,_e,M),g(s,S,M),e(S,Ee),g(s,oe,M),g(s,z,M),e(z,ue),e(ue,I),e(I,xe),e(z,je),e(z,_),e(_,X),e(X,qe),e(X,K),e(K,Ae),e(X,Ze),e(X,E),e(E,Se),e(X,Be),e(z,Ge),e(z,Ue),e(Ue,Ie),e(Ie,q),e(Ue,P),e(Ue,Ce),e(Ce,We),e(We,H),e(Ce,Re),e(Ce,Ne),e(Ne,ze),e(Ce,Ve),e(Ce,ee),e(ee,Qe),g(s,cd,M),g(s,Zt,M),e(Zt,Sc),e(Zt,ss),e(ss,Bc),e(Zt,Gc),e(Zt,as),e(as,Rc),e(Zt,Vc),g(s,pd,M),g(s,eo,M),e(eo,So),e(So,ai),w(rs,ai,null),e(eo,Qc),e(eo,ri),e(ri,Dc),g(s,hd,M),g(s,rt,M),e(rt,ii),e(ii,er),e(er,Oc),e(rt,Pc),e(rt,li),e(li,tr),e(tr,Hc),e(rt,Yc),e(rt,di),e(di,or),e(or,Kc),e(rt,ep),e(rt,ci),e(ci,nr),e(nr,tp),e(rt,op),e(rt,pi),e(pi,sr),e(sr,np),e(rt,sp),e(rt,hi),e(hi,ar),e(ar,ap),g(s,md,M),g(s,to,M),e(to,Bo),e(Bo,mi),w(is,mi,null),e(to,rp),e(to,ui),e(ui,ip),g(s,ud,M),g(s,bt,M),w(ls,bt,null),e(bt,lp),e(bt,qt),e(qt,dp),e(qt,rr),e(rr,cp),e(qt,pp),e(qt,ir),e(ir,hp),e(qt,mp),e(qt,ds),e(ds,up),e(qt,fp),e(bt,gp),e(bt,oo),e(oo,_p),e(oo,lr),e(lr,Mp),e(oo,yp),e(oo,dr),e(dr,bp),e(oo,Tp),e(bt,vp),w(Go,bt,null),g(s,fd,M),g(s,no,M),e(no,Ro),e(Ro,fi),w(cs,fi,null),e(no,wp),e(no,gi),e(gi,kp),g(s,gd,M),g(s,De,M),w(ps,De,null),e(De,$p),e(De,_i),e(_i,Lp),e(De,Fp),e(De,lt),e(lt,Mi),e(Mi,Xp),e(lt,Ep),e(lt,yi),e(yi,xp),e(lt,jp),e(lt,bi),e(bi,Cp),e(lt,zp),e(lt,At),e(At,Jp),e(At,Ti),e(Ti,Up),e(At,Ip),e(At,vi),e(vi,Wp),e(At,Np),e(At,wi),e(wi,qp),e(At,Ap),e(lt,Zp),e(lt,hs),e(hs,Sp),e(hs,ki),e(ki,Bp),e(hs,Gp),e(lt,Rp),e(lt,ms),e(ms,Vp),e(ms,$i),e($i,Qp),e(ms,Dp),e(De,Op),e(De,us),e(us,Pp),e(us,cr),e(cr,Hp),e(us,Yp),e(De,Kp),e(De,St),w(fs,St,null),e(St,eh),e(St,Li),e(Li,th),e(St,oh),e(St,gs),e(gs,pr),e(pr,nh),e(pr,Fi),e(Fi,sh),e(gs,ah),e(gs,hr),e(hr,rh),e(hr,Xi),e(Xi,ih),e(De,lh),e(De,Vo),w(_s,Vo,null),e(Vo,dh),e(Vo,Ms),e(Ms,ch),e(Ms,Ei),e(Ei,ph),e(Ms,hh),e(De,mh),e(De,Tt),w(ys,Tt,null),e(Tt,uh),e(Tt,xi),e(xi,fh),e(Tt,gh),w(Qo,Tt,null),e(Tt,_h),e(Tt,so),e(so,Mh),e(so,ji),e(ji,yh),e(so,bh),e(so,Ci),e(Ci,Th),e(so,vh),e(De,wh),e(De,mr),w(bs,mr,null),g(s,_d,M),g(s,ao,M),e(ao,Do),e(Do,zi),w(Ts,zi,null),e(ao,kh),e(ao,Ji),e(Ji,$h),g(s,Md,M),g(s,ro,M),w(vs,ro,null),e(ro,Lh),e(ro,ws),e(ws,Fh),e(ws,Ui),e(Ui,Xh),e(ws,Eh),g(s,yd,M),g(s,io,M),e(io,Oo),e(Oo,Ii),w(ks,Ii,null),e(io,xh),e(io,Wi),e(Wi,jh),g(s,bd,M),g(s,dt,M),w($s,dt,null),e(dt,Ch),e(dt,Ni),e(Ni,zh),e(dt,Jh),e(dt,Ls),e(Ls,Uh),e(Ls,ur),e(ur,Ih),e(Ls,Wh),e(dt,Nh),e(dt,Fs),e(Fs,qh),e(Fs,Xs),e(Xs,Ah),e(Fs,Zh),e(dt,Sh),e(dt,vt),w(Es,vt,null),e(vt,Bh),e(vt,lo),e(lo,Gh),e(lo,fr),e(fr,Rh),e(lo,Vh),e(lo,qi),e(qi,Qh),e(lo,Dh),e(vt,Oh),w(Po,vt,null),e(vt,Ph),w(Ho,vt,null),g(s,Td,M),g(s,co,M),e(co,Yo),e(Yo,Ai),w(xs,Ai,null),e(co,Hh),e(co,Zi),e(Zi,Yh),g(s,vd,M),g(s,ct,M),w(js,ct,null),e(ct,Kh),e(ct,Si),e(Si,em),e(ct,tm),e(ct,Cs),e(Cs,om),e(Cs,gr),e(gr,nm),e(Cs,sm),e(ct,am),e(ct,zs),e(zs,rm),e(zs,Js),e(Js,im),e(zs,lm),e(ct,dm),e(ct,wt),w(Us,wt,null),e(wt,cm),e(wt,po),e(po,pm),e(po,_r),e(_r,hm),e(po,mm),e(po,Bi),e(Bi,um),e(po,fm),e(wt,gm),w(Ko,wt,null),e(wt,_m),w(en,wt,null),g(s,wd,M),g(s,ho,M),e(ho,tn),e(tn,Gi),w(Is,Gi,null),e(ho,Mm),e(ho,Ri),e(Ri,ym),g(s,kd,M),g(s,pt,M),w(Ws,pt,null),e(pt,bm),e(pt,Vi),e(Vi,Tm),e(pt,vm),e(pt,Ns),e(Ns,wm),e(Ns,Mr),e(Mr,km),e(Ns,$m),e(pt,Lm),e(pt,qs),e(qs,Fm),e(qs,As),e(As,Xm),e(qs,Em),e(pt,xm),e(pt,gt),w(Zs,gt,null),e(gt,jm),e(gt,mo),e(mo,Cm),e(mo,yr),e(yr,zm),e(mo,Jm),e(mo,Qi),e(Qi,Um),e(mo,Im),e(gt,Wm),w(on,gt,null),e(gt,Nm),w(nn,gt,null),e(gt,qm),w(sn,gt,null),g(s,$d,M),g(s,uo,M),e(uo,an),e(an,Di),w(Ss,Di,null),e(uo,Am),e(uo,Oi),e(Oi,Zm),g(s,Ld,M),g(s,ht,M),w(Bs,ht,null),e(ht,Sm),e(ht,Pi),e(Pi,Bm),e(ht,Gm),e(ht,Gs),e(Gs,Rm),e(Gs,br),e(br,Vm),e(Gs,Qm),e(ht,Dm),e(ht,Rs),e(Rs,Om),e(Rs,Vs),e(Vs,Pm),e(Rs,Hm),e(ht,Ym),e(ht,kt),w(Qs,kt,null),e(kt,Km),e(kt,fo),e(fo,eu),e(fo,Tr),e(Tr,tu),e(fo,ou),e(fo,Hi),e(Hi,nu),e(fo,su),e(kt,au),w(rn,kt,null),e(kt,ru),w(ln,kt,null),g(s,Fd,M),g(s,go,M),e(go,dn),e(dn,Yi),w(Ds,Yi,null),e(go,iu),e(go,Ki),e(Ki,lu),g(s,Xd,M),g(s,mt,M),w(Os,mt,null),e(mt,du),e(mt,el),e(el,cu),e(mt,pu),e(mt,Ps),e(Ps,hu),e(Ps,vr),e(vr,mu),e(Ps,uu),e(mt,fu),e(mt,Hs),e(Hs,gu),e(Hs,Ys),e(Ys,_u),e(Hs,Mu),e(mt,yu),e(mt,$t),w(Ks,$t,null),e($t,bu),e($t,_o),e(_o,Tu),e(_o,wr),e(wr,vu),e(_o,wu),e(_o,tl),e(tl,ku),e(_o,$u),e($t,Lu),w(cn,$t,null),e($t,Fu),w(pn,$t,null),g(s,Ed,M),g(s,Mo,M),e(Mo,hn),e(hn,ol),w(ea,ol,null),e(Mo,Xu),e(Mo,nl),e(nl,Eu),g(s,xd,M),g(s,ut,M),w(ta,ut,null),e(ut,xu),e(ut,yo),e(yo,ju),e(yo,sl),e(sl,Cu),e(yo,zu),e(yo,al),e(al,Ju),e(yo,Uu),e(ut,Iu),e(ut,oa),e(oa,Wu),e(oa,kr),e(kr,Nu),e(oa,qu),e(ut,Au),e(ut,na),e(na,Zu),e(na,sa),e(sa,Su),e(na,Bu),e(ut,Gu),e(ut,Lt),w(aa,Lt,null),e(Lt,Ru),e(Lt,bo),e(bo,Vu),e(bo,$r),e($r,Qu),e(bo,Du),e(bo,rl),e(rl,Ou),e(bo,Pu),e(Lt,Hu),w(mn,Lt,null),e(Lt,Yu),w(un,Lt,null),g(s,jd,M),g(s,To,M),e(To,fn),e(fn,il),w(ra,il,null),e(To,Ku),e(To,ll),e(ll,ef),g(s,Cd,M),g(s,ft,M),w(ia,ft,null),e(ft,tf),e(ft,vo),e(vo,of),e(vo,dl),e(dl,nf),e(vo,sf),e(vo,cl),e(cl,af),e(vo,rf),e(ft,lf),e(ft,la),e(la,df),e(la,Lr),e(Lr,cf),e(la,pf),e(ft,hf),e(ft,da),e(da,mf),e(da,ca),e(ca,uf),e(da,ff),e(ft,gf),e(ft,Ft),w(pa,Ft,null),e(Ft,_f),e(Ft,wo),e(wo,Mf),e(wo,Fr),e(Fr,yf),e(wo,bf),e(wo,pl),e(pl,Tf),e(wo,vf),e(Ft,wf),w(gn,Ft,null),e(Ft,kf),w(_n,Ft,null),g(s,zd,M),g(s,ko,M),e(ko,Mn),e(Mn,hl),w(ha,hl,null),e(ko,$f),e(ko,ml),e(ml,Lf),g(s,Jd,M),g(s,et,M),w(ma,et,null),e(et,Ff),e(et,ul),e(ul,Xf),e(et,Ef),e(et,ua),e(ua,xf),e(ua,Xr),e(Xr,jf),e(ua,Cf),e(et,zf),e(et,fa),e(fa,Jf),e(fa,ga),e(ga,Uf),e(fa,If),e(et,Wf),w(yn,et,null),e(et,Nf),e(et,Xt),w(_a,Xt,null),e(Xt,qf),e(Xt,$o),e($o,Af),e($o,Er),e(Er,Zf),e($o,Sf),e($o,fl),e(fl,Bf),e($o,Gf),e(Xt,Rf),w(bn,Xt,null),e(Xt,Vf),w(Tn,Xt,null),g(s,Ud,M),g(s,Lo,M),e(Lo,vn),e(vn,gl),w(Ma,gl,null),e(Lo,Qf),e(Lo,_l),e(_l,Df),g(s,Id,M),g(s,tt,M),w(ya,tt,null),e(tt,Of),e(tt,Ml),e(Ml,Pf),e(tt,Hf),e(tt,ba),e(ba,Yf),e(ba,xr),e(xr,Kf),e(ba,eg),e(tt,tg),e(tt,Ta),e(Ta,og),e(Ta,va),e(va,ng),e(Ta,sg),e(tt,ag),w(wn,tt,null),e(tt,rg),e(tt,Et),w(wa,Et,null),e(Et,ig),e(Et,Fo),e(Fo,lg),e(Fo,jr),e(jr,dg),e(Fo,cg),e(Fo,yl),e(yl,pg),e(Fo,hg),e(Et,mg),w(kn,Et,null),e(Et,ug),w($n,Et,null),g(s,Wd,M),g(s,Xo,M),e(Xo,Ln),e(Ln,bl),w(ka,bl,null),e(Xo,fg),e(Xo,Tl),e(Tl,gg),g(s,Nd,M),g(s,ot,M),w($a,ot,null),e(ot,_g),e(ot,vl),e(vl,Mg),e(ot,yg),e(ot,La),e(La,bg),e(La,Cr),e(Cr,Tg),e(La,vg),e(ot,wg),e(ot,Fa),e(Fa,kg),e(Fa,Xa),e(Xa,$g),e(Fa,Lg),e(ot,Fg),w(Fn,ot,null),e(ot,Xg),e(ot,_t),w(Ea,_t,null),e(_t,Eg),e(_t,Eo),e(Eo,xg),e(Eo,zr),e(zr,jg),e(Eo,Cg),e(Eo,wl),e(wl,zg),e(Eo,Jg),e(_t,Ug),w(Xn,_t,null),e(_t,Ig),w(En,_t,null),e(_t,Wg),w(xn,_t,null),g(s,qd,M),g(s,xo,M),e(xo,jn),e(jn,kl),w(xa,kl,null),e(xo,Ng),e(xo,$l),e($l,qg),g(s,Ad,M),g(s,nt,M),w(ja,nt,null),e(nt,Ag),e(nt,Ll),e(Ll,Zg),e(nt,Sg),e(nt,Ca),e(Ca,Bg),e(Ca,Jr),e(Jr,Gg),e(Ca,Rg),e(nt,Vg),e(nt,za),e(za,Qg),e(za,Ja),e(Ja,Dg),e(za,Og),e(nt,Pg),w(Cn,nt,null),e(nt,Hg),e(nt,xt),w(Ua,xt,null),e(xt,Yg),e(xt,jo),e(jo,Kg),e(jo,Ur),e(Ur,e_),e(jo,t_),e(jo,Fl),e(Fl,o_),e(jo,n_),e(xt,s_),w(zn,xt,null),e(xt,a_),w(Jn,xt,null),g(s,Zd,M),g(s,Co,M),e(Co,Un),e(Un,Xl),w(Ia,Xl,null),e(Co,r_),e(Co,El),e(El,i_),g(s,Sd,M),g(s,st,M),w(Wa,st,null),e(st,l_),e(st,xl),e(xl,d_),e(st,c_),e(st,Na),e(Na,p_),e(Na,Ir),e(Ir,h_),e(Na,m_),e(st,u_),e(st,qa),e(qa,f_),e(qa,Aa),e(Aa,g_),e(qa,__),e(st,M_),w(In,st,null),e(st,y_),e(st,Mt),w(Za,Mt,null),e(Mt,b_),e(Mt,zo),e(zo,T_),e(zo,Wr),e(Wr,v_),e(zo,w_),e(zo,jl),e(jl,k_),e(zo,$_),e(Mt,L_),w(Wn,Mt,null),e(Mt,F_),w(Nn,Mt,null),e(Mt,X_),w(qn,Mt,null),g(s,Bd,M),g(s,Jo,M),e(Jo,An),e(An,Cl),w(Sa,Cl,null),e(Jo,E_),e(Jo,zl),e(zl,x_),g(s,Gd,M),g(s,at,M),w(Ba,at,null),e(at,j_),e(at,Uo),e(Uo,C_),e(Uo,Jl),e(Jl,z_),e(Uo,J_),e(Uo,Ul),e(Ul,U_),e(Uo,I_),e(at,W_),e(at,Ga),e(Ga,N_),e(Ga,Nr),e(Nr,q_),e(Ga,A_),e(at,Z_),e(at,Ra),e(Ra,S_),e(Ra,Va),e(Va,B_),e(Ra,G_),e(at,R_),w(Zn,at,null),e(at,V_),e(at,yt),w(Qa,yt,null),e(yt,Q_),e(yt,Io),e(Io,D_),e(Io,qr),e(qr,O_),e(Io,P_),e(Io,Il),e(Il,H_),e(Io,Y_),e(yt,K_),w(Sn,yt,null),e(yt,eM),w(Bn,yt,null),e(yt,tM),w(Gn,yt,null),Rd=!0},p(s,[M]){const Da={};M&2&&(Da.$$scope={dirty:M,ctx:s}),Go.$set(Da);const Wl={};M&2&&(Wl.$$scope={dirty:M,ctx:s}),Qo.$set(Wl);const Nl={};M&2&&(Nl.$$scope={dirty:M,ctx:s}),Po.$set(Nl);const ql={};M&2&&(ql.$$scope={dirty:M,ctx:s}),Ho.$set(ql);const Oa={};M&2&&(Oa.$$scope={dirty:M,ctx:s}),Ko.$set(Oa);const Al={};M&2&&(Al.$$scope={dirty:M,ctx:s}),en.$set(Al);const Zl={};M&2&&(Zl.$$scope={dirty:M,ctx:s}),on.$set(Zl);const Pa={};M&2&&(Pa.$$scope={dirty:M,ctx:s}),nn.$set(Pa);const Sl={};M&2&&(Sl.$$scope={dirty:M,ctx:s}),sn.$set(Sl);const Bl={};M&2&&(Bl.$$scope={dirty:M,ctx:s}),rn.$set(Bl);const Gl={};M&2&&(Gl.$$scope={dirty:M,ctx:s}),ln.$set(Gl);const Ha={};M&2&&(Ha.$$scope={dirty:M,ctx:s}),cn.$set(Ha);const Rl={};M&2&&(Rl.$$scope={dirty:M,ctx:s}),pn.$set(Rl);const Wo={};M&2&&(Wo.$$scope={dirty:M,ctx:s}),mn.$set(Wo);const Vl={};M&2&&(Vl.$$scope={dirty:M,ctx:s}),un.$set(Vl);const Ql={};M&2&&(Ql.$$scope={dirty:M,ctx:s}),gn.$set(Ql);const Dl={};M&2&&(Dl.$$scope={dirty:M,ctx:s}),_n.$set(Dl);const Ol={};M&2&&(Ol.$$scope={dirty:M,ctx:s}),yn.$set(Ol);const Pl={};M&2&&(Pl.$$scope={dirty:M,ctx:s}),bn.$set(Pl);const Hl={};M&2&&(Hl.$$scope={dirty:M,ctx:s}),Tn.$set(Hl);const Yl={};M&2&&(Yl.$$scope={dirty:M,ctx:s}),wn.$set(Yl);const No={};M&2&&(No.$$scope={dirty:M,ctx:s}),kn.$set(No);const Kl={};M&2&&(Kl.$$scope={dirty:M,ctx:s}),$n.$set(Kl);const ed={};M&2&&(ed.$$scope={dirty:M,ctx:s}),Fn.$set(ed);const td={};M&2&&(td.$$scope={dirty:M,ctx:s}),Xn.$set(td);const qo={};M&2&&(qo.$$scope={dirty:M,ctx:s}),En.$set(qo);const od={};M&2&&(od.$$scope={dirty:M,ctx:s}),xn.$set(od);const nd={};M&2&&(nd.$$scope={dirty:M,ctx:s}),Cn.$set(nd);const Ya={};M&2&&(Ya.$$scope={dirty:M,ctx:s}),zn.$set(Ya);const sd={};M&2&&(sd.$$scope={dirty:M,ctx:s}),Jn.$set(sd);const Ao={};M&2&&(Ao.$$scope={dirty:M,ctx:s}),In.$set(Ao);const ad={};M&2&&(ad.$$scope={dirty:M,ctx:s}),Wn.$set(ad);const rd={};M&2&&(rd.$$scope={dirty:M,ctx:s}),Nn.$set(rd);const id={};M&2&&(id.$$scope={dirty:M,ctx:s}),qn.$set(id);const Zo={};M&2&&(Zo.$$scope={dirty:M,ctx:s}),Zn.$set(Zo);const ld={};M&2&&(ld.$$scope={dirty:M,ctx:s}),Sn.$set(ld);const dd={};M&2&&(dd.$$scope={dirty:M,ctx:s}),Bn.$set(dd);const Ka={};M&2&&(Ka.$$scope={dirty:M,ctx:s}),Gn.$set(Ka)},i(s){Rd||(k(l.$$.fragment,s),k(ie.$$.fragment,s),k(rs.$$.fragment,s),k(is.$$.fragment,s),k(ls.$$.fragment,s),k(Go.$$.fragment,s),k(cs.$$.fragment,s),k(ps.$$.fragment,s),k(fs.$$.fragment,s),k(_s.$$.fragment,s),k(ys.$$.fragment,s),k(Qo.$$.fragment,s),k(bs.$$.fragment,s),k(Ts.$$.fragment,s),k(vs.$$.fragment,s),k(ks.$$.fragment,s),k($s.$$.fragment,s),k(Es.$$.fragment,s),k(Po.$$.fragment,s),k(Ho.$$.fragment,s),k(xs.$$.fragment,s),k(js.$$.fragment,s),k(Us.$$.fragment,s),k(Ko.$$.fragment,s),k(en.$$.fragment,s),k(Is.$$.fragment,s),k(Ws.$$.fragment,s),k(Zs.$$.fragment,s),k(on.$$.fragment,s),k(nn.$$.fragment,s),k(sn.$$.fragment,s),k(Ss.$$.fragment,s),k(Bs.$$.fragment,s),k(Qs.$$.fragment,s),k(rn.$$.fragment,s),k(ln.$$.fragment,s),k(Ds.$$.fragment,s),k(Os.$$.fragment,s),k(Ks.$$.fragment,s),k(cn.$$.fragment,s),k(pn.$$.fragment,s),k(ea.$$.fragment,s),k(ta.$$.fragment,s),k(aa.$$.fragment,s),k(mn.$$.fragment,s),k(un.$$.fragment,s),k(ra.$$.fragment,s),k(ia.$$.fragment,s),k(pa.$$.fragment,s),k(gn.$$.fragment,s),k(_n.$$.fragment,s),k(ha.$$.fragment,s),k(ma.$$.fragment,s),k(yn.$$.fragment,s),k(_a.$$.fragment,s),k(bn.$$.fragment,s),k(Tn.$$.fragment,s),k(Ma.$$.fragment,s),k(ya.$$.fragment,s),k(wn.$$.fragment,s),k(wa.$$.fragment,s),k(kn.$$.fragment,s),k($n.$$.fragment,s),k(ka.$$.fragment,s),k($a.$$.fragment,s),k(Fn.$$.fragment,s),k(Ea.$$.fragment,s),k(Xn.$$.fragment,s),k(En.$$.fragment,s),k(xn.$$.fragment,s),k(xa.$$.fragment,s),k(ja.$$.fragment,s),k(Cn.$$.fragment,s),k(Ua.$$.fragment,s),k(zn.$$.fragment,s),k(Jn.$$.fragment,s),k(Ia.$$.fragment,s),k(Wa.$$.fragment,s),k(In.$$.fragment,s),k(Za.$$.fragment,s),k(Wn.$$.fragment,s),k(Nn.$$.fragment,s),k(qn.$$.fragment,s),k(Sa.$$.fragment,s),k(Ba.$$.fragment,s),k(Zn.$$.fragment,s),k(Qa.$$.fragment,s),k(Sn.$$.fragment,s),k(Bn.$$.fragment,s),k(Gn.$$.fragment,s),Rd=!0)},o(s){$(l.$$.fragment,s),$(ie.$$.fragment,s),$(rs.$$.fragment,s),$(is.$$.fragment,s),$(ls.$$.fragment,s),$(Go.$$.fragment,s),$(cs.$$.fragment,s),$(ps.$$.fragment,s),$(fs.$$.fragment,s),$(_s.$$.fragment,s),$(ys.$$.fragment,s),$(Qo.$$.fragment,s),$(bs.$$.fragment,s),$(Ts.$$.fragment,s),$(vs.$$.fragment,s),$(ks.$$.fragment,s),$($s.$$.fragment,s),$(Es.$$.fragment,s),$(Po.$$.fragment,s),$(Ho.$$.fragment,s),$(xs.$$.fragment,s),$(js.$$.fragment,s),$(Us.$$.fragment,s),$(Ko.$$.fragment,s),$(en.$$.fragment,s),$(Is.$$.fragment,s),$(Ws.$$.fragment,s),$(Zs.$$.fragment,s),$(on.$$.fragment,s),$(nn.$$.fragment,s),$(sn.$$.fragment,s),$(Ss.$$.fragment,s),$(Bs.$$.fragment,s),$(Qs.$$.fragment,s),$(rn.$$.fragment,s),$(ln.$$.fragment,s),$(Ds.$$.fragment,s),$(Os.$$.fragment,s),$(Ks.$$.fragment,s),$(cn.$$.fragment,s),$(pn.$$.fragment,s),$(ea.$$.fragment,s),$(ta.$$.fragment,s),$(aa.$$.fragment,s),$(mn.$$.fragment,s),$(un.$$.fragment,s),$(ra.$$.fragment,s),$(ia.$$.fragment,s),$(pa.$$.fragment,s),$(gn.$$.fragment,s),$(_n.$$.fragment,s),$(ha.$$.fragment,s),$(ma.$$.fragment,s),$(yn.$$.fragment,s),$(_a.$$.fragment,s),$(bn.$$.fragment,s),$(Tn.$$.fragment,s),$(Ma.$$.fragment,s),$(ya.$$.fragment,s),$(wn.$$.fragment,s),$(wa.$$.fragment,s),$(kn.$$.fragment,s),$($n.$$.fragment,s),$(ka.$$.fragment,s),$($a.$$.fragment,s),$(Fn.$$.fragment,s),$(Ea.$$.fragment,s),$(Xn.$$.fragment,s),$(En.$$.fragment,s),$(xn.$$.fragment,s),$(xa.$$.fragment,s),$(ja.$$.fragment,s),$(Cn.$$.fragment,s),$(Ua.$$.fragment,s),$(zn.$$.fragment,s),$(Jn.$$.fragment,s),$(Ia.$$.fragment,s),$(Wa.$$.fragment,s),$(In.$$.fragment,s),$(Za.$$.fragment,s),$(Wn.$$.fragment,s),$(Nn.$$.fragment,s),$(qn.$$.fragment,s),$(Sa.$$.fragment,s),$(Ba.$$.fragment,s),$(Zn.$$.fragment,s),$(Qa.$$.fragment,s),$(Sn.$$.fragment,s),$(Bn.$$.fragment,s),$(Gn.$$.fragment,s),Rd=!1},d(s){t(d),s&&t(b),s&&t(m),L(l),s&&t(fe),s&&t(W),s&&t(Q),s&&t(ne),L(ie),s&&t(ge),s&&t(A),s&&t(U),s&&t(te),s&&t(D),s&&t(pe),s&&t(O),s&&t(he),s&&t(_e),s&&t(S),s&&t(oe),s&&t(z),s&&t(cd),s&&t(Zt),s&&t(pd),s&&t(eo),L(rs),s&&t(hd),s&&t(rt),s&&t(md),s&&t(to),L(is),s&&t(ud),s&&t(bt),L(ls),L(Go),s&&t(fd),s&&t(no),L(cs),s&&t(gd),s&&t(De),L(ps),L(fs),L(_s),L(ys),L(Qo),L(bs),s&&t(_d),s&&t(ao),L(Ts),s&&t(Md),s&&t(ro),L(vs),s&&t(yd),s&&t(io),L(ks),s&&t(bd),s&&t(dt),L($s),L(Es),L(Po),L(Ho),s&&t(Td),s&&t(co),L(xs),s&&t(vd),s&&t(ct),L(js),L(Us),L(Ko),L(en),s&&t(wd),s&&t(ho),L(Is),s&&t(kd),s&&t(pt),L(Ws),L(Zs),L(on),L(nn),L(sn),s&&t($d),s&&t(uo),L(Ss),s&&t(Ld),s&&t(ht),L(Bs),L(Qs),L(rn),L(ln),s&&t(Fd),s&&t(go),L(Ds),s&&t(Xd),s&&t(mt),L(Os),L(Ks),L(cn),L(pn),s&&t(Ed),s&&t(Mo),L(ea),s&&t(xd),s&&t(ut),L(ta),L(aa),L(mn),L(un),s&&t(jd),s&&t(To),L(ra),s&&t(Cd),s&&t(ft),L(ia),L(pa),L(gn),L(_n),s&&t(zd),s&&t(ko),L(ha),s&&t(Jd),s&&t(et),L(ma),L(yn),L(_a),L(bn),L(Tn),s&&t(Ud),s&&t(Lo),L(Ma),s&&t(Id),s&&t(tt),L(ya),L(wn),L(wa),L(kn),L($n),s&&t(Wd),s&&t(Xo),L(ka),s&&t(Nd),s&&t(ot),L($a),L(Fn),L(Ea),L(Xn),L(En),L(xn),s&&t(qd),s&&t(xo),L(xa),s&&t(Ad),s&&t(nt),L(ja),L(Cn),L(Ua),L(zn),L(Jn),s&&t(Zd),s&&t(Co),L(Ia),s&&t(Sd),s&&t(st),L(Wa),L(In),L(Za),L(Wn),L(Nn),L(qn),s&&t(Bd),s&&t(Jo),L(Sa),s&&t(Gd),s&&t(at),L(Ba),L(Zn),L(Qa),L(Sn),L(Bn),L(Gn)}}}const ST={local:"xlm",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.XLMConfig",title:"XLMConfig"},{local:"transformers.XLMTokenizer",title:"XLMTokenizer"},{local:"transformers.models.xlm.modeling_xlm.XLMForQuestionAnsweringOutput",title:"XLM specific outputs"},{local:"transformers.XLMModel",title:"XLMModel"},{local:"transformers.XLMWithLMHeadModel",title:"XLMWithLMHeadModel"},{local:"transformers.XLMForSequenceClassification",title:"XLMForSequenceClassification"},{local:"transformers.XLMForMultipleChoice",title:"XLMForMultipleChoice"},{local:"transformers.XLMForTokenClassification",title:"XLMForTokenClassification"},{local:"transformers.XLMForQuestionAnsweringSimple",title:"XLMForQuestionAnsweringSimple"},{local:"transformers.XLMForQuestionAnswering",title:"XLMForQuestionAnswering"},{local:"transformers.TFXLMModel",title:"TFXLMModel"},{local:"transformers.TFXLMWithLMHeadModel",title:"TFXLMWithLMHeadModel"},{local:"transformers.TFXLMForSequenceClassification",title:"TFXLMForSequenceClassification"},{local:"transformers.TFXLMForMultipleChoice",title:"TFXLMForMultipleChoice"},{local:"transformers.TFXLMForTokenClassification",title:"TFXLMForTokenClassification"},{local:"transformers.TFXLMForQuestionAnsweringSimple",title:"TFXLMForQuestionAnsweringSimple"}],title:"XLM"};function BT(j){return oT(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class PT extends Yb{constructor(d){super();Kb(this,d,BT,ZT,eT,{})}}export{PT as default,ST as metadata};
