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,a as i,x as w,h as n,b as f,N as Hb,G as e,g,y as v,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,h,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:"),h=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Examples:"),c.forEach(t),h=m(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,h,c),v(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(h),L(u,l)}}}function sT(j){let d,b,h,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:"),h=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),h=m(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,h,c),v(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(h),L(u,l)}}}function aT(j){let d,b,h,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 "),h=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 "),h=r(c,"CODE",{});var x=i(h);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,h),e(h,u),e(d,y)},d(l){l&&t(d)}}}function rT(j){let d,b,h,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:"),h=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),h=m(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,h,c),v(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(h),L(u,l)}}}function iT(j){let d,b,h,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 "),h=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 "),h=r(c,"CODE",{});var x=i(h);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,h),e(h,u),e(d,y)},d(l){l&&t(d)}}}function lT(j){let d,b,h,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:"),h=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),h=m(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,h,c),v(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(h),L(u,l)}}}function dT(j){let d,b,h,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 "),h=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 "),h=r(c,"CODE",{});var x=i(h);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,h),e(h,u),e(d,y)},d(l){l&&t(d)}}}function cT(j){let d,b,h,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:"),h=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),h=m(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,h,c),v(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(h),L(u,l)}}}function pT(j){let d,b,h,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:"),h=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),h=m(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,h,c),v(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(h),L(u,l)}}}function mT(j){let d,b,h,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 "),h=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 "),h=r(c,"CODE",{});var x=i(h);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,h),e(h,u),e(d,y)},d(l){l&&t(d)}}}function hT(j){let d,b,h,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:"),h=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),h=m(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,h,c),v(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(h),L(u,l)}}}function uT(j){let d,b,h,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 "),h=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 "),h=r(c,"CODE",{});var x=i(h);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,h),e(h,u),e(d,y)},d(l){l&&t(d)}}}function fT(j){let d,b,h,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:"),h=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),h=m(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,h,c),v(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(h),L(u,l)}}}function gT(j){let d,b,h,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 "),h=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 "),h=r(c,"CODE",{});var x=i(h);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,h),e(h,u),e(d,y)},d(l){l&&t(d)}}}function _T(j){let d,b,h,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:"),h=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),h=m(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,h,c),v(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(h),L(u,l)}}}function MT(j){let d,b,h,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 "),h=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 "),h=r(c,"CODE",{});var x=i(h);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,h),e(h,u),e(d,y)},d(l){l&&t(d)}}}function yT(j){let d,b,h,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:"),h=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),h=m(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,h,c),v(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(h),L(u,l)}}}function bT(j){let d,b,h,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,we,le,se,C,U,te,R,ve,ke,V,$e,Le,J,Fe,D,pe,Xe,O,me,he,N,_e,S,Ee,oe,z,ue,I,xe,je;return{c(){d=a("p"),b=o("TensorFlow models and layers in "),h=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"),we=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"),ve=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"),me=o("model([input_ids, attention_mask, token_type_ids])"),he=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 "),h=r(X,"CODE",{});var qe=i(h);u=n(qe,"transformers"),qe.forEach(t),y=n(X," accept two formats as input:"),X.forEach(t),l=m(_),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=m(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=m(_),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);we=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=m(_),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);ve=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=m(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);me=n(Ne,"model([input_ids, attention_mask, token_type_ids])"),Ne.forEach(t),H.forEach(t),he=m(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=m(_),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,h),e(h,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,we),e(F,le),g(_,se,X),g(_,C,X),e(C,U),e(U,te),e(U,R),e(R,ve),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,me),e(C,he),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,h,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 "),h=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 "),h=r(c,"CODE",{});var x=i(h);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,h),e(h,u),e(d,y)},d(l){l&&t(d)}}}function wT(j){let d,b,h,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:"),h=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),h=m(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,h,c),v(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(h),L(u,l)}}}function vT(j){let d,b,h,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,we,le,se,C,U,te,R,ve,ke,V,$e,Le,J,Fe,D,pe,Xe,O,me,he,N,_e,S,Ee,oe,z,ue,I,xe,je;return{c(){d=a("p"),b=o("TensorFlow models and layers in "),h=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"),we=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"),ve=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"),me=o("model([input_ids, attention_mask, token_type_ids])"),he=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 "),h=r(X,"CODE",{});var qe=i(h);u=n(qe,"transformers"),qe.forEach(t),y=n(X," accept two formats as input:"),X.forEach(t),l=m(_),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=m(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=m(_),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);we=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=m(_),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);ve=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=m(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);me=n(Ne,"model([input_ids, attention_mask, token_type_ids])"),Ne.forEach(t),H.forEach(t),he=m(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=m(_),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,h),e(h,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,we),e(F,le),g(_,se,X),g(_,C,X),e(C,U),e(U,te),e(U,R),e(R,ve),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,me),e(C,he),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,h,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 "),h=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 "),h=r(c,"CODE",{});var x=i(h);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,h),e(h,u),e(d,y)},d(l){l&&t(d)}}}function $T(j){let d,b,h,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:"),h=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),h=m(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,h,c),v(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(h),L(u,l)}}}function LT(j){let d,b,h,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,we,le,se,C,U,te,R,ve,ke,V,$e,Le,J,Fe,D,pe,Xe,O,me,he,N,_e,S,Ee,oe,z,ue,I,xe,je;return{c(){d=a("p"),b=o("TensorFlow models and layers in "),h=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"),we=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"),ve=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"),me=o("model([input_ids, attention_mask, token_type_ids])"),he=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 "),h=r(X,"CODE",{});var qe=i(h);u=n(qe,"transformers"),qe.forEach(t),y=n(X," accept two formats as input:"),X.forEach(t),l=m(_),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=m(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=m(_),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);we=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=m(_),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);ve=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=m(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);me=n(Ne,"model([input_ids, attention_mask, token_type_ids])"),Ne.forEach(t),H.forEach(t),he=m(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=m(_),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,h),e(h,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,we),e(F,le),g(_,se,X),g(_,C,X),e(C,U),e(U,te),e(U,R),e(R,ve),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,me),e(C,he),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,h,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 "),h=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 "),h=r(c,"CODE",{});var x=i(h);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,h),e(h,u),e(d,y)},d(l){l&&t(d)}}}function XT(j){let d,b,h,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:"),h=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),h=m(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,h,c),v(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(h),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(h){w(d.$$.fragment,h)},m(h,u){v(d,h,u),b=!0},p:Ye,i(h){b||(k(d.$$.fragment,h),b=!0)},o(h){$(d.$$.fragment,h),b=!1},d(h){L(d,h)}}}function xT(j){let d,b,h,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,we,le,se,C,U,te,R,ve,ke,V,$e,Le,J,Fe,D,pe,Xe,O,me,he,N,_e,S,Ee,oe,z,ue,I,xe,je;return{c(){d=a("p"),b=o("TensorFlow models and layers in "),h=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"),we=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"),ve=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"),me=o("model([input_ids, attention_mask, token_type_ids])"),he=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 "),h=r(X,"CODE",{});var qe=i(h);u=n(qe,"transformers"),qe.forEach(t),y=n(X," accept two formats as input:"),X.forEach(t),l=m(_),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=m(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=m(_),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);we=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=m(_),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);ve=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=m(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);me=n(Ne,"model([input_ids, attention_mask, token_type_ids])"),Ne.forEach(t),H.forEach(t),he=m(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=m(_),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,h),e(h,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,we),e(F,le),g(_,se,X),g(_,C,X),e(C,U),e(U,te),e(U,R),e(R,ve),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,me),e(C,he),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,h,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 "),h=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 "),h=r(c,"CODE",{});var x=i(h);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,h),e(h,u),e(d,y)},d(l){l&&t(d)}}}function CT(j){let d,b,h,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:"),h=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),h=m(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,h,c),v(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(h),L(u,l)}}}function zT(j){let d,b,h,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,we,le,se,C,U,te,R,ve,ke,V,$e,Le,J,Fe,D,pe,Xe,O,me,he,N,_e,S,Ee,oe,z,ue,I,xe,je;return{c(){d=a("p"),b=o("TensorFlow models and layers in "),h=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"),we=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"),ve=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"),me=o("model([input_ids, attention_mask, token_type_ids])"),he=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 "),h=r(X,"CODE",{});var qe=i(h);u=n(qe,"transformers"),qe.forEach(t),y=n(X," accept two formats as input:"),X.forEach(t),l=m(_),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=m(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=m(_),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);we=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=m(_),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);ve=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=m(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);me=n(Ne,"model([input_ids, attention_mask, token_type_ids])"),Ne.forEach(t),H.forEach(t),he=m(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=m(_),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,h),e(h,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,we),e(F,le),g(_,se,X),g(_,C,X),e(C,U),e(U,te),e(U,R),e(R,ve),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,me),e(C,he),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,h,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 "),h=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 "),h=r(c,"CODE",{});var x=i(h);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,h),e(h,u),e(d,y)},d(l){l&&t(d)}}}function UT(j){let d,b,h,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:"),h=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),h=m(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,h,c),v(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(h),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(h){w(d.$$.fragment,h)},m(h,u){v(d,h,u),b=!0},p:Ye,i(h){b||(k(d.$$.fragment,h),b=!0)},o(h){$(d.$$.fragment,h),b=!1},d(h){L(d,h)}}}function WT(j){let d,b,h,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,we,le,se,C,U,te,R,ve,ke,V,$e,Le,J,Fe,D,pe,Xe,O,me,he,N,_e,S,Ee,oe,z,ue,I,xe,je;return{c(){d=a("p"),b=o("TensorFlow models and layers in "),h=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"),we=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"),ve=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"),me=o("model([input_ids, attention_mask, token_type_ids])"),he=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 "),h=r(X,"CODE",{});var qe=i(h);u=n(qe,"transformers"),qe.forEach(t),y=n(X," accept two formats as input:"),X.forEach(t),l=m(_),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=m(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=m(_),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);we=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=m(_),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);ve=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=m(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);me=n(Ne,"model([input_ids, attention_mask, token_type_ids])"),Ne.forEach(t),H.forEach(t),he=m(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=m(_),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,h),e(h,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,we),e(F,le),g(_,se,X),g(_,C,X),e(C,U),e(U,te),e(U,R),e(R,ve),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,me),e(C,he),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,h,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 "),h=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 "),h=r(c,"CODE",{});var x=i(h);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,h),e(h,u),e(d,y)},d(l){l&&t(d)}}}function qT(j){let d,b,h,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:"),h=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=n(c,"Example:"),c.forEach(t),h=m(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,b),g(l,h,c),v(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(h),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(h){w(d.$$.fragment,h)},m(h,u){v(d,h,u),b=!0},p:Ye,i(h){b||(k(d.$$.fragment,h),b=!0)},o(h){$(d.$$.fragment,h),b=!1},d(h){L(d,h)}}}function ZT(j){let d,b,h,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,we,le,se,C,U,te,R,ve,ke,V,$e,Le,J,Fe,D,pe,Xe,O,me,he,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,md,rt,ii,er,Oc,Pc,li,tr,Hc,Yc,di,or,Kc,ep,ci,nr,tp,op,pi,sr,np,sp,mi,ar,ap,hd,to,Bo,hi,is,rp,ui,ip,ud,bt,ls,lp,qt,dp,rr,cp,pp,ir,mp,hp,ds,up,fp,gp,oo,_p,lr,Mp,yp,dr,bp,Tp,wp,Go,fd,no,Ro,fi,cs,vp,gi,kp,gd,De,ps,$p,_i,Lp,Fp,lt,Mi,Xp,Ep,yi,xp,jp,bi,Cp,zp,At,Jp,Ti,Up,Ip,wi,Wp,Np,vi,qp,Ap,Zp,ms,Sp,ki,Bp,Gp,Rp,hs,Vp,$i,Qp,Dp,Op,us,Pp,cr,Hp,Yp,Kp,St,fs,em,Li,tm,om,gs,pr,nm,Fi,sm,am,mr,rm,Xi,im,lm,Vo,_s,dm,Ms,cm,Ei,pm,mm,hm,Tt,ys,um,xi,fm,gm,Qo,_m,so,Mm,ji,ym,bm,Ci,Tm,wm,vm,hr,bs,_d,ao,Do,zi,Ts,km,Ji,$m,Md,ro,ws,Lm,vs,Fm,Ui,Xm,Em,yd,io,Oo,Ii,ks,xm,Wi,jm,bd,dt,$s,Cm,Ni,zm,Jm,Ls,Um,ur,Im,Wm,Nm,Fs,qm,Xs,Am,Zm,Sm,wt,Es,Bm,lo,Gm,fr,Rm,Vm,qi,Qm,Dm,Om,Po,Pm,Ho,Td,co,Yo,Ai,xs,Hm,Zi,Ym,wd,ct,js,Km,Si,eh,th,Cs,oh,gr,nh,sh,ah,zs,rh,Js,ih,lh,dh,vt,Us,ch,po,ph,_r,mh,hh,Bi,uh,fh,gh,Ko,_h,en,vd,mo,tn,Gi,Is,Mh,Ri,yh,kd,pt,Ws,bh,Vi,Th,wh,Ns,vh,Mr,kh,$h,Lh,qs,Fh,As,Xh,Eh,xh,gt,Zs,jh,ho,Ch,yr,zh,Jh,Qi,Uh,Ih,Wh,on,Nh,nn,qh,sn,$d,uo,an,Di,Ss,Ah,Oi,Zh,Ld,mt,Bs,Sh,Pi,Bh,Gh,Gs,Rh,br,Vh,Qh,Dh,Rs,Oh,Vs,Ph,Hh,Yh,kt,Qs,Kh,fo,eu,Tr,tu,ou,Hi,nu,su,au,rn,ru,ln,Fd,go,dn,Yi,Ds,iu,Ki,lu,Xd,ht,Os,du,el,cu,pu,Ps,mu,wr,hu,uu,fu,Hs,gu,Ys,_u,Mu,yu,$t,Ks,bu,_o,Tu,vr,wu,vu,tl,ku,$u,Lu,cn,Fu,pn,Ed,Mo,mn,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,hn,Yu,un,jd,To,fn,il,ra,Ku,ll,ef,Cd,ft,ia,tf,wo,of,dl,nf,sf,cl,af,rf,lf,la,df,Lr,cf,pf,mf,da,hf,ca,uf,ff,gf,Ft,pa,_f,vo,Mf,Fr,yf,bf,pl,Tf,wf,vf,gn,kf,_n,zd,ko,Mn,ml,ma,$f,hl,Lf,Jd,et,ha,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,wn,gl,Ma,Qf,_l,Df,Id,tt,ya,Of,Ml,Pf,Hf,ba,Yf,xr,Kf,eg,tg,Ta,og,wa,ng,sg,ag,vn,rg,Et,va,ig,Fo,lg,jr,dg,cg,yl,pg,mg,hg,kn,ug,$n,Wd,Xo,Ln,bl,ka,fg,Tl,gg,Nd,ot,$a,_g,wl,Mg,yg,La,bg,Cr,Tg,wg,vg,Fa,kg,Xa,$g,Lg,Fg,Fn,Xg,_t,Ea,Eg,Eo,xg,zr,jg,Cg,vl,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,m_,h_,u_,qa,f_,Aa,g_,__,M_,In,y_,Mt,Za,b_,zo,T_,Wr,w_,v_,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/main/en/model_doc/xlm#transformers.XLMModel">XLMModel</a> or <a href="/docs/transformers/main/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/main/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/main/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/main/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/main/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/main/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/main/src/transformers/models/xlm/tokenization_xlm.py#L955"}}),Ts=new Pe({}),ws=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/main/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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlm/modeling_xlm.py#L480",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/xlm/modeling_xlm.py#L702",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/xlm/modeling_xlm.py#L781",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/xlm/modeling_xlm.py#L1191",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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:[mT]},$$scope:{ctx:j}}}),ln=new He({props:{anchor:"transformers.XLMForMultipleChoice.forward.example",$$slots:{default:[hT]},$$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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/xlm/modeling_xlm.py#L1108",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/xlm/modeling_xlm.py#L881",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),hn=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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/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/main/src/transformers/models/xlm/modeling_xlm.py#L985",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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}}}),ma=new Pe({}),ha=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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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/main/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/main/src/transformers/models/xlm/modeling_tf_xlm.py#L694",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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:[wT]},$$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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlm/modeling_tf_xlm.py#L794"}}),vn=new Oe({props:{$$slots:{default:[vT]},$$scope:{ctx:j}}}),va=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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/main/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/main/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/main/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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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/main/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/main/src/transformers/models/xlm/modeling_tf_xlm.py#L888",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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/main/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/main/src/transformers/models/xlm/modeling_tf_xlm.py#L987",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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/main/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/main/src/transformers/models/xlm/modeling_tf_xlm.py#L1088",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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/main/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/main/src/transformers/models/xlm/modeling_tf_xlm.py#L1165",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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(),h=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"),we=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"),ve=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(),me=a("p"),he=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"),md=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(),mi=a("li"),ar=a("a"),ap=o("Multiple choice task guide"),hd=p(),to=a("h2"),Bo=a("a"),hi=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"),mp=o("TFXLMModel"),hp=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."),wp=p(),T(Go.$$.fragment),fd=p(),no=a("h2"),Ro=a("a"),fi=a("span"),T(cs.$$.fragment),vp=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 "),wi=a("code"),Wp=o("set_special_tokens"),Np=o(`, can be used to add additional symbols (like
\u201D`),vi=a("strong"),qp=o("classify"),Ap=o("\u201D) to a vocabulary."),Zp=p(),ms=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(),hs=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),em=p(),Li=a("p"),tm=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:`),om=p(),gs=a("ul"),pr=a("li"),nm=o("single sequence: "),Fi=a("code"),sm=o("<s> X </s>"),am=p(),mr=a("li"),rm=o("pair of sequences: "),Xi=a("code"),im=o("<s> A </s> B </s>"),lm=p(),Vo=a("div"),T(_s.$$.fragment),dm=p(),Ms=a("p"),cm=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"),pm=o("prepare_for_model"),mm=o(" method."),hm=p(),Tt=a("div"),T(ys.$$.fragment),um=p(),xi=a("p"),fm=o("Create a mask from the two sequences passed to be used in a sequence-pair classification task. An XLM sequence"),gm=p(),T(Qo.$$.fragment),_m=p(),so=a("p"),Mm=o("If "),ji=a("code"),ym=o("token_ids_1"),bm=o(" is "),Ci=a("code"),Tm=o("None"),wm=o(", this method only returns the first portion of the mask (0s)."),vm=p(),hr=a("div"),T(bs.$$.fragment),_d=p(),ao=a("h2"),Do=a("a"),zi=a("span"),T(Ts.$$.fragment),km=p(),Ji=a("span"),$m=o("XLM specific outputs"),Md=p(),ro=a("div"),T(ws.$$.fragment),Lm=p(),vs=a("p"),Fm=o("Base class for outputs of question answering models using a "),Ui=a("code"),Xm=o("SquadHead"),Em=o("."),yd=p(),io=a("h2"),Oo=a("a"),Ii=a("span"),T(ks.$$.fragment),xm=p(),Wi=a("span"),jm=o("XLMModel"),bd=p(),dt=a("div"),T($s.$$.fragment),Cm=p(),Ni=a("p"),zm=o("The bare XLM Model transformer outputting raw hidden-states without any specific head on top."),Jm=p(),Ls=a("p"),Um=o("This model inherits from "),ur=a("a"),Im=o("PreTrainedModel"),Wm=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.)`),Nm=p(),Fs=a("p"),qm=o("This model is also a PyTorch "),Xs=a("a"),Am=o("torch.nn.Module"),Zm=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Sm=p(),wt=a("div"),T(Es.$$.fragment),Bm=p(),lo=a("p"),Gm=o("The "),fr=a("a"),Rm=o("XLMModel"),Vm=o(" forward method, overrides the "),qi=a("code"),Qm=o("__call__"),Dm=o(" special method."),Om=p(),T(Po.$$.fragment),Pm=p(),T(Ho.$$.fragment),Td=p(),co=a("h2"),Yo=a("a"),Ai=a("span"),T(xs.$$.fragment),Hm=p(),Zi=a("span"),Ym=o("XLMWithLMHeadModel"),wd=p(),ct=a("div"),T(js.$$.fragment),Km=p(),Si=a("p"),eh=o(`The XLM Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),th=p(),Cs=a("p"),oh=o("This model inherits from "),gr=a("a"),nh=o("PreTrainedModel"),sh=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.)`),ah=p(),zs=a("p"),rh=o("This model is also a PyTorch "),Js=a("a"),ih=o("torch.nn.Module"),lh=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),dh=p(),vt=a("div"),T(Us.$$.fragment),ch=p(),po=a("p"),ph=o("The "),_r=a("a"),mh=o("XLMWithLMHeadModel"),hh=o(" forward method, overrides the "),Bi=a("code"),uh=o("__call__"),fh=o(" special method."),gh=p(),T(Ko.$$.fragment),_h=p(),T(en.$$.fragment),vd=p(),mo=a("h2"),tn=a("a"),Gi=a("span"),T(Is.$$.fragment),Mh=p(),Ri=a("span"),yh=o("XLMForSequenceClassification"),kd=p(),pt=a("div"),T(Ws.$$.fragment),bh=p(),Vi=a("p"),Th=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.`),wh=p(),Ns=a("p"),vh=o("This model inherits from "),Mr=a("a"),kh=o("PreTrainedModel"),$h=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.)`),Lh=p(),qs=a("p"),Fh=o("This model is also a PyTorch "),As=a("a"),Xh=o("torch.nn.Module"),Eh=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),xh=p(),gt=a("div"),T(Zs.$$.fragment),jh=p(),ho=a("p"),Ch=o("The "),yr=a("a"),zh=o("XLMForSequenceClassification"),Jh=o(" forward method, overrides the "),Qi=a("code"),Uh=o("__call__"),Ih=o(" special method."),Wh=p(),T(on.$$.fragment),Nh=p(),T(nn.$$.fragment),qh=p(),T(sn.$$.fragment),$d=p(),uo=a("h2"),an=a("a"),Di=a("span"),T(Ss.$$.fragment),Ah=p(),Oi=a("span"),Zh=o("XLMForMultipleChoice"),Ld=p(),mt=a("div"),T(Bs.$$.fragment),Sh=p(),Pi=a("p"),Bh=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.`),Gh=p(),Gs=a("p"),Rh=o("This model inherits from "),br=a("a"),Vh=o("PreTrainedModel"),Qh=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.)`),Dh=p(),Rs=a("p"),Oh=o("This model is also a PyTorch "),Vs=a("a"),Ph=o("torch.nn.Module"),Hh=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Yh=p(),kt=a("div"),T(Qs.$$.fragment),Kh=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(),ht=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"),mu=o("This model inherits from "),wr=a("a"),hu=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 "),vr=a("a"),wu=o("XLMForTokenClassification"),vu=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"),mn=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(hn.$$.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(),wo=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.)`),mf=p(),da=a("p"),hf=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(),vo=a("p"),Mf=o("The "),Fr=a("a"),yf=o("XLMForQuestionAnswering"),bf=o(" forward method, overrides the "),pl=a("code"),Tf=o("__call__"),wf=o(" special method."),vf=p(),T(gn.$$.fragment),kf=p(),T(_n.$$.fragment),zd=p(),ko=a("h2"),Mn=a("a"),ml=a("span"),T(ma.$$.fragment),$f=p(),hl=a("span"),Lf=o("TFXLMModel"),Jd=p(),et=a("div"),T(ha.$$.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"),wn=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 "),wa=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(vn.$$.fragment),rg=p(),Et=a("div"),T(va.$$.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__"),mg=o(" special method."),hg=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(),wl=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"),wg=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(),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 "),vl=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"),m_=o("TFPreTrainedModel"),h_=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"),w_=o("TFXLMForTokenClassification"),v_=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=m(s),h=r(s,"H1",{class:!0});var Da=i(h);u=r(Da,"A",{id:!0,class:!0,href:!0});var Wl=i(u);y=r(Wl,"SPAN",{});var Nl=i(y);w(l.$$.fragment,Nl),Nl.forEach(t),Wl.forEach(t),c=m(Da),x=r(Da,"SPAN",{});var ql=i(x);Me=n(ql,"XLM"),ql.forEach(t),Da.forEach(t),fe=m(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=m(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=m(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);w(ie.$$.fragment,Bl),Bl.forEach(t),Sl.forEach(t),be=m(Pa),G=r(Pa,"SPAN",{});var Gl=i(G);Te=n(Gl,"Overview"),Gl.forEach(t),Pa.forEach(t),ge=m(s),A=r(s,"P",{});var Ha=i(A);we=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=m(s),te=r(s,"UL",{});var Wo=i(te);R=r(Wo,"LI",{});var Vl=i(R);ve=n(Vl,"a causal language modeling (CLM) objective (next token prediction),"),Vl.forEach(t),ke=m(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=m(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=m(s),pe=r(s,"P",{});var Ol=i(pe);Xe=n(Ol,"The abstract from the paper is the following:"),Ol.forEach(t),O=m(s),me=r(s,"P",{});var Pl=i(me);he=r(Pl,"EM",{});var Hl=i(he);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=m(s),S=r(s,"P",{});var Yl=i(S);Ee=n(Yl,"Tips:"),Yl.forEach(t),oe=m(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=m(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=m(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=m(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=m(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=m(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=m(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=m(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);w(rs.$$.fragment,aM),aM.forEach(t),sM.forEach(t),Qc=m(Ka),ri=r(Ka,"SPAN",{});var rM=i(ri);Dc=n(rM,"Documentation resources"),rM.forEach(t),Ka.forEach(t),md=m(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=m(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=m(jt),di=r(jt,"LI",{});var pM=i(di);or=r(pM,"A",{href:!0});var mM=i(or);Kc=n(mM,"Question answering task guide"),mM.forEach(t),pM.forEach(t),ep=m(jt),ci=r(jt,"LI",{});var hM=i(ci);nr=r(hM,"A",{href:!0});var uM=i(nr);tp=n(uM,"Causal language modeling task guide"),uM.forEach(t),hM.forEach(t),op=m(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=m(jt),mi=r(jt,"LI",{});var _M=i(mi);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),hd=m(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);hi=r(yM,"SPAN",{});var bM=i(hi);w(is.$$.fragment,bM),bM.forEach(t),yM.forEach(t),rp=m(Vd),ui=r(Vd,"SPAN",{});var TM=i(ui);ip=n(TM,"XLMConfig"),TM.forEach(t),Vd.forEach(t),ud=m(s),bt=r(s,"DIV",{class:!0});var Rn=i(bt);w(ls.$$.fragment,Rn),lp=m(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 wM=i(rr);cp=n(wM,"XLMModel"),wM.forEach(t),pp=n(Vn," or a "),ir=r(Vn,"A",{href:!0});var vM=i(ir);mp=n(vM,"TFXLMModel"),vM.forEach(t),hp=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=m(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),wp=m(Rn),w(Go.$$.fragment,Rn),Rn.forEach(t),fd=m(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);w(cs.$$.fragment,XM),XM.forEach(t),FM.forEach(t),vp=m(Qd),gi=r(Qd,"SPAN",{});var EM=i(gi);kp=n(EM,"XLMTokenizer"),EM.forEach(t),Qd.forEach(t),gd=m(s),De=r(s,"DIV",{class:!0});var it=i(De);w(ps.$$.fragment,it),$p=m(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=m(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=m(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=m(Ct),bi=r(Ct,"LI",{});var zM=i(bi);Cp=n(zM,"Optionally lowercases and normalizes all inputs text."),zM.forEach(t),zp=m(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 "),wi=r(Qn,"CODE",{});var UM=i(wi);Wp=n(UM,"set_special_tokens"),UM.forEach(t),Np=n(Qn,`, can be used to add additional symbols (like
\u201D`),vi=r(Qn,"STRONG",{});var IM=i(vi);qp=n(IM,"classify"),IM.forEach(t),Ap=n(Qn,"\u201D) to a vocabulary."),Qn.forEach(t),Zp=m(Ct),ms=r(Ct,"LI",{});var Dd=i(ms);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=m(Ct),hs=r(Ct,"LI",{});var Od=i(hs);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=m(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=m(it),St=r(it,"DIV",{class:!0});var Zr=i(St);w(fs.$$.fragment,Zr),em=m(Zr),Li=r(Zr,"P",{});var AM=i(Li);tm=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),om=m(Zr),gs=r(Zr,"UL",{});var Hd=i(gs);pr=r(Hd,"LI",{});var oM=i(pr);nm=n(oM,"single sequence: "),Fi=r(oM,"CODE",{});var ZM=i(Fi);sm=n(ZM,"<s> X </s>"),ZM.forEach(t),oM.forEach(t),am=m(Hd),mr=r(Hd,"LI",{});var nM=i(mr);rm=n(nM,"pair of sequences: "),Xi=r(nM,"CODE",{});var SM=i(Xi);im=n(SM,"<s> A </s> B </s>"),SM.forEach(t),nM.forEach(t),Hd.forEach(t),Zr.forEach(t),lm=m(it),Vo=r(it,"DIV",{class:!0});var Yd=i(Vo);w(_s.$$.fragment,Yd),dm=m(Yd),Ms=r(Yd,"P",{});var Kd=i(Ms);cm=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);pm=n(BM,"prepare_for_model"),BM.forEach(t),mm=n(Kd," method."),Kd.forEach(t),Yd.forEach(t),hm=m(it),Tt=r(it,"DIV",{class:!0});var Dn=i(Tt);w(ys.$$.fragment,Dn),um=m(Dn),xi=r(Dn,"P",{});var GM=i(xi);fm=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),gm=m(Dn),w(Qo.$$.fragment,Dn),_m=m(Dn),so=r(Dn,"P",{});var Sr=i(so);Mm=n(Sr,"If "),ji=r(Sr,"CODE",{});var RM=i(ji);ym=n(RM,"token_ids_1"),RM.forEach(t),bm=n(Sr," is "),Ci=r(Sr,"CODE",{});var VM=i(Ci);Tm=n(VM,"None"),VM.forEach(t),wm=n(Sr,", this method only returns the first portion of the mask (0s)."),Sr.forEach(t),Dn.forEach(t),vm=m(it),hr=r(it,"DIV",{class:!0});var QM=i(hr);w(bs.$$.fragment,QM),QM.forEach(t),it.forEach(t),_d=m(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);w(Ts.$$.fragment,OM),OM.forEach(t),DM.forEach(t),km=m(ec),Ji=r(ec,"SPAN",{});var PM=i(Ji);$m=n(PM,"XLM specific outputs"),PM.forEach(t),ec.forEach(t),Md=m(s),ro=r(s,"DIV",{class:!0});var tc=i(ro);w(ws.$$.fragment,tc),Lm=m(tc),vs=r(tc,"P",{});var oc=i(vs);Fm=n(oc,"Base class for outputs of question answering models using a "),Ui=r(oc,"CODE",{});var HM=i(Ui);Xm=n(HM,"SquadHead"),HM.forEach(t),Em=n(oc,"."),oc.forEach(t),tc.forEach(t),yd=m(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);w(ks.$$.fragment,KM),KM.forEach(t),YM.forEach(t),xm=m(nc),Wi=r(nc,"SPAN",{});var ey=i(Wi);jm=n(ey,"XLMModel"),ey.forEach(t),nc.forEach(t),bd=m(s),dt=r(s,"DIV",{class:!0});var Bt=i(dt);w($s.$$.fragment,Bt),Cm=m(Bt),Ni=r(Bt,"P",{});var ty=i(Ni);zm=n(ty,"The bare XLM Model transformer outputting raw hidden-states without any specific head on top."),ty.forEach(t),Jm=m(Bt),Ls=r(Bt,"P",{});var sc=i(Ls);Um=n(sc,"This model inherits from "),ur=r(sc,"A",{href:!0});var oy=i(ur);Im=n(oy,"PreTrainedModel"),oy.forEach(t),Wm=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),Nm=m(Bt),Fs=r(Bt,"P",{});var ac=i(Fs);qm=n(ac,"This model is also a PyTorch "),Xs=r(ac,"A",{href:!0,rel:!0});var ny=i(Xs);Am=n(ny,"torch.nn.Module"),ny.forEach(t),Zm=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),Sm=m(Bt),wt=r(Bt,"DIV",{class:!0});var On=i(wt);w(Es.$$.fragment,On),Bm=m(On),lo=r(On,"P",{});var Br=i(lo);Gm=n(Br,"The "),fr=r(Br,"A",{href:!0});var sy=i(fr);Rm=n(sy,"XLMModel"),sy.forEach(t),Vm=n(Br," forward method, overrides the "),qi=r(Br,"CODE",{});var ay=i(qi);Qm=n(ay,"__call__"),ay.forEach(t),Dm=n(Br," special method."),Br.forEach(t),Om=m(On),w(Po.$$.fragment,On),Pm=m(On),w(Ho.$$.fragment,On),On.forEach(t),Bt.forEach(t),Td=m(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);w(xs.$$.fragment,iy),iy.forEach(t),ry.forEach(t),Hm=m(rc),Zi=r(rc,"SPAN",{});var ly=i(Zi);Ym=n(ly,"XLMWithLMHeadModel"),ly.forEach(t),rc.forEach(t),wd=m(s),ct=r(s,"DIV",{class:!0});var Gt=i(ct);w(js.$$.fragment,Gt),Km=m(Gt),Si=r(Gt,"P",{});var dy=i(Si);eh=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),th=m(Gt),Cs=r(Gt,"P",{});var ic=i(Cs);oh=n(ic,"This model inherits from "),gr=r(ic,"A",{href:!0});var cy=i(gr);nh=n(cy,"PreTrainedModel"),cy.forEach(t),sh=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),ah=m(Gt),zs=r(Gt,"P",{});var lc=i(zs);rh=n(lc,"This model is also a PyTorch "),Js=r(lc,"A",{href:!0,rel:!0});var py=i(Js);ih=n(py,"torch.nn.Module"),py.forEach(t),lh=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),dh=m(Gt),vt=r(Gt,"DIV",{class:!0});var Pn=i(vt);w(Us.$$.fragment,Pn),ch=m(Pn),po=r(Pn,"P",{});var Gr=i(po);ph=n(Gr,"The "),_r=r(Gr,"A",{href:!0});var my=i(_r);mh=n(my,"XLMWithLMHeadModel"),my.forEach(t),hh=n(Gr," forward method, overrides the "),Bi=r(Gr,"CODE",{});var hy=i(Bi);uh=n(hy,"__call__"),hy.forEach(t),fh=n(Gr," special method."),Gr.forEach(t),gh=m(Pn),w(Ko.$$.fragment,Pn),_h=m(Pn),w(en.$$.fragment,Pn),Pn.forEach(t),Gt.forEach(t),vd=m(s),mo=r(s,"H2",{class:!0});var dc=i(mo);tn=r(dc,"A",{id:!0,class:!0,href:!0});var uy=i(tn);Gi=r(uy,"SPAN",{});var fy=i(Gi);w(Is.$$.fragment,fy),fy.forEach(t),uy.forEach(t),Mh=m(dc),Ri=r(dc,"SPAN",{});var gy=i(Ri);yh=n(gy,"XLMForSequenceClassification"),gy.forEach(t),dc.forEach(t),kd=m(s),pt=r(s,"DIV",{class:!0});var Rt=i(pt);w(Ws.$$.fragment,Rt),bh=m(Rt),Vi=r(Rt,"P",{});var _y=i(Vi);Th=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),wh=m(Rt),Ns=r(Rt,"P",{});var cc=i(Ns);vh=n(cc,"This model inherits from "),Mr=r(cc,"A",{href:!0});var My=i(Mr);kh=n(My,"PreTrainedModel"),My.forEach(t),$h=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),Lh=m(Rt),qs=r(Rt,"P",{});var pc=i(qs);Fh=n(pc,"This model is also a PyTorch "),As=r(pc,"A",{href:!0,rel:!0});var yy=i(As);Xh=n(yy,"torch.nn.Module"),yy.forEach(t),Eh=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),xh=m(Rt),gt=r(Rt,"DIV",{class:!0});var Vt=i(gt);w(Zs.$$.fragment,Vt),jh=m(Vt),ho=r(Vt,"P",{});var Rr=i(ho);Ch=n(Rr,"The "),yr=r(Rr,"A",{href:!0});var by=i(yr);zh=n(by,"XLMForSequenceClassification"),by.forEach(t),Jh=n(Rr," forward method, overrides the "),Qi=r(Rr,"CODE",{});var Ty=i(Qi);Uh=n(Ty,"__call__"),Ty.forEach(t),Ih=n(Rr," special method."),Rr.forEach(t),Wh=m(Vt),w(on.$$.fragment,Vt),Nh=m(Vt),w(nn.$$.fragment,Vt),qh=m(Vt),w(sn.$$.fragment,Vt),Vt.forEach(t),Rt.forEach(t),$d=m(s),uo=r(s,"H2",{class:!0});var mc=i(uo);an=r(mc,"A",{id:!0,class:!0,href:!0});var wy=i(an);Di=r(wy,"SPAN",{});var vy=i(Di);w(Ss.$$.fragment,vy),vy.forEach(t),wy.forEach(t),Ah=m(mc),Oi=r(mc,"SPAN",{});var ky=i(Oi);Zh=n(ky,"XLMForMultipleChoice"),ky.forEach(t),mc.forEach(t),Ld=m(s),mt=r(s,"DIV",{class:!0});var Qt=i(mt);w(Bs.$$.fragment,Qt),Sh=m(Qt),Pi=r(Qt,"P",{});var $y=i(Pi);Bh=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),Gh=m(Qt),Gs=r(Qt,"P",{});var hc=i(Gs);Rh=n(hc,"This model inherits from "),br=r(hc,"A",{href:!0});var Ly=i(br);Vh=n(Ly,"PreTrainedModel"),Ly.forEach(t),Qh=n(hc,`. 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.)`),hc.forEach(t),Dh=m(Qt),Rs=r(Qt,"P",{});var uc=i(Rs);Oh=n(uc,"This model is also a PyTorch "),Vs=r(uc,"A",{href:!0,rel:!0});var Fy=i(Vs);Ph=n(Fy,"torch.nn.Module"),Fy.forEach(t),Hh=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),Yh=m(Qt),kt=r(Qt,"DIV",{class:!0});var Hn=i(kt);w(Qs.$$.fragment,Hn),Kh=m(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=m(Hn),w(rn.$$.fragment,Hn),ru=m(Hn),w(ln.$$.fragment,Hn),Hn.forEach(t),Qt.forEach(t),Fd=m(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);w(Ds.$$.fragment,jy),jy.forEach(t),xy.forEach(t),iu=m(fc),Ki=r(fc,"SPAN",{});var Cy=i(Ki);lu=n(Cy,"XLMForTokenClassification"),Cy.forEach(t),fc.forEach(t),Xd=m(s),ht=r(s,"DIV",{class:!0});var Dt=i(ht);w(Os.$$.fragment,Dt),du=m(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=m(Dt),Ps=r(Dt,"P",{});var gc=i(Ps);mu=n(gc,"This model inherits from "),wr=r(gc,"A",{href:!0});var Jy=i(wr);hu=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=m(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=m(Dt),$t=r(Dt,"DIV",{class:!0});var Yn=i($t);w(Ks.$$.fragment,Yn),bu=m(Yn),_o=r(Yn,"P",{});var Qr=i(_o);Tu=n(Qr,"The "),vr=r(Qr,"A",{href:!0});var Iy=i(vr);wu=n(Iy,"XLMForTokenClassification"),Iy.forEach(t),vu=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=m(Yn),w(cn.$$.fragment,Yn),Fu=m(Yn),w(pn.$$.fragment,Yn),Yn.forEach(t),Dt.forEach(t),Ed=m(s),Mo=r(s,"H2",{class:!0});var Mc=i(Mo);mn=r(Mc,"A",{id:!0,class:!0,href:!0});var Ny=i(mn);ol=r(Ny,"SPAN",{});var qy=i(ol);w(ea.$$.fragment,qy),qy.forEach(t),Ny.forEach(t),Xu=m(Mc),nl=r(Mc,"SPAN",{});var Ay=i(nl);Eu=n(Ay,"XLMForQuestionAnsweringSimple"),Ay.forEach(t),Mc.forEach(t),xd=m(s),ut=r(s,"DIV",{class:!0});var Ot=i(ut);w(ta.$$.fragment,Ot),xu=m(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=m(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=m(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=m(Ot),Lt=r(Ot,"DIV",{class:!0});var Kn=i(Lt);w(aa.$$.fragment,Kn),Ru=m(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=m(Kn),w(hn.$$.fragment,Kn),Yu=m(Kn),w(un.$$.fragment,Kn),Kn.forEach(t),Ot.forEach(t),jd=m(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);w(ra.$$.fragment,Dy),Dy.forEach(t),Qy.forEach(t),Ku=m(Tc),ll=r(Tc,"SPAN",{});var Oy=i(ll);ef=n(Oy,"XLMForQuestionAnswering"),Oy.forEach(t),Tc.forEach(t),Cd=m(s),ft=r(s,"DIV",{class:!0});var Pt=i(ft);w(ia.$$.fragment,Pt),tf=m(Pt),wo=r(Pt,"P",{});var Pr=i(wo);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=m(Pt),la=r(Pt,"P",{});var wc=i(la);df=n(wc,"This model inherits from "),Lr=r(wc,"A",{href:!0});var Yy=i(Lr);cf=n(Yy,"PreTrainedModel"),Yy.forEach(t),pf=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),mf=m(Pt),da=r(Pt,"P",{});var vc=i(da);hf=n(vc,"This model is also a PyTorch "),ca=r(vc,"A",{href:!0,rel:!0});var Ky=i(ca);uf=n(Ky,"torch.nn.Module"),Ky.forEach(t),ff=n(vc,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),vc.forEach(t),gf=m(Pt),Ft=r(Pt,"DIV",{class:!0});var es=i(Ft);w(pa.$$.fragment,es),_f=m(es),vo=r(es,"P",{});var Hr=i(vo);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),wf=n(Hr," special method."),Hr.forEach(t),vf=m(es),w(gn.$$.fragment,es),kf=m(es),w(_n.$$.fragment,es),es.forEach(t),Pt.forEach(t),zd=m(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);ml=r(ob,"SPAN",{});var nb=i(ml);w(ma.$$.fragment,nb),nb.forEach(t),ob.forEach(t),$f=m(kc),hl=r(kc,"SPAN",{});var sb=i(hl);Lf=n(sb,"TFXLMModel"),sb.forEach(t),kc.forEach(t),Jd=m(s),et=r(s,"DIV",{class:!0});var zt=i(et);w(ha.$$.fragment,zt),Ff=m(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=m(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=m(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=m(zt),w(yn.$$.fragment,zt),Nf=m(zt),Xt=r(zt,"DIV",{class:!0});var ts=i(Xt);w(_a.$$.fragment,ts),qf=m(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=m(ts),w(bn.$$.fragment,ts),Vf=m(ts),w(Tn.$$.fragment,ts),ts.forEach(t),zt.forEach(t),Ud=m(s),Lo=r(s,"H2",{class:!0});var Fc=i(Lo);wn=r(Fc,"A",{id:!0,class:!0,href:!0});var cb=i(wn);gl=r(cb,"SPAN",{});var pb=i(gl);w(Ma.$$.fragment,pb),pb.forEach(t),cb.forEach(t),Qf=m(Fc),_l=r(Fc,"SPAN",{});var mb=i(_l);Df=n(mb,"TFXLMWithLMHeadModel"),mb.forEach(t),Fc.forEach(t),Id=m(s),tt=r(s,"DIV",{class:!0});var Jt=i(tt);w(ya.$$.fragment,Jt),Of=m(Jt),Ml=r(Jt,"P",{});var hb=i(Ml);Pf=n(hb,`The XLM Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),hb.forEach(t),Hf=m(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=m(Jt),Ta=r(Jt,"P",{});var Ec=i(Ta);og=n(Ec,"This model is also a "),wa=r(Ec,"A",{href:!0,rel:!0});var fb=i(wa);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=m(Jt),w(vn.$$.fragment,Jt),rg=m(Jt),Et=r(Jt,"DIV",{class:!0});var os=i(Et);w(va.$$.fragment,os),ig=m(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),mg=n(Kr," special method."),Kr.forEach(t),hg=m(os),w(kn.$$.fragment,os),ug=m(os),w($n.$$.fragment,os),os.forEach(t),Jt.forEach(t),Wd=m(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);w(ka.$$.fragment,yb),yb.forEach(t),Mb.forEach(t),fg=m(xc),Tl=r(xc,"SPAN",{});var bb=i(Tl);gg=n(bb,"TFXLMForSequenceClassification"),bb.forEach(t),xc.forEach(t),Nd=m(s),ot=r(s,"DIV",{class:!0});var Ut=i(ot);w($a.$$.fragment,Ut),_g=m(Ut),wl=r(Ut,"P",{});var Tb=i(wl);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=m(Ut),La=r(Ut,"P",{});var jc=i(La);bg=n(jc,"This model inherits from "),Cr=r(jc,"A",{href:!0});var wb=i(Cr);Tg=n(wb,"TFPreTrainedModel"),wb.forEach(t),wg=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=m(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 vb=i(Xa);$g=n(vb,"tf.keras.Model"),vb.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=m(Ut),w(Fn.$$.fragment,Ut),Xg=m(Ut),_t=r(Ut,"DIV",{class:!0});var Ht=i(_t);w(Ea.$$.fragment,Ht),Eg=m(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 "),vl=r(ei,"CODE",{});var $b=i(vl);zg=n($b,"__call__"),$b.forEach(t),Jg=n(ei," special method."),ei.forEach(t),Ug=m(Ht),w(Xn.$$.fragment,Ht),Ig=m(Ht),w(En.$$.fragment,Ht),Wg=m(Ht),w(xn.$$.fragment,Ht),Ht.forEach(t),Ut.forEach(t),qd=m(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);w(xa.$$.fragment,Fb),Fb.forEach(t),Lb.forEach(t),Ng=m(zc),$l=r(zc,"SPAN",{});var Xb=i($l);qg=n(Xb,"TFXLMForMultipleChoice"),Xb.forEach(t),zc.forEach(t),Ad=m(s),nt=r(s,"DIV",{class:!0});var It=i(nt);w(ja.$$.fragment,It),Ag=m(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=m(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=m(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=m(It),w(Cn.$$.fragment,It),Hg=m(It),xt=r(It,"DIV",{class:!0});var ns=i(xt);w(Ua.$$.fragment,ns),Yg=m(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_=m(ns),w(zn.$$.fragment,ns),a_=m(ns),w(Jn.$$.fragment,ns),ns.forEach(t),It.forEach(t),Zd=m(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);w(Ia.$$.fragment,Ub),Ub.forEach(t),Jb.forEach(t),r_=m(Ic),El=r(Ic,"SPAN",{});var Ib=i(El);i_=n(Ib,"TFXLMForTokenClassification"),Ib.forEach(t),Ic.forEach(t),Sd=m(s),st=r(s,"DIV",{class:!0});var Wt=i(st);w(Wa.$$.fragment,Wt),l_=m(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_=m(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);m_=n(Nb,"TFPreTrainedModel"),Nb.forEach(t),h_=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_=m(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_=m(Wt),w(In.$$.fragment,Wt),y_=m(Wt),Mt=r(Wt,"DIV",{class:!0});var Yt=i(Mt);w(Za.$$.fragment,Yt),b_=m(Yt),zo=r(Yt,"P",{});var oi=i(zo);T_=n(oi,"The "),Wr=r(oi,"A",{href:!0});var Ab=i(Wr);w_=n(Ab,"TFXLMForTokenClassification"),Ab.forEach(t),v_=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_=m(Yt),w(Wn.$$.fragment,Yt),F_=m(Yt),w(Nn.$$.fragment,Yt),X_=m(Yt),w(qn.$$.fragment,Yt),Yt.forEach(t),Wt.forEach(t),Bd=m(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);w(Sa.$$.fragment,Bb),Bb.forEach(t),Sb.forEach(t),E_=m(qc),zl=r(qc,"SPAN",{});var Gb=i(zl);x_=n(Gb,"TFXLMForQuestionAnsweringSimple"),Gb.forEach(t),qc.forEach(t),Gd=m(s),at=r(s,"DIV",{class:!0});var Nt=i(at);w(Ba.$$.fragment,Nt),j_=m(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_=m(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_=m(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_=m(Nt),w(Zn.$$.fragment,Nt),V_=m(Nt),yt=r(Nt,"DIV",{class:!0});var Kt=i(yt);w(Qa.$$.fragment,Kt),Q_=m(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_=m(Kt),w(Sn.$$.fragment,Kt),eM=m(Kt),w(Bn.$$.fragment,Kt),tM=m(Kt),w(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(h,"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/main/en/model_doc/xlm#transformers.XLMModel"),f(ir,"href","/docs/transformers/main/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/main/en/main_classes/configuration#transformers.PretrainedConfig"),f(dr,"href","/docs/transformers/main/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/main/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(hr,"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/main/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/main/en/model_doc/xlm#transformers.XLMModel"),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(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/main/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/main/en/model_doc/xlm#transformers.XLMWithLMHeadModel"),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(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(mo,"class","relative group"),f(Mr,"href","/docs/transformers/main/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/main/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/main/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/main/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(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(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(wr,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),f(Ys,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(Ys,"rel","nofollow"),f(vr,"href","/docs/transformers/main/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(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(mn,"id","transformers.XLMForQuestionAnsweringSimple"),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.XLMForQuestionAnsweringSimple"),f(Mo,"class","relative group"),f(kr,"href","/docs/transformers/main/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/main/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/main/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/main/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/main/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/main/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(wn,"id","transformers.TFXLMWithLMHeadModel"),f(wn,"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(wn,"href","#transformers.TFXLMWithLMHeadModel"),f(Lo,"class","relative group"),f(xr,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),f(wa,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(wa,"rel","nofollow"),f(jr,"href","/docs/transformers/main/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/main/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/main/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/main/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/main/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/main/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/main/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/main/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/main/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,h,M),e(h,u),e(u,y),v(l,y,null),e(h,c),e(h,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),v(ie,B,null),e(ne,be),e(ne,G),e(G,Te),g(s,ge,M),g(s,A,M),e(A,we),e(A,le),e(le,se),e(A,C),g(s,U,M),g(s,te,M),e(te,R),e(R,ve),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,me,M),e(me,he),e(he,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),v(rs,ai,null),e(eo,Qc),e(eo,ri),e(ri,Dc),g(s,md,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,mi),e(mi,ar),e(ar,ap),g(s,hd,M),g(s,to,M),e(to,Bo),e(Bo,hi),v(is,hi,null),e(to,rp),e(to,ui),e(ui,ip),g(s,ud,M),g(s,bt,M),v(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,mp),e(qt,hp),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,wp),v(Go,bt,null),g(s,fd,M),g(s,no,M),e(no,Ro),e(Ro,fi),v(cs,fi,null),e(no,vp),e(no,gi),e(gi,kp),g(s,gd,M),g(s,De,M),v(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,wi),e(wi,Wp),e(At,Np),e(At,vi),e(vi,qp),e(At,Ap),e(lt,Zp),e(lt,ms),e(ms,Sp),e(ms,ki),e(ki,Bp),e(ms,Gp),e(lt,Rp),e(lt,hs),e(hs,Vp),e(hs,$i),e($i,Qp),e(hs,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),v(fs,St,null),e(St,em),e(St,Li),e(Li,tm),e(St,om),e(St,gs),e(gs,pr),e(pr,nm),e(pr,Fi),e(Fi,sm),e(gs,am),e(gs,mr),e(mr,rm),e(mr,Xi),e(Xi,im),e(De,lm),e(De,Vo),v(_s,Vo,null),e(Vo,dm),e(Vo,Ms),e(Ms,cm),e(Ms,Ei),e(Ei,pm),e(Ms,mm),e(De,hm),e(De,Tt),v(ys,Tt,null),e(Tt,um),e(Tt,xi),e(xi,fm),e(Tt,gm),v(Qo,Tt,null),e(Tt,_m),e(Tt,so),e(so,Mm),e(so,ji),e(ji,ym),e(so,bm),e(so,Ci),e(Ci,Tm),e(so,wm),e(De,vm),e(De,hr),v(bs,hr,null),g(s,_d,M),g(s,ao,M),e(ao,Do),e(Do,zi),v(Ts,zi,null),e(ao,km),e(ao,Ji),e(Ji,$m),g(s,Md,M),g(s,ro,M),v(ws,ro,null),e(ro,Lm),e(ro,vs),e(vs,Fm),e(vs,Ui),e(Ui,Xm),e(vs,Em),g(s,yd,M),g(s,io,M),e(io,Oo),e(Oo,Ii),v(ks,Ii,null),e(io,xm),e(io,Wi),e(Wi,jm),g(s,bd,M),g(s,dt,M),v($s,dt,null),e(dt,Cm),e(dt,Ni),e(Ni,zm),e(dt,Jm),e(dt,Ls),e(Ls,Um),e(Ls,ur),e(ur,Im),e(Ls,Wm),e(dt,Nm),e(dt,Fs),e(Fs,qm),e(Fs,Xs),e(Xs,Am),e(Fs,Zm),e(dt,Sm),e(dt,wt),v(Es,wt,null),e(wt,Bm),e(wt,lo),e(lo,Gm),e(lo,fr),e(fr,Rm),e(lo,Vm),e(lo,qi),e(qi,Qm),e(lo,Dm),e(wt,Om),v(Po,wt,null),e(wt,Pm),v(Ho,wt,null),g(s,Td,M),g(s,co,M),e(co,Yo),e(Yo,Ai),v(xs,Ai,null),e(co,Hm),e(co,Zi),e(Zi,Ym),g(s,wd,M),g(s,ct,M),v(js,ct,null),e(ct,Km),e(ct,Si),e(Si,eh),e(ct,th),e(ct,Cs),e(Cs,oh),e(Cs,gr),e(gr,nh),e(Cs,sh),e(ct,ah),e(ct,zs),e(zs,rh),e(zs,Js),e(Js,ih),e(zs,lh),e(ct,dh),e(ct,vt),v(Us,vt,null),e(vt,ch),e(vt,po),e(po,ph),e(po,_r),e(_r,mh),e(po,hh),e(po,Bi),e(Bi,uh),e(po,fh),e(vt,gh),v(Ko,vt,null),e(vt,_h),v(en,vt,null),g(s,vd,M),g(s,mo,M),e(mo,tn),e(tn,Gi),v(Is,Gi,null),e(mo,Mh),e(mo,Ri),e(Ri,yh),g(s,kd,M),g(s,pt,M),v(Ws,pt,null),e(pt,bh),e(pt,Vi),e(Vi,Th),e(pt,wh),e(pt,Ns),e(Ns,vh),e(Ns,Mr),e(Mr,kh),e(Ns,$h),e(pt,Lh),e(pt,qs),e(qs,Fh),e(qs,As),e(As,Xh),e(qs,Eh),e(pt,xh),e(pt,gt),v(Zs,gt,null),e(gt,jh),e(gt,ho),e(ho,Ch),e(ho,yr),e(yr,zh),e(ho,Jh),e(ho,Qi),e(Qi,Uh),e(ho,Ih),e(gt,Wh),v(on,gt,null),e(gt,Nh),v(nn,gt,null),e(gt,qh),v(sn,gt,null),g(s,$d,M),g(s,uo,M),e(uo,an),e(an,Di),v(Ss,Di,null),e(uo,Ah),e(uo,Oi),e(Oi,Zh),g(s,Ld,M),g(s,mt,M),v(Bs,mt,null),e(mt,Sh),e(mt,Pi),e(Pi,Bh),e(mt,Gh),e(mt,Gs),e(Gs,Rh),e(Gs,br),e(br,Vh),e(Gs,Qh),e(mt,Dh),e(mt,Rs),e(Rs,Oh),e(Rs,Vs),e(Vs,Ph),e(Rs,Hh),e(mt,Yh),e(mt,kt),v(Qs,kt,null),e(kt,Kh),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),v(rn,kt,null),e(kt,ru),v(ln,kt,null),g(s,Fd,M),g(s,go,M),e(go,dn),e(dn,Yi),v(Ds,Yi,null),e(go,iu),e(go,Ki),e(Ki,lu),g(s,Xd,M),g(s,ht,M),v(Os,ht,null),e(ht,du),e(ht,el),e(el,cu),e(ht,pu),e(ht,Ps),e(Ps,mu),e(Ps,wr),e(wr,hu),e(Ps,uu),e(ht,fu),e(ht,Hs),e(Hs,gu),e(Hs,Ys),e(Ys,_u),e(Hs,Mu),e(ht,yu),e(ht,$t),v(Ks,$t,null),e($t,bu),e($t,_o),e(_o,Tu),e(_o,vr),e(vr,wu),e(_o,vu),e(_o,tl),e(tl,ku),e(_o,$u),e($t,Lu),v(cn,$t,null),e($t,Fu),v(pn,$t,null),g(s,Ed,M),g(s,Mo,M),e(Mo,mn),e(mn,ol),v(ea,ol,null),e(Mo,Xu),e(Mo,nl),e(nl,Eu),g(s,xd,M),g(s,ut,M),v(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),v(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),v(hn,Lt,null),e(Lt,Yu),v(un,Lt,null),g(s,jd,M),g(s,To,M),e(To,fn),e(fn,il),v(ra,il,null),e(To,Ku),e(To,ll),e(ll,ef),g(s,Cd,M),g(s,ft,M),v(ia,ft,null),e(ft,tf),e(ft,wo),e(wo,of),e(wo,dl),e(dl,nf),e(wo,sf),e(wo,cl),e(cl,af),e(wo,rf),e(ft,lf),e(ft,la),e(la,df),e(la,Lr),e(Lr,cf),e(la,pf),e(ft,mf),e(ft,da),e(da,hf),e(da,ca),e(ca,uf),e(da,ff),e(ft,gf),e(ft,Ft),v(pa,Ft,null),e(Ft,_f),e(Ft,vo),e(vo,Mf),e(vo,Fr),e(Fr,yf),e(vo,bf),e(vo,pl),e(pl,Tf),e(vo,wf),e(Ft,vf),v(gn,Ft,null),e(Ft,kf),v(_n,Ft,null),g(s,zd,M),g(s,ko,M),e(ko,Mn),e(Mn,ml),v(ma,ml,null),e(ko,$f),e(ko,hl),e(hl,Lf),g(s,Jd,M),g(s,et,M),v(ha,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),v(yn,et,null),e(et,Nf),e(et,Xt),v(_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),v(bn,Xt,null),e(Xt,Vf),v(Tn,Xt,null),g(s,Ud,M),g(s,Lo,M),e(Lo,wn),e(wn,gl),v(Ma,gl,null),e(Lo,Qf),e(Lo,_l),e(_l,Df),g(s,Id,M),g(s,tt,M),v(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,wa),e(wa,ng),e(Ta,sg),e(tt,ag),v(vn,tt,null),e(tt,rg),e(tt,Et),v(va,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,mg),e(Et,hg),v(kn,Et,null),e(Et,ug),v($n,Et,null),g(s,Wd,M),g(s,Xo,M),e(Xo,Ln),e(Ln,bl),v(ka,bl,null),e(Xo,fg),e(Xo,Tl),e(Tl,gg),g(s,Nd,M),g(s,ot,M),v($a,ot,null),e(ot,_g),e(ot,wl),e(wl,Mg),e(ot,yg),e(ot,La),e(La,bg),e(La,Cr),e(Cr,Tg),e(La,wg),e(ot,vg),e(ot,Fa),e(Fa,kg),e(Fa,Xa),e(Xa,$g),e(Fa,Lg),e(ot,Fg),v(Fn,ot,null),e(ot,Xg),e(ot,_t),v(Ea,_t,null),e(_t,Eg),e(_t,Eo),e(Eo,xg),e(Eo,zr),e(zr,jg),e(Eo,Cg),e(Eo,vl),e(vl,zg),e(Eo,Jg),e(_t,Ug),v(Xn,_t,null),e(_t,Ig),v(En,_t,null),e(_t,Wg),v(xn,_t,null),g(s,qd,M),g(s,xo,M),e(xo,jn),e(jn,kl),v(xa,kl,null),e(xo,Ng),e(xo,$l),e($l,qg),g(s,Ad,M),g(s,nt,M),v(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),v(Cn,nt,null),e(nt,Hg),e(nt,xt),v(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_),v(zn,xt,null),e(xt,a_),v(Jn,xt,null),g(s,Zd,M),g(s,Co,M),e(Co,Un),e(Un,Xl),v(Ia,Xl,null),e(Co,r_),e(Co,El),e(El,i_),g(s,Sd,M),g(s,st,M),v(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,m_),e(Na,h_),e(st,u_),e(st,qa),e(qa,f_),e(qa,Aa),e(Aa,g_),e(qa,__),e(st,M_),v(In,st,null),e(st,y_),e(st,Mt),v(Za,Mt,null),e(Mt,b_),e(Mt,zo),e(zo,T_),e(zo,Wr),e(Wr,w_),e(zo,v_),e(zo,jl),e(jl,k_),e(zo,$_),e(Mt,L_),v(Wn,Mt,null),e(Mt,F_),v(Nn,Mt,null),e(Mt,X_),v(qn,Mt,null),g(s,Bd,M),g(s,Jo,M),e(Jo,An),e(An,Cl),v(Sa,Cl,null),e(Jo,E_),e(Jo,zl),e(zl,x_),g(s,Gd,M),g(s,at,M),v(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_),v(Zn,at,null),e(at,V_),e(at,yt),v(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_),v(Sn,yt,null),e(yt,eM),v(Bn,yt,null),e(yt,tM),v(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}),hn.$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}),vn.$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(ws.$$.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(hn.$$.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(ma.$$.fragment,s),k(ha.$$.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(vn.$$.fragment,s),k(va.$$.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),$(ws.$$.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),$(hn.$$.fragment,s),$(un.$$.fragment,s),$(ra.$$.fragment,s),$(ia.$$.fragment,s),$(pa.$$.fragment,s),$(gn.$$.fragment,s),$(_n.$$.fragment,s),$(ma.$$.fragment,s),$(ha.$$.fragment,s),$(yn.$$.fragment,s),$(_a.$$.fragment,s),$(bn.$$.fragment,s),$(Tn.$$.fragment,s),$(Ma.$$.fragment,s),$(ya.$$.fragment,s),$(vn.$$.fragment,s),$(va.$$.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(h),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(me),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(md),s&&t(rt),s&&t(hd),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(ws),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(wd),s&&t(ct),L(js),L(Us),L(Ko),L(en),s&&t(vd),s&&t(mo),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(mt),L(Bs),L(Qs),L(rn),L(ln),s&&t(Fd),s&&t(go),L(Ds),s&&t(Xd),s&&t(ht),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(hn),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(ma),s&&t(Jd),s&&t(et),L(ha),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(vn),L(va),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};
