import{S as q_,i as x_,s as C_,e as a,k as p,w as T,t as n,M as j_,c as r,d as t,m as h,a as i,x as y,h as s,b as g,G as e,g as _,y as M,q as $,o as P,B as N,v as A_,L as Je}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ve}from"../../chunks/Tip-hf-doc-builder.js";import{D as ie}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ye}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Xe}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ge}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function O_(q){let d,v,m,u,b;return u=new Ye({props:{code:`from transformers import MPNetModel, MPNetConfig

# Initializing a MPNet mpnet-base style configuration
configuration = MPNetConfig()

# Initializing a model from the mpnet-base style configuration
model = MPNetModel(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> MPNetModel, MPNetConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a MPNet mpnet-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = MPNetConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the mpnet-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MPNetModel(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"),v=n("Examples:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);v=s(c,"Examples:"),c.forEach(t),m=h(l),y(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,v),_(l,m,c),M(u,l,c),b=!0},p:Je,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){P(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(m),N(u,l)}}}function L_(q){let d,v,m,u,b;return{c(){d=a("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=n("Module"),b=n(`
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);v=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var z=i(m);u=s(z,"Module"),z.forEach(t),b=s(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){_(l,d,c),e(d,v),e(d,m),e(m,u),e(d,b)},d(l){l&&t(d)}}}function D_(q){let d,v,m,u,b;return u=new Ye({props:{code:`from transformers import AutoTokenizer, MPNetModel
import torch

tokenizer = AutoTokenizer.from_pretrained("microsoft/mpnet-base")
model = MPNetModel.from_pretrained("microsoft/mpnet-base")

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, MPNetModel
<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;microsoft/mpnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MPNetModel.from_pretrained(<span class="hljs-string">&quot;microsoft/mpnet-base&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"),v=n("Example:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);v=s(c,"Example:"),c.forEach(t),m=h(l),y(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,v),_(l,m,c),M(u,l,c),b=!0},p:Je,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){P(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(m),N(u,l)}}}function I_(q){let d,v,m,u,b;return{c(){d=a("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=n("Module"),b=n(`
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);v=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var z=i(m);u=s(z,"Module"),z.forEach(t),b=s(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){_(l,d,c),e(d,v),e(d,m),e(m,u),e(d,b)},d(l){l&&t(d)}}}function S_(q){let d,v,m,u,b;return u=new Ye({props:{code:`from transformers import AutoTokenizer, MPNetForMaskedLM
import torch

tokenizer = AutoTokenizer.from_pretrained("microsoft/mpnet-base")
model = MPNetForMaskedLM.from_pretrained("microsoft/mpnet-base")

inputs = tokenizer("The capital of France is [MASK].", return_tensors="pt")

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

# retrieve index of [MASK]
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-[MASK] 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, MPNetForMaskedLM
<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;microsoft/mpnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MPNetForMaskedLM.from_pretrained(<span class="hljs-string">&quot;microsoft/mpnet-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The capital of France is [MASK].&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 [MASK]</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-[MASK] 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"),v=n("Example:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);v=s(c,"Example:"),c.forEach(t),m=h(l),y(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,v),_(l,m,c),M(u,l,c),b=!0},p:Je,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){P(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(m),N(u,l)}}}function W_(q){let d,v,m,u,b;return{c(){d=a("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=n("Module"),b=n(`
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);v=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var z=i(m);u=s(z,"Module"),z.forEach(t),b=s(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){_(l,d,c),e(d,v),e(d,m),e(m,u),e(d,b)},d(l){l&&t(d)}}}function K_(q){let d,v,m,u,b;return u=new Ye({props:{code:`import torch
from transformers import AutoTokenizer, MPNetForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("microsoft/mpnet-base")
model = MPNetForSequenceClassification.from_pretrained("microsoft/mpnet-base")

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 = MPNetForSequenceClassification.from_pretrained("microsoft/mpnet-base", 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, MPNetForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;microsoft/mpnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MPNetForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/mpnet-base&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 = MPNetForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/mpnet-base&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"),v=n("Example of single-label classification:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);v=s(c,"Example of single-label classification:"),c.forEach(t),m=h(l),y(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,v),_(l,m,c),M(u,l,c),b=!0},p:Je,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){P(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(m),N(u,l)}}}function U_(q){let d,v,m,u,b;return u=new Ye({props:{code:`import torch
from transformers import AutoTokenizer, MPNetForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("microsoft/mpnet-base")
model = MPNetForSequenceClassification.from_pretrained("microsoft/mpnet-base", 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 = MPNetForSequenceClassification.from_pretrained(
    "microsoft/mpnet-base", 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, MPNetForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;microsoft/mpnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MPNetForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/mpnet-base&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 = MPNetForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;microsoft/mpnet-base&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"),v=n("Example of multi-label classification:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);v=s(c,"Example of multi-label classification:"),c.forEach(t),m=h(l),y(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,v),_(l,m,c),M(u,l,c),b=!0},p:Je,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){P(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(m),N(u,l)}}}function Q_(q){let d,v,m,u,b;return{c(){d=a("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=n("Module"),b=n(`
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);v=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var z=i(m);u=s(z,"Module"),z.forEach(t),b=s(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){_(l,d,c),e(d,v),e(d,m),e(m,u),e(d,b)},d(l){l&&t(d)}}}function B_(q){let d,v,m,u,b;return u=new Ye({props:{code:`from transformers import AutoTokenizer, MPNetForMultipleChoice
import torch

tokenizer = AutoTokenizer.from_pretrained("microsoft/mpnet-base")
model = MPNetForMultipleChoice.from_pretrained("microsoft/mpnet-base")

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, MPNetForMultipleChoice
<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;microsoft/mpnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MPNetForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;microsoft/mpnet-base&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"),v=n("Example:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);v=s(c,"Example:"),c.forEach(t),m=h(l),y(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,v),_(l,m,c),M(u,l,c),b=!0},p:Je,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){P(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(m),N(u,l)}}}function H_(q){let d,v,m,u,b;return{c(){d=a("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=n("Module"),b=n(`
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);v=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var z=i(m);u=s(z,"Module"),z.forEach(t),b=s(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){_(l,d,c),e(d,v),e(d,m),e(m,u),e(d,b)},d(l){l&&t(d)}}}function R_(q){let d,v,m,u,b;return u=new Ye({props:{code:`from transformers import AutoTokenizer, MPNetForTokenClassification
import torch

tokenizer = AutoTokenizer.from_pretrained("microsoft/mpnet-base")
model = MPNetForTokenClassification.from_pretrained("microsoft/mpnet-base")

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, MPNetForTokenClassification
<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;microsoft/mpnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MPNetForTokenClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/mpnet-base&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"),v=n("Example:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);v=s(c,"Example:"),c.forEach(t),m=h(l),y(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,v),_(l,m,c),M(u,l,c),b=!0},p:Je,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){P(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(m),N(u,l)}}}function V_(q){let d,v,m,u,b;return{c(){d=a("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=n("Module"),b=n(`
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);v=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var z=i(m);u=s(z,"Module"),z.forEach(t),b=s(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){_(l,d,c),e(d,v),e(d,m),e(m,u),e(d,b)},d(l){l&&t(d)}}}function X_(q){let d,v,m,u,b;return u=new Ye({props:{code:`from transformers import AutoTokenizer, MPNetForQuestionAnswering
import torch

tokenizer = AutoTokenizer.from_pretrained("microsoft/mpnet-base")
model = MPNetForQuestionAnswering.from_pretrained("microsoft/mpnet-base")

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

tokenizer = AutoTokenizer.from_pretrained("microsoft/mpnet-base")
model = TFMPNetModel.from_pretrained("microsoft/mpnet-base")

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

tokenizer = AutoTokenizer.from_pretrained("microsoft/mpnet-base")
model = TFMPNetForMaskedLM.from_pretrained("microsoft/mpnet-base")

inputs = tokenizer("The capital of France is [MASK].", return_tensors="tf")
logits = model(**inputs).logits

# retrieve index of [MASK]
mask_token_index = tf.where((inputs.input_ids == tokenizer.mask_token_id)[0])
selected_logits = tf.gather_nd(logits[0], indices=mask_token_index)

predicted_token_id = tf.math.argmax(selected_logits, axis=-1)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFMPNetForMaskedLM
<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;microsoft/mpnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFMPNetForMaskedLM.from_pretrained(<span class="hljs-string">&quot;microsoft/mpnet-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The capital of France is [MASK].&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><span class="hljs-comment"># retrieve index of [MASK]</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_token_index = tf.where((inputs.input_ids == tokenizer.mask_token_id)[<span class="hljs-number">0</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>selected_logits = tf.gather_nd(logits[<span class="hljs-number">0</span>], indices=mask_token_index)

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_id = tf.math.argmax(selected_logits, axis=-<span class="hljs-number">1</span>)`}}),{c(){d=a("p"),v=n("Example:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);v=s(c,"Example:"),c.forEach(t),m=h(l),y(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,v),_(l,m,c),M(u,l,c),b=!0},p:Je,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){P(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(m),N(u,l)}}}function ok(q){let d,v;return d=new Ye({props:{code:`labels = tokenizer("The capital of France is Paris.", return_tensors="tf")["input_ids"]
# mask labels of non-[MASK] tokens
labels = tf.where(inputs.input_ids == tokenizer.mask_token_id, labels, -100)

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

tokenizer = AutoTokenizer.from_pretrained("microsoft/mpnet-base")
model = TFMPNetForSequenceClassification.from_pretrained("microsoft/mpnet-base")

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

tokenizer = AutoTokenizer.from_pretrained("microsoft/mpnet-base")
model = TFMPNetForMultipleChoice.from_pretrained("microsoft/mpnet-base")

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

tokenizer = AutoTokenizer.from_pretrained("microsoft/mpnet-base")
model = TFMPNetForTokenClassification.from_pretrained("microsoft/mpnet-base")

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

tokenizer = AutoTokenizer.from_pretrained("microsoft/mpnet-base")
model = TFMPNetForQuestionAnswering.from_pretrained("microsoft/mpnet-base")

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, TFMPNetForQuestionAnswering
<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;microsoft/mpnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFMPNetForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;microsoft/mpnet-base&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"),v=n("Example:"),m=p(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);v=s(c,"Example:"),c.forEach(t),m=h(l),y(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,v),_(l,m,c),M(u,l,c),b=!0},p:Je,i(l){b||($(u.$$.fragment,l),b=!0)},o(l){P(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(m),N(u,l)}}}function _k(q){let d,v;return d=new Ye({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(){T(d.$$.fragment)},l(m){y(d.$$.fragment,m)},m(m,u){M(d,m,u),v=!0},p:Je,i(m){v||($(d.$$.fragment,m),v=!0)},o(m){P(d.$$.fragment,m),v=!1},d(m){N(d,m)}}}function kk(q){let d,v,m,u,b,l,c,z,be,he,D,ae,ee,w,we,R,Te,me,S,ye,le,V,Me,ue,K,$e,fe,U,Pe,ge,Z,x,j,_e,Q,Ne,ke,B,te,Fe,C,Ee,X,de,ze,G,ce,qe,I,ve,W,xe,Y,A,Ce,O,ne,re,f,F,Se,oe,We,Ie,E,Oe,je,Ke,Ue,Le,L,J,Qe,De,H,Be,He,pe,Ae,se,Re,ur,va,Td,Yi,Ht,Mo,fr,An,yd,gr,Md,Zi,gt,On,$d,Ct,Pd,ba,Nd,Fd,wa,Ed,zd,Ln,qd,xd,Cd,Rt,jd,Ta,Ad,Od,ya,Ld,Dd,Id,$o,el,Vt,Po,_r,Dn,Sd,kr,Wd,tl,Ze,In,Kd,Sn,Ud,Ma,Qd,Bd,Hd,At,Wn,Rd,vr,Vd,Xd,Kn,$a,Gd,br,Jd,Yd,Pa,Zd,wr,ec,tc,No,Un,oc,Qn,nc,Tr,sc,ac,rc,Fo,Bn,ic,yr,lc,dc,Na,Hn,ol,Xt,Eo,Mr,Rn,cc,$r,pc,nl,_t,Vn,hc,Xn,mc,Pr,uc,fc,gc,Gn,_c,Fa,kc,vc,bc,zo,Jn,wc,Nr,Tc,sl,Gt,qo,Fr,Yn,yc,Er,Mc,al,rt,Zn,$c,zr,Pc,Nc,es,Fc,Ea,Ec,zc,qc,ts,xc,os,Cc,jc,Ac,vt,ns,Oc,Jt,Lc,za,Dc,Ic,qr,Sc,Wc,Kc,xo,Uc,Co,rl,Yt,jo,xr,ss,Qc,Cr,Bc,il,Zt,as,Hc,bt,rs,Rc,eo,Vc,qa,Xc,Gc,jr,Jc,Yc,Zc,Ao,ep,Oo,ll,to,Lo,Ar,is,tp,Or,op,dl,it,ls,np,Lr,sp,ap,ds,rp,xa,ip,lp,dp,cs,cp,ps,pp,hp,mp,pt,hs,up,oo,fp,Ca,gp,_p,Dr,kp,vp,bp,Do,wp,Io,Tp,So,cl,no,Wo,Ir,ms,yp,Sr,Mp,pl,lt,us,$p,Wr,Pp,Np,fs,Fp,ja,Ep,zp,qp,gs,xp,_s,Cp,jp,Ap,wt,ks,Op,so,Lp,Aa,Dp,Ip,Kr,Sp,Wp,Kp,Ko,Up,Uo,hl,ao,Qo,Ur,vs,Qp,Qr,Bp,ml,dt,bs,Hp,Br,Rp,Vp,ws,Xp,Oa,Gp,Jp,Yp,Ts,Zp,ys,eh,th,oh,Tt,Ms,nh,ro,sh,La,ah,rh,Hr,ih,lh,dh,Bo,ch,Ho,ul,io,Ro,Rr,$s,ph,Vr,hh,fl,ct,Ps,mh,lo,uh,Xr,fh,gh,Gr,_h,kh,vh,Ns,bh,Da,wh,Th,yh,Fs,Mh,Es,$h,Ph,Nh,yt,zs,Fh,co,Eh,Ia,zh,qh,Jr,xh,Ch,jh,Vo,Ah,Xo,gl,po,Go,Yr,qs,Oh,Zr,Lh,_l,et,xs,Dh,ei,Ih,Sh,Cs,Wh,Sa,Kh,Uh,Qh,js,Bh,As,Hh,Rh,Vh,Jo,Xh,Mt,Os,Gh,ho,Jh,Wa,Yh,Zh,ti,em,tm,om,Yo,nm,Zo,kl,mo,en,oi,Ls,sm,ni,am,vl,tt,Ds,rm,Is,im,si,lm,dm,cm,Ss,pm,Ka,hm,mm,um,Ws,fm,Ks,gm,_m,km,tn,vm,ht,Us,bm,uo,wm,Ua,Tm,ym,ai,Mm,$m,Pm,on,Nm,nn,Fm,sn,bl,fo,an,ri,Qs,Em,ii,zm,wl,ot,Bs,qm,li,xm,Cm,Hs,jm,Qa,Am,Om,Lm,Rs,Dm,Vs,Im,Sm,Wm,rn,Km,mt,Xs,Um,go,Qm,Ba,Bm,Hm,di,Rm,Vm,Xm,ln,Gm,dn,Jm,cn,Tl,_o,pn,ci,Gs,Ym,pi,Zm,yl,nt,Js,eu,hi,tu,ou,Ys,nu,Ha,su,au,ru,Zs,iu,ea,lu,du,cu,hn,pu,$t,ta,hu,ko,mu,Ra,uu,fu,mi,gu,_u,ku,mn,vu,un,Ml,vo,fn,ui,oa,bu,fi,wu,$l,st,na,Tu,gi,yu,Mu,sa,$u,Va,Pu,Nu,Fu,aa,Eu,ra,zu,qu,xu,gn,Cu,ut,ia,ju,bo,Au,Xa,Ou,Lu,_i,Du,Iu,Su,_n,Wu,kn,Ku,vn,Pl,wo,bn,ki,la,Uu,vi,Qu,Nl,at,da,Bu,To,Hu,bi,Ru,Vu,wi,Xu,Gu,Ju,ca,Yu,Ga,Zu,ef,tf,pa,of,ha,nf,sf,af,wn,rf,ft,ma,lf,yo,df,Ja,cf,pf,Ti,hf,mf,uf,Tn,ff,yn,gf,Mn,Fl;return l=new Xe({}),w=new Xe({}),F=new Xe({}),An=new Xe({}),On=new ie({props:{name:"class transformers.MPNetConfig",anchor:"transformers.MPNetConfig",parameters:[{name:"vocab_size",val:" = 30527"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"relative_attention_num_buckets",val:" = 32"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MPNetConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30527) &#x2014;
Vocabulary size of the MPNet 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/mpnet#transformers.MPNetModel">MPNetModel</a> or <a href="/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.TFMPNetModel">TFMPNetModel</a>.`,name:"vocab_size"},{anchor:"transformers.MPNetConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.MPNetConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.MPNetConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.MPNetConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.MPNetConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.MPNetConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.MPNetConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.MPNetConfig.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.MPNetConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.MPNetConfig.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.MPNetConfig.relative_attention_num_buckets",description:`<strong>relative_attention_num_buckets</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The number of buckets to use for each attention layer.`,name:"relative_attention_num_buckets"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/mpnet/configuration_mpnet.py#L29"}}),$o=new Ge({props:{anchor:"transformers.MPNetConfig.example",$$slots:{default:[O_]},$$scope:{ctx:q}}}),Dn=new Xe({}),In=new ie({props:{name:"class transformers.MPNetTokenizer",anchor:"transformers.MPNetTokenizer",parameters:[{name:"vocab_file",val:""},{name:"do_lower_case",val:" = True"},{name:"do_basic_tokenize",val:" = True"},{name:"never_split",val:" = None"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"sep_token",val:" = '</s>'"},{name:"cls_token",val:" = '<s>'"},{name:"unk_token",val:" = '[UNK]'"},{name:"pad_token",val:" = '<pad>'"},{name:"mask_token",val:" = '<mask>'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MPNetTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.MPNetTokenizer.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.MPNetTokenizer.do_basic_tokenize",description:`<strong>do_basic_tokenize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to do basic tokenization before WordPiece.`,name:"do_basic_tokenize"},{anchor:"transformers.MPNetTokenizer.never_split",description:`<strong>never_split</strong> (<code>Iterable</code>, <em>optional</em>) &#x2014;
Collection of tokens which will never be split during tokenization. Only has an effect when
<code>do_basic_tokenize=True</code>`,name:"never_split"},{anchor:"transformers.MPNetTokenizer.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 pre-training. 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.MPNetTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence 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 end of sequence.
The token used is the <code>sep_token</code>.</p>

					</div>`,name:"eos_token"},{anchor:"transformers.MPNetTokenizer.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.MPNetTokenizer.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.MPNetTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[UNK]&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.MPNetTokenizer.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.MPNetTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;mask&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.MPNetTokenizer.tokenize_chinese_chars",description:`<strong>tokenize_chinese_chars</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to tokenize Chinese characters.</p>
<p>This should likely be deactivated for Japanese (see this
<a href="https://github.com/huggingface/transformers/issues/328" rel="nofollow">issue</a>).
strip_accents &#x2014; (<code>bool</code>, <em>optional</em>):
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
value for <code>lowercase</code> (as in the original BERT).`,name:"tokenize_chinese_chars"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/mpnet/tokenization_mpnet.py#L66"}}),Wn=new ie({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.MPNetTokenizer.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.MPNetTokenizer.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.MPNetTokenizer.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/mpnet/tokenization_mpnet.py#L230",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>
`}}),Un=new ie({props:{name:"get_special_tokens_mask",anchor:"transformers.MPNetTokenizer.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.MPNetTokenizer.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.MPNetTokenizer.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.MPNetTokenizer.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;
Set to True if 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/mpnet/tokenization_mpnet.py#L255",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>
`}}),Bn=new ie({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.MPNetTokenizer.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.MPNetTokenizer.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.MPNetTokenizer.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/mpnet/tokenization_mpnet.py#L282",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Hn=new ie({props:{name:"save_vocabulary",anchor:"transformers.MPNetTokenizer.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/mpnet/tokenization_mpnet.py#L305"}}),Rn=new Xe({}),Vn=new ie({props:{name:"class transformers.MPNetTokenizerFast",anchor:"transformers.MPNetTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"do_lower_case",val:" = True"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"sep_token",val:" = '</s>'"},{name:"cls_token",val:" = '<s>'"},{name:"unk_token",val:" = '[UNK]'"},{name:"pad_token",val:" = '<pad>'"},{name:"mask_token",val:" = '<mask>'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MPNetTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.MPNetTokenizerFast.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.MPNetTokenizerFast.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.MPNetTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence 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 end of sequence.
The token used is the <code>sep_token</code>.</p>

					</div>`,name:"eos_token"},{anchor:"transformers.MPNetTokenizerFast.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.MPNetTokenizerFast.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.MPNetTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[UNK]&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.MPNetTokenizerFast.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.MPNetTokenizerFast.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;mask&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.MPNetTokenizerFast.tokenize_chinese_chars",description:`<strong>tokenize_chinese_chars</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to tokenize Chinese characters. This should likely be deactivated for Japanese (see <a href="https://github.com/huggingface/transformers/issues/328" rel="nofollow">this
issue</a>).
strip_accents &#x2014; (<code>bool</code>, <em>optional</em>):
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
value for <code>lowercase</code> (as in the original BERT).`,name:"tokenize_chinese_chars"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/mpnet/tokenization_mpnet_fast.py#L51"}}),Jn=new ie({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.MPNetTokenizerFast.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.MPNetTokenizerFast.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.MPNetTokenizerFast.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/mpnet/tokenization_mpnet_fast.py#L191",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Yn=new Xe({}),Zn=new ie({props:{name:"class transformers.MPNetModel",anchor:"transformers.MPNetModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.MPNetModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.MPNetConfig">MPNetConfig</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/mpnet/modeling_mpnet.py#L481"}}),ns=new ie({props:{name:"forward",anchor:"transformers.MPNetModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MPNetModel.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.MPNetModel.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.MPNetModel.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.MPNetModel.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.MPNetModel.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.MPNetModel.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.MPNetModel.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.MPNetModel.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/mpnet/modeling_mpnet.py#L509",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</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/mpnet#transformers.MPNetConfig"
>MPNetConfig</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>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</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.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),xo=new Ve({props:{$$slots:{default:[L_]},$$scope:{ctx:q}}}),Co=new Ge({props:{anchor:"transformers.MPNetModel.forward.example",$$slots:{default:[D_]},$$scope:{ctx:q}}}),ss=new Xe({}),as=new ie({props:{name:"class transformers.MPNetForMaskedLM",anchor:"transformers.MPNetForMaskedLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/mpnet/modeling_mpnet.py#L572"}}),rs=new ie({props:{name:"forward",anchor:"transformers.MPNetForMaskedLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MPNetForMaskedLM.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.MPNetForMaskedLM.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.MPNetForMaskedLM.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.MPNetForMaskedLM.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.MPNetForMaskedLM.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.MPNetForMaskedLM.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.MPNetForMaskedLM.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.MPNetForMaskedLM.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.MPNetForMaskedLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/mpnet/modeling_mpnet.py#L591",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/mpnet#transformers.MPNetConfig"
>MPNetConfig</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>
`}}),Ao=new Ve({props:{$$slots:{default:[I_]},$$scope:{ctx:q}}}),Oo=new Ge({props:{anchor:"transformers.MPNetForMaskedLM.forward.example",$$slots:{default:[S_]},$$scope:{ctx:q}}}),is=new Xe({}),ls=new ie({props:{name:"class transformers.MPNetForSequenceClassification",anchor:"transformers.MPNetForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.MPNetForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.MPNetConfig">MPNetConfig</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/mpnet/modeling_mpnet.py#L680"}}),hs=new ie({props:{name:"forward",anchor:"transformers.MPNetForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MPNetForSequenceClassification.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.MPNetForSequenceClassification.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.MPNetForSequenceClassification.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.MPNetForSequenceClassification.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.MPNetForSequenceClassification.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.MPNetForSequenceClassification.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.MPNetForSequenceClassification.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.MPNetForSequenceClassification.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.MPNetForSequenceClassification.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/mpnet/modeling_mpnet.py#L693",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/mpnet#transformers.MPNetConfig"
>MPNetConfig</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>
`}}),Do=new Ve({props:{$$slots:{default:[W_]},$$scope:{ctx:q}}}),Io=new Ge({props:{anchor:"transformers.MPNetForSequenceClassification.forward.example",$$slots:{default:[K_]},$$scope:{ctx:q}}}),So=new Ge({props:{anchor:"transformers.MPNetForSequenceClassification.forward.example-2",$$slots:{default:[U_]},$$scope:{ctx:q}}}),ms=new Xe({}),us=new ie({props:{name:"class transformers.MPNetForMultipleChoice",anchor:"transformers.MPNetForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.MPNetForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.MPNetConfig">MPNetConfig</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/mpnet/modeling_mpnet.py#L774"}}),ks=new ie({props:{name:"forward",anchor:"transformers.MPNetForMultipleChoice.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MPNetForMultipleChoice.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.MPNetForMultipleChoice.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.MPNetForMultipleChoice.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.MPNetForMultipleChoice.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.MPNetForMultipleChoice.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.MPNetForMultipleChoice.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.MPNetForMultipleChoice.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.MPNetForMultipleChoice.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.MPNetForMultipleChoice.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/mpnet/modeling_mpnet.py#L787",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/mpnet#transformers.MPNetConfig"
>MPNetConfig</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>
`}}),Ko=new Ve({props:{$$slots:{default:[Q_]},$$scope:{ctx:q}}}),Uo=new Ge({props:{anchor:"transformers.MPNetForMultipleChoice.forward.example",$$slots:{default:[B_]},$$scope:{ctx:q}}}),vs=new Xe({}),bs=new ie({props:{name:"class transformers.MPNetForTokenClassification",anchor:"transformers.MPNetForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.MPNetForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.MPNetConfig">MPNetConfig</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/mpnet/modeling_mpnet.py#L864"}}),Ms=new ie({props:{name:"forward",anchor:"transformers.MPNetForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MPNetForTokenClassification.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.MPNetForTokenClassification.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.MPNetForTokenClassification.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.MPNetForTokenClassification.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.MPNetForTokenClassification.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.MPNetForTokenClassification.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.MPNetForTokenClassification.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.MPNetForTokenClassification.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.MPNetForTokenClassification.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/mpnet/modeling_mpnet.py#L879",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/mpnet#transformers.MPNetConfig"
>MPNetConfig</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>
`}}),Bo=new Ve({props:{$$slots:{default:[H_]},$$scope:{ctx:q}}}),Ho=new Ge({props:{anchor:"transformers.MPNetForTokenClassification.forward.example",$$slots:{default:[R_]},$$scope:{ctx:q}}}),$s=new Xe({}),Ps=new ie({props:{name:"class transformers.MPNetForQuestionAnswering",anchor:"transformers.MPNetForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.MPNetForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.MPNetConfig">MPNetConfig</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/mpnet/modeling_mpnet.py#L963"}}),zs=new ie({props:{name:"forward",anchor:"transformers.MPNetForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MPNetForQuestionAnswering.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.MPNetForQuestionAnswering.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.MPNetForQuestionAnswering.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.MPNetForQuestionAnswering.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.MPNetForQuestionAnswering.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.MPNetForQuestionAnswering.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.MPNetForQuestionAnswering.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.MPNetForQuestionAnswering.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.MPNetForQuestionAnswering.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.MPNetForQuestionAnswering.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/mpnet/modeling_mpnet.py#L977",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/mpnet#transformers.MPNetConfig"
>MPNetConfig</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>
`}}),Vo=new Ve({props:{$$slots:{default:[V_]},$$scope:{ctx:q}}}),Xo=new Ge({props:{anchor:"transformers.MPNetForQuestionAnswering.forward.example",$$slots:{default:[X_]},$$scope:{ctx:q}}}),qs=new Xe({}),xs=new ie({props:{name:"class transformers.TFMPNetModel",anchor:"transformers.TFMPNetModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMPNetModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.MPNetConfig">MPNetConfig</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/mpnet/modeling_tf_mpnet.py#L680"}}),Jo=new Ve({props:{$$slots:{default:[G_]},$$scope:{ctx:q}}}),Os=new ie({props:{name:"call",anchor:"transformers.TFMPNetModel.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[<built-in function array>, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[<built-in function array>, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[<built-in function array>, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Optional[tensorflow.python.framework.ops.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"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFMPNetModel.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.TFMPNetModel.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.TFMPNetModel.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.TFMPNetModel.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.TFMPNetModel.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.TFMPNetModel.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.TFMPNetModel.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.TFMPNetModel.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.TFMPNetModel.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/mpnet/modeling_tf_mpnet.py#L685",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/mpnet#transformers.MPNetConfig"
>MPNetConfig</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>
`}}),Yo=new Ve({props:{$$slots:{default:[J_]},$$scope:{ctx:q}}}),Zo=new Ge({props:{anchor:"transformers.TFMPNetModel.call.example",$$slots:{default:[Y_]},$$scope:{ctx:q}}}),Ls=new Xe({}),Ds=new ie({props:{name:"class transformers.TFMPNetForMaskedLM",anchor:"transformers.TFMPNetForMaskedLM",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMPNetForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.MPNetConfig">MPNetConfig</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/mpnet/modeling_tf_mpnet.py#L782"}}),tn=new Ve({props:{$$slots:{default:[Z_]},$$scope:{ctx:q}}}),Us=new ie({props:{name:"call",anchor:"transformers.TFMPNetForMaskedLM.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:"position_ids",val:": typing.Union[numpy.ndarray, 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.Optional[tensorflow.python.framework.ops.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"},{name:"labels",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFMPNetForMaskedLM.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.TFMPNetForMaskedLM.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.TFMPNetForMaskedLM.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.TFMPNetForMaskedLM.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.TFMPNetForMaskedLM.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.TFMPNetForMaskedLM.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.TFMPNetForMaskedLM.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.TFMPNetForMaskedLM.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.TFMPNetForMaskedLM.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.TFMPNetForMaskedLM.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 masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/mpnet/modeling_tf_mpnet.py#L798",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_tf_outputs.TFMaskedLMOutput"
>transformers.modeling_tf_outputs.TFMaskedLMOutput</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/mpnet#transformers.MPNetConfig"
>MPNetConfig</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 non-masked labels, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<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><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_tf_outputs.TFMaskedLMOutput"
>transformers.modeling_tf_outputs.TFMaskedLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),on=new Ve({props:{$$slots:{default:[ek]},$$scope:{ctx:q}}}),nn=new Ge({props:{anchor:"transformers.TFMPNetForMaskedLM.call.example",$$slots:{default:[tk]},$$scope:{ctx:q}}}),sn=new Ge({props:{anchor:"transformers.TFMPNetForMaskedLM.call.example-2",$$slots:{default:[ok]},$$scope:{ctx:q}}}),Qs=new Xe({}),Bs=new ie({props:{name:"class transformers.TFMPNetForSequenceClassification",anchor:"transformers.TFMPNetForSequenceClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMPNetForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.MPNetConfig">MPNetConfig</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/mpnet/modeling_tf_mpnet.py#L891"}}),rn=new Ve({props:{$$slots:{default:[nk]},$$scope:{ctx:q}}}),Xs=new ie({props:{name:"call",anchor:"transformers.TFMPNetForSequenceClassification.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[<built-in function array>, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[<built-in function array>, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[<built-in function array>, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Optional[tensorflow.python.framework.ops.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"},{name:"labels",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFMPNetForSequenceClassification.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.TFMPNetForSequenceClassification.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.TFMPNetForSequenceClassification.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.TFMPNetForSequenceClassification.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.TFMPNetForSequenceClassification.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.TFMPNetForSequenceClassification.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.TFMPNetForSequenceClassification.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.TFMPNetForSequenceClassification.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.TFMPNetForSequenceClassification.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.TFMPNetForSequenceClassification.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/mpnet/modeling_tf_mpnet.py#L901",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/mpnet#transformers.MPNetConfig"
>MPNetConfig</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>
`}}),ln=new Ve({props:{$$slots:{default:[sk]},$$scope:{ctx:q}}}),dn=new Ge({props:{anchor:"transformers.TFMPNetForSequenceClassification.call.example",$$slots:{default:[ak]},$$scope:{ctx:q}}}),cn=new Ge({props:{anchor:"transformers.TFMPNetForSequenceClassification.call.example-2",$$slots:{default:[rk]},$$scope:{ctx:q}}}),Gs=new Xe({}),Js=new ie({props:{name:"class transformers.TFMPNetForMultipleChoice",anchor:"transformers.TFMPNetForMultipleChoice",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMPNetForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.MPNetConfig">MPNetConfig</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/mpnet/modeling_tf_mpnet.py#L970"}}),hn=new Ve({props:{$$slots:{default:[ik]},$$scope:{ctx:q}}}),ta=new ie({props:{name:"call",anchor:"transformers.TFMPNetForMultipleChoice.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:"position_ids",val:": typing.Union[numpy.ndarray, 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.Optional[tensorflow.python.framework.ops.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"},{name:"labels",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFMPNetForMultipleChoice.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.TFMPNetForMultipleChoice.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.TFMPNetForMultipleChoice.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.TFMPNetForMultipleChoice.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.TFMPNetForMultipleChoice.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.TFMPNetForMultipleChoice.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.TFMPNetForMultipleChoice.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.TFMPNetForMultipleChoice.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.TFMPNetForMultipleChoice.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.TFMPNetForMultipleChoice.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</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]</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/mpnet/modeling_tf_mpnet.py#L990",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/mpnet#transformers.MPNetConfig"
>MPNetConfig</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>
`}}),mn=new Ve({props:{$$slots:{default:[lk]},$$scope:{ctx:q}}}),un=new Ge({props:{anchor:"transformers.TFMPNetForMultipleChoice.call.example",$$slots:{default:[dk]},$$scope:{ctx:q}}}),oa=new Xe({}),na=new ie({props:{name:"class transformers.TFMPNetForTokenClassification",anchor:"transformers.TFMPNetForTokenClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMPNetForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.MPNetConfig">MPNetConfig</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/mpnet/modeling_tf_mpnet.py#L1086"}}),gn=new Ve({props:{$$slots:{default:[ck]},$$scope:{ctx:q}}}),ia=new ie({props:{name:"call",anchor:"transformers.TFMPNetForTokenClassification.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:"position_ids",val:": typing.Union[numpy.ndarray, 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.Optional[tensorflow.python.framework.ops.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"},{name:"labels",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFMPNetForTokenClassification.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.TFMPNetForTokenClassification.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.TFMPNetForTokenClassification.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.TFMPNetForTokenClassification.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.TFMPNetForTokenClassification.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.TFMPNetForTokenClassification.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.TFMPNetForTokenClassification.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.TFMPNetForTokenClassification.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.TFMPNetForTokenClassification.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.TFMPNetForTokenClassification.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/mpnet/modeling_tf_mpnet.py#L1099",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/mpnet#transformers.MPNetConfig"
>MPNetConfig</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>
`}}),_n=new Ve({props:{$$slots:{default:[pk]},$$scope:{ctx:q}}}),kn=new Ge({props:{anchor:"transformers.TFMPNetForTokenClassification.call.example",$$slots:{default:[hk]},$$scope:{ctx:q}}}),vn=new Ge({props:{anchor:"transformers.TFMPNetForTokenClassification.call.example-2",$$slots:{default:[mk]},$$scope:{ctx:q}}}),la=new Xe({}),da=new ie({props:{name:"class transformers.TFMPNetForQuestionAnswering",anchor:"transformers.TFMPNetForQuestionAnswering",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMPNetForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.MPNetConfig">MPNetConfig</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/mpnet/modeling_tf_mpnet.py#L1167"}}),wn=new Ve({props:{$$slots:{default:[uk]},$$scope:{ctx:q}}}),ma=new ie({props:{name:"call",anchor:"transformers.TFMPNetForQuestionAnswering.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[<built-in function array>, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[<built-in function array>, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[<built-in function array>, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Optional[tensorflow.python.framework.ops.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"},{name:"start_positions",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"end_positions",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"training",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMPNetForQuestionAnswering.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.TFMPNetForQuestionAnswering.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.TFMPNetForQuestionAnswering.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.TFMPNetForQuestionAnswering.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.TFMPNetForQuestionAnswering.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.TFMPNetForQuestionAnswering.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.TFMPNetForQuestionAnswering.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.TFMPNetForQuestionAnswering.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.TFMPNetForQuestionAnswering.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.TFMPNetForQuestionAnswering.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.TFMPNetForQuestionAnswering.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/mpnet/modeling_tf_mpnet.py#L1179",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/mpnet#transformers.MPNetConfig"
>MPNetConfig</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>
`}}),Tn=new Ve({props:{$$slots:{default:[fk]},$$scope:{ctx:q}}}),yn=new Ge({props:{anchor:"transformers.TFMPNetForQuestionAnswering.call.example",$$slots:{default:[gk]},$$scope:{ctx:q}}}),Mn=new Ge({props:{anchor:"transformers.TFMPNetForQuestionAnswering.call.example-2",$$slots:{default:[_k]},$$scope:{ctx:q}}}),{c(){d=a("meta"),v=p(),m=a("h1"),u=a("a"),b=a("span"),T(l.$$.fragment),c=p(),z=a("span"),be=n("MPNet"),he=p(),D=a("h2"),ae=a("a"),ee=a("span"),T(w.$$.fragment),we=p(),R=a("span"),Te=n("Overview"),me=p(),S=a("p"),ye=n("The MPNet model was proposed in "),le=a("a"),V=n("MPNet: Masked and Permuted Pre-training for Language Understanding"),Me=n(" by Kaitao Song, Xu Tan, Tao Qin, Jianfeng Lu, Tie-Yan Liu."),ue=p(),K=a("p"),$e=n(`MPNet adopts a novel pre-training method, named masked and permuted language modeling, to inherit the advantages of
masked language modeling and permuted language modeling for natural language understanding.`),fe=p(),U=a("p"),Pe=n("The abstract from the paper is the following:"),ge=p(),Z=a("p"),x=a("em"),j=n(`BERT adopts masked language modeling (MLM) for pre-training and is one of the most successful pre-training models.
Since BERT neglects dependency among predicted tokens, XLNet introduces permuted language modeling (PLM) for
pre-training to address this problem. However, XLNet does not leverage the full position information of a sentence and
thus suffers from position discrepancy between pre-training and fine-tuning. In this paper, we propose MPNet, a novel
pre-training method that inherits the advantages of BERT and XLNet and avoids their limitations. MPNet leverages the
dependency among predicted tokens through permuted language modeling (vs. MLM in BERT), and takes auxiliary position
information as input to make the model see a full sentence and thus reducing the position discrepancy (vs. PLM in
XLNet). We pre-train MPNet on a large-scale dataset (over 160GB text corpora) and fine-tune on a variety of
down-streaming tasks (GLUE, SQuAD, etc). Experimental results show that MPNet outperforms MLM and PLM by a large
margin, and achieves better results on these tasks compared with previous state-of-the-art pre-trained methods (e.g.,
BERT, XLNet, RoBERTa) under the same model setting.`),_e=p(),Q=a("p"),Ne=n("Tips:"),ke=p(),B=a("ul"),te=a("li"),Fe=n("MPNet doesn\u2019t have "),C=a("code"),Ee=n("token_type_ids"),X=n(`, you don\u2019t need to indicate which token belongs to which segment. just
separate your segments with the separation token `),de=a("code"),ze=n("tokenizer.sep_token"),G=n(" (or "),ce=a("code"),qe=n("[sep]"),I=n(")."),ve=p(),W=a("p"),xe=n("The original code can be found "),Y=a("a"),A=n("here"),Ce=n("."),O=p(),ne=a("h2"),re=a("a"),f=a("span"),T(F.$$.fragment),Se=p(),oe=a("span"),We=n("Documentation resources"),Ie=p(),E=a("ul"),Oe=a("li"),je=a("a"),Ke=n("Text classification task guide"),Ue=p(),Le=a("li"),L=a("a"),J=n("Token classification task guide"),Qe=p(),De=a("li"),H=a("a"),Be=n("Question answering task guide"),He=p(),pe=a("li"),Ae=a("a"),se=n("Masked language modeling task guide"),Re=p(),ur=a("li"),va=a("a"),Td=n("Multiple choice task guide"),Yi=p(),Ht=a("h2"),Mo=a("a"),fr=a("span"),T(An.$$.fragment),yd=p(),gr=a("span"),Md=n("MPNetConfig"),Zi=p(),gt=a("div"),T(On.$$.fragment),$d=p(),Ct=a("p"),Pd=n("This is the configuration class to store the configuration of a "),ba=a("a"),Nd=n("MPNetModel"),Fd=n(" or a "),wa=a("a"),Ed=n("TFMPNetModel"),zd=n(`. It is used to
instantiate a MPNet 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 MPNet
`),Ln=a("a"),qd=n("microsoft/mpnet-base"),xd=n(" architecture."),Cd=p(),Rt=a("p"),jd=n("Configuration objects inherit from "),Ta=a("a"),Ad=n("PretrainedConfig"),Od=n(` and can be used to control the model outputs. Read the
documentation from `),ya=a("a"),Ld=n("PretrainedConfig"),Dd=n(" for more information."),Id=p(),T($o.$$.fragment),el=p(),Vt=a("h2"),Po=a("a"),_r=a("span"),T(Dn.$$.fragment),Sd=p(),kr=a("span"),Wd=n("MPNetTokenizer"),tl=p(),Ze=a("div"),T(In.$$.fragment),Kd=p(),Sn=a("p"),Ud=n("This tokenizer inherits from "),Ma=a("a"),Qd=n("BertTokenizer"),Bd=n(` which contains most of the methods. Users should refer to the
superclass for more information regarding methods.`),Hd=p(),At=a("div"),T(Wn.$$.fragment),Rd=p(),vr=a("p"),Vd=n(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A MPNet sequence has the following format:`),Xd=p(),Kn=a("ul"),$a=a("li"),Gd=n("single sequence: "),br=a("code"),Jd=n("<s> X </s>"),Yd=p(),Pa=a("li"),Zd=n("pair of sequences: "),wr=a("code"),ec=n("<s> A </s></s> B </s>"),tc=p(),No=a("div"),T(Un.$$.fragment),oc=p(),Qn=a("p"),nc=n(`Retrieves sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Tr=a("code"),sc=n("prepare_for_model"),ac=n(" methods."),rc=p(),Fo=a("div"),T(Bn.$$.fragment),ic=p(),yr=a("p"),lc=n(`Creates a mask from the two sequences passed to be used in a sequence-pair classification task. MPNet does not
make use of token type ids, therefore a list of zeros is returned.`),dc=p(),Na=a("div"),T(Hn.$$.fragment),ol=p(),Xt=a("h2"),Eo=a("a"),Mr=a("span"),T(Rn.$$.fragment),cc=p(),$r=a("span"),pc=n("MPNetTokenizerFast"),nl=p(),_t=a("div"),T(Vn.$$.fragment),hc=p(),Xn=a("p"),mc=n("Construct a \u201Cfast\u201D MPNet tokenizer (backed by HuggingFace\u2019s "),Pr=a("em"),uc=n("tokenizers"),fc=n(" library). Based on WordPiece."),gc=p(),Gn=a("p"),_c=n("This tokenizer inherits from "),Fa=a("a"),kc=n("PreTrainedTokenizerFast"),vc=n(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),bc=p(),zo=a("div"),T(Jn.$$.fragment),wc=p(),Nr=a("p"),Tc=n(`Creates a mask from the two sequences passed to be used in a sequence-pair classification task. MPNet does not
make use of token type ids, therefore a list of zeros is returned`),sl=p(),Gt=a("h2"),qo=a("a"),Fr=a("span"),T(Yn.$$.fragment),yc=p(),Er=a("span"),Mc=n("MPNetModel"),al=p(),rt=a("div"),T(Zn.$$.fragment),$c=p(),zr=a("p"),Pc=n("The bare MPNet Model transformer outputting raw hidden-states without any specific head on top."),Nc=p(),es=a("p"),Fc=n("This model inherits from "),Ea=a("a"),Ec=n("PreTrainedModel"),zc=n(`. 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=p(),ts=a("p"),xc=n("This model is also a PyTorch "),os=a("a"),Cc=n("torch.nn.Module"),jc=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ac=p(),vt=a("div"),T(ns.$$.fragment),Oc=p(),Jt=a("p"),Lc=n("The "),za=a("a"),Dc=n("MPNetModel"),Ic=n(" forward method, overrides the "),qr=a("code"),Sc=n("__call__"),Wc=n(" special method."),Kc=p(),T(xo.$$.fragment),Uc=p(),T(Co.$$.fragment),rl=p(),Yt=a("h2"),jo=a("a"),xr=a("span"),T(ss.$$.fragment),Qc=p(),Cr=a("span"),Bc=n("MPNetForMaskedLM"),il=p(),Zt=a("div"),T(as.$$.fragment),Hc=p(),bt=a("div"),T(rs.$$.fragment),Rc=p(),eo=a("p"),Vc=n("The "),qa=a("a"),Xc=n("MPNetForMaskedLM"),Gc=n(" forward method, overrides the "),jr=a("code"),Jc=n("__call__"),Yc=n(" special method."),Zc=p(),T(Ao.$$.fragment),ep=p(),T(Oo.$$.fragment),ll=p(),to=a("h2"),Lo=a("a"),Ar=a("span"),T(is.$$.fragment),tp=p(),Or=a("span"),op=n("MPNetForSequenceClassification"),dl=p(),it=a("div"),T(ls.$$.fragment),np=p(),Lr=a("p"),sp=n(`MPNet Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),ap=p(),ds=a("p"),rp=n("This model inherits from "),xa=a("a"),ip=n("PreTrainedModel"),lp=n(`. 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.)`),dp=p(),cs=a("p"),cp=n("This model is also a PyTorch "),ps=a("a"),pp=n("torch.nn.Module"),hp=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),mp=p(),pt=a("div"),T(hs.$$.fragment),up=p(),oo=a("p"),fp=n("The "),Ca=a("a"),gp=n("MPNetForSequenceClassification"),_p=n(" forward method, overrides the "),Dr=a("code"),kp=n("__call__"),vp=n(" special method."),bp=p(),T(Do.$$.fragment),wp=p(),T(Io.$$.fragment),Tp=p(),T(So.$$.fragment),cl=p(),no=a("h2"),Wo=a("a"),Ir=a("span"),T(ms.$$.fragment),yp=p(),Sr=a("span"),Mp=n("MPNetForMultipleChoice"),pl=p(),lt=a("div"),T(us.$$.fragment),$p=p(),Wr=a("p"),Pp=n(`MPNet 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.`),Np=p(),fs=a("p"),Fp=n("This model inherits from "),ja=a("a"),Ep=n("PreTrainedModel"),zp=n(`. 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.)`),qp=p(),gs=a("p"),xp=n("This model is also a PyTorch "),_s=a("a"),Cp=n("torch.nn.Module"),jp=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ap=p(),wt=a("div"),T(ks.$$.fragment),Op=p(),so=a("p"),Lp=n("The "),Aa=a("a"),Dp=n("MPNetForMultipleChoice"),Ip=n(" forward method, overrides the "),Kr=a("code"),Sp=n("__call__"),Wp=n(" special method."),Kp=p(),T(Ko.$$.fragment),Up=p(),T(Uo.$$.fragment),hl=p(),ao=a("h2"),Qo=a("a"),Ur=a("span"),T(vs.$$.fragment),Qp=p(),Qr=a("span"),Bp=n("MPNetForTokenClassification"),ml=p(),dt=a("div"),T(bs.$$.fragment),Hp=p(),Br=a("p"),Rp=n(`MPNet 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.`),Vp=p(),ws=a("p"),Xp=n("This model inherits from "),Oa=a("a"),Gp=n("PreTrainedModel"),Jp=n(`. 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.)`),Yp=p(),Ts=a("p"),Zp=n("This model is also a PyTorch "),ys=a("a"),eh=n("torch.nn.Module"),th=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),oh=p(),Tt=a("div"),T(Ms.$$.fragment),nh=p(),ro=a("p"),sh=n("The "),La=a("a"),ah=n("MPNetForTokenClassification"),rh=n(" forward method, overrides the "),Hr=a("code"),ih=n("__call__"),lh=n(" special method."),dh=p(),T(Bo.$$.fragment),ch=p(),T(Ho.$$.fragment),ul=p(),io=a("h2"),Ro=a("a"),Rr=a("span"),T($s.$$.fragment),ph=p(),Vr=a("span"),hh=n("MPNetForQuestionAnswering"),fl=p(),ct=a("div"),T(Ps.$$.fragment),mh=p(),lo=a("p"),uh=n(`MPNet 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 `),Xr=a("code"),fh=n("span start logits"),gh=n(" and "),Gr=a("code"),_h=n("span end logits"),kh=n(")."),vh=p(),Ns=a("p"),bh=n("This model inherits from "),Da=a("a"),wh=n("PreTrainedModel"),Th=n(`. 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.)`),yh=p(),Fs=a("p"),Mh=n("This model is also a PyTorch "),Es=a("a"),$h=n("torch.nn.Module"),Ph=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Nh=p(),yt=a("div"),T(zs.$$.fragment),Fh=p(),co=a("p"),Eh=n("The "),Ia=a("a"),zh=n("MPNetForQuestionAnswering"),qh=n(" forward method, overrides the "),Jr=a("code"),xh=n("__call__"),Ch=n(" special method."),jh=p(),T(Vo.$$.fragment),Ah=p(),T(Xo.$$.fragment),gl=p(),po=a("h2"),Go=a("a"),Yr=a("span"),T(qs.$$.fragment),Oh=p(),Zr=a("span"),Lh=n("TFMPNetModel"),_l=p(),et=a("div"),T(xs.$$.fragment),Dh=p(),ei=a("p"),Ih=n("The bare MPNet Model transformer outputting raw hidden-states without any specific head on top."),Sh=p(),Cs=a("p"),Wh=n("This model inherits from "),Sa=a("a"),Kh=n("TFPreTrainedModel"),Uh=n(`. 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.)`),Qh=p(),js=a("p"),Bh=n("This model is also a "),As=a("a"),Hh=n("tf.keras.Model"),Rh=n(` 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.`),Vh=p(),T(Jo.$$.fragment),Xh=p(),Mt=a("div"),T(Os.$$.fragment),Gh=p(),ho=a("p"),Jh=n("The "),Wa=a("a"),Yh=n("TFMPNetModel"),Zh=n(" forward method, overrides the "),ti=a("code"),em=n("__call__"),tm=n(" special method."),om=p(),T(Yo.$$.fragment),nm=p(),T(Zo.$$.fragment),kl=p(),mo=a("h2"),en=a("a"),oi=a("span"),T(Ls.$$.fragment),sm=p(),ni=a("span"),am=n("TFMPNetForMaskedLM"),vl=p(),tt=a("div"),T(Ds.$$.fragment),rm=p(),Is=a("p"),im=n("MPNet Model with a "),si=a("code"),lm=n("language modeling"),dm=n(" head on top."),cm=p(),Ss=a("p"),pm=n("This model inherits from "),Ka=a("a"),hm=n("TFPreTrainedModel"),mm=n(`. 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.)`),um=p(),Ws=a("p"),fm=n("This model is also a "),Ks=a("a"),gm=n("tf.keras.Model"),_m=n(` 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.`),km=p(),T(tn.$$.fragment),vm=p(),ht=a("div"),T(Us.$$.fragment),bm=p(),uo=a("p"),wm=n("The "),Ua=a("a"),Tm=n("TFMPNetForMaskedLM"),ym=n(" forward method, overrides the "),ai=a("code"),Mm=n("__call__"),$m=n(" special method."),Pm=p(),T(on.$$.fragment),Nm=p(),T(nn.$$.fragment),Fm=p(),T(sn.$$.fragment),bl=p(),fo=a("h2"),an=a("a"),ri=a("span"),T(Qs.$$.fragment),Em=p(),ii=a("span"),zm=n("TFMPNetForSequenceClassification"),wl=p(),ot=a("div"),T(Bs.$$.fragment),qm=p(),li=a("p"),xm=n(`MPNet Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),Cm=p(),Hs=a("p"),jm=n("This model inherits from "),Qa=a("a"),Am=n("TFPreTrainedModel"),Om=n(`. 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(),Rs=a("p"),Dm=n("This model is also a "),Vs=a("a"),Im=n("tf.keras.Model"),Sm=n(` 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.`),Wm=p(),T(rn.$$.fragment),Km=p(),mt=a("div"),T(Xs.$$.fragment),Um=p(),go=a("p"),Qm=n("The "),Ba=a("a"),Bm=n("TFMPNetForSequenceClassification"),Hm=n(" forward method, overrides the "),di=a("code"),Rm=n("__call__"),Vm=n(" special method."),Xm=p(),T(ln.$$.fragment),Gm=p(),T(dn.$$.fragment),Jm=p(),T(cn.$$.fragment),Tl=p(),_o=a("h2"),pn=a("a"),ci=a("span"),T(Gs.$$.fragment),Ym=p(),pi=a("span"),Zm=n("TFMPNetForMultipleChoice"),yl=p(),nt=a("div"),T(Js.$$.fragment),eu=p(),hi=a("p"),tu=n(`MPNet 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.`),ou=p(),Ys=a("p"),nu=n("This model inherits from "),Ha=a("a"),su=n("TFPreTrainedModel"),au=n(`. 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.)`),ru=p(),Zs=a("p"),iu=n("This model is also a "),ea=a("a"),lu=n("tf.keras.Model"),du=n(` 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.`),cu=p(),T(hn.$$.fragment),pu=p(),$t=a("div"),T(ta.$$.fragment),hu=p(),ko=a("p"),mu=n("The "),Ra=a("a"),uu=n("TFMPNetForMultipleChoice"),fu=n(" forward method, overrides the "),mi=a("code"),gu=n("__call__"),_u=n(" special method."),ku=p(),T(mn.$$.fragment),vu=p(),T(un.$$.fragment),Ml=p(),vo=a("h2"),fn=a("a"),ui=a("span"),T(oa.$$.fragment),bu=p(),fi=a("span"),wu=n("TFMPNetForTokenClassification"),$l=p(),st=a("div"),T(na.$$.fragment),Tu=p(),gi=a("p"),yu=n(`MPNet 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.`),Mu=p(),sa=a("p"),$u=n("This model inherits from "),Va=a("a"),Pu=n("TFPreTrainedModel"),Nu=n(`. 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(),aa=a("p"),Eu=n("This model is also a "),ra=a("a"),zu=n("tf.keras.Model"),qu=n(` 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.`),xu=p(),T(gn.$$.fragment),Cu=p(),ut=a("div"),T(ia.$$.fragment),ju=p(),bo=a("p"),Au=n("The "),Xa=a("a"),Ou=n("TFMPNetForTokenClassification"),Lu=n(" forward method, overrides the "),_i=a("code"),Du=n("__call__"),Iu=n(" special method."),Su=p(),T(_n.$$.fragment),Wu=p(),T(kn.$$.fragment),Ku=p(),T(vn.$$.fragment),Pl=p(),wo=a("h2"),bn=a("a"),ki=a("span"),T(la.$$.fragment),Uu=p(),vi=a("span"),Qu=n("TFMPNetForQuestionAnswering"),Nl=p(),at=a("div"),T(da.$$.fragment),Bu=p(),To=a("p"),Hu=n(`MPNet 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 `),bi=a("code"),Ru=n("span start logits"),Vu=n(" and "),wi=a("code"),Xu=n("span end logits"),Gu=n(")."),Ju=p(),ca=a("p"),Yu=n("This model inherits from "),Ga=a("a"),Zu=n("TFPreTrainedModel"),ef=n(`. 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.)`),tf=p(),pa=a("p"),of=n("This model is also a "),ha=a("a"),nf=n("tf.keras.Model"),sf=n(` 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.`),af=p(),T(wn.$$.fragment),rf=p(),ft=a("div"),T(ma.$$.fragment),lf=p(),yo=a("p"),df=n("The "),Ja=a("a"),cf=n("TFMPNetForQuestionAnswering"),pf=n(" forward method, overrides the "),Ti=a("code"),hf=n("__call__"),mf=n(" special method."),uf=p(),T(Tn.$$.fragment),ff=p(),T(yn.$$.fragment),gf=p(),T(Mn.$$.fragment),this.h()},l(o){const k=j_('[data-svelte="svelte-1phssyn"]',document.head);d=r(k,"META",{name:!0,content:!0}),k.forEach(t),v=h(o),m=r(o,"H1",{class:!0});var ua=i(m);u=r(ua,"A",{id:!0,class:!0,href:!0});var yi=i(u);b=r(yi,"SPAN",{});var Mi=i(b);y(l.$$.fragment,Mi),Mi.forEach(t),yi.forEach(t),c=h(ua),z=r(ua,"SPAN",{});var $i=i(z);be=s($i,"MPNet"),$i.forEach(t),ua.forEach(t),he=h(o),D=r(o,"H2",{class:!0});var fa=i(D);ae=r(fa,"A",{id:!0,class:!0,href:!0});var Pi=i(ae);ee=r(Pi,"SPAN",{});var Ni=i(ee);y(w.$$.fragment,Ni),Ni.forEach(t),Pi.forEach(t),we=h(fa),R=r(fa,"SPAN",{});var Fi=i(R);Te=s(Fi,"Overview"),Fi.forEach(t),fa.forEach(t),me=h(o),S=r(o,"P",{});var ga=i(S);ye=s(ga,"The MPNet model was proposed in "),le=r(ga,"A",{href:!0,rel:!0});var Ei=i(le);V=s(Ei,"MPNet: Masked and Permuted Pre-training for Language Understanding"),Ei.forEach(t),Me=s(ga," by Kaitao Song, Xu Tan, Tao Qin, Jianfeng Lu, Tie-Yan Liu."),ga.forEach(t),ue=h(o),K=r(o,"P",{});var zi=i(K);$e=s(zi,`MPNet adopts a novel pre-training method, named masked and permuted language modeling, to inherit the advantages of
masked language modeling and permuted language modeling for natural language understanding.`),zi.forEach(t),fe=h(o),U=r(o,"P",{});var qi=i(U);Pe=s(qi,"The abstract from the paper is the following:"),qi.forEach(t),ge=h(o),Z=r(o,"P",{});var xi=i(Z);x=r(xi,"EM",{});var Ci=i(x);j=s(Ci,`BERT adopts masked language modeling (MLM) for pre-training and is one of the most successful pre-training models.
Since BERT neglects dependency among predicted tokens, XLNet introduces permuted language modeling (PLM) for
pre-training to address this problem. However, XLNet does not leverage the full position information of a sentence and
thus suffers from position discrepancy between pre-training and fine-tuning. In this paper, we propose MPNet, a novel
pre-training method that inherits the advantages of BERT and XLNet and avoids their limitations. MPNet leverages the
dependency among predicted tokens through permuted language modeling (vs. MLM in BERT), and takes auxiliary position
information as input to make the model see a full sentence and thus reducing the position discrepancy (vs. PLM in
XLNet). We pre-train MPNet on a large-scale dataset (over 160GB text corpora) and fine-tune on a variety of
down-streaming tasks (GLUE, SQuAD, etc). Experimental results show that MPNet outperforms MLM and PLM by a large
margin, and achieves better results on these tasks compared with previous state-of-the-art pre-trained methods (e.g.,
BERT, XLNet, RoBERTa) under the same model setting.`),Ci.forEach(t),xi.forEach(t),_e=h(o),Q=r(o,"P",{});var ji=i(Q);Ne=s(ji,"Tips:"),ji.forEach(t),ke=h(o),B=r(o,"UL",{});var Ai=i(B);te=r(Ai,"LI",{});var jt=i(te);Fe=s(jt,"MPNet doesn\u2019t have "),C=r(jt,"CODE",{});var Oi=i(C);Ee=s(Oi,"token_type_ids"),Oi.forEach(t),X=s(jt,`, you don\u2019t need to indicate which token belongs to which segment. just
separate your segments with the separation token `),de=r(jt,"CODE",{});var Li=i(de);ze=s(Li,"tokenizer.sep_token"),Li.forEach(t),G=s(jt," (or "),ce=r(jt,"CODE",{});var Di=i(ce);qe=s(Di,"[sep]"),Di.forEach(t),I=s(jt,")."),jt.forEach(t),Ai.forEach(t),ve=h(o),W=r(o,"P",{});var _a=i(W);xe=s(_a,"The original code can be found "),Y=r(_a,"A",{href:!0,rel:!0});var Ii=i(Y);A=s(Ii,"here"),Ii.forEach(t),Ce=s(_a,"."),_a.forEach(t),O=h(o),ne=r(o,"H2",{class:!0});var ka=i(ne);re=r(ka,"A",{id:!0,class:!0,href:!0});var Si=i(re);f=r(Si,"SPAN",{});var Wi=i(f);y(F.$$.fragment,Wi),Wi.forEach(t),Si.forEach(t),Se=h(ka),oe=r(ka,"SPAN",{});var Ki=i(oe);We=s(Ki,"Documentation resources"),Ki.forEach(t),ka.forEach(t),Ie=h(o),E=r(o,"UL",{});var kt=i(E);Oe=r(kt,"LI",{});var Ui=i(Oe);je=r(Ui,"A",{href:!0});var Qi=i(je);Ke=s(Qi,"Text classification task guide"),Qi.forEach(t),Ui.forEach(t),Ue=h(kt),Le=r(kt,"LI",{});var Bi=i(Le);L=r(Bi,"A",{href:!0});var Hi=i(L);J=s(Hi,"Token classification task guide"),Hi.forEach(t),Bi.forEach(t),Qe=h(kt),De=r(kt,"LI",{});var Ri=i(De);H=r(Ri,"A",{href:!0});var Vi=i(H);Be=s(Vi,"Question answering task guide"),Vi.forEach(t),Ri.forEach(t),He=h(kt),pe=r(kt,"LI",{});var Xi=i(pe);Ae=r(Xi,"A",{href:!0});var Gi=i(Ae);se=s(Gi,"Masked language modeling task guide"),Gi.forEach(t),Xi.forEach(t),Re=h(kt),ur=r(kt,"LI",{});var Ji=i(ur);va=r(Ji,"A",{href:!0});var vf=i(va);Td=s(vf,"Multiple choice task guide"),vf.forEach(t),Ji.forEach(t),kt.forEach(t),Yi=h(o),Ht=r(o,"H2",{class:!0});var El=i(Ht);Mo=r(El,"A",{id:!0,class:!0,href:!0});var bf=i(Mo);fr=r(bf,"SPAN",{});var wf=i(fr);y(An.$$.fragment,wf),wf.forEach(t),bf.forEach(t),yd=h(El),gr=r(El,"SPAN",{});var Tf=i(gr);Md=s(Tf,"MPNetConfig"),Tf.forEach(t),El.forEach(t),Zi=h(o),gt=r(o,"DIV",{class:!0});var $n=i(gt);y(On.$$.fragment,$n),$d=h($n),Ct=r($n,"P",{});var Pn=i(Ct);Pd=s(Pn,"This is the configuration class to store the configuration of a "),ba=r(Pn,"A",{href:!0});var yf=i(ba);Nd=s(yf,"MPNetModel"),yf.forEach(t),Fd=s(Pn," or a "),wa=r(Pn,"A",{href:!0});var Mf=i(wa);Ed=s(Mf,"TFMPNetModel"),Mf.forEach(t),zd=s(Pn,`. It is used to
instantiate a MPNet 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 MPNet
`),Ln=r(Pn,"A",{href:!0,rel:!0});var $f=i(Ln);qd=s($f,"microsoft/mpnet-base"),$f.forEach(t),xd=s(Pn," architecture."),Pn.forEach(t),Cd=h($n),Rt=r($n,"P",{});var Ya=i(Rt);jd=s(Ya,"Configuration objects inherit from "),Ta=r(Ya,"A",{href:!0});var Pf=i(Ta);Ad=s(Pf,"PretrainedConfig"),Pf.forEach(t),Od=s(Ya,` and can be used to control the model outputs. Read the
documentation from `),ya=r(Ya,"A",{href:!0});var Nf=i(ya);Ld=s(Nf,"PretrainedConfig"),Nf.forEach(t),Dd=s(Ya," for more information."),Ya.forEach(t),Id=h($n),y($o.$$.fragment,$n),$n.forEach(t),el=h(o),Vt=r(o,"H2",{class:!0});var zl=i(Vt);Po=r(zl,"A",{id:!0,class:!0,href:!0});var Ff=i(Po);_r=r(Ff,"SPAN",{});var Ef=i(_r);y(Dn.$$.fragment,Ef),Ef.forEach(t),Ff.forEach(t),Sd=h(zl),kr=r(zl,"SPAN",{});var zf=i(kr);Wd=s(zf,"MPNetTokenizer"),zf.forEach(t),zl.forEach(t),tl=h(o),Ze=r(o,"DIV",{class:!0});var Pt=i(Ze);y(In.$$.fragment,Pt),Kd=h(Pt),Sn=r(Pt,"P",{});var ql=i(Sn);Ud=s(ql,"This tokenizer inherits from "),Ma=r(ql,"A",{href:!0});var qf=i(Ma);Qd=s(qf,"BertTokenizer"),qf.forEach(t),Bd=s(ql,` which contains most of the methods. Users should refer to the
superclass for more information regarding methods.`),ql.forEach(t),Hd=h(Pt),At=r(Pt,"DIV",{class:!0});var Za=i(At);y(Wn.$$.fragment,Za),Rd=h(Za),vr=r(Za,"P",{});var xf=i(vr);Vd=s(xf,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A MPNet sequence has the following format:`),xf.forEach(t),Xd=h(Za),Kn=r(Za,"UL",{});var xl=i(Kn);$a=r(xl,"LI",{});var _f=i($a);Gd=s(_f,"single sequence: "),br=r(_f,"CODE",{});var Cf=i(br);Jd=s(Cf,"<s> X </s>"),Cf.forEach(t),_f.forEach(t),Yd=h(xl),Pa=r(xl,"LI",{});var kf=i(Pa);Zd=s(kf,"pair of sequences: "),wr=r(kf,"CODE",{});var jf=i(wr);ec=s(jf,"<s> A </s></s> B </s>"),jf.forEach(t),kf.forEach(t),xl.forEach(t),Za.forEach(t),tc=h(Pt),No=r(Pt,"DIV",{class:!0});var Cl=i(No);y(Un.$$.fragment,Cl),oc=h(Cl),Qn=r(Cl,"P",{});var jl=i(Qn);nc=s(jl,`Retrieves sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Tr=r(jl,"CODE",{});var Af=i(Tr);sc=s(Af,"prepare_for_model"),Af.forEach(t),ac=s(jl," methods."),jl.forEach(t),Cl.forEach(t),rc=h(Pt),Fo=r(Pt,"DIV",{class:!0});var Al=i(Fo);y(Bn.$$.fragment,Al),ic=h(Al),yr=r(Al,"P",{});var Of=i(yr);lc=s(Of,`Creates a mask from the two sequences passed to be used in a sequence-pair classification task. MPNet does not
make use of token type ids, therefore a list of zeros is returned.`),Of.forEach(t),Al.forEach(t),dc=h(Pt),Na=r(Pt,"DIV",{class:!0});var Lf=i(Na);y(Hn.$$.fragment,Lf),Lf.forEach(t),Pt.forEach(t),ol=h(o),Xt=r(o,"H2",{class:!0});var Ol=i(Xt);Eo=r(Ol,"A",{id:!0,class:!0,href:!0});var Df=i(Eo);Mr=r(Df,"SPAN",{});var If=i(Mr);y(Rn.$$.fragment,If),If.forEach(t),Df.forEach(t),cc=h(Ol),$r=r(Ol,"SPAN",{});var Sf=i($r);pc=s(Sf,"MPNetTokenizerFast"),Sf.forEach(t),Ol.forEach(t),nl=h(o),_t=r(o,"DIV",{class:!0});var Nn=i(_t);y(Vn.$$.fragment,Nn),hc=h(Nn),Xn=r(Nn,"P",{});var Ll=i(Xn);mc=s(Ll,"Construct a \u201Cfast\u201D MPNet tokenizer (backed by HuggingFace\u2019s "),Pr=r(Ll,"EM",{});var Wf=i(Pr);uc=s(Wf,"tokenizers"),Wf.forEach(t),fc=s(Ll," library). Based on WordPiece."),Ll.forEach(t),gc=h(Nn),Gn=r(Nn,"P",{});var Dl=i(Gn);_c=s(Dl,"This tokenizer inherits from "),Fa=r(Dl,"A",{href:!0});var Kf=i(Fa);kc=s(Kf,"PreTrainedTokenizerFast"),Kf.forEach(t),vc=s(Dl,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Dl.forEach(t),bc=h(Nn),zo=r(Nn,"DIV",{class:!0});var Il=i(zo);y(Jn.$$.fragment,Il),wc=h(Il),Nr=r(Il,"P",{});var Uf=i(Nr);Tc=s(Uf,`Creates a mask from the two sequences passed to be used in a sequence-pair classification task. MPNet does not
make use of token type ids, therefore a list of zeros is returned`),Uf.forEach(t),Il.forEach(t),Nn.forEach(t),sl=h(o),Gt=r(o,"H2",{class:!0});var Sl=i(Gt);qo=r(Sl,"A",{id:!0,class:!0,href:!0});var Qf=i(qo);Fr=r(Qf,"SPAN",{});var Bf=i(Fr);y(Yn.$$.fragment,Bf),Bf.forEach(t),Qf.forEach(t),yc=h(Sl),Er=r(Sl,"SPAN",{});var Hf=i(Er);Mc=s(Hf,"MPNetModel"),Hf.forEach(t),Sl.forEach(t),al=h(o),rt=r(o,"DIV",{class:!0});var Ot=i(rt);y(Zn.$$.fragment,Ot),$c=h(Ot),zr=r(Ot,"P",{});var Rf=i(zr);Pc=s(Rf,"The bare MPNet Model transformer outputting raw hidden-states without any specific head on top."),Rf.forEach(t),Nc=h(Ot),es=r(Ot,"P",{});var Wl=i(es);Fc=s(Wl,"This model inherits from "),Ea=r(Wl,"A",{href:!0});var Vf=i(Ea);Ec=s(Vf,"PreTrainedModel"),Vf.forEach(t),zc=s(Wl,`. 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.)`),Wl.forEach(t),qc=h(Ot),ts=r(Ot,"P",{});var Kl=i(ts);xc=s(Kl,"This model is also a PyTorch "),os=r(Kl,"A",{href:!0,rel:!0});var Xf=i(os);Cc=s(Xf,"torch.nn.Module"),Xf.forEach(t),jc=s(Kl,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Kl.forEach(t),Ac=h(Ot),vt=r(Ot,"DIV",{class:!0});var Fn=i(vt);y(ns.$$.fragment,Fn),Oc=h(Fn),Jt=r(Fn,"P",{});var er=i(Jt);Lc=s(er,"The "),za=r(er,"A",{href:!0});var Gf=i(za);Dc=s(Gf,"MPNetModel"),Gf.forEach(t),Ic=s(er," forward method, overrides the "),qr=r(er,"CODE",{});var Jf=i(qr);Sc=s(Jf,"__call__"),Jf.forEach(t),Wc=s(er," special method."),er.forEach(t),Kc=h(Fn),y(xo.$$.fragment,Fn),Uc=h(Fn),y(Co.$$.fragment,Fn),Fn.forEach(t),Ot.forEach(t),rl=h(o),Yt=r(o,"H2",{class:!0});var Ul=i(Yt);jo=r(Ul,"A",{id:!0,class:!0,href:!0});var Yf=i(jo);xr=r(Yf,"SPAN",{});var Zf=i(xr);y(ss.$$.fragment,Zf),Zf.forEach(t),Yf.forEach(t),Qc=h(Ul),Cr=r(Ul,"SPAN",{});var eg=i(Cr);Bc=s(eg,"MPNetForMaskedLM"),eg.forEach(t),Ul.forEach(t),il=h(o),Zt=r(o,"DIV",{class:!0});var Ql=i(Zt);y(as.$$.fragment,Ql),Hc=h(Ql),bt=r(Ql,"DIV",{class:!0});var En=i(bt);y(rs.$$.fragment,En),Rc=h(En),eo=r(En,"P",{});var tr=i(eo);Vc=s(tr,"The "),qa=r(tr,"A",{href:!0});var tg=i(qa);Xc=s(tg,"MPNetForMaskedLM"),tg.forEach(t),Gc=s(tr," forward method, overrides the "),jr=r(tr,"CODE",{});var og=i(jr);Jc=s(og,"__call__"),og.forEach(t),Yc=s(tr," special method."),tr.forEach(t),Zc=h(En),y(Ao.$$.fragment,En),ep=h(En),y(Oo.$$.fragment,En),En.forEach(t),Ql.forEach(t),ll=h(o),to=r(o,"H2",{class:!0});var Bl=i(to);Lo=r(Bl,"A",{id:!0,class:!0,href:!0});var ng=i(Lo);Ar=r(ng,"SPAN",{});var sg=i(Ar);y(is.$$.fragment,sg),sg.forEach(t),ng.forEach(t),tp=h(Bl),Or=r(Bl,"SPAN",{});var ag=i(Or);op=s(ag,"MPNetForSequenceClassification"),ag.forEach(t),Bl.forEach(t),dl=h(o),it=r(o,"DIV",{class:!0});var Lt=i(it);y(ls.$$.fragment,Lt),np=h(Lt),Lr=r(Lt,"P",{});var rg=i(Lr);sp=s(rg,`MPNet Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),rg.forEach(t),ap=h(Lt),ds=r(Lt,"P",{});var Hl=i(ds);rp=s(Hl,"This model inherits from "),xa=r(Hl,"A",{href:!0});var ig=i(xa);ip=s(ig,"PreTrainedModel"),ig.forEach(t),lp=s(Hl,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Hl.forEach(t),dp=h(Lt),cs=r(Lt,"P",{});var Rl=i(cs);cp=s(Rl,"This model is also a PyTorch "),ps=r(Rl,"A",{href:!0,rel:!0});var lg=i(ps);pp=s(lg,"torch.nn.Module"),lg.forEach(t),hp=s(Rl,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Rl.forEach(t),mp=h(Lt),pt=r(Lt,"DIV",{class:!0});var Dt=i(pt);y(hs.$$.fragment,Dt),up=h(Dt),oo=r(Dt,"P",{});var or=i(oo);fp=s(or,"The "),Ca=r(or,"A",{href:!0});var dg=i(Ca);gp=s(dg,"MPNetForSequenceClassification"),dg.forEach(t),_p=s(or," forward method, overrides the "),Dr=r(or,"CODE",{});var cg=i(Dr);kp=s(cg,"__call__"),cg.forEach(t),vp=s(or," special method."),or.forEach(t),bp=h(Dt),y(Do.$$.fragment,Dt),wp=h(Dt),y(Io.$$.fragment,Dt),Tp=h(Dt),y(So.$$.fragment,Dt),Dt.forEach(t),Lt.forEach(t),cl=h(o),no=r(o,"H2",{class:!0});var Vl=i(no);Wo=r(Vl,"A",{id:!0,class:!0,href:!0});var pg=i(Wo);Ir=r(pg,"SPAN",{});var hg=i(Ir);y(ms.$$.fragment,hg),hg.forEach(t),pg.forEach(t),yp=h(Vl),Sr=r(Vl,"SPAN",{});var mg=i(Sr);Mp=s(mg,"MPNetForMultipleChoice"),mg.forEach(t),Vl.forEach(t),pl=h(o),lt=r(o,"DIV",{class:!0});var It=i(lt);y(us.$$.fragment,It),$p=h(It),Wr=r(It,"P",{});var ug=i(Wr);Pp=s(ug,`MPNet 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.`),ug.forEach(t),Np=h(It),fs=r(It,"P",{});var Xl=i(fs);Fp=s(Xl,"This model inherits from "),ja=r(Xl,"A",{href:!0});var fg=i(ja);Ep=s(fg,"PreTrainedModel"),fg.forEach(t),zp=s(Xl,`. 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.)`),Xl.forEach(t),qp=h(It),gs=r(It,"P",{});var Gl=i(gs);xp=s(Gl,"This model is also a PyTorch "),_s=r(Gl,"A",{href:!0,rel:!0});var gg=i(_s);Cp=s(gg,"torch.nn.Module"),gg.forEach(t),jp=s(Gl,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Gl.forEach(t),Ap=h(It),wt=r(It,"DIV",{class:!0});var zn=i(wt);y(ks.$$.fragment,zn),Op=h(zn),so=r(zn,"P",{});var nr=i(so);Lp=s(nr,"The "),Aa=r(nr,"A",{href:!0});var _g=i(Aa);Dp=s(_g,"MPNetForMultipleChoice"),_g.forEach(t),Ip=s(nr," forward method, overrides the "),Kr=r(nr,"CODE",{});var kg=i(Kr);Sp=s(kg,"__call__"),kg.forEach(t),Wp=s(nr," special method."),nr.forEach(t),Kp=h(zn),y(Ko.$$.fragment,zn),Up=h(zn),y(Uo.$$.fragment,zn),zn.forEach(t),It.forEach(t),hl=h(o),ao=r(o,"H2",{class:!0});var Jl=i(ao);Qo=r(Jl,"A",{id:!0,class:!0,href:!0});var vg=i(Qo);Ur=r(vg,"SPAN",{});var bg=i(Ur);y(vs.$$.fragment,bg),bg.forEach(t),vg.forEach(t),Qp=h(Jl),Qr=r(Jl,"SPAN",{});var wg=i(Qr);Bp=s(wg,"MPNetForTokenClassification"),wg.forEach(t),Jl.forEach(t),ml=h(o),dt=r(o,"DIV",{class:!0});var St=i(dt);y(bs.$$.fragment,St),Hp=h(St),Br=r(St,"P",{});var Tg=i(Br);Rp=s(Tg,`MPNet 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.`),Tg.forEach(t),Vp=h(St),ws=r(St,"P",{});var Yl=i(ws);Xp=s(Yl,"This model inherits from "),Oa=r(Yl,"A",{href:!0});var yg=i(Oa);Gp=s(yg,"PreTrainedModel"),yg.forEach(t),Jp=s(Yl,`. 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.)`),Yl.forEach(t),Yp=h(St),Ts=r(St,"P",{});var Zl=i(Ts);Zp=s(Zl,"This model is also a PyTorch "),ys=r(Zl,"A",{href:!0,rel:!0});var Mg=i(ys);eh=s(Mg,"torch.nn.Module"),Mg.forEach(t),th=s(Zl,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Zl.forEach(t),oh=h(St),Tt=r(St,"DIV",{class:!0});var qn=i(Tt);y(Ms.$$.fragment,qn),nh=h(qn),ro=r(qn,"P",{});var sr=i(ro);sh=s(sr,"The "),La=r(sr,"A",{href:!0});var $g=i(La);ah=s($g,"MPNetForTokenClassification"),$g.forEach(t),rh=s(sr," forward method, overrides the "),Hr=r(sr,"CODE",{});var Pg=i(Hr);ih=s(Pg,"__call__"),Pg.forEach(t),lh=s(sr," special method."),sr.forEach(t),dh=h(qn),y(Bo.$$.fragment,qn),ch=h(qn),y(Ho.$$.fragment,qn),qn.forEach(t),St.forEach(t),ul=h(o),io=r(o,"H2",{class:!0});var ed=i(io);Ro=r(ed,"A",{id:!0,class:!0,href:!0});var Ng=i(Ro);Rr=r(Ng,"SPAN",{});var Fg=i(Rr);y($s.$$.fragment,Fg),Fg.forEach(t),Ng.forEach(t),ph=h(ed),Vr=r(ed,"SPAN",{});var Eg=i(Vr);hh=s(Eg,"MPNetForQuestionAnswering"),Eg.forEach(t),ed.forEach(t),fl=h(o),ct=r(o,"DIV",{class:!0});var Wt=i(ct);y(Ps.$$.fragment,Wt),mh=h(Wt),lo=r(Wt,"P",{});var ar=i(lo);uh=s(ar,`MPNet 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 `),Xr=r(ar,"CODE",{});var zg=i(Xr);fh=s(zg,"span start logits"),zg.forEach(t),gh=s(ar," and "),Gr=r(ar,"CODE",{});var qg=i(Gr);_h=s(qg,"span end logits"),qg.forEach(t),kh=s(ar,")."),ar.forEach(t),vh=h(Wt),Ns=r(Wt,"P",{});var td=i(Ns);bh=s(td,"This model inherits from "),Da=r(td,"A",{href:!0});var xg=i(Da);wh=s(xg,"PreTrainedModel"),xg.forEach(t),Th=s(td,`. 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.)`),td.forEach(t),yh=h(Wt),Fs=r(Wt,"P",{});var od=i(Fs);Mh=s(od,"This model is also a PyTorch "),Es=r(od,"A",{href:!0,rel:!0});var Cg=i(Es);$h=s(Cg,"torch.nn.Module"),Cg.forEach(t),Ph=s(od,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),od.forEach(t),Nh=h(Wt),yt=r(Wt,"DIV",{class:!0});var xn=i(yt);y(zs.$$.fragment,xn),Fh=h(xn),co=r(xn,"P",{});var rr=i(co);Eh=s(rr,"The "),Ia=r(rr,"A",{href:!0});var jg=i(Ia);zh=s(jg,"MPNetForQuestionAnswering"),jg.forEach(t),qh=s(rr," forward method, overrides the "),Jr=r(rr,"CODE",{});var Ag=i(Jr);xh=s(Ag,"__call__"),Ag.forEach(t),Ch=s(rr," special method."),rr.forEach(t),jh=h(xn),y(Vo.$$.fragment,xn),Ah=h(xn),y(Xo.$$.fragment,xn),xn.forEach(t),Wt.forEach(t),gl=h(o),po=r(o,"H2",{class:!0});var nd=i(po);Go=r(nd,"A",{id:!0,class:!0,href:!0});var Og=i(Go);Yr=r(Og,"SPAN",{});var Lg=i(Yr);y(qs.$$.fragment,Lg),Lg.forEach(t),Og.forEach(t),Oh=h(nd),Zr=r(nd,"SPAN",{});var Dg=i(Zr);Lh=s(Dg,"TFMPNetModel"),Dg.forEach(t),nd.forEach(t),_l=h(o),et=r(o,"DIV",{class:!0});var Nt=i(et);y(xs.$$.fragment,Nt),Dh=h(Nt),ei=r(Nt,"P",{});var Ig=i(ei);Ih=s(Ig,"The bare MPNet Model transformer outputting raw hidden-states without any specific head on top."),Ig.forEach(t),Sh=h(Nt),Cs=r(Nt,"P",{});var sd=i(Cs);Wh=s(sd,"This model inherits from "),Sa=r(sd,"A",{href:!0});var Sg=i(Sa);Kh=s(Sg,"TFPreTrainedModel"),Sg.forEach(t),Uh=s(sd,`. 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.)`),sd.forEach(t),Qh=h(Nt),js=r(Nt,"P",{});var ad=i(js);Bh=s(ad,"This model is also a "),As=r(ad,"A",{href:!0,rel:!0});var Wg=i(As);Hh=s(Wg,"tf.keras.Model"),Wg.forEach(t),Rh=s(ad,` 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.`),ad.forEach(t),Vh=h(Nt),y(Jo.$$.fragment,Nt),Xh=h(Nt),Mt=r(Nt,"DIV",{class:!0});var Cn=i(Mt);y(Os.$$.fragment,Cn),Gh=h(Cn),ho=r(Cn,"P",{});var ir=i(ho);Jh=s(ir,"The "),Wa=r(ir,"A",{href:!0});var Kg=i(Wa);Yh=s(Kg,"TFMPNetModel"),Kg.forEach(t),Zh=s(ir," forward method, overrides the "),ti=r(ir,"CODE",{});var Ug=i(ti);em=s(Ug,"__call__"),Ug.forEach(t),tm=s(ir," special method."),ir.forEach(t),om=h(Cn),y(Yo.$$.fragment,Cn),nm=h(Cn),y(Zo.$$.fragment,Cn),Cn.forEach(t),Nt.forEach(t),kl=h(o),mo=r(o,"H2",{class:!0});var rd=i(mo);en=r(rd,"A",{id:!0,class:!0,href:!0});var Qg=i(en);oi=r(Qg,"SPAN",{});var Bg=i(oi);y(Ls.$$.fragment,Bg),Bg.forEach(t),Qg.forEach(t),sm=h(rd),ni=r(rd,"SPAN",{});var Hg=i(ni);am=s(Hg,"TFMPNetForMaskedLM"),Hg.forEach(t),rd.forEach(t),vl=h(o),tt=r(o,"DIV",{class:!0});var Ft=i(tt);y(Ds.$$.fragment,Ft),rm=h(Ft),Is=r(Ft,"P",{});var id=i(Is);im=s(id,"MPNet Model with a "),si=r(id,"CODE",{});var Rg=i(si);lm=s(Rg,"language modeling"),Rg.forEach(t),dm=s(id," head on top."),id.forEach(t),cm=h(Ft),Ss=r(Ft,"P",{});var ld=i(Ss);pm=s(ld,"This model inherits from "),Ka=r(ld,"A",{href:!0});var Vg=i(Ka);hm=s(Vg,"TFPreTrainedModel"),Vg.forEach(t),mm=s(ld,`. 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.)`),ld.forEach(t),um=h(Ft),Ws=r(Ft,"P",{});var dd=i(Ws);fm=s(dd,"This model is also a "),Ks=r(dd,"A",{href:!0,rel:!0});var Xg=i(Ks);gm=s(Xg,"tf.keras.Model"),Xg.forEach(t),_m=s(dd,` 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.`),dd.forEach(t),km=h(Ft),y(tn.$$.fragment,Ft),vm=h(Ft),ht=r(Ft,"DIV",{class:!0});var Kt=i(ht);y(Us.$$.fragment,Kt),bm=h(Kt),uo=r(Kt,"P",{});var lr=i(uo);wm=s(lr,"The "),Ua=r(lr,"A",{href:!0});var Gg=i(Ua);Tm=s(Gg,"TFMPNetForMaskedLM"),Gg.forEach(t),ym=s(lr," forward method, overrides the "),ai=r(lr,"CODE",{});var Jg=i(ai);Mm=s(Jg,"__call__"),Jg.forEach(t),$m=s(lr," special method."),lr.forEach(t),Pm=h(Kt),y(on.$$.fragment,Kt),Nm=h(Kt),y(nn.$$.fragment,Kt),Fm=h(Kt),y(sn.$$.fragment,Kt),Kt.forEach(t),Ft.forEach(t),bl=h(o),fo=r(o,"H2",{class:!0});var cd=i(fo);an=r(cd,"A",{id:!0,class:!0,href:!0});var Yg=i(an);ri=r(Yg,"SPAN",{});var Zg=i(ri);y(Qs.$$.fragment,Zg),Zg.forEach(t),Yg.forEach(t),Em=h(cd),ii=r(cd,"SPAN",{});var e_=i(ii);zm=s(e_,"TFMPNetForSequenceClassification"),e_.forEach(t),cd.forEach(t),wl=h(o),ot=r(o,"DIV",{class:!0});var Et=i(ot);y(Bs.$$.fragment,Et),qm=h(Et),li=r(Et,"P",{});var t_=i(li);xm=s(t_,`MPNet Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),t_.forEach(t),Cm=h(Et),Hs=r(Et,"P",{});var pd=i(Hs);jm=s(pd,"This model inherits from "),Qa=r(pd,"A",{href:!0});var o_=i(Qa);Am=s(o_,"TFPreTrainedModel"),o_.forEach(t),Om=s(pd,`. 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.)`),pd.forEach(t),Lm=h(Et),Rs=r(Et,"P",{});var hd=i(Rs);Dm=s(hd,"This model is also a "),Vs=r(hd,"A",{href:!0,rel:!0});var n_=i(Vs);Im=s(n_,"tf.keras.Model"),n_.forEach(t),Sm=s(hd,` 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.`),hd.forEach(t),Wm=h(Et),y(rn.$$.fragment,Et),Km=h(Et),mt=r(Et,"DIV",{class:!0});var Ut=i(mt);y(Xs.$$.fragment,Ut),Um=h(Ut),go=r(Ut,"P",{});var dr=i(go);Qm=s(dr,"The "),Ba=r(dr,"A",{href:!0});var s_=i(Ba);Bm=s(s_,"TFMPNetForSequenceClassification"),s_.forEach(t),Hm=s(dr," forward method, overrides the "),di=r(dr,"CODE",{});var a_=i(di);Rm=s(a_,"__call__"),a_.forEach(t),Vm=s(dr," special method."),dr.forEach(t),Xm=h(Ut),y(ln.$$.fragment,Ut),Gm=h(Ut),y(dn.$$.fragment,Ut),Jm=h(Ut),y(cn.$$.fragment,Ut),Ut.forEach(t),Et.forEach(t),Tl=h(o),_o=r(o,"H2",{class:!0});var md=i(_o);pn=r(md,"A",{id:!0,class:!0,href:!0});var r_=i(pn);ci=r(r_,"SPAN",{});var i_=i(ci);y(Gs.$$.fragment,i_),i_.forEach(t),r_.forEach(t),Ym=h(md),pi=r(md,"SPAN",{});var l_=i(pi);Zm=s(l_,"TFMPNetForMultipleChoice"),l_.forEach(t),md.forEach(t),yl=h(o),nt=r(o,"DIV",{class:!0});var zt=i(nt);y(Js.$$.fragment,zt),eu=h(zt),hi=r(zt,"P",{});var d_=i(hi);tu=s(d_,`MPNet 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.`),d_.forEach(t),ou=h(zt),Ys=r(zt,"P",{});var ud=i(Ys);nu=s(ud,"This model inherits from "),Ha=r(ud,"A",{href:!0});var c_=i(Ha);su=s(c_,"TFPreTrainedModel"),c_.forEach(t),au=s(ud,`. 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.)`),ud.forEach(t),ru=h(zt),Zs=r(zt,"P",{});var fd=i(Zs);iu=s(fd,"This model is also a "),ea=r(fd,"A",{href:!0,rel:!0});var p_=i(ea);lu=s(p_,"tf.keras.Model"),p_.forEach(t),du=s(fd,` 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.`),fd.forEach(t),cu=h(zt),y(hn.$$.fragment,zt),pu=h(zt),$t=r(zt,"DIV",{class:!0});var jn=i($t);y(ta.$$.fragment,jn),hu=h(jn),ko=r(jn,"P",{});var cr=i(ko);mu=s(cr,"The "),Ra=r(cr,"A",{href:!0});var h_=i(Ra);uu=s(h_,"TFMPNetForMultipleChoice"),h_.forEach(t),fu=s(cr," forward method, overrides the "),mi=r(cr,"CODE",{});var m_=i(mi);gu=s(m_,"__call__"),m_.forEach(t),_u=s(cr," special method."),cr.forEach(t),ku=h(jn),y(mn.$$.fragment,jn),vu=h(jn),y(un.$$.fragment,jn),jn.forEach(t),zt.forEach(t),Ml=h(o),vo=r(o,"H2",{class:!0});var gd=i(vo);fn=r(gd,"A",{id:!0,class:!0,href:!0});var u_=i(fn);ui=r(u_,"SPAN",{});var f_=i(ui);y(oa.$$.fragment,f_),f_.forEach(t),u_.forEach(t),bu=h(gd),fi=r(gd,"SPAN",{});var g_=i(fi);wu=s(g_,"TFMPNetForTokenClassification"),g_.forEach(t),gd.forEach(t),$l=h(o),st=r(o,"DIV",{class:!0});var qt=i(st);y(na.$$.fragment,qt),Tu=h(qt),gi=r(qt,"P",{});var __=i(gi);yu=s(__,`MPNet 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.`),__.forEach(t),Mu=h(qt),sa=r(qt,"P",{});var _d=i(sa);$u=s(_d,"This model inherits from "),Va=r(_d,"A",{href:!0});var k_=i(Va);Pu=s(k_,"TFPreTrainedModel"),k_.forEach(t),Nu=s(_d,`. 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.)`),_d.forEach(t),Fu=h(qt),aa=r(qt,"P",{});var kd=i(aa);Eu=s(kd,"This model is also a "),ra=r(kd,"A",{href:!0,rel:!0});var v_=i(ra);zu=s(v_,"tf.keras.Model"),v_.forEach(t),qu=s(kd,` 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.`),kd.forEach(t),xu=h(qt),y(gn.$$.fragment,qt),Cu=h(qt),ut=r(qt,"DIV",{class:!0});var Qt=i(ut);y(ia.$$.fragment,Qt),ju=h(Qt),bo=r(Qt,"P",{});var pr=i(bo);Au=s(pr,"The "),Xa=r(pr,"A",{href:!0});var b_=i(Xa);Ou=s(b_,"TFMPNetForTokenClassification"),b_.forEach(t),Lu=s(pr," forward method, overrides the "),_i=r(pr,"CODE",{});var w_=i(_i);Du=s(w_,"__call__"),w_.forEach(t),Iu=s(pr," special method."),pr.forEach(t),Su=h(Qt),y(_n.$$.fragment,Qt),Wu=h(Qt),y(kn.$$.fragment,Qt),Ku=h(Qt),y(vn.$$.fragment,Qt),Qt.forEach(t),qt.forEach(t),Pl=h(o),wo=r(o,"H2",{class:!0});var vd=i(wo);bn=r(vd,"A",{id:!0,class:!0,href:!0});var T_=i(bn);ki=r(T_,"SPAN",{});var y_=i(ki);y(la.$$.fragment,y_),y_.forEach(t),T_.forEach(t),Uu=h(vd),vi=r(vd,"SPAN",{});var M_=i(vi);Qu=s(M_,"TFMPNetForQuestionAnswering"),M_.forEach(t),vd.forEach(t),Nl=h(o),at=r(o,"DIV",{class:!0});var xt=i(at);y(da.$$.fragment,xt),Bu=h(xt),To=r(xt,"P",{});var hr=i(To);Hu=s(hr,`MPNet 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 `),bi=r(hr,"CODE",{});var $_=i(bi);Ru=s($_,"span start logits"),$_.forEach(t),Vu=s(hr," and "),wi=r(hr,"CODE",{});var P_=i(wi);Xu=s(P_,"span end logits"),P_.forEach(t),Gu=s(hr,")."),hr.forEach(t),Ju=h(xt),ca=r(xt,"P",{});var bd=i(ca);Yu=s(bd,"This model inherits from "),Ga=r(bd,"A",{href:!0});var N_=i(Ga);Zu=s(N_,"TFPreTrainedModel"),N_.forEach(t),ef=s(bd,`. 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.)`),bd.forEach(t),tf=h(xt),pa=r(xt,"P",{});var wd=i(pa);of=s(wd,"This model is also a "),ha=r(wd,"A",{href:!0,rel:!0});var F_=i(ha);nf=s(F_,"tf.keras.Model"),F_.forEach(t),sf=s(wd,` 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.`),wd.forEach(t),af=h(xt),y(wn.$$.fragment,xt),rf=h(xt),ft=r(xt,"DIV",{class:!0});var Bt=i(ft);y(ma.$$.fragment,Bt),lf=h(Bt),yo=r(Bt,"P",{});var mr=i(yo);df=s(mr,"The "),Ja=r(mr,"A",{href:!0});var E_=i(Ja);cf=s(E_,"TFMPNetForQuestionAnswering"),E_.forEach(t),pf=s(mr," forward method, overrides the "),Ti=r(mr,"CODE",{});var z_=i(Ti);hf=s(z_,"__call__"),z_.forEach(t),mf=s(mr," special method."),mr.forEach(t),uf=h(Bt),y(Tn.$$.fragment,Bt),ff=h(Bt),y(yn.$$.fragment,Bt),gf=h(Bt),y(Mn.$$.fragment,Bt),Bt.forEach(t),xt.forEach(t),this.h()},h(){g(d,"name","hf:doc:metadata"),g(d,"content",JSON.stringify(vk)),g(u,"id","mpnet"),g(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"),g(u,"href","#mpnet"),g(m,"class","relative group"),g(ae,"id","overview"),g(ae,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(ae,"href","#overview"),g(D,"class","relative group"),g(le,"href","https://arxiv.org/abs/2004.09297"),g(le,"rel","nofollow"),g(Y,"href","https://github.com/microsoft/MPNet"),g(Y,"rel","nofollow"),g(re,"id","documentation-resources"),g(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"),g(re,"href","#documentation-resources"),g(ne,"class","relative group"),g(je,"href","./tasks/sequence_classification"),g(L,"href","./tasks/token_classification"),g(H,"href","./tasks/question_answering"),g(Ae,"href","./tasks/masked_language_modeling"),g(va,"href","./tasks/multiple_choice"),g(Mo,"id","transformers.MPNetConfig"),g(Mo,"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"),g(Mo,"href","#transformers.MPNetConfig"),g(Ht,"class","relative group"),g(ba,"href","/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.MPNetModel"),g(wa,"href","/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.TFMPNetModel"),g(Ln,"href","https://huggingface.co/microsoft/mpnet-base"),g(Ln,"rel","nofollow"),g(Ta,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),g(ya,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),g(gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Po,"id","transformers.MPNetTokenizer"),g(Po,"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"),g(Po,"href","#transformers.MPNetTokenizer"),g(Vt,"class","relative group"),g(Ma,"href","/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertTokenizer"),g(At,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(No,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Fo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Na,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Eo,"id","transformers.MPNetTokenizerFast"),g(Eo,"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"),g(Eo,"href","#transformers.MPNetTokenizerFast"),g(Xt,"class","relative group"),g(Fa,"href","/docs/transformers/v4.27.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),g(zo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(_t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(qo,"id","transformers.MPNetModel"),g(qo,"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"),g(qo,"href","#transformers.MPNetModel"),g(Gt,"class","relative group"),g(Ea,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),g(os,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(os,"rel","nofollow"),g(za,"href","/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.MPNetModel"),g(vt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(jo,"id","transformers.MPNetForMaskedLM"),g(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"),g(jo,"href","#transformers.MPNetForMaskedLM"),g(Yt,"class","relative group"),g(qa,"href","/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.MPNetForMaskedLM"),g(bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Lo,"id","transformers.MPNetForSequenceClassification"),g(Lo,"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"),g(Lo,"href","#transformers.MPNetForSequenceClassification"),g(to,"class","relative group"),g(xa,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),g(ps,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(ps,"rel","nofollow"),g(Ca,"href","/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.MPNetForSequenceClassification"),g(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(it,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Wo,"id","transformers.MPNetForMultipleChoice"),g(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"),g(Wo,"href","#transformers.MPNetForMultipleChoice"),g(no,"class","relative group"),g(ja,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),g(_s,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(_s,"rel","nofollow"),g(Aa,"href","/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.MPNetForMultipleChoice"),g(wt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Qo,"id","transformers.MPNetForTokenClassification"),g(Qo,"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"),g(Qo,"href","#transformers.MPNetForTokenClassification"),g(ao,"class","relative group"),g(Oa,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),g(ys,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(ys,"rel","nofollow"),g(La,"href","/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.MPNetForTokenClassification"),g(Tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Ro,"id","transformers.MPNetForQuestionAnswering"),g(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"),g(Ro,"href","#transformers.MPNetForQuestionAnswering"),g(io,"class","relative group"),g(Da,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),g(Es,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(Es,"rel","nofollow"),g(Ia,"href","/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.MPNetForQuestionAnswering"),g(yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Go,"id","transformers.TFMPNetModel"),g(Go,"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"),g(Go,"href","#transformers.TFMPNetModel"),g(po,"class","relative group"),g(Sa,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel"),g(As,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),g(As,"rel","nofollow"),g(Wa,"href","/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.TFMPNetModel"),g(Mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(en,"id","transformers.TFMPNetForMaskedLM"),g(en,"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"),g(en,"href","#transformers.TFMPNetForMaskedLM"),g(mo,"class","relative group"),g(Ka,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel"),g(Ks,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),g(Ks,"rel","nofollow"),g(Ua,"href","/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.TFMPNetForMaskedLM"),g(ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(an,"id","transformers.TFMPNetForSequenceClassification"),g(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"),g(an,"href","#transformers.TFMPNetForSequenceClassification"),g(fo,"class","relative group"),g(Qa,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel"),g(Vs,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),g(Vs,"rel","nofollow"),g(Ba,"href","/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.TFMPNetForSequenceClassification"),g(mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(pn,"id","transformers.TFMPNetForMultipleChoice"),g(pn,"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"),g(pn,"href","#transformers.TFMPNetForMultipleChoice"),g(_o,"class","relative group"),g(Ha,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel"),g(ea,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),g(ea,"rel","nofollow"),g(Ra,"href","/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.TFMPNetForMultipleChoice"),g($t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(fn,"id","transformers.TFMPNetForTokenClassification"),g(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"),g(fn,"href","#transformers.TFMPNetForTokenClassification"),g(vo,"class","relative group"),g(Va,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel"),g(ra,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),g(ra,"rel","nofollow"),g(Xa,"href","/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.TFMPNetForTokenClassification"),g(ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(bn,"id","transformers.TFMPNetForQuestionAnswering"),g(bn,"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"),g(bn,"href","#transformers.TFMPNetForQuestionAnswering"),g(wo,"class","relative group"),g(Ga,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel"),g(ha,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),g(ha,"rel","nofollow"),g(Ja,"href","/docs/transformers/v4.27.1/en/model_doc/mpnet#transformers.TFMPNetForQuestionAnswering"),g(ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(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(o,k){e(document.head,d),_(o,v,k),_(o,m,k),e(m,u),e(u,b),M(l,b,null),e(m,c),e(m,z),e(z,be),_(o,he,k),_(o,D,k),e(D,ae),e(ae,ee),M(w,ee,null),e(D,we),e(D,R),e(R,Te),_(o,me,k),_(o,S,k),e(S,ye),e(S,le),e(le,V),e(S,Me),_(o,ue,k),_(o,K,k),e(K,$e),_(o,fe,k),_(o,U,k),e(U,Pe),_(o,ge,k),_(o,Z,k),e(Z,x),e(x,j),_(o,_e,k),_(o,Q,k),e(Q,Ne),_(o,ke,k),_(o,B,k),e(B,te),e(te,Fe),e(te,C),e(C,Ee),e(te,X),e(te,de),e(de,ze),e(te,G),e(te,ce),e(ce,qe),e(te,I),_(o,ve,k),_(o,W,k),e(W,xe),e(W,Y),e(Y,A),e(W,Ce),_(o,O,k),_(o,ne,k),e(ne,re),e(re,f),M(F,f,null),e(ne,Se),e(ne,oe),e(oe,We),_(o,Ie,k),_(o,E,k),e(E,Oe),e(Oe,je),e(je,Ke),e(E,Ue),e(E,Le),e(Le,L),e(L,J),e(E,Qe),e(E,De),e(De,H),e(H,Be),e(E,He),e(E,pe),e(pe,Ae),e(Ae,se),e(E,Re),e(E,ur),e(ur,va),e(va,Td),_(o,Yi,k),_(o,Ht,k),e(Ht,Mo),e(Mo,fr),M(An,fr,null),e(Ht,yd),e(Ht,gr),e(gr,Md),_(o,Zi,k),_(o,gt,k),M(On,gt,null),e(gt,$d),e(gt,Ct),e(Ct,Pd),e(Ct,ba),e(ba,Nd),e(Ct,Fd),e(Ct,wa),e(wa,Ed),e(Ct,zd),e(Ct,Ln),e(Ln,qd),e(Ct,xd),e(gt,Cd),e(gt,Rt),e(Rt,jd),e(Rt,Ta),e(Ta,Ad),e(Rt,Od),e(Rt,ya),e(ya,Ld),e(Rt,Dd),e(gt,Id),M($o,gt,null),_(o,el,k),_(o,Vt,k),e(Vt,Po),e(Po,_r),M(Dn,_r,null),e(Vt,Sd),e(Vt,kr),e(kr,Wd),_(o,tl,k),_(o,Ze,k),M(In,Ze,null),e(Ze,Kd),e(Ze,Sn),e(Sn,Ud),e(Sn,Ma),e(Ma,Qd),e(Sn,Bd),e(Ze,Hd),e(Ze,At),M(Wn,At,null),e(At,Rd),e(At,vr),e(vr,Vd),e(At,Xd),e(At,Kn),e(Kn,$a),e($a,Gd),e($a,br),e(br,Jd),e(Kn,Yd),e(Kn,Pa),e(Pa,Zd),e(Pa,wr),e(wr,ec),e(Ze,tc),e(Ze,No),M(Un,No,null),e(No,oc),e(No,Qn),e(Qn,nc),e(Qn,Tr),e(Tr,sc),e(Qn,ac),e(Ze,rc),e(Ze,Fo),M(Bn,Fo,null),e(Fo,ic),e(Fo,yr),e(yr,lc),e(Ze,dc),e(Ze,Na),M(Hn,Na,null),_(o,ol,k),_(o,Xt,k),e(Xt,Eo),e(Eo,Mr),M(Rn,Mr,null),e(Xt,cc),e(Xt,$r),e($r,pc),_(o,nl,k),_(o,_t,k),M(Vn,_t,null),e(_t,hc),e(_t,Xn),e(Xn,mc),e(Xn,Pr),e(Pr,uc),e(Xn,fc),e(_t,gc),e(_t,Gn),e(Gn,_c),e(Gn,Fa),e(Fa,kc),e(Gn,vc),e(_t,bc),e(_t,zo),M(Jn,zo,null),e(zo,wc),e(zo,Nr),e(Nr,Tc),_(o,sl,k),_(o,Gt,k),e(Gt,qo),e(qo,Fr),M(Yn,Fr,null),e(Gt,yc),e(Gt,Er),e(Er,Mc),_(o,al,k),_(o,rt,k),M(Zn,rt,null),e(rt,$c),e(rt,zr),e(zr,Pc),e(rt,Nc),e(rt,es),e(es,Fc),e(es,Ea),e(Ea,Ec),e(es,zc),e(rt,qc),e(rt,ts),e(ts,xc),e(ts,os),e(os,Cc),e(ts,jc),e(rt,Ac),e(rt,vt),M(ns,vt,null),e(vt,Oc),e(vt,Jt),e(Jt,Lc),e(Jt,za),e(za,Dc),e(Jt,Ic),e(Jt,qr),e(qr,Sc),e(Jt,Wc),e(vt,Kc),M(xo,vt,null),e(vt,Uc),M(Co,vt,null),_(o,rl,k),_(o,Yt,k),e(Yt,jo),e(jo,xr),M(ss,xr,null),e(Yt,Qc),e(Yt,Cr),e(Cr,Bc),_(o,il,k),_(o,Zt,k),M(as,Zt,null),e(Zt,Hc),e(Zt,bt),M(rs,bt,null),e(bt,Rc),e(bt,eo),e(eo,Vc),e(eo,qa),e(qa,Xc),e(eo,Gc),e(eo,jr),e(jr,Jc),e(eo,Yc),e(bt,Zc),M(Ao,bt,null),e(bt,ep),M(Oo,bt,null),_(o,ll,k),_(o,to,k),e(to,Lo),e(Lo,Ar),M(is,Ar,null),e(to,tp),e(to,Or),e(Or,op),_(o,dl,k),_(o,it,k),M(ls,it,null),e(it,np),e(it,Lr),e(Lr,sp),e(it,ap),e(it,ds),e(ds,rp),e(ds,xa),e(xa,ip),e(ds,lp),e(it,dp),e(it,cs),e(cs,cp),e(cs,ps),e(ps,pp),e(cs,hp),e(it,mp),e(it,pt),M(hs,pt,null),e(pt,up),e(pt,oo),e(oo,fp),e(oo,Ca),e(Ca,gp),e(oo,_p),e(oo,Dr),e(Dr,kp),e(oo,vp),e(pt,bp),M(Do,pt,null),e(pt,wp),M(Io,pt,null),e(pt,Tp),M(So,pt,null),_(o,cl,k),_(o,no,k),e(no,Wo),e(Wo,Ir),M(ms,Ir,null),e(no,yp),e(no,Sr),e(Sr,Mp),_(o,pl,k),_(o,lt,k),M(us,lt,null),e(lt,$p),e(lt,Wr),e(Wr,Pp),e(lt,Np),e(lt,fs),e(fs,Fp),e(fs,ja),e(ja,Ep),e(fs,zp),e(lt,qp),e(lt,gs),e(gs,xp),e(gs,_s),e(_s,Cp),e(gs,jp),e(lt,Ap),e(lt,wt),M(ks,wt,null),e(wt,Op),e(wt,so),e(so,Lp),e(so,Aa),e(Aa,Dp),e(so,Ip),e(so,Kr),e(Kr,Sp),e(so,Wp),e(wt,Kp),M(Ko,wt,null),e(wt,Up),M(Uo,wt,null),_(o,hl,k),_(o,ao,k),e(ao,Qo),e(Qo,Ur),M(vs,Ur,null),e(ao,Qp),e(ao,Qr),e(Qr,Bp),_(o,ml,k),_(o,dt,k),M(bs,dt,null),e(dt,Hp),e(dt,Br),e(Br,Rp),e(dt,Vp),e(dt,ws),e(ws,Xp),e(ws,Oa),e(Oa,Gp),e(ws,Jp),e(dt,Yp),e(dt,Ts),e(Ts,Zp),e(Ts,ys),e(ys,eh),e(Ts,th),e(dt,oh),e(dt,Tt),M(Ms,Tt,null),e(Tt,nh),e(Tt,ro),e(ro,sh),e(ro,La),e(La,ah),e(ro,rh),e(ro,Hr),e(Hr,ih),e(ro,lh),e(Tt,dh),M(Bo,Tt,null),e(Tt,ch),M(Ho,Tt,null),_(o,ul,k),_(o,io,k),e(io,Ro),e(Ro,Rr),M($s,Rr,null),e(io,ph),e(io,Vr),e(Vr,hh),_(o,fl,k),_(o,ct,k),M(Ps,ct,null),e(ct,mh),e(ct,lo),e(lo,uh),e(lo,Xr),e(Xr,fh),e(lo,gh),e(lo,Gr),e(Gr,_h),e(lo,kh),e(ct,vh),e(ct,Ns),e(Ns,bh),e(Ns,Da),e(Da,wh),e(Ns,Th),e(ct,yh),e(ct,Fs),e(Fs,Mh),e(Fs,Es),e(Es,$h),e(Fs,Ph),e(ct,Nh),e(ct,yt),M(zs,yt,null),e(yt,Fh),e(yt,co),e(co,Eh),e(co,Ia),e(Ia,zh),e(co,qh),e(co,Jr),e(Jr,xh),e(co,Ch),e(yt,jh),M(Vo,yt,null),e(yt,Ah),M(Xo,yt,null),_(o,gl,k),_(o,po,k),e(po,Go),e(Go,Yr),M(qs,Yr,null),e(po,Oh),e(po,Zr),e(Zr,Lh),_(o,_l,k),_(o,et,k),M(xs,et,null),e(et,Dh),e(et,ei),e(ei,Ih),e(et,Sh),e(et,Cs),e(Cs,Wh),e(Cs,Sa),e(Sa,Kh),e(Cs,Uh),e(et,Qh),e(et,js),e(js,Bh),e(js,As),e(As,Hh),e(js,Rh),e(et,Vh),M(Jo,et,null),e(et,Xh),e(et,Mt),M(Os,Mt,null),e(Mt,Gh),e(Mt,ho),e(ho,Jh),e(ho,Wa),e(Wa,Yh),e(ho,Zh),e(ho,ti),e(ti,em),e(ho,tm),e(Mt,om),M(Yo,Mt,null),e(Mt,nm),M(Zo,Mt,null),_(o,kl,k),_(o,mo,k),e(mo,en),e(en,oi),M(Ls,oi,null),e(mo,sm),e(mo,ni),e(ni,am),_(o,vl,k),_(o,tt,k),M(Ds,tt,null),e(tt,rm),e(tt,Is),e(Is,im),e(Is,si),e(si,lm),e(Is,dm),e(tt,cm),e(tt,Ss),e(Ss,pm),e(Ss,Ka),e(Ka,hm),e(Ss,mm),e(tt,um),e(tt,Ws),e(Ws,fm),e(Ws,Ks),e(Ks,gm),e(Ws,_m),e(tt,km),M(tn,tt,null),e(tt,vm),e(tt,ht),M(Us,ht,null),e(ht,bm),e(ht,uo),e(uo,wm),e(uo,Ua),e(Ua,Tm),e(uo,ym),e(uo,ai),e(ai,Mm),e(uo,$m),e(ht,Pm),M(on,ht,null),e(ht,Nm),M(nn,ht,null),e(ht,Fm),M(sn,ht,null),_(o,bl,k),_(o,fo,k),e(fo,an),e(an,ri),M(Qs,ri,null),e(fo,Em),e(fo,ii),e(ii,zm),_(o,wl,k),_(o,ot,k),M(Bs,ot,null),e(ot,qm),e(ot,li),e(li,xm),e(ot,Cm),e(ot,Hs),e(Hs,jm),e(Hs,Qa),e(Qa,Am),e(Hs,Om),e(ot,Lm),e(ot,Rs),e(Rs,Dm),e(Rs,Vs),e(Vs,Im),e(Rs,Sm),e(ot,Wm),M(rn,ot,null),e(ot,Km),e(ot,mt),M(Xs,mt,null),e(mt,Um),e(mt,go),e(go,Qm),e(go,Ba),e(Ba,Bm),e(go,Hm),e(go,di),e(di,Rm),e(go,Vm),e(mt,Xm),M(ln,mt,null),e(mt,Gm),M(dn,mt,null),e(mt,Jm),M(cn,mt,null),_(o,Tl,k),_(o,_o,k),e(_o,pn),e(pn,ci),M(Gs,ci,null),e(_o,Ym),e(_o,pi),e(pi,Zm),_(o,yl,k),_(o,nt,k),M(Js,nt,null),e(nt,eu),e(nt,hi),e(hi,tu),e(nt,ou),e(nt,Ys),e(Ys,nu),e(Ys,Ha),e(Ha,su),e(Ys,au),e(nt,ru),e(nt,Zs),e(Zs,iu),e(Zs,ea),e(ea,lu),e(Zs,du),e(nt,cu),M(hn,nt,null),e(nt,pu),e(nt,$t),M(ta,$t,null),e($t,hu),e($t,ko),e(ko,mu),e(ko,Ra),e(Ra,uu),e(ko,fu),e(ko,mi),e(mi,gu),e(ko,_u),e($t,ku),M(mn,$t,null),e($t,vu),M(un,$t,null),_(o,Ml,k),_(o,vo,k),e(vo,fn),e(fn,ui),M(oa,ui,null),e(vo,bu),e(vo,fi),e(fi,wu),_(o,$l,k),_(o,st,k),M(na,st,null),e(st,Tu),e(st,gi),e(gi,yu),e(st,Mu),e(st,sa),e(sa,$u),e(sa,Va),e(Va,Pu),e(sa,Nu),e(st,Fu),e(st,aa),e(aa,Eu),e(aa,ra),e(ra,zu),e(aa,qu),e(st,xu),M(gn,st,null),e(st,Cu),e(st,ut),M(ia,ut,null),e(ut,ju),e(ut,bo),e(bo,Au),e(bo,Xa),e(Xa,Ou),e(bo,Lu),e(bo,_i),e(_i,Du),e(bo,Iu),e(ut,Su),M(_n,ut,null),e(ut,Wu),M(kn,ut,null),e(ut,Ku),M(vn,ut,null),_(o,Pl,k),_(o,wo,k),e(wo,bn),e(bn,ki),M(la,ki,null),e(wo,Uu),e(wo,vi),e(vi,Qu),_(o,Nl,k),_(o,at,k),M(da,at,null),e(at,Bu),e(at,To),e(To,Hu),e(To,bi),e(bi,Ru),e(To,Vu),e(To,wi),e(wi,Xu),e(To,Gu),e(at,Ju),e(at,ca),e(ca,Yu),e(ca,Ga),e(Ga,Zu),e(ca,ef),e(at,tf),e(at,pa),e(pa,of),e(pa,ha),e(ha,nf),e(pa,sf),e(at,af),M(wn,at,null),e(at,rf),e(at,ft),M(ma,ft,null),e(ft,lf),e(ft,yo),e(yo,df),e(yo,Ja),e(Ja,cf),e(yo,pf),e(yo,Ti),e(Ti,hf),e(yo,mf),e(ft,uf),M(Tn,ft,null),e(ft,ff),M(yn,ft,null),e(ft,gf),M(Mn,ft,null),Fl=!0},p(o,[k]){const ua={};k&2&&(ua.$$scope={dirty:k,ctx:o}),$o.$set(ua);const yi={};k&2&&(yi.$$scope={dirty:k,ctx:o}),xo.$set(yi);const Mi={};k&2&&(Mi.$$scope={dirty:k,ctx:o}),Co.$set(Mi);const $i={};k&2&&($i.$$scope={dirty:k,ctx:o}),Ao.$set($i);const fa={};k&2&&(fa.$$scope={dirty:k,ctx:o}),Oo.$set(fa);const Pi={};k&2&&(Pi.$$scope={dirty:k,ctx:o}),Do.$set(Pi);const Ni={};k&2&&(Ni.$$scope={dirty:k,ctx:o}),Io.$set(Ni);const Fi={};k&2&&(Fi.$$scope={dirty:k,ctx:o}),So.$set(Fi);const ga={};k&2&&(ga.$$scope={dirty:k,ctx:o}),Ko.$set(ga);const Ei={};k&2&&(Ei.$$scope={dirty:k,ctx:o}),Uo.$set(Ei);const zi={};k&2&&(zi.$$scope={dirty:k,ctx:o}),Bo.$set(zi);const qi={};k&2&&(qi.$$scope={dirty:k,ctx:o}),Ho.$set(qi);const xi={};k&2&&(xi.$$scope={dirty:k,ctx:o}),Vo.$set(xi);const Ci={};k&2&&(Ci.$$scope={dirty:k,ctx:o}),Xo.$set(Ci);const ji={};k&2&&(ji.$$scope={dirty:k,ctx:o}),Jo.$set(ji);const Ai={};k&2&&(Ai.$$scope={dirty:k,ctx:o}),Yo.$set(Ai);const jt={};k&2&&(jt.$$scope={dirty:k,ctx:o}),Zo.$set(jt);const Oi={};k&2&&(Oi.$$scope={dirty:k,ctx:o}),tn.$set(Oi);const Li={};k&2&&(Li.$$scope={dirty:k,ctx:o}),on.$set(Li);const Di={};k&2&&(Di.$$scope={dirty:k,ctx:o}),nn.$set(Di);const _a={};k&2&&(_a.$$scope={dirty:k,ctx:o}),sn.$set(_a);const Ii={};k&2&&(Ii.$$scope={dirty:k,ctx:o}),rn.$set(Ii);const ka={};k&2&&(ka.$$scope={dirty:k,ctx:o}),ln.$set(ka);const Si={};k&2&&(Si.$$scope={dirty:k,ctx:o}),dn.$set(Si);const Wi={};k&2&&(Wi.$$scope={dirty:k,ctx:o}),cn.$set(Wi);const Ki={};k&2&&(Ki.$$scope={dirty:k,ctx:o}),hn.$set(Ki);const kt={};k&2&&(kt.$$scope={dirty:k,ctx:o}),mn.$set(kt);const Ui={};k&2&&(Ui.$$scope={dirty:k,ctx:o}),un.$set(Ui);const Qi={};k&2&&(Qi.$$scope={dirty:k,ctx:o}),gn.$set(Qi);const Bi={};k&2&&(Bi.$$scope={dirty:k,ctx:o}),_n.$set(Bi);const Hi={};k&2&&(Hi.$$scope={dirty:k,ctx:o}),kn.$set(Hi);const Ri={};k&2&&(Ri.$$scope={dirty:k,ctx:o}),vn.$set(Ri);const Vi={};k&2&&(Vi.$$scope={dirty:k,ctx:o}),wn.$set(Vi);const Xi={};k&2&&(Xi.$$scope={dirty:k,ctx:o}),Tn.$set(Xi);const Gi={};k&2&&(Gi.$$scope={dirty:k,ctx:o}),yn.$set(Gi);const Ji={};k&2&&(Ji.$$scope={dirty:k,ctx:o}),Mn.$set(Ji)},i(o){Fl||($(l.$$.fragment,o),$(w.$$.fragment,o),$(F.$$.fragment,o),$(An.$$.fragment,o),$(On.$$.fragment,o),$($o.$$.fragment,o),$(Dn.$$.fragment,o),$(In.$$.fragment,o),$(Wn.$$.fragment,o),$(Un.$$.fragment,o),$(Bn.$$.fragment,o),$(Hn.$$.fragment,o),$(Rn.$$.fragment,o),$(Vn.$$.fragment,o),$(Jn.$$.fragment,o),$(Yn.$$.fragment,o),$(Zn.$$.fragment,o),$(ns.$$.fragment,o),$(xo.$$.fragment,o),$(Co.$$.fragment,o),$(ss.$$.fragment,o),$(as.$$.fragment,o),$(rs.$$.fragment,o),$(Ao.$$.fragment,o),$(Oo.$$.fragment,o),$(is.$$.fragment,o),$(ls.$$.fragment,o),$(hs.$$.fragment,o),$(Do.$$.fragment,o),$(Io.$$.fragment,o),$(So.$$.fragment,o),$(ms.$$.fragment,o),$(us.$$.fragment,o),$(ks.$$.fragment,o),$(Ko.$$.fragment,o),$(Uo.$$.fragment,o),$(vs.$$.fragment,o),$(bs.$$.fragment,o),$(Ms.$$.fragment,o),$(Bo.$$.fragment,o),$(Ho.$$.fragment,o),$($s.$$.fragment,o),$(Ps.$$.fragment,o),$(zs.$$.fragment,o),$(Vo.$$.fragment,o),$(Xo.$$.fragment,o),$(qs.$$.fragment,o),$(xs.$$.fragment,o),$(Jo.$$.fragment,o),$(Os.$$.fragment,o),$(Yo.$$.fragment,o),$(Zo.$$.fragment,o),$(Ls.$$.fragment,o),$(Ds.$$.fragment,o),$(tn.$$.fragment,o),$(Us.$$.fragment,o),$(on.$$.fragment,o),$(nn.$$.fragment,o),$(sn.$$.fragment,o),$(Qs.$$.fragment,o),$(Bs.$$.fragment,o),$(rn.$$.fragment,o),$(Xs.$$.fragment,o),$(ln.$$.fragment,o),$(dn.$$.fragment,o),$(cn.$$.fragment,o),$(Gs.$$.fragment,o),$(Js.$$.fragment,o),$(hn.$$.fragment,o),$(ta.$$.fragment,o),$(mn.$$.fragment,o),$(un.$$.fragment,o),$(oa.$$.fragment,o),$(na.$$.fragment,o),$(gn.$$.fragment,o),$(ia.$$.fragment,o),$(_n.$$.fragment,o),$(kn.$$.fragment,o),$(vn.$$.fragment,o),$(la.$$.fragment,o),$(da.$$.fragment,o),$(wn.$$.fragment,o),$(ma.$$.fragment,o),$(Tn.$$.fragment,o),$(yn.$$.fragment,o),$(Mn.$$.fragment,o),Fl=!0)},o(o){P(l.$$.fragment,o),P(w.$$.fragment,o),P(F.$$.fragment,o),P(An.$$.fragment,o),P(On.$$.fragment,o),P($o.$$.fragment,o),P(Dn.$$.fragment,o),P(In.$$.fragment,o),P(Wn.$$.fragment,o),P(Un.$$.fragment,o),P(Bn.$$.fragment,o),P(Hn.$$.fragment,o),P(Rn.$$.fragment,o),P(Vn.$$.fragment,o),P(Jn.$$.fragment,o),P(Yn.$$.fragment,o),P(Zn.$$.fragment,o),P(ns.$$.fragment,o),P(xo.$$.fragment,o),P(Co.$$.fragment,o),P(ss.$$.fragment,o),P(as.$$.fragment,o),P(rs.$$.fragment,o),P(Ao.$$.fragment,o),P(Oo.$$.fragment,o),P(is.$$.fragment,o),P(ls.$$.fragment,o),P(hs.$$.fragment,o),P(Do.$$.fragment,o),P(Io.$$.fragment,o),P(So.$$.fragment,o),P(ms.$$.fragment,o),P(us.$$.fragment,o),P(ks.$$.fragment,o),P(Ko.$$.fragment,o),P(Uo.$$.fragment,o),P(vs.$$.fragment,o),P(bs.$$.fragment,o),P(Ms.$$.fragment,o),P(Bo.$$.fragment,o),P(Ho.$$.fragment,o),P($s.$$.fragment,o),P(Ps.$$.fragment,o),P(zs.$$.fragment,o),P(Vo.$$.fragment,o),P(Xo.$$.fragment,o),P(qs.$$.fragment,o),P(xs.$$.fragment,o),P(Jo.$$.fragment,o),P(Os.$$.fragment,o),P(Yo.$$.fragment,o),P(Zo.$$.fragment,o),P(Ls.$$.fragment,o),P(Ds.$$.fragment,o),P(tn.$$.fragment,o),P(Us.$$.fragment,o),P(on.$$.fragment,o),P(nn.$$.fragment,o),P(sn.$$.fragment,o),P(Qs.$$.fragment,o),P(Bs.$$.fragment,o),P(rn.$$.fragment,o),P(Xs.$$.fragment,o),P(ln.$$.fragment,o),P(dn.$$.fragment,o),P(cn.$$.fragment,o),P(Gs.$$.fragment,o),P(Js.$$.fragment,o),P(hn.$$.fragment,o),P(ta.$$.fragment,o),P(mn.$$.fragment,o),P(un.$$.fragment,o),P(oa.$$.fragment,o),P(na.$$.fragment,o),P(gn.$$.fragment,o),P(ia.$$.fragment,o),P(_n.$$.fragment,o),P(kn.$$.fragment,o),P(vn.$$.fragment,o),P(la.$$.fragment,o),P(da.$$.fragment,o),P(wn.$$.fragment,o),P(ma.$$.fragment,o),P(Tn.$$.fragment,o),P(yn.$$.fragment,o),P(Mn.$$.fragment,o),Fl=!1},d(o){t(d),o&&t(v),o&&t(m),N(l),o&&t(he),o&&t(D),N(w),o&&t(me),o&&t(S),o&&t(ue),o&&t(K),o&&t(fe),o&&t(U),o&&t(ge),o&&t(Z),o&&t(_e),o&&t(Q),o&&t(ke),o&&t(B),o&&t(ve),o&&t(W),o&&t(O),o&&t(ne),N(F),o&&t(Ie),o&&t(E),o&&t(Yi),o&&t(Ht),N(An),o&&t(Zi),o&&t(gt),N(On),N($o),o&&t(el),o&&t(Vt),N(Dn),o&&t(tl),o&&t(Ze),N(In),N(Wn),N(Un),N(Bn),N(Hn),o&&t(ol),o&&t(Xt),N(Rn),o&&t(nl),o&&t(_t),N(Vn),N(Jn),o&&t(sl),o&&t(Gt),N(Yn),o&&t(al),o&&t(rt),N(Zn),N(ns),N(xo),N(Co),o&&t(rl),o&&t(Yt),N(ss),o&&t(il),o&&t(Zt),N(as),N(rs),N(Ao),N(Oo),o&&t(ll),o&&t(to),N(is),o&&t(dl),o&&t(it),N(ls),N(hs),N(Do),N(Io),N(So),o&&t(cl),o&&t(no),N(ms),o&&t(pl),o&&t(lt),N(us),N(ks),N(Ko),N(Uo),o&&t(hl),o&&t(ao),N(vs),o&&t(ml),o&&t(dt),N(bs),N(Ms),N(Bo),N(Ho),o&&t(ul),o&&t(io),N($s),o&&t(fl),o&&t(ct),N(Ps),N(zs),N(Vo),N(Xo),o&&t(gl),o&&t(po),N(qs),o&&t(_l),o&&t(et),N(xs),N(Jo),N(Os),N(Yo),N(Zo),o&&t(kl),o&&t(mo),N(Ls),o&&t(vl),o&&t(tt),N(Ds),N(tn),N(Us),N(on),N(nn),N(sn),o&&t(bl),o&&t(fo),N(Qs),o&&t(wl),o&&t(ot),N(Bs),N(rn),N(Xs),N(ln),N(dn),N(cn),o&&t(Tl),o&&t(_o),N(Gs),o&&t(yl),o&&t(nt),N(Js),N(hn),N(ta),N(mn),N(un),o&&t(Ml),o&&t(vo),N(oa),o&&t($l),o&&t(st),N(na),N(gn),N(ia),N(_n),N(kn),N(vn),o&&t(Pl),o&&t(wo),N(la),o&&t(Nl),o&&t(at),N(da),N(wn),N(ma),N(Tn),N(yn),N(Mn)}}}const vk={local:"mpnet",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.MPNetConfig",title:"MPNetConfig"},{local:"transformers.MPNetTokenizer",title:"MPNetTokenizer"},{local:"transformers.MPNetTokenizerFast",title:"MPNetTokenizerFast"},{local:"transformers.MPNetModel",title:"MPNetModel"},{local:"transformers.MPNetForMaskedLM",title:"MPNetForMaskedLM"},{local:"transformers.MPNetForSequenceClassification",title:"MPNetForSequenceClassification"},{local:"transformers.MPNetForMultipleChoice",title:"MPNetForMultipleChoice"},{local:"transformers.MPNetForTokenClassification",title:"MPNetForTokenClassification"},{local:"transformers.MPNetForQuestionAnswering",title:"MPNetForQuestionAnswering"},{local:"transformers.TFMPNetModel",title:"TFMPNetModel"},{local:"transformers.TFMPNetForMaskedLM",title:"TFMPNetForMaskedLM"},{local:"transformers.TFMPNetForSequenceClassification",title:"TFMPNetForSequenceClassification"},{local:"transformers.TFMPNetForMultipleChoice",title:"TFMPNetForMultipleChoice"},{local:"transformers.TFMPNetForTokenClassification",title:"TFMPNetForTokenClassification"},{local:"transformers.TFMPNetForQuestionAnswering",title:"TFMPNetForQuestionAnswering"}],title:"MPNet"};function bk(q){return A_(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Nk extends q_{constructor(d){super();x_(this,d,bk,kk,C_,{})}}export{Nk as default,vk as metadata};
