import{S as Jy,i as Zy,s as eb,e as a,k as p,w as b,t as o,M as tb,c as r,d as t,m as h,a as i,x as w,h as n,b as f,N as Yy,G as e,g,y as T,q as M,o as $,B as L,v as ob,L as Je}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ve}from"../../chunks/Tip-hf-doc-builder.js";import{D as ae}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ze}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ge}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ye}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function nb(q){let d,y,m,u,v;return u=new Ze({props:{code:`from transformers import XLMConfig, XLMModel

# Initializing a XLM configuration
configuration = XLMConfig()

# Initializing a model (with random weights) from the configuration
model = XLMModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> 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"),y=o("Examples:"),m=p(),b(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=n(c,"Examples:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,y),g(l,m,c),T(u,l,c),v=!0},p:Je,i(l){v||(M(u.$$.fragment,l),v=!0)},o(l){$(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function sb(q){let d,y,m,u,v;return u=new Ze({props:{code:`0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
| first sequence    | second sequence |`,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"),y=o("pair mask has the following format:"),m=p(),b(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=n(c,"pair mask has the following format:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,y),g(l,m,c),T(u,l,c),v=!0},p:Je,i(l){v||(M(u.$$.fragment,l),v=!0)},o(l){$(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function ab(q){let d,y,m,u,v;return{c(){d=a("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=o("Module"),v=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);y=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var X=i(m);u=n(X,"Module"),X.forEach(t),v=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,y),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function rb(q){let d,y,m,u,v;return u=new Ze({props:{code:`from transformers import AutoTokenizer, XLMModel
import torch

tokenizer = AutoTokenizer.from_pretrained("xlm-mlm-en-2048")
model = XLMModel.from_pretrained("xlm-mlm-en-2048")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state`,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"),y=o("Example:"),m=p(),b(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=n(c,"Example:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,y),g(l,m,c),T(u,l,c),v=!0},p:Je,i(l){v||(M(u.$$.fragment,l),v=!0)},o(l){$(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function ib(q){let d,y,m,u,v;return{c(){d=a("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=o("Module"),v=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);y=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var X=i(m);u=n(X,"Module"),X.forEach(t),v=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,y),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function lb(q){let d,y,m,u,v;return u=new Ze({props:{code:`from transformers import AutoTokenizer, XLMWithLMHeadModel
import torch

tokenizer = AutoTokenizer.from_pretrained("xlm-mlm-en-2048")
model = XLMWithLMHeadModel.from_pretrained("xlm-mlm-en-2048")

inputs = tokenizer("The capital of France is <special1>.", return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

# retrieve index of <special1>
mask_token_index = (inputs.input_ids == tokenizer.mask_token_id)[0].nonzero(as_tuple=True)[0]

predicted_token_id = logits[0, mask_token_index].argmax(axis=-1)

labels = tokenizer("The capital of France is Paris.", return_tensors="pt")["input_ids"]
# mask labels of non-<special1> tokens
labels = torch.where(inputs.input_ids == tokenizer.mask_token_id, labels, -100)

outputs = model(**inputs, labels=labels)`,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"),y=o("Example:"),m=p(),b(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=n(c,"Example:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,y),g(l,m,c),T(u,l,c),v=!0},p:Je,i(l){v||(M(u.$$.fragment,l),v=!0)},o(l){$(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function db(q){let d,y,m,u,v;return{c(){d=a("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=o("Module"),v=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);y=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var X=i(m);u=n(X,"Module"),X.forEach(t),v=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,y),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function cb(q){let d,y,m,u,v;return u=new Ze({props:{code:`import torch
from transformers import AutoTokenizer, XLMForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("xlm-mlm-en-2048")
model = XLMForSequenceClassification.from_pretrained("xlm-mlm-en-2048")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_id = logits.argmax().item()

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = XLMForSequenceClassification.from_pretrained("xlm-mlm-en-2048", num_labels=num_labels)

labels = torch.tensor([1])
loss = model(**inputs, labels=labels).loss`,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"),y=o("Example of single-label classification:"),m=p(),b(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=n(c,"Example of single-label classification:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,y),g(l,m,c),T(u,l,c),v=!0},p:Je,i(l){v||(M(u.$$.fragment,l),v=!0)},o(l){$(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function pb(q){let d,y,m,u,v;return u=new Ze({props:{code:`import torch
from transformers import AutoTokenizer, XLMForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("xlm-mlm-en-2048")
model = XLMForSequenceClassification.from_pretrained("xlm-mlm-en-2048", problem_type="multi_label_classification")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_ids = torch.arange(0, logits.shape[-1])[torch.sigmoid(logits).squeeze(dim=0) > 0.5]

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = XLMForSequenceClassification.from_pretrained(
    "xlm-mlm-en-2048", num_labels=num_labels, problem_type="multi_label_classification"
)

labels = torch.sum(
    torch.nn.functional.one_hot(predicted_class_ids[None, :].clone(), num_classes=num_labels), dim=1
).to(torch.float)
loss = model(**inputs, labels=labels).loss`,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"),y=o("Example of multi-label classification:"),m=p(),b(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=n(c,"Example of multi-label classification:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,y),g(l,m,c),T(u,l,c),v=!0},p:Je,i(l){v||(M(u.$$.fragment,l),v=!0)},o(l){$(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function hb(q){let d,y,m,u,v;return{c(){d=a("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=o("Module"),v=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);y=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var X=i(m);u=n(X,"Module"),X.forEach(t),v=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,y),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function mb(q){let d,y,m,u,v;return u=new Ze({props:{code:`from transformers import AutoTokenizer, XLMForMultipleChoice
import torch

tokenizer = AutoTokenizer.from_pretrained("xlm-mlm-en-2048")
model = XLMForMultipleChoice.from_pretrained("xlm-mlm-en-2048")

prompt = "In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced."
choice0 = "It is eaten with a fork and a knife."
choice1 = "It is eaten while held in the hand."
labels = torch.tensor(0).unsqueeze(0)  # choice0 is correct (according to Wikipedia ;)), batch size 1

encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors="pt", padding=True)
outputs = model(**{k: v.unsqueeze(0) for k, v in encoding.items()}, labels=labels)  # batch size is 1

# the linear classifier still needs to be trained
loss = outputs.loss
logits = outputs.logits`,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"),y=o("Example:"),m=p(),b(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=n(c,"Example:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,y),g(l,m,c),T(u,l,c),v=!0},p:Je,i(l){v||(M(u.$$.fragment,l),v=!0)},o(l){$(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function ub(q){let d,y,m,u,v;return{c(){d=a("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=o("Module"),v=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);y=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var X=i(m);u=n(X,"Module"),X.forEach(t),v=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,y),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function fb(q){let d,y,m,u,v;return u=new Ze({props:{code:`from transformers import AutoTokenizer, XLMForTokenClassification
import torch

tokenizer = AutoTokenizer.from_pretrained("xlm-mlm-en-2048")
model = XLMForTokenClassification.from_pretrained("xlm-mlm-en-2048")

inputs = tokenizer(
    "HuggingFace is a company based in Paris and New York", add_special_tokens=False, return_tensors="pt"
)

with torch.no_grad():
    logits = model(**inputs).logits

predicted_token_class_ids = logits.argmax(-1)

# Note that tokens are classified rather then input words which means that
# there might be more predicted token classes than words.
# Multiple token classes might account for the same word
predicted_tokens_classes = [model.config.id2label[t.item()] for t in predicted_token_class_ids[0]]

labels = predicted_token_class_ids
loss = model(**inputs, labels=labels).loss`,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"),y=o("Example:"),m=p(),b(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=n(c,"Example:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,y),g(l,m,c),T(u,l,c),v=!0},p:Je,i(l){v||(M(u.$$.fragment,l),v=!0)},o(l){$(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function gb(q){let d,y,m,u,v;return{c(){d=a("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=o("Module"),v=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);y=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var X=i(m);u=n(X,"Module"),X.forEach(t),v=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,y),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function _b(q){let d,y,m,u,v;return u=new Ze({props:{code:`from transformers import AutoTokenizer, XLMForQuestionAnsweringSimple
import torch

tokenizer = AutoTokenizer.from_pretrained("xlm-mlm-en-2048")
model = XLMForQuestionAnsweringSimple.from_pretrained("xlm-mlm-en-2048")

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"

inputs = tokenizer(question, text, return_tensors="pt")
with torch.no_grad():
    outputs = model(**inputs)

answer_start_index = outputs.start_logits.argmax()
answer_end_index = outputs.end_logits.argmax()

predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]

# target is "nice puppet"
target_start_index = torch.tensor([14])
target_end_index = torch.tensor([15])

outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
loss = outputs.loss`,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"),y=o("Example:"),m=p(),b(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=n(c,"Example:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,y),g(l,m,c),T(u,l,c),v=!0},p:Je,i(l){v||(M(u.$$.fragment,l),v=!0)},o(l){$(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function kb(q){let d,y,m,u,v;return{c(){d=a("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=o("Module"),v=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);y=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var X=i(m);u=n(X,"Module"),X.forEach(t),v=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,y),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function vb(q){let d,y,m,u,v;return u=new Ze({props:{code:`from transformers import AutoTokenizer, XLMForQuestionAnswering
import torch

tokenizer = AutoTokenizer.from_pretrained("xlm-mlm-en-2048")
model = XLMForQuestionAnswering.from_pretrained("xlm-mlm-en-2048")

input_ids = torch.tensor(tokenizer.encode("Hello, my dog is cute", add_special_tokens=True)).unsqueeze(
    0
)  # Batch size 1
start_positions = torch.tensor([1])
end_positions = torch.tensor([3])

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

tokenizer = AutoTokenizer.from_pretrained("xlm-mlm-en-2048")
model = TFXLMModel.from_pretrained("xlm-mlm-en-2048")

inputs = tokenizer("Hello, my dog is cute", return_tensors="tf")
outputs = model(inputs)

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

tokenizer = AutoTokenizer.from_pretrained("xlm-mlm-en-2048")
model = TFXLMWithLMHeadModel.from_pretrained("xlm-mlm-en-2048")

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

tokenizer = AutoTokenizer.from_pretrained("xlm-mlm-en-2048")
model = TFXLMForSequenceClassification.from_pretrained("xlm-mlm-en-2048")

inputs = tokenizer("Hello, my dog is cute", return_tensors="tf")

logits = model(**inputs).logits

predicted_class_id = int(tf.math.argmax(logits, axis=-1)[0])`,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"),y=o("Example:"),m=p(),b(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=n(c,"Example:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,y),g(l,m,c),T(u,l,c),v=!0},p:Je,i(l){v||(M(u.$$.fragment,l),v=!0)},o(l){$(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function Eb(q){let d,y;return d=new Ze({props:{code:'# To train a model on `num_labels` classes, you can pass `num_labels=num_labels` to `.from_pretrained(...)`\nnum_labels = len(model.config.id2label)\nmodel = TFXLMForSequenceClassification.from_pretrained("xlm-mlm-en-2048", num_labels=num_labels)\n\nlabels = tf.constant(1)\nloss = model(**inputs, labels=labels).loss',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(){b(d.$$.fragment)},l(m){w(d.$$.fragment,m)},m(m,u){T(d,m,u),y=!0},p:Je,i(m){y||(M(d.$$.fragment,m),y=!0)},o(m){$(d.$$.fragment,m),y=!1},d(m){L(d,m)}}}function Xb(q){let d,y,m,u,v,l,c,X,ke,fe,P,de,J,x,ve,S,ce,je,K,ne,re,H,ie,ye,Q,be,ge,I,we,le,se,z,A,te,U,Te,Me,B,$e,Le,j,xe,R,pe,Fe,V,he,me,O,_e,W,Ee,oe,C,ue,N,Xe,qe;return{c(){d=a("p"),y=o("TensorFlow models and layers in "),m=a("code"),u=o("transformers"),v=o(" accept two formats as input:"),l=p(),c=a("ul"),X=a("li"),ke=o("having all inputs as keyword arguments (like PyTorch models), or"),fe=p(),P=a("li"),de=o("having all inputs as a list, tuple or dict in the first positional argument."),J=p(),x=a("p"),ve=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 `),S=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 `),K=a("code"),ne=o("model.fit()"),re=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),H=a("code"),ie=o("fit()"),ye=o(" and "),Q=a("code"),be=o("predict()"),ge=o(`, such as when creating your own layers or models with
the Keras `),I=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(),z=a("ul"),A=a("li"),te=o("a single Tensor with "),U=a("code"),Te=o("input_ids"),Me=o(" only and nothing else: "),B=a("code"),$e=o("model(input_ids)"),Le=p(),j=a("li"),xe=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=a("code"),pe=o("model([input_ids, attention_mask])"),Fe=o(" or "),V=a("code"),he=o("model([input_ids, attention_mask, token_type_ids])"),me=p(),O=a("li"),_e=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=a("code"),Ee=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),oe=p(),C=a("p"),ue=o(`Note that when creating models and layers with
`),N=a("a"),Xe=o("subclassing"),qe=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 F=i(d);y=n(F,"TensorFlow models and layers in "),m=r(F,"CODE",{});var De=i(m);u=n(De,"transformers"),De.forEach(t),v=n(F," accept two formats as input:"),F.forEach(t),l=h(_),c=r(_,"UL",{});var Z=i(c);X=r(Z,"LI",{});var Ie=i(X);ke=n(Ie,"having all inputs as keyword arguments (like PyTorch models), or"),Ie.forEach(t),fe=h(Z),P=r(Z,"LI",{});var Se=i(P);de=n(Se,"having all inputs as a list, tuple or dict in the first positional argument."),Se.forEach(t),Z.forEach(t),J=h(_),x=r(_,"P",{});var E=i(x);ve=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 `),S=r(E,"CODE",{});var We=i(S);ce=n(We,"model.fit()"),We.forEach(t),je=n(E,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),K=r(E,"CODE",{});var He=i(K);ne=n(He,"model.fit()"),He.forEach(t),re=n(E,` supports! If, however, you want to use the second
format outside of Keras methods like `),H=r(E,"CODE",{});var Qe=i(H);ie=n(Qe,"fit()"),Qe.forEach(t),ye=n(E," and "),Q=r(E,"CODE",{});var Ae=i(Q);be=n(Ae,"predict()"),Ae.forEach(t),ge=n(E,`, such as when creating your own layers or models with
the Keras `),I=r(E,"CODE",{});var Ne=i(I);we=n(Ne,"Functional"),Ne.forEach(t),le=n(E,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),E.forEach(t),se=h(_),z=r(_,"UL",{});var D=i(z);A=r(D,"LI",{});var G=i(A);te=n(G,"a single Tensor with "),U=r(G,"CODE",{});var ze=i(U);Te=n(ze,"input_ids"),ze.forEach(t),Me=n(G," only and nothing else: "),B=r(G,"CODE",{});var Pe=i(B);$e=n(Pe,"model(input_ids)"),Pe.forEach(t),G.forEach(t),Le=h(D),j=r(D,"LI",{});var Y=i(j);xe=n(Y,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=r(Y,"CODE",{});var Ue=i(R);pe=n(Ue,"model([input_ids, attention_mask])"),Ue.forEach(t),Fe=n(Y," or "),V=r(Y,"CODE",{});var Oe=i(V);he=n(Oe,"model([input_ids, attention_mask, token_type_ids])"),Oe.forEach(t),Y.forEach(t),me=h(D),O=r(D,"LI",{});var Ce=i(O);_e=n(Ce,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),W=r(Ce,"CODE",{});var Be=i(W);Ee=n(Be,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Be.forEach(t),Ce.forEach(t),D.forEach(t),oe=h(_),C=r(_,"P",{});var ee=i(C);ue=n(ee,`Note that when creating models and layers with
`),N=r(ee,"A",{href:!0,rel:!0});var Ke=i(N);Xe=n(Ke,"subclassing"),Ke.forEach(t),qe=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(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),f(N,"rel","nofollow")},m(_,F){g(_,d,F),e(d,y),e(d,m),e(m,u),e(d,v),g(_,l,F),g(_,c,F),e(c,X),e(X,ke),e(c,fe),e(c,P),e(P,de),g(_,J,F),g(_,x,F),e(x,ve),e(x,S),e(S,ce),e(x,je),e(x,K),e(K,ne),e(x,re),e(x,H),e(H,ie),e(x,ye),e(x,Q),e(Q,be),e(x,ge),e(x,I),e(I,we),e(x,le),g(_,se,F),g(_,z,F),e(z,A),e(A,te),e(A,U),e(U,Te),e(A,Me),e(A,B),e(B,$e),e(z,Le),e(z,j),e(j,xe),e(j,R),e(R,pe),e(j,Fe),e(j,V),e(V,he),e(z,me),e(z,O),e(O,_e),e(O,W),e(W,Ee),g(_,oe,F),g(_,C,F),e(C,ue),e(C,N),e(N,Xe),e(C,qe)},d(_){_&&t(d),_&&t(l),_&&t(c),_&&t(J),_&&t(x),_&&t(se),_&&t(z),_&&t(oe),_&&t(C)}}}function qb(q){let d,y,m,u,v;return{c(){d=a("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=o("Module"),v=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);y=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var X=i(m);u=n(X,"Module"),X.forEach(t),v=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,y),e(d,m),e(m,u),e(d,v)},d(l){l&&t(d)}}}function zb(q){let d,y,m,u,v;return u=new Ze({props:{code:`from transformers import AutoTokenizer, TFXLMForMultipleChoice
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("xlm-mlm-en-2048")
model = TFXLMForMultipleChoice.from_pretrained("xlm-mlm-en-2048")

prompt = "In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced."
choice0 = "It is eaten with a fork and a knife."
choice1 = "It is eaten while held in the hand."

encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors="tf", padding=True)
inputs = {k: tf.expand_dims(v, 0) for k, v in encoding.items()}
outputs = model(inputs)  # batch size is 1

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

tokenizer = AutoTokenizer.from_pretrained("xlm-mlm-en-2048")
model = TFXLMForTokenClassification.from_pretrained("xlm-mlm-en-2048")

inputs = tokenizer(
    "HuggingFace is a company based in Paris and New York", add_special_tokens=False, return_tensors="tf"
)

logits = model(**inputs).logits
predicted_token_class_ids = tf.math.argmax(logits, axis=-1)

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

tokenizer = AutoTokenizer.from_pretrained("xlm-mlm-en-2048")
model = TFXLMForQuestionAnsweringSimple.from_pretrained("xlm-mlm-en-2048")

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"

inputs = tokenizer(question, text, return_tensors="tf")
outputs = model(**inputs)

answer_start_index = int(tf.math.argmax(outputs.start_logits, axis=-1)[0])
answer_end_index = int(tf.math.argmax(outputs.end_logits, axis=-1)[0])

predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]`,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"),y=o("Example:"),m=p(),b(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=n(c,"Example:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,y),g(l,m,c),T(u,l,c),v=!0},p:Je,i(l){v||(M(u.$$.fragment,l),v=!0)},o(l){$(u.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(m),L(u,l)}}}function Ib(q){let d,y;return d=new Ze({props:{code:`# target is "nice puppet"
target_start_index = tf.constant([14])
target_end_index = tf.constant([15])

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

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