import{S as J_,i as C_,s as U_,e as a,k as p,w as v,t as n,M as z_,c as r,d as t,m as h,a as i,x as w,h as s,b as g,G as e,g as _,y as k,q as $,o as N,B as F,v as I_,L as He}from"../../chunks/vendor-hf-doc-builder.js";import{T as Le}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 Oe}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as De}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function W_(J){let d,b,m,u,y;return u=new Ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1QTmV0TW9kZWwlMkMlMjBNUE5ldENvbmZpZyUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBNUE5ldCUyMG1wbmV0LWJhc2UlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwTVBOZXRDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMGZyb20lMjB0aGUlMjBtcG5ldC1iYXNlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBNUE5ldE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",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"),b=n("Examples:"),m=p(),v(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=s(c,"Examples:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,b),_(l,m,c),k(u,l,c),y=!0},p:He,i(l){y||($(u.$$.fragment,l),y=!0)},o(l){N(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function x_(J){let d,b,m,u,y;return{c(){d=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=n("Module"),y=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);b=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var j=i(m);u=s(j,"Module"),j.forEach(t),y=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,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function Z_(J){let d,b,m,u,y;return u=new Ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBNUE5ldE1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZtcG5ldC1iYXNlJTIyKSUwQW1vZGVsJTIwJTNEJTIwTVBOZXRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGbXBuZXQtYmFzZSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",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"),b=n("Example:"),m=p(),v(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=s(c,"Example:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,b),_(l,m,c),k(u,l,c),y=!0},p:He,i(l){y||($(u.$$.fragment,l),y=!0)},o(l){N(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function q_(J){let d,b,m,u,y;return{c(){d=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=n("Module"),y=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);b=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var j=i(m);u=s(j,"Module"),j.forEach(t),y=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,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function B_(J){let d,b,m,u,y;return u=new Ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBNUE5ldEZvck1hc2tlZExNJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZtcG5ldC1iYXNlJTIyKSUwQW1vZGVsJTIwJTNEJTIwTVBOZXRGb3JNYXNrZWRMTS5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGbXBuZXQtYmFzZSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyVGhlJTIwY2FwaXRhbCUyMG9mJTIwRnJhbmNlJTIwaXMlMjAlNUJNQVNLJTVELiUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjByZXRyaWV2ZSUyMGluZGV4JTIwb2YlMjAlNUJNQVNLJTVEJTBBbWFza190b2tlbl9pbmRleCUyMCUzRCUyMChpbnB1dHMuaW5wdXRfaWRzJTIwJTNEJTNEJTIwdG9rZW5pemVyLm1hc2tfdG9rZW5faWQpJTVCMCU1RC5ub256ZXJvKGFzX3R1cGxlJTNEVHJ1ZSklNUIwJTVEJTBBJTBBcHJlZGljdGVkX3Rva2VuX2lkJTIwJTNEJTIwbG9naXRzJTVCMCUyQyUyMG1hc2tfdG9rZW5faW5kZXglNUQuYXJnbWF4KGF4aXMlM0QtMSklMEElMEFsYWJlbHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyVGhlJTIwY2FwaXRhbCUyMG9mJTIwRnJhbmNlJTIwaXMlMjBQYXJpcy4lMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSU1QiUyMmlucHV0X2lkcyUyMiU1RCUwQSUyMyUyMG1hc2slMjBsYWJlbHMlMjBvZiUyMG5vbi0lNUJNQVNLJTVEJTIwdG9rZW5zJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2gud2hlcmUoaW5wdXRzLmlucHV0X2lkcyUyMCUzRCUzRCUyMHRva2VuaXplci5tYXNrX3Rva2VuX2lkJTJDJTIwbGFiZWxzJTJDJTIwLTEwMCklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBsYWJlbHMlM0RsYWJlbHMp",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"),b=n("Example:"),m=p(),v(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=s(c,"Example:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,b),_(l,m,c),k(u,l,c),y=!0},p:He,i(l){y||($(u.$$.fragment,l),y=!0)},o(l){N(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function R_(J){let d,b,m,u,y;return{c(){d=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=n("Module"),y=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);b=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var j=i(m);u=s(j,"Module"),j.forEach(t),y=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,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function G_(J){let d,b,m,u,y;return u=new Ye({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyME1QTmV0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRm1wbmV0LWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBNUE5ldEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRm1wbmV0LWJhc2UlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX2NsYXNzX2lkJTIwJTNEJTIwbG9naXRzLmFyZ21heCgpLml0ZW0oKSUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyME1QTmV0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGbXBuZXQtYmFzZSUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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"),b=n("Example of single-label classification:"),m=p(),v(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=s(c,"Example of single-label classification:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,b),_(l,m,c),k(u,l,c),y=!0},p:He,i(l){y||($(u.$$.fragment,l),y=!0)},o(l){N(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function V_(J){let d,b,m,u,y;return u=new Ye({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyME1QTmV0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRm1wbmV0LWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBNUE5ldEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRm1wbmV0LWJhc2UlMjIlMkMlMjBwcm9ibGVtX3R5cGUlM0QlMjJtdWx0aV9sYWJlbF9jbGFzc2lmaWNhdGlvbiUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWRzJTIwJTNEJTIwdG9yY2guYXJhbmdlKDAlMkMlMjBsb2dpdHMuc2hhcGUlNUItMSU1RCklNUJ0b3JjaC5zaWdtb2lkKGxvZ2l0cykuc3F1ZWV6ZShkaW0lM0QwKSUyMCUzRSUyMDAuNSU1RCUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyME1QTmV0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIybWljcm9zb2Z0JTJGbXBuZXQtYmFzZSUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIlMEEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2guc3VtKCUwQSUyMCUyMCUyMCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwub25lX2hvdChwcmVkaWN0ZWRfY2xhc3NfaWRzJTVCTm9uZSUyQyUyMCUzQSU1RC5jbG9uZSgpJTJDJTIwbnVtX2NsYXNzZXMlM0RudW1fbGFiZWxzKSUyQyUyMGRpbSUzRDElMEEpLnRvKHRvcmNoLmZsb2F0KSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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"),b=n("Example of multi-label classification:"),m=p(),v(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=s(c,"Example of multi-label classification:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,b),_(l,m,c),k(u,l,c),y=!0},p:He,i(l){y||($(u.$$.fragment,l),y=!0)},o(l){N(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function A_(J){let d,b,m,u,y;return{c(){d=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=n("Module"),y=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);b=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var j=i(m);u=s(j,"Module"),j.forEach(t),y=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,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function X_(J){let d,b,m,u,y;return u=new Ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBNUE5ldEZvck11bHRpcGxlQ2hvaWNlJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZtcG5ldC1iYXNlJTIyKSUwQW1vZGVsJTIwJTNEJTIwTVBOZXRGb3JNdWx0aXBsZUNob2ljZS5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGbXBuZXQtYmFzZSUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJJbiUyMEl0YWx5JTJDJTIwcGl6emElMjBzZXJ2ZWQlMjBpbiUyMGZvcm1hbCUyMHNldHRpbmdzJTJDJTIwc3VjaCUyMGFzJTIwYXQlMjBhJTIwcmVzdGF1cmFudCUyQyUyMGlzJTIwcHJlc2VudGVkJTIwdW5zbGljZWQuJTIyJTBBY2hvaWNlMCUyMCUzRCUyMCUyMkl0JTIwaXMlMjBlYXRlbiUyMHdpdGglMjBhJTIwZm9yayUyMGFuZCUyMGElMjBrbmlmZS4lMjIlMEFjaG9pY2UxJTIwJTNEJTIwJTIySXQlMjBpcyUyMGVhdGVuJTIwd2hpbGUlMjBoZWxkJTIwaW4lMjB0aGUlMjBoYW5kLiUyMiUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvcigwKS51bnNxdWVlemUoMCklMjAlMjAlMjMlMjBjaG9pY2UwJTIwaXMlMjBjb3JyZWN0JTIwKGFjY29yZGluZyUyMHRvJTIwV2lraXBlZGlhJTIwJTNCKSklMkMlMjBiYXRjaCUyMHNpemUlMjAxJTBBJTBBZW5jb2RpbmclMjAlM0QlMjB0b2tlbml6ZXIoJTVCcHJvbXB0JTJDJTIwcHJvbXB0JTVEJTJDJTIwJTVCY2hvaWNlMCUyQyUyMGNob2ljZTElNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTJDJTIwcGFkZGluZyUzRFRydWUpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqJTdCayUzQSUyMHYudW5zcXVlZXplKDApJTIwZm9yJTIwayUyQyUyMHYlMjBpbiUyMGVuY29kaW5nLml0ZW1zKCklN0QlMkMlMjBsYWJlbHMlM0RsYWJlbHMpJTIwJTIwJTIzJTIwYmF0Y2glMjBzaXplJTIwaXMlMjAxJTBBJTBBJTIzJTIwdGhlJTIwbGluZWFyJTIwY2xhc3NpZmllciUyMHN0aWxsJTIwbmVlZHMlMjB0byUyMGJlJTIwdHJhaW5lZCUwQWxvc3MlMjAlM0QlMjBvdXRwdXRzLmxvc3MlMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",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"),b=n("Example:"),m=p(),v(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=s(c,"Example:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,b),_(l,m,c),k(u,l,c),y=!0},p:He,i(l){y||($(u.$$.fragment,l),y=!0)},o(l){N(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function S_(J){let d,b,m,u,y;return{c(){d=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=n("Module"),y=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);b=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var j=i(m);u=s(j,"Module"),j.forEach(t),y=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,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function Q_(J){let d,b,m,u,y;return u=new Ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBNUE5ldEZvclRva2VuQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRm1wbmV0LWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBNUE5ldEZvclRva2VuQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRm1wbmV0LWJhc2UlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUwQSUyMCUyMCUyMCUyMCUyMkh1Z2dpbmdGYWNlJTIwaXMlMjBhJTIwY29tcGFueSUyMGJhc2VkJTIwaW4lMjBQYXJpcyUyMGFuZCUyME5ldyUyMFlvcmslMjIlMkMlMjBhZGRfc3BlY2lhbF90b2tlbnMlM0RGYWxzZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMEEpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfdG9rZW5fY2xhc3NfaWRzJTIwJTNEJTIwbG9naXRzLmFyZ21heCgtMSklMEElMEElMjMlMjBOb3RlJTIwdGhhdCUyMHRva2VucyUyMGFyZSUyMGNsYXNzaWZpZWQlMjByYXRoZXIlMjB0aGVuJTIwaW5wdXQlMjB3b3JkcyUyMHdoaWNoJTIwbWVhbnMlMjB0aGF0JTBBJTIzJTIwdGhlcmUlMjBtaWdodCUyMGJlJTIwbW9yZSUyMHByZWRpY3RlZCUyMHRva2VuJTIwY2xhc3NlcyUyMHRoYW4lMjB3b3Jkcy4lMEElMjMlMjBNdWx0aXBsZSUyMHRva2VuJTIwY2xhc3NlcyUyMG1pZ2h0JTIwYWNjb3VudCUyMGZvciUyMHRoZSUyMHNhbWUlMjB3b3JkJTBBcHJlZGljdGVkX3Rva2Vuc19jbGFzc2VzJTIwJTNEJTIwJTVCbW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCdC5pdGVtKCklNUQlMjBmb3IlMjB0JTIwaW4lMjBwcmVkaWN0ZWRfdG9rZW5fY2xhc3NfaWRzJTVCMCU1RCU1RCUwQSUwQWxhYmVscyUyMCUzRCUyMHByZWRpY3RlZF90b2tlbl9jbGFzc19pZHMlMEFsb3NzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBsYWJlbHMlM0RsYWJlbHMpLmxvc3M=",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"),b=n("Example:"),m=p(),v(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=s(c,"Example:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,b),_(l,m,c),k(u,l,c),y=!0},p:He,i(l){y||($(u.$$.fragment,l),y=!0)},o(l){N(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function L_(J){let d,b,m,u,y;return{c(){d=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=n("Module"),y=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);b=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var j=i(m);u=s(j,"Module"),j.forEach(t),y=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,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function O_(J){let d,b,m,u,y;return u=new Ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBNUE5ldEZvclF1ZXN0aW9uQW5zd2VyaW5nJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZtcG5ldC1iYXNlJTIyKSUwQW1vZGVsJTIwJTNEJTIwTVBOZXRGb3JRdWVzdGlvbkFuc3dlcmluZy5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGbXBuZXQtYmFzZSUyMiklMEElMEFxdWVzdGlvbiUyQyUyMHRleHQlMjAlM0QlMjAlMjJXaG8lMjB3YXMlMjBKaW0lMjBIZW5zb24lM0YlMjIlMkMlMjAlMjJKaW0lMjBIZW5zb24lMjB3YXMlMjBhJTIwbmljZSUyMHB1cHBldCUyMiUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihxdWVzdGlvbiUyQyUyMHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBYW5zd2VyX3N0YXJ0X2luZGV4JTIwJTNEJTIwb3V0cHV0cy5zdGFydF9sb2dpdHMuYXJnbWF4KCklMEFhbnN3ZXJfZW5kX2luZGV4JTIwJTNEJTIwb3V0cHV0cy5lbmRfbG9naXRzLmFyZ21heCgpJTBBJTBBcHJlZGljdF9hbnN3ZXJfdG9rZW5zJTIwJTNEJTIwaW5wdXRzLmlucHV0X2lkcyU1QjAlMkMlMjBhbnN3ZXJfc3RhcnRfaW5kZXglMjAlM0ElMjBhbnN3ZXJfZW5kX2luZGV4JTIwJTJCJTIwMSU1RCUwQSUwQSUyMyUyMHRhcmdldCUyMGlzJTIwJTIybmljZSUyMHB1cHBldCUyMiUwQXRhcmdldF9zdGFydF9pbmRleCUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxNCU1RCklMEF0YXJnZXRfZW5kX2luZGV4JTIwJTNEJTIwdG9yY2gudGVuc29yKCU1QjE1JTVEKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMHN0YXJ0X3Bvc2l0aW9ucyUzRHRhcmdldF9zdGFydF9pbmRleCUyQyUyMGVuZF9wb3NpdGlvbnMlM0R0YXJnZXRfZW5kX2luZGV4KSUwQWxvc3MlMjAlM0QlMjBvdXRwdXRzLmxvc3M=",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"),b=n("Example:"),m=p(),v(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=s(c,"Example:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,b),_(l,m,c),k(u,l,c),y=!0},p:He,i(l){y||($(u.$$.fragment,l),y=!0)},o(l){N(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function D_(J){let d,b,m,u,y,l,c,j,ye,he,Z,ae,ee,T,Te,Q,ve,me,B,we,le,L,ke,ue,G,$e,fe,V,Ne,ge,K,C,z,_e,A,Fe,Me,X,te,Ee,U,Pe,O,de,je,D,ce,Je,q,be,R,Ce,Y,I,Ue,W,ne,re;return{c(){d=a("p"),b=n("TensorFlow models and layers in "),m=a("code"),u=n("transformers"),y=n(" accept two formats as input:"),l=p(),c=a("ul"),j=a("li"),ye=n("having all inputs as keyword arguments (like PyTorch models), or"),he=p(),Z=a("li"),ae=n("having all inputs as a list, tuple or dict in the first positional argument."),ee=p(),T=a("p"),Te=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 `),Q=a("code"),ve=n("model.fit()"),me=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),B=a("code"),we=n("model.fit()"),le=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),L=a("code"),ke=n("fit()"),ue=n(" and "),G=a("code"),$e=n("predict()"),fe=n(`, such as when creating your own layers or models with
the Keras `),V=a("code"),Ne=n("Functional"),ge=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),K=p(),C=a("ul"),z=a("li"),_e=n("a single Tensor with "),A=a("code"),Fe=n("input_ids"),Me=n(" only and nothing else: "),X=a("code"),te=n("model(input_ids)"),Ee=p(),U=a("li"),Pe=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),O=a("code"),de=n("model([input_ids, attention_mask])"),je=n(" or "),D=a("code"),ce=n("model([input_ids, attention_mask, token_type_ids])"),Je=p(),q=a("li"),be=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),R=a("code"),Ce=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Y=p(),I=a("p"),Ue=n(`Note that when creating models and layers with
`),W=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 E=i(d);b=s(E,"TensorFlow models and layers in "),m=r(E,"CODE",{});var Be=i(m);u=s(Be,"transformers"),Be.forEach(t),y=s(E," accept two formats as input:"),E.forEach(t),l=h(f),c=r(f,"UL",{});var oe=i(c);j=r(oe,"LI",{});var Re=i(j);ye=s(Re,"having all inputs as keyword arguments (like PyTorch models), or"),Re.forEach(t),he=h(oe),Z=r(oe,"LI",{});var qe=i(Z);ae=s(qe,"having all inputs as a list, tuple or dict in the first positional argument."),qe.forEach(t),oe.forEach(t),ee=h(f),T=r(f,"P",{});var P=i(T);Te=s(P,`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 `),Q=r(P,"CODE",{});var We=i(Q);ve=s(We,"model.fit()"),We.forEach(t),me=s(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),B=r(P,"CODE",{});var ze=i(B);we=s(ze,"model.fit()"),ze.forEach(t),le=s(P,` supports! If, however, you want to use the second
format outside of Keras methods like `),L=r(P,"CODE",{});var Ge=i(L);ke=s(Ge,"fit()"),Ge.forEach(t),ue=s(P," and "),G=r(P,"CODE",{});var Ve=i(G);$e=s(Ve,"predict()"),Ve.forEach(t),fe=s(P,`, such as when creating your own layers or models with
the Keras `),V=r(P,"CODE",{});var xe=i(V);Ne=s(xe,"Functional"),xe.forEach(t),ge=s(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),K=h(f),C=r(f,"UL",{});var x=i(C);z=r(x,"LI",{});var H=i(z);_e=s(H,"a single Tensor with "),A=r(H,"CODE",{});var Ae=i(A);Fe=s(Ae,"input_ids"),Ae.forEach(t),Me=s(H," only and nothing else: "),X=r(H,"CODE",{});var Ze=i(X);te=s(Ze,"model(input_ids)"),Ze.forEach(t),H.forEach(t),Ee=h(x),U=r(x,"LI",{});var S=i(U);Pe=s(S,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),O=r(S,"CODE",{});var Xe=i(O);de=s(Xe,"model([input_ids, attention_mask])"),Xe.forEach(t),je=s(S," or "),D=r(S,"CODE",{});var Se=i(D);ce=s(Se,"model([input_ids, attention_mask, token_type_ids])"),Se.forEach(t),S.forEach(t),Je=h(x),q=r(x,"LI",{});var pe=i(q);be=s(pe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),R=r(pe,"CODE",{});var Ie=i(R);Ce=s(Ie,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ie.forEach(t),pe.forEach(t),x.forEach(t),Y=h(f),I=r(f,"P",{});var se=i(I);Ue=s(se,`Note that when creating models and layers with
`),W=r(se,"A",{href:!0,rel:!0});var Qe=i(W);ne=s(Qe,"subclassing"),Qe.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(W,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),g(W,"rel","nofollow")},m(f,E){_(f,d,E),e(d,b),e(d,m),e(m,u),e(d,y),_(f,l,E),_(f,c,E),e(c,j),e(j,ye),e(c,he),e(c,Z),e(Z,ae),_(f,ee,E),_(f,T,E),e(T,Te),e(T,Q),e(Q,ve),e(T,me),e(T,B),e(B,we),e(T,le),e(T,L),e(L,ke),e(T,ue),e(T,G),e(G,$e),e(T,fe),e(T,V),e(V,Ne),e(T,ge),_(f,K,E),_(f,C,E),e(C,z),e(z,_e),e(z,A),e(A,Fe),e(z,Me),e(z,X),e(X,te),e(C,Ee),e(C,U),e(U,Pe),e(U,O),e(O,de),e(U,je),e(U,D),e(D,ce),e(C,Je),e(C,q),e(q,be),e(q,R),e(R,Ce),_(f,Y,E),_(f,I,E),e(I,Ue),e(I,W),e(W,ne),e(I,re)},d(f){f&&t(d),f&&t(l),f&&t(c),f&&t(ee),f&&t(T),f&&t(K),f&&t(C),f&&t(Y),f&&t(I)}}}function H_(J){let d,b,m,u,y;return{c(){d=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=n("Module"),y=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);b=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var j=i(m);u=s(j,"Module"),j.forEach(t),y=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,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function Y_(J){let d,b,m,u,y;return u=new Ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURk1QTmV0TW9kZWwlMEFpbXBvcnQlMjB0ZW5zb3JmbG93JTIwYXMlMjB0ZiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRm1wbmV0LWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBURk1QTmV0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRm1wbmV0LWJhc2UlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbChpbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",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"),b=n("Example:"),m=p(),v(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=s(c,"Example:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,b),_(l,m,c),k(u,l,c),y=!0},p:He,i(l){y||($(u.$$.fragment,l),y=!0)},o(l){N(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function K_(J){let d,b,m,u,y,l,c,j,ye,he,Z,ae,ee,T,Te,Q,ve,me,B,we,le,L,ke,ue,G,$e,fe,V,Ne,ge,K,C,z,_e,A,Fe,Me,X,te,Ee,U,Pe,O,de,je,D,ce,Je,q,be,R,Ce,Y,I,Ue,W,ne,re;return{c(){d=a("p"),b=n("TensorFlow models and layers in "),m=a("code"),u=n("transformers"),y=n(" accept two formats as input:"),l=p(),c=a("ul"),j=a("li"),ye=n("having all inputs as keyword arguments (like PyTorch models), or"),he=p(),Z=a("li"),ae=n("having all inputs as a list, tuple or dict in the first positional argument."),ee=p(),T=a("p"),Te=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 `),Q=a("code"),ve=n("model.fit()"),me=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),B=a("code"),we=n("model.fit()"),le=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),L=a("code"),ke=n("fit()"),ue=n(" and "),G=a("code"),$e=n("predict()"),fe=n(`, such as when creating your own layers or models with
the Keras `),V=a("code"),Ne=n("Functional"),ge=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),K=p(),C=a("ul"),z=a("li"),_e=n("a single Tensor with "),A=a("code"),Fe=n("input_ids"),Me=n(" only and nothing else: "),X=a("code"),te=n("model(input_ids)"),Ee=p(),U=a("li"),Pe=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),O=a("code"),de=n("model([input_ids, attention_mask])"),je=n(" or "),D=a("code"),ce=n("model([input_ids, attention_mask, token_type_ids])"),Je=p(),q=a("li"),be=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),R=a("code"),Ce=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Y=p(),I=a("p"),Ue=n(`Note that when creating models and layers with
`),W=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 E=i(d);b=s(E,"TensorFlow models and layers in "),m=r(E,"CODE",{});var Be=i(m);u=s(Be,"transformers"),Be.forEach(t),y=s(E," accept two formats as input:"),E.forEach(t),l=h(f),c=r(f,"UL",{});var oe=i(c);j=r(oe,"LI",{});var Re=i(j);ye=s(Re,"having all inputs as keyword arguments (like PyTorch models), or"),Re.forEach(t),he=h(oe),Z=r(oe,"LI",{});var qe=i(Z);ae=s(qe,"having all inputs as a list, tuple or dict in the first positional argument."),qe.forEach(t),oe.forEach(t),ee=h(f),T=r(f,"P",{});var P=i(T);Te=s(P,`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 `),Q=r(P,"CODE",{});var We=i(Q);ve=s(We,"model.fit()"),We.forEach(t),me=s(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),B=r(P,"CODE",{});var ze=i(B);we=s(ze,"model.fit()"),ze.forEach(t),le=s(P,` supports! If, however, you want to use the second
format outside of Keras methods like `),L=r(P,"CODE",{});var Ge=i(L);ke=s(Ge,"fit()"),Ge.forEach(t),ue=s(P," and "),G=r(P,"CODE",{});var Ve=i(G);$e=s(Ve,"predict()"),Ve.forEach(t),fe=s(P,`, such as when creating your own layers or models with
the Keras `),V=r(P,"CODE",{});var xe=i(V);Ne=s(xe,"Functional"),xe.forEach(t),ge=s(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),K=h(f),C=r(f,"UL",{});var x=i(C);z=r(x,"LI",{});var H=i(z);_e=s(H,"a single Tensor with "),A=r(H,"CODE",{});var Ae=i(A);Fe=s(Ae,"input_ids"),Ae.forEach(t),Me=s(H," only and nothing else: "),X=r(H,"CODE",{});var Ze=i(X);te=s(Ze,"model(input_ids)"),Ze.forEach(t),H.forEach(t),Ee=h(x),U=r(x,"LI",{});var S=i(U);Pe=s(S,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),O=r(S,"CODE",{});var Xe=i(O);de=s(Xe,"model([input_ids, attention_mask])"),Xe.forEach(t),je=s(S," or "),D=r(S,"CODE",{});var Se=i(D);ce=s(Se,"model([input_ids, attention_mask, token_type_ids])"),Se.forEach(t),S.forEach(t),Je=h(x),q=r(x,"LI",{});var pe=i(q);be=s(pe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),R=r(pe,"CODE",{});var Ie=i(R);Ce=s(Ie,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ie.forEach(t),pe.forEach(t),x.forEach(t),Y=h(f),I=r(f,"P",{});var se=i(I);Ue=s(se,`Note that when creating models and layers with
`),W=r(se,"A",{href:!0,rel:!0});var Qe=i(W);ne=s(Qe,"subclassing"),Qe.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(W,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),g(W,"rel","nofollow")},m(f,E){_(f,d,E),e(d,b),e(d,m),e(m,u),e(d,y),_(f,l,E),_(f,c,E),e(c,j),e(j,ye),e(c,he),e(c,Z),e(Z,ae),_(f,ee,E),_(f,T,E),e(T,Te),e(T,Q),e(Q,ve),e(T,me),e(T,B),e(B,we),e(T,le),e(T,L),e(L,ke),e(T,ue),e(T,G),e(G,$e),e(T,fe),e(T,V),e(V,Ne),e(T,ge),_(f,K,E),_(f,C,E),e(C,z),e(z,_e),e(z,A),e(A,Fe),e(z,Me),e(z,X),e(X,te),e(C,Ee),e(C,U),e(U,Pe),e(U,O),e(O,de),e(U,je),e(U,D),e(D,ce),e(C,Je),e(C,q),e(q,be),e(q,R),e(R,Ce),_(f,Y,E),_(f,I,E),e(I,Ue),e(I,W),e(W,ne),e(I,re)},d(f){f&&t(d),f&&t(l),f&&t(c),f&&t(ee),f&&t(T),f&&t(K),f&&t(C),f&&t(Y),f&&t(I)}}}function eM(J){let d,b,m,u,y;return{c(){d=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=n("Module"),y=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);b=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var j=i(m);u=s(j,"Module"),j.forEach(t),y=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,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function tM(J){let d,b,m,u,y;return u=new Ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURk1QTmV0Rm9yTWFza2VkTE0lMEFpbXBvcnQlMjB0ZW5zb3JmbG93JTIwYXMlMjB0ZiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRm1wbmV0LWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBURk1QTmV0Rm9yTWFza2VkTE0uZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRm1wbmV0LWJhc2UlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMlRoZSUyMGNhcGl0YWwlMjBvZiUyMEZyYW5jZSUyMGlzJTIwJTVCTUFTSyU1RC4lMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQWxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjByZXRyaWV2ZSUyMGluZGV4JTIwb2YlMjAlNUJNQVNLJTVEJTBBbWFza190b2tlbl9pbmRleCUyMCUzRCUyMHRmLndoZXJlKChpbnB1dHMuaW5wdXRfaWRzJTIwJTNEJTNEJTIwdG9rZW5pemVyLm1hc2tfdG9rZW5faWQpJTVCMCU1RCklMEFzZWxlY3RlZF9sb2dpdHMlMjAlM0QlMjB0Zi5nYXRoZXJfbmQobG9naXRzJTVCMCU1RCUyQyUyMGluZGljZXMlM0RtYXNrX3Rva2VuX2luZGV4KSUwQSUwQXByZWRpY3RlZF90b2tlbl9pZCUyMCUzRCUyMHRmLm1hdGguYXJnbWF4KHNlbGVjdGVkX2xvZ2l0cyUyQyUyMGF4aXMlM0QtMSk=",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"),b=n("Example:"),m=p(),v(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=s(c,"Example:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,b),_(l,m,c),k(u,l,c),y=!0},p:He,i(l){y||($(u.$$.fragment,l),y=!0)},o(l){N(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function oM(J){let d,b;return d=new Ye({props:{code:"bGFiZWxzJTIwJTNEJTIwdG9rZW5pemVyKCUyMlRoZSUyMGNhcGl0YWwlMjBvZiUyMEZyYW5jZSUyMGlzJTIwUGFyaXMuJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklNUIlMjJpbnB1dF9pZHMlMjIlNUQlMEElMjMlMjBtYXNrJTIwbGFiZWxzJTIwb2YlMjBub24tJTVCTUFTSyU1RCUyMHRva2VucyUwQWxhYmVscyUyMCUzRCUyMHRmLndoZXJlKGlucHV0cy5pbnB1dF9pZHMlMjAlM0QlM0QlMjB0b2tlbml6ZXIubWFza190b2tlbl9pZCUyQyUyMGxhYmVscyUyQyUyMC0xMDApJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzJTJDJTIwbGFiZWxzJTNEbGFiZWxzKQ==",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(){v(d.$$.fragment)},l(m){w(d.$$.fragment,m)},m(m,u){k(d,m,u),b=!0},p:He,i(m){b||($(d.$$.fragment,m),b=!0)},o(m){N(d.$$.fragment,m),b=!1},d(m){F(d,m)}}}function nM(J){let d,b,m,u,y,l,c,j,ye,he,Z,ae,ee,T,Te,Q,ve,me,B,we,le,L,ke,ue,G,$e,fe,V,Ne,ge,K,C,z,_e,A,Fe,Me,X,te,Ee,U,Pe,O,de,je,D,ce,Je,q,be,R,Ce,Y,I,Ue,W,ne,re;return{c(){d=a("p"),b=n("TensorFlow models and layers in "),m=a("code"),u=n("transformers"),y=n(" accept two formats as input:"),l=p(),c=a("ul"),j=a("li"),ye=n("having all inputs as keyword arguments (like PyTorch models), or"),he=p(),Z=a("li"),ae=n("having all inputs as a list, tuple or dict in the first positional argument."),ee=p(),T=a("p"),Te=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 `),Q=a("code"),ve=n("model.fit()"),me=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),B=a("code"),we=n("model.fit()"),le=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),L=a("code"),ke=n("fit()"),ue=n(" and "),G=a("code"),$e=n("predict()"),fe=n(`, such as when creating your own layers or models with
the Keras `),V=a("code"),Ne=n("Functional"),ge=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),K=p(),C=a("ul"),z=a("li"),_e=n("a single Tensor with "),A=a("code"),Fe=n("input_ids"),Me=n(" only and nothing else: "),X=a("code"),te=n("model(input_ids)"),Ee=p(),U=a("li"),Pe=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),O=a("code"),de=n("model([input_ids, attention_mask])"),je=n(" or "),D=a("code"),ce=n("model([input_ids, attention_mask, token_type_ids])"),Je=p(),q=a("li"),be=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),R=a("code"),Ce=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Y=p(),I=a("p"),Ue=n(`Note that when creating models and layers with
`),W=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 E=i(d);b=s(E,"TensorFlow models and layers in "),m=r(E,"CODE",{});var Be=i(m);u=s(Be,"transformers"),Be.forEach(t),y=s(E," accept two formats as input:"),E.forEach(t),l=h(f),c=r(f,"UL",{});var oe=i(c);j=r(oe,"LI",{});var Re=i(j);ye=s(Re,"having all inputs as keyword arguments (like PyTorch models), or"),Re.forEach(t),he=h(oe),Z=r(oe,"LI",{});var qe=i(Z);ae=s(qe,"having all inputs as a list, tuple or dict in the first positional argument."),qe.forEach(t),oe.forEach(t),ee=h(f),T=r(f,"P",{});var P=i(T);Te=s(P,`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 `),Q=r(P,"CODE",{});var We=i(Q);ve=s(We,"model.fit()"),We.forEach(t),me=s(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),B=r(P,"CODE",{});var ze=i(B);we=s(ze,"model.fit()"),ze.forEach(t),le=s(P,` supports! If, however, you want to use the second
format outside of Keras methods like `),L=r(P,"CODE",{});var Ge=i(L);ke=s(Ge,"fit()"),Ge.forEach(t),ue=s(P," and "),G=r(P,"CODE",{});var Ve=i(G);$e=s(Ve,"predict()"),Ve.forEach(t),fe=s(P,`, such as when creating your own layers or models with
the Keras `),V=r(P,"CODE",{});var xe=i(V);Ne=s(xe,"Functional"),xe.forEach(t),ge=s(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),K=h(f),C=r(f,"UL",{});var x=i(C);z=r(x,"LI",{});var H=i(z);_e=s(H,"a single Tensor with "),A=r(H,"CODE",{});var Ae=i(A);Fe=s(Ae,"input_ids"),Ae.forEach(t),Me=s(H," only and nothing else: "),X=r(H,"CODE",{});var Ze=i(X);te=s(Ze,"model(input_ids)"),Ze.forEach(t),H.forEach(t),Ee=h(x),U=r(x,"LI",{});var S=i(U);Pe=s(S,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),O=r(S,"CODE",{});var Xe=i(O);de=s(Xe,"model([input_ids, attention_mask])"),Xe.forEach(t),je=s(S," or "),D=r(S,"CODE",{});var Se=i(D);ce=s(Se,"model([input_ids, attention_mask, token_type_ids])"),Se.forEach(t),S.forEach(t),Je=h(x),q=r(x,"LI",{});var pe=i(q);be=s(pe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),R=r(pe,"CODE",{});var Ie=i(R);Ce=s(Ie,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ie.forEach(t),pe.forEach(t),x.forEach(t),Y=h(f),I=r(f,"P",{});var se=i(I);Ue=s(se,`Note that when creating models and layers with
`),W=r(se,"A",{href:!0,rel:!0});var Qe=i(W);ne=s(Qe,"subclassing"),Qe.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(W,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),g(W,"rel","nofollow")},m(f,E){_(f,d,E),e(d,b),e(d,m),e(m,u),e(d,y),_(f,l,E),_(f,c,E),e(c,j),e(j,ye),e(c,he),e(c,Z),e(Z,ae),_(f,ee,E),_(f,T,E),e(T,Te),e(T,Q),e(Q,ve),e(T,me),e(T,B),e(B,we),e(T,le),e(T,L),e(L,ke),e(T,ue),e(T,G),e(G,$e),e(T,fe),e(T,V),e(V,Ne),e(T,ge),_(f,K,E),_(f,C,E),e(C,z),e(z,_e),e(z,A),e(A,Fe),e(z,Me),e(z,X),e(X,te),e(C,Ee),e(C,U),e(U,Pe),e(U,O),e(O,de),e(U,je),e(U,D),e(D,ce),e(C,Je),e(C,q),e(q,be),e(q,R),e(R,Ce),_(f,Y,E),_(f,I,E),e(I,Ue),e(I,W),e(W,ne),e(I,re)},d(f){f&&t(d),f&&t(l),f&&t(c),f&&t(ee),f&&t(T),f&&t(K),f&&t(C),f&&t(Y),f&&t(I)}}}function sM(J){let d,b,m,u,y;return{c(){d=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=n("Module"),y=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);b=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var j=i(m);u=s(j,"Module"),j.forEach(t),y=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,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function aM(J){let d,b,m,u,y;return u=new Ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURk1QTmV0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbiUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGbXBuZXQtYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyMFRGTVBOZXRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZtcG5ldC1iYXNlJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEElMEFsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX2NsYXNzX2lkJTIwJTNEJTIwaW50KHRmLm1hdGguYXJnbWF4KGxvZ2l0cyUyQyUyMGF4aXMlM0QtMSklNUIwJTVEKQ==",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"),b=n("Example:"),m=p(),v(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=s(c,"Example:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,b),_(l,m,c),k(u,l,c),y=!0},p:He,i(l){y||($(u.$$.fragment,l),y=!0)},o(l){N(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function rM(J){let d,b;return d=new Ye({props:{code:"JTIzJTIwVG8lMjB0cmFpbiUyMGElMjBtb2RlbCUyMG9uJTIwJTYwbnVtX2xhYmVscyU2MCUyMGNsYXNzZXMlMkMlMjB5b3UlMjBjYW4lMjBwYXNzJTIwJTYwbnVtX2xhYmVscyUzRG51bV9sYWJlbHMlNjAlMjB0byUyMCU2MC5mcm9tX3ByZXRyYWluZWQoLi4uKSU2MCUwQW51bV9sYWJlbHMlMjAlM0QlMjBsZW4obW9kZWwuY29uZmlnLmlkMmxhYmVsKSUwQW1vZGVsJTIwJTNEJTIwVEZNUE5ldEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRm1wbmV0LWJhc2UlMjIlMkMlMjBudW1fbGFiZWxzJTNEbnVtX2xhYmVscyklMEElMEFsYWJlbHMlMjAlM0QlMjB0Zi5jb25zdGFudCgxKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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(){v(d.$$.fragment)},l(m){w(d.$$.fragment,m)},m(m,u){k(d,m,u),b=!0},p:He,i(m){b||($(d.$$.fragment,m),b=!0)},o(m){N(d.$$.fragment,m),b=!1},d(m){F(d,m)}}}function iM(J){let d,b,m,u,y,l,c,j,ye,he,Z,ae,ee,T,Te,Q,ve,me,B,we,le,L,ke,ue,G,$e,fe,V,Ne,ge,K,C,z,_e,A,Fe,Me,X,te,Ee,U,Pe,O,de,je,D,ce,Je,q,be,R,Ce,Y,I,Ue,W,ne,re;return{c(){d=a("p"),b=n("TensorFlow models and layers in "),m=a("code"),u=n("transformers"),y=n(" accept two formats as input:"),l=p(),c=a("ul"),j=a("li"),ye=n("having all inputs as keyword arguments (like PyTorch models), or"),he=p(),Z=a("li"),ae=n("having all inputs as a list, tuple or dict in the first positional argument."),ee=p(),T=a("p"),Te=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 `),Q=a("code"),ve=n("model.fit()"),me=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),B=a("code"),we=n("model.fit()"),le=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),L=a("code"),ke=n("fit()"),ue=n(" and "),G=a("code"),$e=n("predict()"),fe=n(`, such as when creating your own layers or models with
the Keras `),V=a("code"),Ne=n("Functional"),ge=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),K=p(),C=a("ul"),z=a("li"),_e=n("a single Tensor with "),A=a("code"),Fe=n("input_ids"),Me=n(" only and nothing else: "),X=a("code"),te=n("model(input_ids)"),Ee=p(),U=a("li"),Pe=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),O=a("code"),de=n("model([input_ids, attention_mask])"),je=n(" or "),D=a("code"),ce=n("model([input_ids, attention_mask, token_type_ids])"),Je=p(),q=a("li"),be=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),R=a("code"),Ce=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Y=p(),I=a("p"),Ue=n(`Note that when creating models and layers with
`),W=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 E=i(d);b=s(E,"TensorFlow models and layers in "),m=r(E,"CODE",{});var Be=i(m);u=s(Be,"transformers"),Be.forEach(t),y=s(E," accept two formats as input:"),E.forEach(t),l=h(f),c=r(f,"UL",{});var oe=i(c);j=r(oe,"LI",{});var Re=i(j);ye=s(Re,"having all inputs as keyword arguments (like PyTorch models), or"),Re.forEach(t),he=h(oe),Z=r(oe,"LI",{});var qe=i(Z);ae=s(qe,"having all inputs as a list, tuple or dict in the first positional argument."),qe.forEach(t),oe.forEach(t),ee=h(f),T=r(f,"P",{});var P=i(T);Te=s(P,`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 `),Q=r(P,"CODE",{});var We=i(Q);ve=s(We,"model.fit()"),We.forEach(t),me=s(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),B=r(P,"CODE",{});var ze=i(B);we=s(ze,"model.fit()"),ze.forEach(t),le=s(P,` supports! If, however, you want to use the second
format outside of Keras methods like `),L=r(P,"CODE",{});var Ge=i(L);ke=s(Ge,"fit()"),Ge.forEach(t),ue=s(P," and "),G=r(P,"CODE",{});var Ve=i(G);$e=s(Ve,"predict()"),Ve.forEach(t),fe=s(P,`, such as when creating your own layers or models with
the Keras `),V=r(P,"CODE",{});var xe=i(V);Ne=s(xe,"Functional"),xe.forEach(t),ge=s(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),K=h(f),C=r(f,"UL",{});var x=i(C);z=r(x,"LI",{});var H=i(z);_e=s(H,"a single Tensor with "),A=r(H,"CODE",{});var Ae=i(A);Fe=s(Ae,"input_ids"),Ae.forEach(t),Me=s(H," only and nothing else: "),X=r(H,"CODE",{});var Ze=i(X);te=s(Ze,"model(input_ids)"),Ze.forEach(t),H.forEach(t),Ee=h(x),U=r(x,"LI",{});var S=i(U);Pe=s(S,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),O=r(S,"CODE",{});var Xe=i(O);de=s(Xe,"model([input_ids, attention_mask])"),Xe.forEach(t),je=s(S," or "),D=r(S,"CODE",{});var Se=i(D);ce=s(Se,"model([input_ids, attention_mask, token_type_ids])"),Se.forEach(t),S.forEach(t),Je=h(x),q=r(x,"LI",{});var pe=i(q);be=s(pe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),R=r(pe,"CODE",{});var Ie=i(R);Ce=s(Ie,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ie.forEach(t),pe.forEach(t),x.forEach(t),Y=h(f),I=r(f,"P",{});var se=i(I);Ue=s(se,`Note that when creating models and layers with
`),W=r(se,"A",{href:!0,rel:!0});var Qe=i(W);ne=s(Qe,"subclassing"),Qe.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(W,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),g(W,"rel","nofollow")},m(f,E){_(f,d,E),e(d,b),e(d,m),e(m,u),e(d,y),_(f,l,E),_(f,c,E),e(c,j),e(j,ye),e(c,he),e(c,Z),e(Z,ae),_(f,ee,E),_(f,T,E),e(T,Te),e(T,Q),e(Q,ve),e(T,me),e(T,B),e(B,we),e(T,le),e(T,L),e(L,ke),e(T,ue),e(T,G),e(G,$e),e(T,fe),e(T,V),e(V,Ne),e(T,ge),_(f,K,E),_(f,C,E),e(C,z),e(z,_e),e(z,A),e(A,Fe),e(z,Me),e(z,X),e(X,te),e(C,Ee),e(C,U),e(U,Pe),e(U,O),e(O,de),e(U,je),e(U,D),e(D,ce),e(C,Je),e(C,q),e(q,be),e(q,R),e(R,Ce),_(f,Y,E),_(f,I,E),e(I,Ue),e(I,W),e(W,ne),e(I,re)},d(f){f&&t(d),f&&t(l),f&&t(c),f&&t(ee),f&&t(T),f&&t(K),f&&t(C),f&&t(Y),f&&t(I)}}}function lM(J){let d,b,m,u,y;return{c(){d=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=n("Module"),y=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);b=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var j=i(m);u=s(j,"Module"),j.forEach(t),y=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,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function dM(J){let d,b,m,u,y;return u=new Ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURk1QTmV0Rm9yTXVsdGlwbGVDaG9pY2UlMEFpbXBvcnQlMjB0ZW5zb3JmbG93JTIwYXMlMjB0ZiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRm1wbmV0LWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBURk1QTmV0Rm9yTXVsdGlwbGVDaG9pY2UuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRm1wbmV0LWJhc2UlMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIySW4lMjBJdGFseSUyQyUyMHBpenphJTIwc2VydmVkJTIwaW4lMjBmb3JtYWwlMjBzZXR0aW5ncyUyQyUyMHN1Y2glMjBhcyUyMGF0JTIwYSUyMHJlc3RhdXJhbnQlMkMlMjBpcyUyMHByZXNlbnRlZCUyMHVuc2xpY2VkLiUyMiUwQWNob2ljZTAlMjAlM0QlMjAlMjJJdCUyMGlzJTIwZWF0ZW4lMjB3aXRoJTIwYSUyMGZvcmslMjBhbmQlMjBhJTIwa25pZmUuJTIyJTBBY2hvaWNlMSUyMCUzRCUyMCUyMkl0JTIwaXMlMjBlYXRlbiUyMHdoaWxlJTIwaGVsZCUyMGluJTIwdGhlJTIwaGFuZC4lMjIlMEElMEFlbmNvZGluZyUyMCUzRCUyMHRva2VuaXplciglNUJwcm9tcHQlMkMlMjBwcm9tcHQlNUQlMkMlMjAlNUJjaG9pY2UwJTJDJTIwY2hvaWNlMSU1RCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIlMkMlMjBwYWRkaW5nJTNEVHJ1ZSklMEFpbnB1dHMlMjAlM0QlMjAlN0JrJTNBJTIwdGYuZXhwYW5kX2RpbXModiUyQyUyMDApJTIwZm9yJTIwayUyQyUyMHYlMjBpbiUyMGVuY29kaW5nLml0ZW1zKCklN0QlMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRzKSUyMCUyMCUyMyUyMGJhdGNoJTIwc2l6ZSUyMGlzJTIwMSUwQSUwQSUyMyUyMHRoZSUyMGxpbmVhciUyMGNsYXNzaWZpZXIlMjBzdGlsbCUyMG5lZWRzJTIwdG8lMjBiZSUyMHRyYWluZWQlMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",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"),b=n("Example:"),m=p(),v(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=s(c,"Example:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,b),_(l,m,c),k(u,l,c),y=!0},p:He,i(l){y||($(u.$$.fragment,l),y=!0)},o(l){N(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function cM(J){let d,b,m,u,y,l,c,j,ye,he,Z,ae,ee,T,Te,Q,ve,me,B,we,le,L,ke,ue,G,$e,fe,V,Ne,ge,K,C,z,_e,A,Fe,Me,X,te,Ee,U,Pe,O,de,je,D,ce,Je,q,be,R,Ce,Y,I,Ue,W,ne,re;return{c(){d=a("p"),b=n("TensorFlow models and layers in "),m=a("code"),u=n("transformers"),y=n(" accept two formats as input:"),l=p(),c=a("ul"),j=a("li"),ye=n("having all inputs as keyword arguments (like PyTorch models), or"),he=p(),Z=a("li"),ae=n("having all inputs as a list, tuple or dict in the first positional argument."),ee=p(),T=a("p"),Te=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 `),Q=a("code"),ve=n("model.fit()"),me=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),B=a("code"),we=n("model.fit()"),le=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),L=a("code"),ke=n("fit()"),ue=n(" and "),G=a("code"),$e=n("predict()"),fe=n(`, such as when creating your own layers or models with
the Keras `),V=a("code"),Ne=n("Functional"),ge=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),K=p(),C=a("ul"),z=a("li"),_e=n("a single Tensor with "),A=a("code"),Fe=n("input_ids"),Me=n(" only and nothing else: "),X=a("code"),te=n("model(input_ids)"),Ee=p(),U=a("li"),Pe=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),O=a("code"),de=n("model([input_ids, attention_mask])"),je=n(" or "),D=a("code"),ce=n("model([input_ids, attention_mask, token_type_ids])"),Je=p(),q=a("li"),be=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),R=a("code"),Ce=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Y=p(),I=a("p"),Ue=n(`Note that when creating models and layers with
`),W=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 E=i(d);b=s(E,"TensorFlow models and layers in "),m=r(E,"CODE",{});var Be=i(m);u=s(Be,"transformers"),Be.forEach(t),y=s(E," accept two formats as input:"),E.forEach(t),l=h(f),c=r(f,"UL",{});var oe=i(c);j=r(oe,"LI",{});var Re=i(j);ye=s(Re,"having all inputs as keyword arguments (like PyTorch models), or"),Re.forEach(t),he=h(oe),Z=r(oe,"LI",{});var qe=i(Z);ae=s(qe,"having all inputs as a list, tuple or dict in the first positional argument."),qe.forEach(t),oe.forEach(t),ee=h(f),T=r(f,"P",{});var P=i(T);Te=s(P,`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 `),Q=r(P,"CODE",{});var We=i(Q);ve=s(We,"model.fit()"),We.forEach(t),me=s(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),B=r(P,"CODE",{});var ze=i(B);we=s(ze,"model.fit()"),ze.forEach(t),le=s(P,` supports! If, however, you want to use the second
format outside of Keras methods like `),L=r(P,"CODE",{});var Ge=i(L);ke=s(Ge,"fit()"),Ge.forEach(t),ue=s(P," and "),G=r(P,"CODE",{});var Ve=i(G);$e=s(Ve,"predict()"),Ve.forEach(t),fe=s(P,`, such as when creating your own layers or models with
the Keras `),V=r(P,"CODE",{});var xe=i(V);Ne=s(xe,"Functional"),xe.forEach(t),ge=s(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),K=h(f),C=r(f,"UL",{});var x=i(C);z=r(x,"LI",{});var H=i(z);_e=s(H,"a single Tensor with "),A=r(H,"CODE",{});var Ae=i(A);Fe=s(Ae,"input_ids"),Ae.forEach(t),Me=s(H," only and nothing else: "),X=r(H,"CODE",{});var Ze=i(X);te=s(Ze,"model(input_ids)"),Ze.forEach(t),H.forEach(t),Ee=h(x),U=r(x,"LI",{});var S=i(U);Pe=s(S,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),O=r(S,"CODE",{});var Xe=i(O);de=s(Xe,"model([input_ids, attention_mask])"),Xe.forEach(t),je=s(S," or "),D=r(S,"CODE",{});var Se=i(D);ce=s(Se,"model([input_ids, attention_mask, token_type_ids])"),Se.forEach(t),S.forEach(t),Je=h(x),q=r(x,"LI",{});var pe=i(q);be=s(pe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),R=r(pe,"CODE",{});var Ie=i(R);Ce=s(Ie,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ie.forEach(t),pe.forEach(t),x.forEach(t),Y=h(f),I=r(f,"P",{});var se=i(I);Ue=s(se,`Note that when creating models and layers with
`),W=r(se,"A",{href:!0,rel:!0});var Qe=i(W);ne=s(Qe,"subclassing"),Qe.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(W,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),g(W,"rel","nofollow")},m(f,E){_(f,d,E),e(d,b),e(d,m),e(m,u),e(d,y),_(f,l,E),_(f,c,E),e(c,j),e(j,ye),e(c,he),e(c,Z),e(Z,ae),_(f,ee,E),_(f,T,E),e(T,Te),e(T,Q),e(Q,ve),e(T,me),e(T,B),e(B,we),e(T,le),e(T,L),e(L,ke),e(T,ue),e(T,G),e(G,$e),e(T,fe),e(T,V),e(V,Ne),e(T,ge),_(f,K,E),_(f,C,E),e(C,z),e(z,_e),e(z,A),e(A,Fe),e(z,Me),e(z,X),e(X,te),e(C,Ee),e(C,U),e(U,Pe),e(U,O),e(O,de),e(U,je),e(U,D),e(D,ce),e(C,Je),e(C,q),e(q,be),e(q,R),e(R,Ce),_(f,Y,E),_(f,I,E),e(I,Ue),e(I,W),e(W,ne),e(I,re)},d(f){f&&t(d),f&&t(l),f&&t(c),f&&t(ee),f&&t(T),f&&t(K),f&&t(C),f&&t(Y),f&&t(I)}}}function pM(J){let d,b,m,u,y;return{c(){d=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=n("Module"),y=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);b=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var j=i(m);u=s(j,"Module"),j.forEach(t),y=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,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function hM(J){let d,b,m,u,y;return u=new Ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURk1QTmV0Rm9yVG9rZW5DbGFzc2lmaWNhdGlvbiUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGbXBuZXQtYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyMFRGTVBOZXRGb3JUb2tlbkNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZtcG5ldC1iYXNlJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMEElMjAlMjAlMjAlMjAlMjJIdWdnaW5nRmFjZSUyMGlzJTIwYSUyMGNvbXBhbnklMjBiYXNlZCUyMGluJTIwUGFyaXMlMjBhbmQlMjBOZXclMjBZb3JrJTIyJTJDJTIwYWRkX3NwZWNpYWxfdG9rZW5zJTNERmFsc2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyJTBBKSUwQSUwQWxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEFwcmVkaWN0ZWRfdG9rZW5fY2xhc3NfaWRzJTIwJTNEJTIwdGYubWF0aC5hcmdtYXgobG9naXRzJTJDJTIwYXhpcyUzRC0xKSUwQSUwQSUyMyUyME5vdGUlMjB0aGF0JTIwdG9rZW5zJTIwYXJlJTIwY2xhc3NpZmllZCUyMHJhdGhlciUyMHRoZW4lMjBpbnB1dCUyMHdvcmRzJTIwd2hpY2glMjBtZWFucyUyMHRoYXQlMEElMjMlMjB0aGVyZSUyMG1pZ2h0JTIwYmUlMjBtb3JlJTIwcHJlZGljdGVkJTIwdG9rZW4lMjBjbGFzc2VzJTIwdGhhbiUyMHdvcmRzLiUwQSUyMyUyME11bHRpcGxlJTIwdG9rZW4lMjBjbGFzc2VzJTIwbWlnaHQlMjBhY2NvdW50JTIwZm9yJTIwdGhlJTIwc2FtZSUyMHdvcmQlMEFwcmVkaWN0ZWRfdG9rZW5zX2NsYXNzZXMlMjAlM0QlMjAlNUJtb2RlbC5jb25maWcuaWQybGFiZWwlNUJ0JTVEJTIwZm9yJTIwdCUyMGluJTIwcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyU1QjAlNUQubnVtcHkoKS50b2xpc3QoKSU1RA==",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"),b=n("Example:"),m=p(),v(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=s(c,"Example:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,b),_(l,m,c),k(u,l,c),y=!0},p:He,i(l){y||($(u.$$.fragment,l),y=!0)},o(l){N(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function mM(J){let d,b;return d=new Ye({props:{code:"bGFiZWxzJTIwJTNEJTIwcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyUwQWxvc3MlMjAlM0QlMjB0Zi5tYXRoLnJlZHVjZV9tZWFuKG1vZGVsKCoqaW5wdXRzJTJDJTIwbGFiZWxzJTNEbGFiZWxzKS5sb3NzKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = tf.math.reduce_mean(model(**inputs, labels=labels).loss)`}}),{c(){v(d.$$.fragment)},l(m){w(d.$$.fragment,m)},m(m,u){k(d,m,u),b=!0},p:He,i(m){b||($(d.$$.fragment,m),b=!0)},o(m){N(d.$$.fragment,m),b=!1},d(m){F(d,m)}}}function uM(J){let d,b,m,u,y,l,c,j,ye,he,Z,ae,ee,T,Te,Q,ve,me,B,we,le,L,ke,ue,G,$e,fe,V,Ne,ge,K,C,z,_e,A,Fe,Me,X,te,Ee,U,Pe,O,de,je,D,ce,Je,q,be,R,Ce,Y,I,Ue,W,ne,re;return{c(){d=a("p"),b=n("TensorFlow models and layers in "),m=a("code"),u=n("transformers"),y=n(" accept two formats as input:"),l=p(),c=a("ul"),j=a("li"),ye=n("having all inputs as keyword arguments (like PyTorch models), or"),he=p(),Z=a("li"),ae=n("having all inputs as a list, tuple or dict in the first positional argument."),ee=p(),T=a("p"),Te=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 `),Q=a("code"),ve=n("model.fit()"),me=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),B=a("code"),we=n("model.fit()"),le=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),L=a("code"),ke=n("fit()"),ue=n(" and "),G=a("code"),$e=n("predict()"),fe=n(`, such as when creating your own layers or models with
the Keras `),V=a("code"),Ne=n("Functional"),ge=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),K=p(),C=a("ul"),z=a("li"),_e=n("a single Tensor with "),A=a("code"),Fe=n("input_ids"),Me=n(" only and nothing else: "),X=a("code"),te=n("model(input_ids)"),Ee=p(),U=a("li"),Pe=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),O=a("code"),de=n("model([input_ids, attention_mask])"),je=n(" or "),D=a("code"),ce=n("model([input_ids, attention_mask, token_type_ids])"),Je=p(),q=a("li"),be=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),R=a("code"),Ce=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Y=p(),I=a("p"),Ue=n(`Note that when creating models and layers with
`),W=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 E=i(d);b=s(E,"TensorFlow models and layers in "),m=r(E,"CODE",{});var Be=i(m);u=s(Be,"transformers"),Be.forEach(t),y=s(E," accept two formats as input:"),E.forEach(t),l=h(f),c=r(f,"UL",{});var oe=i(c);j=r(oe,"LI",{});var Re=i(j);ye=s(Re,"having all inputs as keyword arguments (like PyTorch models), or"),Re.forEach(t),he=h(oe),Z=r(oe,"LI",{});var qe=i(Z);ae=s(qe,"having all inputs as a list, tuple or dict in the first positional argument."),qe.forEach(t),oe.forEach(t),ee=h(f),T=r(f,"P",{});var P=i(T);Te=s(P,`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 `),Q=r(P,"CODE",{});var We=i(Q);ve=s(We,"model.fit()"),We.forEach(t),me=s(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),B=r(P,"CODE",{});var ze=i(B);we=s(ze,"model.fit()"),ze.forEach(t),le=s(P,` supports! If, however, you want to use the second
format outside of Keras methods like `),L=r(P,"CODE",{});var Ge=i(L);ke=s(Ge,"fit()"),Ge.forEach(t),ue=s(P," and "),G=r(P,"CODE",{});var Ve=i(G);$e=s(Ve,"predict()"),Ve.forEach(t),fe=s(P,`, such as when creating your own layers or models with
the Keras `),V=r(P,"CODE",{});var xe=i(V);Ne=s(xe,"Functional"),xe.forEach(t),ge=s(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),K=h(f),C=r(f,"UL",{});var x=i(C);z=r(x,"LI",{});var H=i(z);_e=s(H,"a single Tensor with "),A=r(H,"CODE",{});var Ae=i(A);Fe=s(Ae,"input_ids"),Ae.forEach(t),Me=s(H," only and nothing else: "),X=r(H,"CODE",{});var Ze=i(X);te=s(Ze,"model(input_ids)"),Ze.forEach(t),H.forEach(t),Ee=h(x),U=r(x,"LI",{});var S=i(U);Pe=s(S,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),O=r(S,"CODE",{});var Xe=i(O);de=s(Xe,"model([input_ids, attention_mask])"),Xe.forEach(t),je=s(S," or "),D=r(S,"CODE",{});var Se=i(D);ce=s(Se,"model([input_ids, attention_mask, token_type_ids])"),Se.forEach(t),S.forEach(t),Je=h(x),q=r(x,"LI",{});var pe=i(q);be=s(pe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),R=r(pe,"CODE",{});var Ie=i(R);Ce=s(Ie,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ie.forEach(t),pe.forEach(t),x.forEach(t),Y=h(f),I=r(f,"P",{});var se=i(I);Ue=s(se,`Note that when creating models and layers with
`),W=r(se,"A",{href:!0,rel:!0});var Qe=i(W);ne=s(Qe,"subclassing"),Qe.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(W,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),g(W,"rel","nofollow")},m(f,E){_(f,d,E),e(d,b),e(d,m),e(m,u),e(d,y),_(f,l,E),_(f,c,E),e(c,j),e(j,ye),e(c,he),e(c,Z),e(Z,ae),_(f,ee,E),_(f,T,E),e(T,Te),e(T,Q),e(Q,ve),e(T,me),e(T,B),e(B,we),e(T,le),e(T,L),e(L,ke),e(T,ue),e(T,G),e(G,$e),e(T,fe),e(T,V),e(V,Ne),e(T,ge),_(f,K,E),_(f,C,E),e(C,z),e(z,_e),e(z,A),e(A,Fe),e(z,Me),e(z,X),e(X,te),e(C,Ee),e(C,U),e(U,Pe),e(U,O),e(O,de),e(U,je),e(U,D),e(D,ce),e(C,Je),e(C,q),e(q,be),e(q,R),e(R,Ce),_(f,Y,E),_(f,I,E),e(I,Ue),e(I,W),e(W,ne),e(I,re)},d(f){f&&t(d),f&&t(l),f&&t(c),f&&t(ee),f&&t(T),f&&t(K),f&&t(C),f&&t(Y),f&&t(I)}}}function fM(J){let d,b,m,u,y;return{c(){d=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a("code"),u=n("Module"),y=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);b=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(c,"CODE",{});var j=i(m);u=s(j,"Module"),j.forEach(t),y=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,b),e(d,m),e(m,u),e(d,y)},d(l){l&&t(d)}}}function gM(J){let d,b,m,u,y;return u=new Ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURk1QTmV0Rm9yUXVlc3Rpb25BbnN3ZXJpbmclMEFpbXBvcnQlMjB0ZW5zb3JmbG93JTIwYXMlMjB0ZiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRm1wbmV0LWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBURk1QTmV0Rm9yUXVlc3Rpb25BbnN3ZXJpbmcuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRm1wbmV0LWJhc2UlMjIpJTBBJTBBcXVlc3Rpb24lMkMlMjB0ZXh0JTIwJTNEJTIwJTIyV2hvJTIwd2FzJTIwSmltJTIwSGVuc29uJTNGJTIyJTJDJTIwJTIySmltJTIwSGVuc29uJTIwd2FzJTIwYSUyMG5pY2UlMjBwdXBwZXQlMjIlMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIocXVlc3Rpb24lMkMlMjB0ZXh0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBYW5zd2VyX3N0YXJ0X2luZGV4JTIwJTNEJTIwaW50KHRmLm1hdGguYXJnbWF4KG91dHB1dHMuc3RhcnRfbG9naXRzJTJDJTIwYXhpcyUzRC0xKSU1QjAlNUQpJTBBYW5zd2VyX2VuZF9pbmRleCUyMCUzRCUyMGludCh0Zi5tYXRoLmFyZ21heChvdXRwdXRzLmVuZF9sb2dpdHMlMkMlMjBheGlzJTNELTEpJTVCMCU1RCklMEElMEFwcmVkaWN0X2Fuc3dlcl90b2tlbnMlMjAlM0QlMjBpbnB1dHMuaW5wdXRfaWRzJTVCMCUyQyUyMGFuc3dlcl9zdGFydF9pbmRleCUyMCUzQSUyMGFuc3dlcl9lbmRfaW5kZXglMjAlMkIlMjAxJTVE",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"),b=n("Example:"),m=p(),v(u.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);b=s(c,"Example:"),c.forEach(t),m=h(l),w(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,b),_(l,m,c),k(u,l,c),y=!0},p:He,i(l){y||($(u.$$.fragment,l),y=!0)},o(l){N(u.$$.fragment,l),y=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function _M(J){let d,b;return d=new Ye({props:{code:"JTIzJTIwdGFyZ2V0JTIwaXMlMjAlMjJuaWNlJTIwcHVwcGV0JTIyJTBBdGFyZ2V0X3N0YXJ0X2luZGV4JTIwJTNEJTIwdGYuY29uc3RhbnQoJTVCMTQlNUQpJTBBdGFyZ2V0X2VuZF9pbmRleCUyMCUzRCUyMHRmLmNvbnN0YW50KCU1QjE1JTVEKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMHN0YXJ0X3Bvc2l0aW9ucyUzRHRhcmdldF9zdGFydF9pbmRleCUyQyUyMGVuZF9wb3NpdGlvbnMlM0R0YXJnZXRfZW5kX2luZGV4KSUwQWxvc3MlMjAlM0QlMjB0Zi5tYXRoLnJlZHVjZV9tZWFuKG91dHB1dHMubG9zcyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># target is &quot;nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_start_index = tf.constant([<span class="hljs-number">14</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = tf.constant([<span class="hljs-number">15</span>])

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