import{S as Hc,i as Bc,s as Qc,e as r,k as u,w as k,t as s,M as Uc,c as i,d as o,m as f,a as l,x as v,h as a,b as p,G as e,g as z,y as w,q as T,o as $,B as y,v as Vc,L as re}from"../../chunks/vendor-hf-doc-builder.js";import{T as ut}from"../../chunks/Tip-hf-doc-builder.js";import{D as j}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ie}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as J}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ae}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Rc(N){let d,b,m,h,_;return h=new ie({props:{code:`from transformers import NezhaConfig, NezhaModel

# Initializing an Nezha configuration
configuration = NezhaConfig()

# Initializing a model (with random weights) from the Nezha-base style configuration model
model = NezhaModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> NezhaConfig, NezhaModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing an Nezha configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = NezhaConfig()

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

tokenizer = AutoTokenizer.from_pretrained("sijunhe/nezha-cn-base")
model = NezhaModel.from_pretrained("sijunhe/nezha-cn-base")

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

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, NezhaModel
<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;sijunhe/nezha-cn-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NezhaModel.from_pretrained(<span class="hljs-string">&quot;sijunhe/nezha-cn-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=r("p"),b=s("Example:"),m=u(),k(h.$$.fragment)},l(n){d=i(n,"P",{});var c=l(d);b=a(c,"Example:"),c.forEach(o),m=f(n),v(h.$$.fragment,n)},m(n,c){z(n,d,c),e(d,b),z(n,m,c),w(h,n,c),_=!0},p:re,i(n){_||(T(h.$$.fragment,n),_=!0)},o(n){$(h.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(m),y(h,n)}}}function Kc(N){let d,b,m,h,_;return{c(){d=r("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),h=s("Module"),_=s(`
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(n){d=i(n,"P",{});var c=l(d);b=a(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=i(c,"CODE",{});var M=l(m);h=a(M,"Module"),M.forEach(o),_=a(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(o)},m(n,c){z(n,d,c),e(d,b),e(d,m),e(m,h),e(d,_)},d(n){n&&o(d)}}}function Gc(N){let d,b,m,h,_;return h=new ie({props:{code:`from transformers import AutoTokenizer, NezhaForPreTraining
import torch

tokenizer = AutoTokenizer.from_pretrained("sijunhe/nezha-cn-base")
model = NezhaForPreTraining.from_pretrained("sijunhe/nezha-cn-base")

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

prediction_logits = outputs.prediction_logits
seq_relationship_logits = outputs.seq_relationship_logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, NezhaForPreTraining
<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;sijunhe/nezha-cn-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NezhaForPreTraining.from_pretrained(<span class="hljs-string">&quot;sijunhe/nezha-cn-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>prediction_logits = outputs.prediction_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>seq_relationship_logits = outputs.seq_relationship_logits`}}),{c(){d=r("p"),b=s("Example:"),m=u(),k(h.$$.fragment)},l(n){d=i(n,"P",{});var c=l(d);b=a(c,"Example:"),c.forEach(o),m=f(n),v(h.$$.fragment,n)},m(n,c){z(n,d,c),e(d,b),z(n,m,c),w(h,n,c),_=!0},p:re,i(n){_||(T(h.$$.fragment,n),_=!0)},o(n){$(h.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(m),y(h,n)}}}function Xc(N){let d,b,m,h,_;return{c(){d=r("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),h=s("Module"),_=s(`
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(n){d=i(n,"P",{});var c=l(d);b=a(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=i(c,"CODE",{});var M=l(m);h=a(M,"Module"),M.forEach(o),_=a(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(o)},m(n,c){z(n,d,c),e(d,b),e(d,m),e(m,h),e(d,_)},d(n){n&&o(d)}}}function Yc(N){let d,b,m,h,_;return h=new ie({props:{code:`from transformers import AutoTokenizer, NezhaForMaskedLM
import torch

tokenizer = AutoTokenizer.from_pretrained("sijunhe/nezha-cn-base")
model = NezhaForMaskedLM.from_pretrained("sijunhe/nezha-cn-base")

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

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

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

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

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

outputs = model(**inputs, labels=labels)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, NezhaForMaskedLM
<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;sijunhe/nezha-cn-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NezhaForMaskedLM.from_pretrained(<span class="hljs-string">&quot;sijunhe/nezha-cn-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=r("p"),b=s("Example:"),m=u(),k(h.$$.fragment)},l(n){d=i(n,"P",{});var c=l(d);b=a(c,"Example:"),c.forEach(o),m=f(n),v(h.$$.fragment,n)},m(n,c){z(n,d,c),e(d,b),z(n,m,c),w(h,n,c),_=!0},p:re,i(n){_||(T(h.$$.fragment,n),_=!0)},o(n){$(h.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(m),y(h,n)}}}function eh(N){let d,b,m,h,_;return{c(){d=r("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),h=s("Module"),_=s(`
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(n){d=i(n,"P",{});var c=l(d);b=a(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=i(c,"CODE",{});var M=l(m);h=a(M,"Module"),M.forEach(o),_=a(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(o)},m(n,c){z(n,d,c),e(d,b),e(d,m),e(m,h),e(d,_)},d(n){n&&o(d)}}}function th(N){let d,b,m,h,_;return h=new ie({props:{code:`from transformers import AutoTokenizer, NezhaForNextSentencePrediction
import torch

tokenizer = AutoTokenizer.from_pretrained("sijunhe/nezha-cn-base")
model = NezhaForNextSentencePrediction.from_pretrained("sijunhe/nezha-cn-base")

prompt = "In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced."
next_sentence = "The sky is blue due to the shorter wavelength of blue light."
encoding = tokenizer(prompt, next_sentence, return_tensors="pt")

outputs = model(**encoding, labels=torch.LongTensor([1]))
logits = outputs.logits
assert logits[0, 0] < logits[0, 1]  # next sentence was random`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, NezhaForNextSentencePrediction
<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;sijunhe/nezha-cn-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NezhaForNextSentencePrediction.from_pretrained(<span class="hljs-string">&quot;sijunhe/nezha-cn-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>next_sentence = <span class="hljs-string">&quot;The sky is blue due to the shorter wavelength of blue light.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer(prompt, next_sentence, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoding, labels=torch.LongTensor([<span class="hljs-number">1</span>]))
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> logits[<span class="hljs-number">0</span>, <span class="hljs-number">0</span>] &lt; logits[<span class="hljs-number">0</span>, <span class="hljs-number">1</span>]  <span class="hljs-comment"># next sentence was random</span>`}}),{c(){d=r("p"),b=s("Example:"),m=u(),k(h.$$.fragment)},l(n){d=i(n,"P",{});var c=l(d);b=a(c,"Example:"),c.forEach(o),m=f(n),v(h.$$.fragment,n)},m(n,c){z(n,d,c),e(d,b),z(n,m,c),w(h,n,c),_=!0},p:re,i(n){_||(T(h.$$.fragment,n),_=!0)},o(n){$(h.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(m),y(h,n)}}}function oh(N){let d,b,m,h,_;return{c(){d=r("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),h=s("Module"),_=s(`
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(n){d=i(n,"P",{});var c=l(d);b=a(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=i(c,"CODE",{});var M=l(m);h=a(M,"Module"),M.forEach(o),_=a(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(o)},m(n,c){z(n,d,c),e(d,b),e(d,m),e(m,h),e(d,_)},d(n){n&&o(d)}}}function nh(N){let d,b,m,h,_;return h=new ie({props:{code:`import torch
from transformers import AutoTokenizer, NezhaForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("sijunhe/nezha-cn-base")
model = NezhaForSequenceClassification.from_pretrained("sijunhe/nezha-cn-base")

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

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

predicted_class_id = logits.argmax().item()

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = NezhaForSequenceClassification.from_pretrained("sijunhe/nezha-cn-base", num_labels=num_labels)

labels = torch.tensor([1])
loss = model(**inputs, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, NezhaForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;sijunhe/nezha-cn-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NezhaForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;sijunhe/nezha-cn-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 = NezhaForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;sijunhe/nezha-cn-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=r("p"),b=s("Example of single-label classification:"),m=u(),k(h.$$.fragment)},l(n){d=i(n,"P",{});var c=l(d);b=a(c,"Example of single-label classification:"),c.forEach(o),m=f(n),v(h.$$.fragment,n)},m(n,c){z(n,d,c),e(d,b),z(n,m,c),w(h,n,c),_=!0},p:re,i(n){_||(T(h.$$.fragment,n),_=!0)},o(n){$(h.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(m),y(h,n)}}}function sh(N){let d,b,m,h,_;return h=new ie({props:{code:`import torch
from transformers import AutoTokenizer, NezhaForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("sijunhe/nezha-cn-base")
model = NezhaForSequenceClassification.from_pretrained("sijunhe/nezha-cn-base", problem_type="multi_label_classification")

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

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

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

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = NezhaForSequenceClassification.from_pretrained(
    "sijunhe/nezha-cn-base", num_labels=num_labels, problem_type="multi_label_classification"
)

labels = torch.sum(
    torch.nn.functional.one_hot(predicted_class_ids[None, :].clone(), num_classes=num_labels), dim=1
).to(torch.float)
loss = model(**inputs, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, NezhaForSequenceClassification

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

tokenizer = AutoTokenizer.from_pretrained("sijunhe/nezha-cn-base")
model = NezhaForMultipleChoice.from_pretrained("sijunhe/nezha-cn-base")

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

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

# the linear classifier still needs to be trained
loss = outputs.loss
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, NezhaForMultipleChoice
<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;sijunhe/nezha-cn-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NezhaForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;sijunhe/nezha-cn-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=r("p"),b=s("Example:"),m=u(),k(h.$$.fragment)},l(n){d=i(n,"P",{});var c=l(d);b=a(c,"Example:"),c.forEach(o),m=f(n),v(h.$$.fragment,n)},m(n,c){z(n,d,c),e(d,b),z(n,m,c),w(h,n,c),_=!0},p:re,i(n){_||(T(h.$$.fragment,n),_=!0)},o(n){$(h.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(m),y(h,n)}}}function ih(N){let d,b,m,h,_;return{c(){d=r("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),h=s("Module"),_=s(`
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(n){d=i(n,"P",{});var c=l(d);b=a(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=i(c,"CODE",{});var M=l(m);h=a(M,"Module"),M.forEach(o),_=a(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(o)},m(n,c){z(n,d,c),e(d,b),e(d,m),e(m,h),e(d,_)},d(n){n&&o(d)}}}function lh(N){let d,b,m,h,_;return h=new ie({props:{code:`from transformers import AutoTokenizer, NezhaForTokenClassification
import torch

tokenizer = AutoTokenizer.from_pretrained("sijunhe/nezha-cn-base")
model = NezhaForTokenClassification.from_pretrained("sijunhe/nezha-cn-base")

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

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

predicted_token_class_ids = logits.argmax(-1)

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

labels = predicted_token_class_ids
loss = model(**inputs, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, NezhaForTokenClassification
<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;sijunhe/nezha-cn-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NezhaForTokenClassification.from_pretrained(<span class="hljs-string">&quot;sijunhe/nezha-cn-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=r("p"),b=s("Example:"),m=u(),k(h.$$.fragment)},l(n){d=i(n,"P",{});var c=l(d);b=a(c,"Example:"),c.forEach(o),m=f(n),v(h.$$.fragment,n)},m(n,c){z(n,d,c),e(d,b),z(n,m,c),w(h,n,c),_=!0},p:re,i(n){_||(T(h.$$.fragment,n),_=!0)},o(n){$(h.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(m),y(h,n)}}}function dh(N){let d,b,m,h,_;return{c(){d=r("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),h=s("Module"),_=s(`
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(n){d=i(n,"P",{});var c=l(d);b=a(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=i(c,"CODE",{});var M=l(m);h=a(M,"Module"),M.forEach(o),_=a(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(o)},m(n,c){z(n,d,c),e(d,b),e(d,m),e(m,h),e(d,_)},d(n){n&&o(d)}}}function ch(N){let d,b,m,h,_;return h=new ie({props:{code:`from transformers import AutoTokenizer, NezhaForQuestionAnswering
import torch

tokenizer = AutoTokenizer.from_pretrained("sijunhe/nezha-cn-base")
model = NezhaForQuestionAnswering.from_pretrained("sijunhe/nezha-cn-base")

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

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

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

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

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

outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
loss = outputs.loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, NezhaForQuestionAnswering
<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;sijunhe/nezha-cn-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NezhaForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;sijunhe/nezha-cn-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=r("p"),b=s("Example:"),m=u(),k(h.$$.fragment)},l(n){d=i(n,"P",{});var c=l(d);b=a(c,"Example:"),c.forEach(o),m=f(n),v(h.$$.fragment,n)},m(n,c){z(n,d,c),e(d,b),z(n,m,c),w(h,n,c),_=!0},p:re,i(n){_||(T(h.$$.fragment,n),_=!0)},o(n){$(h.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(m),y(h,n)}}}function hh(N){let d,b,m,h,_,n,c,M,ra,ds,le,Pe,sn,ft,ia,an,la,cs,qe,da,gt,ca,ha,hs,yo,pa,ps,No,rn,ma,ms,K,ua,_t,fa,ga,bt,_a,ba,us,de,Ce,ln,zt,za,dn,ka,fs,W,kt,va,ce,wa,Mo,Ta,$a,vt,ya,Na,Ma,he,Fa,Fo,xa,ja,xo,Pa,qa,Ca,Ee,gs,pe,Ae,cn,wt,Ea,hn,Aa,_s,F,Tt,Oa,pn,Sa,La,$t,Ia,jo,Da,Wa,Ha,yt,Ba,Nt,Qa,Ua,Va,Mt,Ra,Ft,Za,Ja,Ka,x,Ga,mn,Xa,Ya,un,er,tr,fn,or,nr,gn,sr,ar,_n,rr,ir,bn,lr,dr,cr,H,xt,hr,me,pr,Po,mr,ur,zn,fr,gr,_r,Oe,br,Se,bs,ue,Le,kn,jt,zr,vn,kr,zs,P,Pt,vr,fe,wr,wn,Tr,$r,Tn,yr,Nr,Mr,qt,Fr,qo,xr,jr,Pr,Ct,qr,Et,Cr,Er,Ar,B,At,Or,ge,Sr,Co,Lr,Ir,$n,Dr,Wr,Hr,Ie,Br,De,ks,_e,We,yn,Ot,Qr,Nn,Ur,vs,q,St,Vr,Lt,Rr,Mn,Zr,Jr,Kr,It,Gr,Eo,Xr,Yr,ei,Dt,ti,Wt,oi,ni,si,Q,Ht,ai,be,ri,Ao,ii,li,Fn,di,ci,hi,He,pi,Be,ws,ze,Qe,xn,Bt,mi,jn,ui,Ts,C,Qt,fi,Ut,gi,Pn,_i,bi,zi,Vt,ki,Oo,vi,wi,Ti,Rt,$i,Zt,yi,Ni,Mi,U,Jt,Fi,ke,xi,So,ji,Pi,qn,qi,Ci,Ei,Ue,Ai,Ve,$s,ve,Re,Cn,Kt,Oi,En,Si,ys,E,Gt,Li,An,Ii,Di,Xt,Wi,Lo,Hi,Bi,Qi,Yt,Ui,eo,Vi,Ri,Zi,L,to,Ji,we,Ki,Io,Gi,Xi,On,Yi,el,tl,Ze,ol,Je,nl,Ke,Ns,Te,Ge,Sn,oo,sl,Ln,al,Ms,A,no,rl,In,il,ll,so,dl,Do,cl,hl,pl,ao,ml,ro,ul,fl,gl,V,io,_l,$e,bl,Wo,zl,kl,Dn,vl,wl,Tl,Xe,$l,Ye,Fs,ye,et,Wn,lo,yl,Hn,Nl,xs,O,co,Ml,Bn,Fl,xl,ho,jl,Ho,Pl,ql,Cl,po,El,mo,Al,Ol,Sl,R,uo,Ll,Ne,Il,Bo,Dl,Wl,Qn,Hl,Bl,Ql,tt,Ul,ot,js,Me,nt,Un,fo,Vl,Vn,Rl,Ps,S,go,Zl,Fe,Jl,Rn,Kl,Gl,Zn,Xl,Yl,ed,_o,td,Qo,od,nd,sd,bo,ad,zo,rd,id,ld,Z,ko,dd,xe,cd,Uo,hd,pd,Jn,md,ud,fd,st,gd,at,qs;return n=new J({}),ft=new J({}),zt=new J({}),kt=new j({props:{name:"class transformers.NezhaConfig",anchor:"transformers.NezhaConfig",parameters:[{name:"vocab_size",val:" = 21128"},{name:"embedding_size",val:" = 128"},{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:"max_relative_position",val:" = 64"},{name:"type_vocab_size",val:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"classifier_dropout",val:" = 0.1"},{name:"pad_token_id",val:" = 0"},{name:"bos_token_id",val:" = 2"},{name:"eos_token_id",val:" = 3"},{name:"use_cache",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.NezhaConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, optional, defaults to 21128) &#x2014;
Vocabulary size of the NEZHA model. Defines the different tokens that can be represented by the
<em>inputs_ids</em> passed to the forward method of <a href="/docs/transformers/main/en/model_doc/nezha#transformers.NezhaModel">NezhaModel</a>.`,name:"vocab_size"},{anchor:"transformers.NezhaConfig.embedding_size",description:`<strong>embedding_size</strong> (<code>int</code>, optional, defaults to 128) &#x2014;
Dimensionality of vocabulary embeddings.`,name:"embedding_size"},{anchor:"transformers.NezhaConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, optional, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.NezhaConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, optional, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.NezhaConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, optional, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.NezhaConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, optional, defaults to 3072) &#x2014;
The dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.NezhaConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, optional, defaults to &#x201C;gelu&#x201D;) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler.`,name:"hidden_act"},{anchor:"transformers.NezhaConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, optional, 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.NezhaConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, optional, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.NezhaConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, optional, defaults to 512) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
(e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.NezhaConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, optional, defaults to 2) &#x2014;
The vocabulary size of the <em>token_type_ids</em> passed into <a href="/docs/transformers/main/en/model_doc/nezha#transformers.NezhaModel">NezhaModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.NezhaConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, optional, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.NezhaConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, optional, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.NezhaConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, optional, defaults to 0.1) &#x2014;
The dropout ratio for attached classifiers.`,name:"classifier_dropout"},{anchor:"transformers.NezhaConfig.is_decoder",description:`<strong>is_decoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the model is used as a decoder or not. If <code>False</code>, the model is used as an encoder.`,name:"is_decoder"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nezha/configuration_nezha.py#L9"}}),Ee=new ae({props:{anchor:"transformers.NezhaConfig.example",$$slots:{default:[Rc]},$$scope:{ctx:N}}}),wt=new J({}),Tt=new j({props:{name:"class transformers.NezhaModel",anchor:"transformers.NezhaModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.NezhaModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/nezha#transformers.NezhaConfig">NezhaConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nezha/modeling_nezha.py#L859"}}),xt=new j({props:{name:"forward",anchor:"transformers.NezhaModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"use_cache",val:": typing.Optional[bool] = 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.NezhaModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.NezhaModel.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.NezhaModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.NezhaModel.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.NezhaModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.NezhaModel.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.NezhaModel.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.NezhaModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.NezhaModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.NezhaModel.forward.encoder_attention_mask",description:`<strong>encoder_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 the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. 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>`,name:"encoder_attention_mask"},{anchor:"transformers.NezhaModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.NezhaModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nezha/modeling_nezha.py#L898",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/nezha#transformers.NezhaConfig"
>NezhaConfig</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>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=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 of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Oe=new ut({props:{$$slots:{default:[Zc]},$$scope:{ctx:N}}}),Se=new ae({props:{anchor:"transformers.NezhaModel.forward.example",$$slots:{default:[Jc]},$$scope:{ctx:N}}}),jt=new J({}),Pt=new j({props:{name:"class transformers.NezhaForPreTraining",anchor:"transformers.NezhaForPreTraining",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.NezhaForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/nezha#transformers.NezhaConfig">NezhaConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nezha/modeling_nezha.py#L1038"}}),At=new j({props:{name:"forward",anchor:"transformers.NezhaForPreTraining.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"next_sentence_label",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.NezhaForPreTraining.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.NezhaForPreTraining.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.NezhaForPreTraining.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.NezhaForPreTraining.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.NezhaForPreTraining.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.NezhaForPreTraining.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.NezhaForPreTraining.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.NezhaForPreTraining.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.</p>
<p>labels (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
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>
next_sentence_label (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>):
Labels for computing the next sequence prediction (classification) loss. Input should be a sequence
pair (see <code>input_ids</code> docstring) Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates sequence B is a continuation of sequence A,</li>
<li>1 indicates sequence B is a random sequence.
kwargs (<code>Dict[str, any]</code>, optional, defaults to <em>{}</em>):
Used to hide legacy arguments that have been deprecated.</li>
</ul>`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nezha/modeling_nezha.py#L1056",returnDescription:`
<p>A <code>transformers.models.nezha.modeling_nezha.NezhaForPreTrainingOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/nezha#transformers.NezhaConfig"
>NezhaConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) \u2014 Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.</p>
</li>
<li>
<p><strong>prediction_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>seq_relationship_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
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 + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.nezha.modeling_nezha.NezhaForPreTrainingOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ie=new ut({props:{$$slots:{default:[Kc]},$$scope:{ctx:N}}}),De=new ae({props:{anchor:"transformers.NezhaForPreTraining.forward.example",$$slots:{default:[Gc]},$$scope:{ctx:N}}}),Ot=new J({}),St=new j({props:{name:"class transformers.NezhaForMaskedLM",anchor:"transformers.NezhaForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.NezhaForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/nezha#transformers.NezhaConfig">NezhaConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nezha/modeling_nezha.py#L1140"}}),Ht=new j({props:{name:"forward",anchor:"transformers.NezhaForMaskedLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.NezhaForMaskedLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.NezhaForMaskedLM.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.NezhaForMaskedLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.NezhaForMaskedLM.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.NezhaForMaskedLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.NezhaForMaskedLM.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.NezhaForMaskedLM.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.NezhaForMaskedLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.NezhaForMaskedLM.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/main/src/transformers/models/nezha/modeling_nezha.py#L1166",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/nezha#transformers.NezhaConfig"
>NezhaConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),He=new ut({props:{$$slots:{default:[Xc]},$$scope:{ctx:N}}}),Be=new ae({props:{anchor:"transformers.NezhaForMaskedLM.forward.example",$$slots:{default:[Yc]},$$scope:{ctx:N}}}),Bt=new J({}),Qt=new j({props:{name:"class transformers.NezhaForNextSentencePrediction",anchor:"transformers.NezhaForNextSentencePrediction",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.NezhaForNextSentencePrediction.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/nezha#transformers.NezhaConfig">NezhaConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nezha/modeling_nezha.py#L1248"}}),Jt=new j({props:{name:"forward",anchor:"transformers.NezhaForNextSentencePrediction.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.NezhaForNextSentencePrediction.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.NezhaForNextSentencePrediction.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.NezhaForNextSentencePrediction.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.NezhaForNextSentencePrediction.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.NezhaForNextSentencePrediction.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.NezhaForNextSentencePrediction.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.NezhaForNextSentencePrediction.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.NezhaForNextSentencePrediction.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.NezhaForNextSentencePrediction.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the next sequence prediction (classification) loss. Input should be a sequence pair
(see <code>input_ids</code> docstring). Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates sequence B is a continuation of sequence A,</li>
<li>1 indicates sequence B is a random sequence.</li>
</ul>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nezha/modeling_nezha.py#L1258",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.NextSentencePredictorOutput"
>transformers.modeling_outputs.NextSentencePredictorOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/nezha#transformers.NezhaConfig"
>NezhaConfig</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>next_sentence_label</code> is provided) \u2014 Next sequence prediction (classification) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.NextSentencePredictorOutput"
>transformers.modeling_outputs.NextSentencePredictorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ue=new ut({props:{$$slots:{default:[eh]},$$scope:{ctx:N}}}),Ve=new ae({props:{anchor:"transformers.NezhaForNextSentencePrediction.forward.example",$$slots:{default:[th]},$$scope:{ctx:N}}}),Kt=new J({}),Gt=new j({props:{name:"class transformers.NezhaForSequenceClassification",anchor:"transformers.NezhaForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.NezhaForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/nezha#transformers.NezhaConfig">NezhaConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nezha/modeling_nezha.py#L1351"}}),to=new j({props:{name:"forward",anchor:"transformers.NezhaForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.NezhaForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.NezhaForSequenceClassification.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.NezhaForSequenceClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.NezhaForSequenceClassification.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.NezhaForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.NezhaForSequenceClassification.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.NezhaForSequenceClassification.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.NezhaForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.NezhaForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nezha/modeling_nezha.py#L1367",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/nezha#transformers.NezhaConfig"
>NezhaConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ze=new ut({props:{$$slots:{default:[oh]},$$scope:{ctx:N}}}),Je=new ae({props:{anchor:"transformers.NezhaForSequenceClassification.forward.example",$$slots:{default:[nh]},$$scope:{ctx:N}}}),Ke=new ae({props:{anchor:"transformers.NezhaForSequenceClassification.forward.example-2",$$slots:{default:[sh]},$$scope:{ctx:N}}}),oo=new J({}),no=new j({props:{name:"class transformers.NezhaForMultipleChoice",anchor:"transformers.NezhaForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.NezhaForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/nezha#transformers.NezhaConfig">NezhaConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nezha/modeling_nezha.py#L1450"}}),io=new j({props:{name:"forward",anchor:"transformers.NezhaForMultipleChoice.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.NezhaForMultipleChoice.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.NezhaForMultipleChoice.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.NezhaForMultipleChoice.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.NezhaForMultipleChoice.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.NezhaForMultipleChoice.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.NezhaForMultipleChoice.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.NezhaForMultipleChoice.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.NezhaForMultipleChoice.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.NezhaForMultipleChoice.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the multiple choice classification loss. Indices should be in <code>[0, ..., num_choices-1]</code> where <code>num_choices</code> is the size of the second dimension of the input tensors. (See
<code>input_ids</code> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nezha/modeling_nezha.py#L1464",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/nezha#transformers.NezhaConfig"
>NezhaConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <em>(1,)</em>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices)</code>) \u2014 <em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Xe=new ut({props:{$$slots:{default:[ah]},$$scope:{ctx:N}}}),Ye=new ae({props:{anchor:"transformers.NezhaForMultipleChoice.forward.example",$$slots:{default:[rh]},$$scope:{ctx:N}}}),lo=new J({}),co=new j({props:{name:"class transformers.NezhaForTokenClassification",anchor:"transformers.NezhaForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.NezhaForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/nezha#transformers.NezhaConfig">NezhaConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nezha/modeling_nezha.py#L1542"}}),uo=new j({props:{name:"forward",anchor:"transformers.NezhaForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.NezhaForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.NezhaForTokenClassification.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.NezhaForTokenClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.NezhaForTokenClassification.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.NezhaForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.NezhaForTokenClassification.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.NezhaForTokenClassification.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.NezhaForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.NezhaForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nezha/modeling_nezha.py#L1560",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/nezha#transformers.NezhaConfig"
>NezhaConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),tt=new ut({props:{$$slots:{default:[ih]},$$scope:{ctx:N}}}),ot=new ae({props:{anchor:"transformers.NezhaForTokenClassification.forward.example",$$slots:{default:[lh]},$$scope:{ctx:N}}}),fo=new J({}),go=new j({props:{name:"class transformers.NezhaForQuestionAnswering",anchor:"transformers.NezhaForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.NezhaForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/nezha#transformers.NezhaConfig">NezhaConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nezha/modeling_nezha.py#L1624"}}),ko=new j({props:{name:"forward",anchor:"transformers.NezhaForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"start_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"end_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.NezhaForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.NezhaForQuestionAnswering.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.NezhaForQuestionAnswering.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.NezhaForQuestionAnswering.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.NezhaForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.NezhaForQuestionAnswering.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.NezhaForQuestionAnswering.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.NezhaForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.NezhaForQuestionAnswering.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.NezhaForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nezha/modeling_nezha.py#L1638",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/nezha#transformers.NezhaConfig"
>NezhaConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),st=new ut({props:{$$slots:{default:[dh]},$$scope:{ctx:N}}}),at=new ae({props:{anchor:"transformers.NezhaForQuestionAnswering.forward.example",$$slots:{default:[ch]},$$scope:{ctx:N}}}),{c(){d=r("meta"),b=u(),m=r("h1"),h=r("a"),_=r("span"),k(n.$$.fragment),c=u(),M=r("span"),ra=s("Nezha"),ds=u(),le=r("h2"),Pe=r("a"),sn=r("span"),k(ft.$$.fragment),ia=u(),an=r("span"),la=s("Overview"),cs=u(),qe=r("p"),da=s("The Nezha model was proposed in "),gt=r("a"),ca=s("NEZHA: Neural Contextualized Representation for Chinese Language Understanding"),ha=s(" by Junqiu Wei et al."),hs=u(),yo=r("p"),pa=s("The abstract from the paper is the following:"),ps=u(),No=r("p"),rn=r("em"),ma=s(`The pre-trained language models have achieved great successes in various natural language understanding (NLU) tasks
due to its capacity to capture the deep contextualized information in text by pre-training on large-scale corpora.
In this technical report, we present our practice of pre-training language models named NEZHA (NEural contextualiZed
representation for CHinese lAnguage understanding) on Chinese corpora and finetuning for the Chinese NLU tasks.
The current version of NEZHA is based on BERT with a collection of proven improvements, which include Functional
Relative Positional Encoding as an effective positional encoding scheme, Whole Word Masking strategy,
Mixed Precision Training and the LAMB Optimizer in training the models. The experimental results show that NEZHA
achieves the state-of-the-art performances when finetuned on several representative Chinese tasks, including
named entity recognition (People\u2019s Daily NER), sentence matching (LCQMC), Chinese sentiment classification (ChnSenti)
and natural language inference (XNLI).`),ms=u(),K=r("p"),ua=s("This model was contributed by "),_t=r("a"),fa=s("sijunhe"),ga=s(". The original code can be found "),bt=r("a"),_a=s("here"),ba=s("."),us=u(),de=r("h2"),Ce=r("a"),ln=r("span"),k(zt.$$.fragment),za=u(),dn=r("span"),ka=s("NezhaConfig"),fs=u(),W=r("div"),k(kt.$$.fragment),va=u(),ce=r("p"),wa=s("This is the configuration class to store the configuration of an "),Mo=r("a"),Ta=s("NezhaModel"),$a=s(`. It is used to instantiate an Nezha
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 Nezha
`),vt=r("a"),ya=s("sijunhe/nezha-cn-base"),Na=s(" architecture."),Ma=u(),he=r("p"),Fa=s("Configuration objects inherit from "),Fo=r("a"),xa=s("PretrainedConfig"),ja=s(` and can be used to control the model outputs. Read the
documentation from `),xo=r("a"),Pa=s("PretrainedConfig"),qa=s(" for more information."),Ca=u(),k(Ee.$$.fragment),gs=u(),pe=r("h2"),Ae=r("a"),cn=r("span"),k(wt.$$.fragment),Ea=u(),hn=r("span"),Aa=s("NezhaModel"),_s=u(),F=r("div"),k(Tt.$$.fragment),Oa=u(),pn=r("p"),Sa=s("The bare Nezha Model transformer outputting raw hidden-states without any specific head on top."),La=u(),$t=r("p"),Ia=s("This model inherits from "),jo=r("a"),Da=s("PreTrainedModel"),Wa=s(`. 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.)`),Ha=u(),yt=r("p"),Ba=s("This model is also a PyTorch "),Nt=r("a"),Qa=s("torch.nn.Module"),Ua=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Va=u(),Mt=r("p"),Ra=s(`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),Ft=r("a"),Za=s(`Attention is
all you need`),Ja=s(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),Ka=u(),x=r("p"),Ga=s("To behave as an decoder the model needs to be initialized with the "),mn=r("code"),Xa=s("is_decoder"),Ya=s(` argument of the configuration set
to `),un=r("code"),er=s("True"),tr=s(". To be used in a Seq2Seq model, the model needs to initialized with both "),fn=r("code"),or=s("is_decoder"),nr=s(` argument and
`),gn=r("code"),sr=s("add_cross_attention"),ar=s(" set to "),_n=r("code"),rr=s("True"),ir=s("; an "),bn=r("code"),lr=s("encoder_hidden_states"),dr=s(" is then expected as an input to the forward pass."),cr=u(),H=r("div"),k(xt.$$.fragment),hr=u(),me=r("p"),pr=s("The "),Po=r("a"),mr=s("NezhaModel"),ur=s(" forward method, overrides the "),zn=r("code"),fr=s("__call__"),gr=s(" special method."),_r=u(),k(Oe.$$.fragment),br=u(),k(Se.$$.fragment),bs=u(),ue=r("h2"),Le=r("a"),kn=r("span"),k(jt.$$.fragment),zr=u(),vn=r("span"),kr=s("NezhaForPreTraining"),zs=u(),P=r("div"),k(Pt.$$.fragment),vr=u(),fe=r("p"),wr=s("Nezha Model with two heads on top as done during the pretraining: a "),wn=r("code"),Tr=s("masked language modeling"),$r=s(" head and a "),Tn=r("code"),yr=s("next sentence prediction (classification)"),Nr=s(" head."),Mr=u(),qt=r("p"),Fr=s("This model inherits from "),qo=r("a"),xr=s("PreTrainedModel"),jr=s(`. 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.)`),Pr=u(),Ct=r("p"),qr=s("This model is also a PyTorch "),Et=r("a"),Cr=s("torch.nn.Module"),Er=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ar=u(),B=r("div"),k(At.$$.fragment),Or=u(),ge=r("p"),Sr=s("The "),Co=r("a"),Lr=s("NezhaForPreTraining"),Ir=s(" forward method, overrides the "),$n=r("code"),Dr=s("__call__"),Wr=s(" special method."),Hr=u(),k(Ie.$$.fragment),Br=u(),k(De.$$.fragment),ks=u(),_e=r("h2"),We=r("a"),yn=r("span"),k(Ot.$$.fragment),Qr=u(),Nn=r("span"),Ur=s("NezhaForMaskedLM"),vs=u(),q=r("div"),k(St.$$.fragment),Vr=u(),Lt=r("p"),Rr=s("Nezha Model with a "),Mn=r("code"),Zr=s("language modeling"),Jr=s(" head on top."),Kr=u(),It=r("p"),Gr=s("This model inherits from "),Eo=r("a"),Xr=s("PreTrainedModel"),Yr=s(`. 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.)`),ei=u(),Dt=r("p"),ti=s("This model is also a PyTorch "),Wt=r("a"),oi=s("torch.nn.Module"),ni=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),si=u(),Q=r("div"),k(Ht.$$.fragment),ai=u(),be=r("p"),ri=s("The "),Ao=r("a"),ii=s("NezhaForMaskedLM"),li=s(" forward method, overrides the "),Fn=r("code"),di=s("__call__"),ci=s(" special method."),hi=u(),k(He.$$.fragment),pi=u(),k(Be.$$.fragment),ws=u(),ze=r("h2"),Qe=r("a"),xn=r("span"),k(Bt.$$.fragment),mi=u(),jn=r("span"),ui=s("NezhaForNextSentencePrediction"),Ts=u(),C=r("div"),k(Qt.$$.fragment),fi=u(),Ut=r("p"),gi=s("Nezha Model with a "),Pn=r("code"),_i=s("next sentence prediction (classification)"),bi=s(" head on top."),zi=u(),Vt=r("p"),ki=s("This model inherits from "),Oo=r("a"),vi=s("PreTrainedModel"),wi=s(`. 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.)`),Ti=u(),Rt=r("p"),$i=s("This model is also a PyTorch "),Zt=r("a"),yi=s("torch.nn.Module"),Ni=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Mi=u(),U=r("div"),k(Jt.$$.fragment),Fi=u(),ke=r("p"),xi=s("The "),So=r("a"),ji=s("NezhaForNextSentencePrediction"),Pi=s(" forward method, overrides the "),qn=r("code"),qi=s("__call__"),Ci=s(" special method."),Ei=u(),k(Ue.$$.fragment),Ai=u(),k(Ve.$$.fragment),$s=u(),ve=r("h2"),Re=r("a"),Cn=r("span"),k(Kt.$$.fragment),Oi=u(),En=r("span"),Si=s("NezhaForSequenceClassification"),ys=u(),E=r("div"),k(Gt.$$.fragment),Li=u(),An=r("p"),Ii=s(`Nezha Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),Di=u(),Xt=r("p"),Wi=s("This model inherits from "),Lo=r("a"),Hi=s("PreTrainedModel"),Bi=s(`. 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.)`),Qi=u(),Yt=r("p"),Ui=s("This model is also a PyTorch "),eo=r("a"),Vi=s("torch.nn.Module"),Ri=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Zi=u(),L=r("div"),k(to.$$.fragment),Ji=u(),we=r("p"),Ki=s("The "),Io=r("a"),Gi=s("NezhaForSequenceClassification"),Xi=s(" forward method, overrides the "),On=r("code"),Yi=s("__call__"),el=s(" special method."),tl=u(),k(Ze.$$.fragment),ol=u(),k(Je.$$.fragment),nl=u(),k(Ke.$$.fragment),Ns=u(),Te=r("h2"),Ge=r("a"),Sn=r("span"),k(oo.$$.fragment),sl=u(),Ln=r("span"),al=s("NezhaForMultipleChoice"),Ms=u(),A=r("div"),k(no.$$.fragment),rl=u(),In=r("p"),il=s(`Nezha 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.`),ll=u(),so=r("p"),dl=s("This model inherits from "),Do=r("a"),cl=s("PreTrainedModel"),hl=s(`. 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.)`),pl=u(),ao=r("p"),ml=s("This model is also a PyTorch "),ro=r("a"),ul=s("torch.nn.Module"),fl=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),gl=u(),V=r("div"),k(io.$$.fragment),_l=u(),$e=r("p"),bl=s("The "),Wo=r("a"),zl=s("NezhaForMultipleChoice"),kl=s(" forward method, overrides the "),Dn=r("code"),vl=s("__call__"),wl=s(" special method."),Tl=u(),k(Xe.$$.fragment),$l=u(),k(Ye.$$.fragment),Fs=u(),ye=r("h2"),et=r("a"),Wn=r("span"),k(lo.$$.fragment),yl=u(),Hn=r("span"),Nl=s("NezhaForTokenClassification"),xs=u(),O=r("div"),k(co.$$.fragment),Ml=u(),Bn=r("p"),Fl=s(`Nezha 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.`),xl=u(),ho=r("p"),jl=s("This model inherits from "),Ho=r("a"),Pl=s("PreTrainedModel"),ql=s(`. 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.)`),Cl=u(),po=r("p"),El=s("This model is also a PyTorch "),mo=r("a"),Al=s("torch.nn.Module"),Ol=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Sl=u(),R=r("div"),k(uo.$$.fragment),Ll=u(),Ne=r("p"),Il=s("The "),Bo=r("a"),Dl=s("NezhaForTokenClassification"),Wl=s(" forward method, overrides the "),Qn=r("code"),Hl=s("__call__"),Bl=s(" special method."),Ql=u(),k(tt.$$.fragment),Ul=u(),k(ot.$$.fragment),js=u(),Me=r("h2"),nt=r("a"),Un=r("span"),k(fo.$$.fragment),Vl=u(),Vn=r("span"),Rl=s("NezhaForQuestionAnswering"),Ps=u(),S=r("div"),k(go.$$.fragment),Zl=u(),Fe=r("p"),Jl=s(`Nezha 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 `),Rn=r("code"),Kl=s("span start logits"),Gl=s(" and "),Zn=r("code"),Xl=s("span end logits"),Yl=s(")."),ed=u(),_o=r("p"),td=s("This model inherits from "),Qo=r("a"),od=s("PreTrainedModel"),nd=s(`. 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=u(),bo=r("p"),ad=s("This model is also a PyTorch "),zo=r("a"),rd=s("torch.nn.Module"),id=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ld=u(),Z=r("div"),k(ko.$$.fragment),dd=u(),xe=r("p"),cd=s("The "),Uo=r("a"),hd=s("NezhaForQuestionAnswering"),pd=s(" forward method, overrides the "),Jn=r("code"),md=s("__call__"),ud=s(" special method."),fd=u(),k(st.$$.fragment),gd=u(),k(at.$$.fragment),this.h()},l(t){const g=Uc('[data-svelte="svelte-1phssyn"]',document.head);d=i(g,"META",{name:!0,content:!0}),g.forEach(o),b=f(t),m=i(t,"H1",{class:!0});var vo=l(m);h=i(vo,"A",{id:!0,class:!0,href:!0});var Kn=l(h);_=i(Kn,"SPAN",{});var Gn=l(_);v(n.$$.fragment,Gn),Gn.forEach(o),Kn.forEach(o),c=f(vo),M=i(vo,"SPAN",{});var Xn=l(M);ra=a(Xn,"Nezha"),Xn.forEach(o),vo.forEach(o),ds=f(t),le=i(t,"H2",{class:!0});var wo=l(le);Pe=i(wo,"A",{id:!0,class:!0,href:!0});var Yn=l(Pe);sn=i(Yn,"SPAN",{});var es=l(sn);v(ft.$$.fragment,es),es.forEach(o),Yn.forEach(o),ia=f(wo),an=i(wo,"SPAN",{});var ts=l(an);la=a(ts,"Overview"),ts.forEach(o),wo.forEach(o),cs=f(t),qe=i(t,"P",{});var To=l(qe);da=a(To,"The Nezha model was proposed in "),gt=i(To,"A",{href:!0,rel:!0});var os=l(gt);ca=a(os,"NEZHA: Neural Contextualized Representation for Chinese Language Understanding"),os.forEach(o),ha=a(To," by Junqiu Wei et al."),To.forEach(o),hs=f(t),yo=i(t,"P",{});var ns=l(yo);pa=a(ns,"The abstract from the paper is the following:"),ns.forEach(o),ps=f(t),No=i(t,"P",{});var ss=l(No);rn=i(ss,"EM",{});var as=l(rn);ma=a(as,`The pre-trained language models have achieved great successes in various natural language understanding (NLU) tasks
due to its capacity to capture the deep contextualized information in text by pre-training on large-scale corpora.
In this technical report, we present our practice of pre-training language models named NEZHA (NEural contextualiZed
representation for CHinese lAnguage understanding) on Chinese corpora and finetuning for the Chinese NLU tasks.
The current version of NEZHA is based on BERT with a collection of proven improvements, which include Functional
Relative Positional Encoding as an effective positional encoding scheme, Whole Word Masking strategy,
Mixed Precision Training and the LAMB Optimizer in training the models. The experimental results show that NEZHA
achieves the state-of-the-art performances when finetuned on several representative Chinese tasks, including
named entity recognition (People\u2019s Daily NER), sentence matching (LCQMC), Chinese sentiment classification (ChnSenti)
and natural language inference (XNLI).`),as.forEach(o),ss.forEach(o),ms=f(t),K=i(t,"P",{});var je=l(K);ua=a(je,"This model was contributed by "),_t=i(je,"A",{href:!0,rel:!0});var rs=l(_t);fa=a(rs,"sijunhe"),rs.forEach(o),ga=a(je,". The original code can be found "),bt=i(je,"A",{href:!0,rel:!0});var is=l(bt);_a=a(is,"here"),is.forEach(o),ba=a(je,"."),je.forEach(o),us=f(t),de=i(t,"H2",{class:!0});var $o=l(de);Ce=i($o,"A",{id:!0,class:!0,href:!0});var ls=l(Ce);ln=i(ls,"SPAN",{});var _d=l(ln);v(zt.$$.fragment,_d),_d.forEach(o),ls.forEach(o),za=f($o),dn=i($o,"SPAN",{});var bd=l(dn);ka=a(bd,"NezhaConfig"),bd.forEach(o),$o.forEach(o),fs=f(t),W=i(t,"DIV",{class:!0});var rt=l(W);v(kt.$$.fragment,rt),va=f(rt),ce=i(rt,"P",{});var Vo=l(ce);wa=a(Vo,"This is the configuration class to store the configuration of an "),Mo=i(Vo,"A",{href:!0});var zd=l(Mo);Ta=a(zd,"NezhaModel"),zd.forEach(o),$a=a(Vo,`. It is used to instantiate an Nezha
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 Nezha
`),vt=i(Vo,"A",{href:!0,rel:!0});var kd=l(vt);ya=a(kd,"sijunhe/nezha-cn-base"),kd.forEach(o),Na=a(Vo," architecture."),Vo.forEach(o),Ma=f(rt),he=i(rt,"P",{});var Ro=l(he);Fa=a(Ro,"Configuration objects inherit from "),Fo=i(Ro,"A",{href:!0});var vd=l(Fo);xa=a(vd,"PretrainedConfig"),vd.forEach(o),ja=a(Ro,` and can be used to control the model outputs. Read the
documentation from `),xo=i(Ro,"A",{href:!0});var wd=l(xo);Pa=a(wd,"PretrainedConfig"),wd.forEach(o),qa=a(Ro," for more information."),Ro.forEach(o),Ca=f(rt),v(Ee.$$.fragment,rt),rt.forEach(o),gs=f(t),pe=i(t,"H2",{class:!0});var Cs=l(pe);Ae=i(Cs,"A",{id:!0,class:!0,href:!0});var Td=l(Ae);cn=i(Td,"SPAN",{});var $d=l(cn);v(wt.$$.fragment,$d),$d.forEach(o),Td.forEach(o),Ea=f(Cs),hn=i(Cs,"SPAN",{});var yd=l(hn);Aa=a(yd,"NezhaModel"),yd.forEach(o),Cs.forEach(o),_s=f(t),F=i(t,"DIV",{class:!0});var I=l(F);v(Tt.$$.fragment,I),Oa=f(I),pn=i(I,"P",{});var Nd=l(pn);Sa=a(Nd,"The bare Nezha Model transformer outputting raw hidden-states without any specific head on top."),Nd.forEach(o),La=f(I),$t=i(I,"P",{});var Es=l($t);Ia=a(Es,"This model inherits from "),jo=i(Es,"A",{href:!0});var Md=l(jo);Da=a(Md,"PreTrainedModel"),Md.forEach(o),Wa=a(Es,`. 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.)`),Es.forEach(o),Ha=f(I),yt=i(I,"P",{});var As=l(yt);Ba=a(As,"This model is also a PyTorch "),Nt=i(As,"A",{href:!0,rel:!0});var Fd=l(Nt);Qa=a(Fd,"torch.nn.Module"),Fd.forEach(o),Ua=a(As,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),As.forEach(o),Va=f(I),Mt=i(I,"P",{});var Os=l(Mt);Ra=a(Os,`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),Ft=i(Os,"A",{href:!0,rel:!0});var xd=l(Ft);Za=a(xd,`Attention is
all you need`),xd.forEach(o),Ja=a(Os,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),Os.forEach(o),Ka=f(I),x=i(I,"P",{});var D=l(x);Ga=a(D,"To behave as an decoder the model needs to be initialized with the "),mn=i(D,"CODE",{});var jd=l(mn);Xa=a(jd,"is_decoder"),jd.forEach(o),Ya=a(D,` argument of the configuration set
to `),un=i(D,"CODE",{});var Pd=l(un);er=a(Pd,"True"),Pd.forEach(o),tr=a(D,". To be used in a Seq2Seq model, the model needs to initialized with both "),fn=i(D,"CODE",{});var qd=l(fn);or=a(qd,"is_decoder"),qd.forEach(o),nr=a(D,` argument and
`),gn=i(D,"CODE",{});var Cd=l(gn);sr=a(Cd,"add_cross_attention"),Cd.forEach(o),ar=a(D," set to "),_n=i(D,"CODE",{});var Ed=l(_n);rr=a(Ed,"True"),Ed.forEach(o),ir=a(D,"; an "),bn=i(D,"CODE",{});var Ad=l(bn);lr=a(Ad,"encoder_hidden_states"),Ad.forEach(o),dr=a(D," is then expected as an input to the forward pass."),D.forEach(o),cr=f(I),H=i(I,"DIV",{class:!0});var it=l(H);v(xt.$$.fragment,it),hr=f(it),me=i(it,"P",{});var Zo=l(me);pr=a(Zo,"The "),Po=i(Zo,"A",{href:!0});var Od=l(Po);mr=a(Od,"NezhaModel"),Od.forEach(o),ur=a(Zo," forward method, overrides the "),zn=i(Zo,"CODE",{});var Sd=l(zn);fr=a(Sd,"__call__"),Sd.forEach(o),gr=a(Zo," special method."),Zo.forEach(o),_r=f(it),v(Oe.$$.fragment,it),br=f(it),v(Se.$$.fragment,it),it.forEach(o),I.forEach(o),bs=f(t),ue=i(t,"H2",{class:!0});var Ss=l(ue);Le=i(Ss,"A",{id:!0,class:!0,href:!0});var Ld=l(Le);kn=i(Ld,"SPAN",{});var Id=l(kn);v(jt.$$.fragment,Id),Id.forEach(o),Ld.forEach(o),zr=f(Ss),vn=i(Ss,"SPAN",{});var Dd=l(vn);kr=a(Dd,"NezhaForPreTraining"),Dd.forEach(o),Ss.forEach(o),zs=f(t),P=i(t,"DIV",{class:!0});var G=l(P);v(Pt.$$.fragment,G),vr=f(G),fe=i(G,"P",{});var Jo=l(fe);wr=a(Jo,"Nezha Model with two heads on top as done during the pretraining: a "),wn=i(Jo,"CODE",{});var Wd=l(wn);Tr=a(Wd,"masked language modeling"),Wd.forEach(o),$r=a(Jo," head and a "),Tn=i(Jo,"CODE",{});var Hd=l(Tn);yr=a(Hd,"next sentence prediction (classification)"),Hd.forEach(o),Nr=a(Jo," head."),Jo.forEach(o),Mr=f(G),qt=i(G,"P",{});var Ls=l(qt);Fr=a(Ls,"This model inherits from "),qo=i(Ls,"A",{href:!0});var Bd=l(qo);xr=a(Bd,"PreTrainedModel"),Bd.forEach(o),jr=a(Ls,`. 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.)`),Ls.forEach(o),Pr=f(G),Ct=i(G,"P",{});var Is=l(Ct);qr=a(Is,"This model is also a PyTorch "),Et=i(Is,"A",{href:!0,rel:!0});var Qd=l(Et);Cr=a(Qd,"torch.nn.Module"),Qd.forEach(o),Er=a(Is,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Is.forEach(o),Ar=f(G),B=i(G,"DIV",{class:!0});var lt=l(B);v(At.$$.fragment,lt),Or=f(lt),ge=i(lt,"P",{});var Ko=l(ge);Sr=a(Ko,"The "),Co=i(Ko,"A",{href:!0});var Ud=l(Co);Lr=a(Ud,"NezhaForPreTraining"),Ud.forEach(o),Ir=a(Ko," forward method, overrides the "),$n=i(Ko,"CODE",{});var Vd=l($n);Dr=a(Vd,"__call__"),Vd.forEach(o),Wr=a(Ko," special method."),Ko.forEach(o),Hr=f(lt),v(Ie.$$.fragment,lt),Br=f(lt),v(De.$$.fragment,lt),lt.forEach(o),G.forEach(o),ks=f(t),_e=i(t,"H2",{class:!0});var Ds=l(_e);We=i(Ds,"A",{id:!0,class:!0,href:!0});var Rd=l(We);yn=i(Rd,"SPAN",{});var Zd=l(yn);v(Ot.$$.fragment,Zd),Zd.forEach(o),Rd.forEach(o),Qr=f(Ds),Nn=i(Ds,"SPAN",{});var Jd=l(Nn);Ur=a(Jd,"NezhaForMaskedLM"),Jd.forEach(o),Ds.forEach(o),vs=f(t),q=i(t,"DIV",{class:!0});var X=l(q);v(St.$$.fragment,X),Vr=f(X),Lt=i(X,"P",{});var Ws=l(Lt);Rr=a(Ws,"Nezha Model with a "),Mn=i(Ws,"CODE",{});var Kd=l(Mn);Zr=a(Kd,"language modeling"),Kd.forEach(o),Jr=a(Ws," head on top."),Ws.forEach(o),Kr=f(X),It=i(X,"P",{});var Hs=l(It);Gr=a(Hs,"This model inherits from "),Eo=i(Hs,"A",{href:!0});var Gd=l(Eo);Xr=a(Gd,"PreTrainedModel"),Gd.forEach(o),Yr=a(Hs,`. 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.)`),Hs.forEach(o),ei=f(X),Dt=i(X,"P",{});var Bs=l(Dt);ti=a(Bs,"This model is also a PyTorch "),Wt=i(Bs,"A",{href:!0,rel:!0});var Xd=l(Wt);oi=a(Xd,"torch.nn.Module"),Xd.forEach(o),ni=a(Bs,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Bs.forEach(o),si=f(X),Q=i(X,"DIV",{class:!0});var dt=l(Q);v(Ht.$$.fragment,dt),ai=f(dt),be=i(dt,"P",{});var Go=l(be);ri=a(Go,"The "),Ao=i(Go,"A",{href:!0});var Yd=l(Ao);ii=a(Yd,"NezhaForMaskedLM"),Yd.forEach(o),li=a(Go," forward method, overrides the "),Fn=i(Go,"CODE",{});var ec=l(Fn);di=a(ec,"__call__"),ec.forEach(o),ci=a(Go," special method."),Go.forEach(o),hi=f(dt),v(He.$$.fragment,dt),pi=f(dt),v(Be.$$.fragment,dt),dt.forEach(o),X.forEach(o),ws=f(t),ze=i(t,"H2",{class:!0});var Qs=l(ze);Qe=i(Qs,"A",{id:!0,class:!0,href:!0});var tc=l(Qe);xn=i(tc,"SPAN",{});var oc=l(xn);v(Bt.$$.fragment,oc),oc.forEach(o),tc.forEach(o),mi=f(Qs),jn=i(Qs,"SPAN",{});var nc=l(jn);ui=a(nc,"NezhaForNextSentencePrediction"),nc.forEach(o),Qs.forEach(o),Ts=f(t),C=i(t,"DIV",{class:!0});var Y=l(C);v(Qt.$$.fragment,Y),fi=f(Y),Ut=i(Y,"P",{});var Us=l(Ut);gi=a(Us,"Nezha Model with a "),Pn=i(Us,"CODE",{});var sc=l(Pn);_i=a(sc,"next sentence prediction (classification)"),sc.forEach(o),bi=a(Us," head on top."),Us.forEach(o),zi=f(Y),Vt=i(Y,"P",{});var Vs=l(Vt);ki=a(Vs,"This model inherits from "),Oo=i(Vs,"A",{href:!0});var ac=l(Oo);vi=a(ac,"PreTrainedModel"),ac.forEach(o),wi=a(Vs,`. 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.)`),Vs.forEach(o),Ti=f(Y),Rt=i(Y,"P",{});var Rs=l(Rt);$i=a(Rs,"This model is also a PyTorch "),Zt=i(Rs,"A",{href:!0,rel:!0});var rc=l(Zt);yi=a(rc,"torch.nn.Module"),rc.forEach(o),Ni=a(Rs,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Rs.forEach(o),Mi=f(Y),U=i(Y,"DIV",{class:!0});var ct=l(U);v(Jt.$$.fragment,ct),Fi=f(ct),ke=i(ct,"P",{});var Xo=l(ke);xi=a(Xo,"The "),So=i(Xo,"A",{href:!0});var ic=l(So);ji=a(ic,"NezhaForNextSentencePrediction"),ic.forEach(o),Pi=a(Xo," forward method, overrides the "),qn=i(Xo,"CODE",{});var lc=l(qn);qi=a(lc,"__call__"),lc.forEach(o),Ci=a(Xo," special method."),Xo.forEach(o),Ei=f(ct),v(Ue.$$.fragment,ct),Ai=f(ct),v(Ve.$$.fragment,ct),ct.forEach(o),Y.forEach(o),$s=f(t),ve=i(t,"H2",{class:!0});var Zs=l(ve);Re=i(Zs,"A",{id:!0,class:!0,href:!0});var dc=l(Re);Cn=i(dc,"SPAN",{});var cc=l(Cn);v(Kt.$$.fragment,cc),cc.forEach(o),dc.forEach(o),Oi=f(Zs),En=i(Zs,"SPAN",{});var hc=l(En);Si=a(hc,"NezhaForSequenceClassification"),hc.forEach(o),Zs.forEach(o),ys=f(t),E=i(t,"DIV",{class:!0});var ee=l(E);v(Gt.$$.fragment,ee),Li=f(ee),An=i(ee,"P",{});var pc=l(An);Ii=a(pc,`Nezha Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),pc.forEach(o),Di=f(ee),Xt=i(ee,"P",{});var Js=l(Xt);Wi=a(Js,"This model inherits from "),Lo=i(Js,"A",{href:!0});var mc=l(Lo);Hi=a(mc,"PreTrainedModel"),mc.forEach(o),Bi=a(Js,`. 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.)`),Js.forEach(o),Qi=f(ee),Yt=i(ee,"P",{});var Ks=l(Yt);Ui=a(Ks,"This model is also a PyTorch "),eo=i(Ks,"A",{href:!0,rel:!0});var uc=l(eo);Vi=a(uc,"torch.nn.Module"),uc.forEach(o),Ri=a(Ks,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ks.forEach(o),Zi=f(ee),L=i(ee,"DIV",{class:!0});var te=l(L);v(to.$$.fragment,te),Ji=f(te),we=i(te,"P",{});var Yo=l(we);Ki=a(Yo,"The "),Io=i(Yo,"A",{href:!0});var fc=l(Io);Gi=a(fc,"NezhaForSequenceClassification"),fc.forEach(o),Xi=a(Yo," forward method, overrides the "),On=i(Yo,"CODE",{});var gc=l(On);Yi=a(gc,"__call__"),gc.forEach(o),el=a(Yo," special method."),Yo.forEach(o),tl=f(te),v(Ze.$$.fragment,te),ol=f(te),v(Je.$$.fragment,te),nl=f(te),v(Ke.$$.fragment,te),te.forEach(o),ee.forEach(o),Ns=f(t),Te=i(t,"H2",{class:!0});var Gs=l(Te);Ge=i(Gs,"A",{id:!0,class:!0,href:!0});var _c=l(Ge);Sn=i(_c,"SPAN",{});var bc=l(Sn);v(oo.$$.fragment,bc),bc.forEach(o),_c.forEach(o),sl=f(Gs),Ln=i(Gs,"SPAN",{});var zc=l(Ln);al=a(zc,"NezhaForMultipleChoice"),zc.forEach(o),Gs.forEach(o),Ms=f(t),A=i(t,"DIV",{class:!0});var oe=l(A);v(no.$$.fragment,oe),rl=f(oe),In=i(oe,"P",{});var kc=l(In);il=a(kc,`Nezha 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.`),kc.forEach(o),ll=f(oe),so=i(oe,"P",{});var Xs=l(so);dl=a(Xs,"This model inherits from "),Do=i(Xs,"A",{href:!0});var vc=l(Do);cl=a(vc,"PreTrainedModel"),vc.forEach(o),hl=a(Xs,`. 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.)`),Xs.forEach(o),pl=f(oe),ao=i(oe,"P",{});var Ys=l(ao);ml=a(Ys,"This model is also a PyTorch "),ro=i(Ys,"A",{href:!0,rel:!0});var wc=l(ro);ul=a(wc,"torch.nn.Module"),wc.forEach(o),fl=a(Ys,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ys.forEach(o),gl=f(oe),V=i(oe,"DIV",{class:!0});var ht=l(V);v(io.$$.fragment,ht),_l=f(ht),$e=i(ht,"P",{});var en=l($e);bl=a(en,"The "),Wo=i(en,"A",{href:!0});var Tc=l(Wo);zl=a(Tc,"NezhaForMultipleChoice"),Tc.forEach(o),kl=a(en," forward method, overrides the "),Dn=i(en,"CODE",{});var $c=l(Dn);vl=a($c,"__call__"),$c.forEach(o),wl=a(en," special method."),en.forEach(o),Tl=f(ht),v(Xe.$$.fragment,ht),$l=f(ht),v(Ye.$$.fragment,ht),ht.forEach(o),oe.forEach(o),Fs=f(t),ye=i(t,"H2",{class:!0});var ea=l(ye);et=i(ea,"A",{id:!0,class:!0,href:!0});var yc=l(et);Wn=i(yc,"SPAN",{});var Nc=l(Wn);v(lo.$$.fragment,Nc),Nc.forEach(o),yc.forEach(o),yl=f(ea),Hn=i(ea,"SPAN",{});var Mc=l(Hn);Nl=a(Mc,"NezhaForTokenClassification"),Mc.forEach(o),ea.forEach(o),xs=f(t),O=i(t,"DIV",{class:!0});var ne=l(O);v(co.$$.fragment,ne),Ml=f(ne),Bn=i(ne,"P",{});var Fc=l(Bn);Fl=a(Fc,`Nezha 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.`),Fc.forEach(o),xl=f(ne),ho=i(ne,"P",{});var ta=l(ho);jl=a(ta,"This model inherits from "),Ho=i(ta,"A",{href:!0});var xc=l(Ho);Pl=a(xc,"PreTrainedModel"),xc.forEach(o),ql=a(ta,`. 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.)`),ta.forEach(o),Cl=f(ne),po=i(ne,"P",{});var oa=l(po);El=a(oa,"This model is also a PyTorch "),mo=i(oa,"A",{href:!0,rel:!0});var jc=l(mo);Al=a(jc,"torch.nn.Module"),jc.forEach(o),Ol=a(oa,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),oa.forEach(o),Sl=f(ne),R=i(ne,"DIV",{class:!0});var pt=l(R);v(uo.$$.fragment,pt),Ll=f(pt),Ne=i(pt,"P",{});var tn=l(Ne);Il=a(tn,"The "),Bo=i(tn,"A",{href:!0});var Pc=l(Bo);Dl=a(Pc,"NezhaForTokenClassification"),Pc.forEach(o),Wl=a(tn," forward method, overrides the "),Qn=i(tn,"CODE",{});var qc=l(Qn);Hl=a(qc,"__call__"),qc.forEach(o),Bl=a(tn," special method."),tn.forEach(o),Ql=f(pt),v(tt.$$.fragment,pt),Ul=f(pt),v(ot.$$.fragment,pt),pt.forEach(o),ne.forEach(o),js=f(t),Me=i(t,"H2",{class:!0});var na=l(Me);nt=i(na,"A",{id:!0,class:!0,href:!0});var Cc=l(nt);Un=i(Cc,"SPAN",{});var Ec=l(Un);v(fo.$$.fragment,Ec),Ec.forEach(o),Cc.forEach(o),Vl=f(na),Vn=i(na,"SPAN",{});var Ac=l(Vn);Rl=a(Ac,"NezhaForQuestionAnswering"),Ac.forEach(o),na.forEach(o),Ps=f(t),S=i(t,"DIV",{class:!0});var se=l(S);v(go.$$.fragment,se),Zl=f(se),Fe=i(se,"P",{});var on=l(Fe);Jl=a(on,`Nezha 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 `),Rn=i(on,"CODE",{});var Oc=l(Rn);Kl=a(Oc,"span start logits"),Oc.forEach(o),Gl=a(on," and "),Zn=i(on,"CODE",{});var Sc=l(Zn);Xl=a(Sc,"span end logits"),Sc.forEach(o),Yl=a(on,")."),on.forEach(o),ed=f(se),_o=i(se,"P",{});var sa=l(_o);td=a(sa,"This model inherits from "),Qo=i(sa,"A",{href:!0});var Lc=l(Qo);od=a(Lc,"PreTrainedModel"),Lc.forEach(o),nd=a(sa,`. 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.)`),sa.forEach(o),sd=f(se),bo=i(se,"P",{});var aa=l(bo);ad=a(aa,"This model is also a PyTorch "),zo=i(aa,"A",{href:!0,rel:!0});var Ic=l(zo);rd=a(Ic,"torch.nn.Module"),Ic.forEach(o),id=a(aa,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),aa.forEach(o),ld=f(se),Z=i(se,"DIV",{class:!0});var mt=l(Z);v(ko.$$.fragment,mt),dd=f(mt),xe=i(mt,"P",{});var nn=l(xe);cd=a(nn,"The "),Uo=i(nn,"A",{href:!0});var Dc=l(Uo);hd=a(Dc,"NezhaForQuestionAnswering"),Dc.forEach(o),pd=a(nn," forward method, overrides the "),Jn=i(nn,"CODE",{});var Wc=l(Jn);md=a(Wc,"__call__"),Wc.forEach(o),ud=a(nn," special method."),nn.forEach(o),fd=f(mt),v(st.$$.fragment,mt),gd=f(mt),v(at.$$.fragment,mt),mt.forEach(o),se.forEach(o),this.h()},h(){p(d,"name","hf:doc:metadata"),p(d,"content",JSON.stringify(ph)),p(h,"id","nezha"),p(h,"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"),p(h,"href","#nezha"),p(m,"class","relative group"),p(Pe,"id","overview"),p(Pe,"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"),p(Pe,"href","#overview"),p(le,"class","relative group"),p(gt,"href","https://arxiv.org/abs/1909.00204"),p(gt,"rel","nofollow"),p(_t,"href","https://huggingface.co/sijunhe"),p(_t,"rel","nofollow"),p(bt,"href","https://github.com/huawei-noah/Pretrained-Language-Model/tree/master/NEZHA-PyTorch"),p(bt,"rel","nofollow"),p(Ce,"id","transformers.NezhaConfig"),p(Ce,"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"),p(Ce,"href","#transformers.NezhaConfig"),p(de,"class","relative group"),p(Mo,"href","/docs/transformers/main/en/model_doc/nezha#transformers.NezhaModel"),p(vt,"href","https://huggingface.co/sijunhe/nezha-cn-base"),p(vt,"rel","nofollow"),p(Fo,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),p(xo,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),p(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ae,"id","transformers.NezhaModel"),p(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"),p(Ae,"href","#transformers.NezhaModel"),p(pe,"class","relative group"),p(jo,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(Nt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Nt,"rel","nofollow"),p(Ft,"href","https://arxiv.org/abs/1706.03762"),p(Ft,"rel","nofollow"),p(Po,"href","/docs/transformers/main/en/model_doc/nezha#transformers.NezhaModel"),p(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Le,"id","transformers.NezhaForPreTraining"),p(Le,"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"),p(Le,"href","#transformers.NezhaForPreTraining"),p(ue,"class","relative group"),p(qo,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(Et,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Et,"rel","nofollow"),p(Co,"href","/docs/transformers/main/en/model_doc/nezha#transformers.NezhaForPreTraining"),p(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(We,"id","transformers.NezhaForMaskedLM"),p(We,"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"),p(We,"href","#transformers.NezhaForMaskedLM"),p(_e,"class","relative group"),p(Eo,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(Wt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Wt,"rel","nofollow"),p(Ao,"href","/docs/transformers/main/en/model_doc/nezha#transformers.NezhaForMaskedLM"),p(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Qe,"id","transformers.NezhaForNextSentencePrediction"),p(Qe,"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"),p(Qe,"href","#transformers.NezhaForNextSentencePrediction"),p(ze,"class","relative group"),p(Oo,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(Zt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Zt,"rel","nofollow"),p(So,"href","/docs/transformers/main/en/model_doc/nezha#transformers.NezhaForNextSentencePrediction"),p(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Re,"id","transformers.NezhaForSequenceClassification"),p(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"),p(Re,"href","#transformers.NezhaForSequenceClassification"),p(ve,"class","relative group"),p(Lo,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(eo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(eo,"rel","nofollow"),p(Io,"href","/docs/transformers/main/en/model_doc/nezha#transformers.NezhaForSequenceClassification"),p(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ge,"id","transformers.NezhaForMultipleChoice"),p(Ge,"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"),p(Ge,"href","#transformers.NezhaForMultipleChoice"),p(Te,"class","relative group"),p(Do,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(ro,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(ro,"rel","nofollow"),p(Wo,"href","/docs/transformers/main/en/model_doc/nezha#transformers.NezhaForMultipleChoice"),p(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(et,"id","transformers.NezhaForTokenClassification"),p(et,"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"),p(et,"href","#transformers.NezhaForTokenClassification"),p(ye,"class","relative group"),p(Ho,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(mo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(mo,"rel","nofollow"),p(Bo,"href","/docs/transformers/main/en/model_doc/nezha#transformers.NezhaForTokenClassification"),p(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(nt,"id","transformers.NezhaForQuestionAnswering"),p(nt,"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"),p(nt,"href","#transformers.NezhaForQuestionAnswering"),p(Me,"class","relative group"),p(Qo,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(zo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(zo,"rel","nofollow"),p(Uo,"href","/docs/transformers/main/en/model_doc/nezha#transformers.NezhaForQuestionAnswering"),p(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,g){e(document.head,d),z(t,b,g),z(t,m,g),e(m,h),e(h,_),w(n,_,null),e(m,c),e(m,M),e(M,ra),z(t,ds,g),z(t,le,g),e(le,Pe),e(Pe,sn),w(ft,sn,null),e(le,ia),e(le,an),e(an,la),z(t,cs,g),z(t,qe,g),e(qe,da),e(qe,gt),e(gt,ca),e(qe,ha),z(t,hs,g),z(t,yo,g),e(yo,pa),z(t,ps,g),z(t,No,g),e(No,rn),e(rn,ma),z(t,ms,g),z(t,K,g),e(K,ua),e(K,_t),e(_t,fa),e(K,ga),e(K,bt),e(bt,_a),e(K,ba),z(t,us,g),z(t,de,g),e(de,Ce),e(Ce,ln),w(zt,ln,null),e(de,za),e(de,dn),e(dn,ka),z(t,fs,g),z(t,W,g),w(kt,W,null),e(W,va),e(W,ce),e(ce,wa),e(ce,Mo),e(Mo,Ta),e(ce,$a),e(ce,vt),e(vt,ya),e(ce,Na),e(W,Ma),e(W,he),e(he,Fa),e(he,Fo),e(Fo,xa),e(he,ja),e(he,xo),e(xo,Pa),e(he,qa),e(W,Ca),w(Ee,W,null),z(t,gs,g),z(t,pe,g),e(pe,Ae),e(Ae,cn),w(wt,cn,null),e(pe,Ea),e(pe,hn),e(hn,Aa),z(t,_s,g),z(t,F,g),w(Tt,F,null),e(F,Oa),e(F,pn),e(pn,Sa),e(F,La),e(F,$t),e($t,Ia),e($t,jo),e(jo,Da),e($t,Wa),e(F,Ha),e(F,yt),e(yt,Ba),e(yt,Nt),e(Nt,Qa),e(yt,Ua),e(F,Va),e(F,Mt),e(Mt,Ra),e(Mt,Ft),e(Ft,Za),e(Mt,Ja),e(F,Ka),e(F,x),e(x,Ga),e(x,mn),e(mn,Xa),e(x,Ya),e(x,un),e(un,er),e(x,tr),e(x,fn),e(fn,or),e(x,nr),e(x,gn),e(gn,sr),e(x,ar),e(x,_n),e(_n,rr),e(x,ir),e(x,bn),e(bn,lr),e(x,dr),e(F,cr),e(F,H),w(xt,H,null),e(H,hr),e(H,me),e(me,pr),e(me,Po),e(Po,mr),e(me,ur),e(me,zn),e(zn,fr),e(me,gr),e(H,_r),w(Oe,H,null),e(H,br),w(Se,H,null),z(t,bs,g),z(t,ue,g),e(ue,Le),e(Le,kn),w(jt,kn,null),e(ue,zr),e(ue,vn),e(vn,kr),z(t,zs,g),z(t,P,g),w(Pt,P,null),e(P,vr),e(P,fe),e(fe,wr),e(fe,wn),e(wn,Tr),e(fe,$r),e(fe,Tn),e(Tn,yr),e(fe,Nr),e(P,Mr),e(P,qt),e(qt,Fr),e(qt,qo),e(qo,xr),e(qt,jr),e(P,Pr),e(P,Ct),e(Ct,qr),e(Ct,Et),e(Et,Cr),e(Ct,Er),e(P,Ar),e(P,B),w(At,B,null),e(B,Or),e(B,ge),e(ge,Sr),e(ge,Co),e(Co,Lr),e(ge,Ir),e(ge,$n),e($n,Dr),e(ge,Wr),e(B,Hr),w(Ie,B,null),e(B,Br),w(De,B,null),z(t,ks,g),z(t,_e,g),e(_e,We),e(We,yn),w(Ot,yn,null),e(_e,Qr),e(_e,Nn),e(Nn,Ur),z(t,vs,g),z(t,q,g),w(St,q,null),e(q,Vr),e(q,Lt),e(Lt,Rr),e(Lt,Mn),e(Mn,Zr),e(Lt,Jr),e(q,Kr),e(q,It),e(It,Gr),e(It,Eo),e(Eo,Xr),e(It,Yr),e(q,ei),e(q,Dt),e(Dt,ti),e(Dt,Wt),e(Wt,oi),e(Dt,ni),e(q,si),e(q,Q),w(Ht,Q,null),e(Q,ai),e(Q,be),e(be,ri),e(be,Ao),e(Ao,ii),e(be,li),e(be,Fn),e(Fn,di),e(be,ci),e(Q,hi),w(He,Q,null),e(Q,pi),w(Be,Q,null),z(t,ws,g),z(t,ze,g),e(ze,Qe),e(Qe,xn),w(Bt,xn,null),e(ze,mi),e(ze,jn),e(jn,ui),z(t,Ts,g),z(t,C,g),w(Qt,C,null),e(C,fi),e(C,Ut),e(Ut,gi),e(Ut,Pn),e(Pn,_i),e(Ut,bi),e(C,zi),e(C,Vt),e(Vt,ki),e(Vt,Oo),e(Oo,vi),e(Vt,wi),e(C,Ti),e(C,Rt),e(Rt,$i),e(Rt,Zt),e(Zt,yi),e(Rt,Ni),e(C,Mi),e(C,U),w(Jt,U,null),e(U,Fi),e(U,ke),e(ke,xi),e(ke,So),e(So,ji),e(ke,Pi),e(ke,qn),e(qn,qi),e(ke,Ci),e(U,Ei),w(Ue,U,null),e(U,Ai),w(Ve,U,null),z(t,$s,g),z(t,ve,g),e(ve,Re),e(Re,Cn),w(Kt,Cn,null),e(ve,Oi),e(ve,En),e(En,Si),z(t,ys,g),z(t,E,g),w(Gt,E,null),e(E,Li),e(E,An),e(An,Ii),e(E,Di),e(E,Xt),e(Xt,Wi),e(Xt,Lo),e(Lo,Hi),e(Xt,Bi),e(E,Qi),e(E,Yt),e(Yt,Ui),e(Yt,eo),e(eo,Vi),e(Yt,Ri),e(E,Zi),e(E,L),w(to,L,null),e(L,Ji),e(L,we),e(we,Ki),e(we,Io),e(Io,Gi),e(we,Xi),e(we,On),e(On,Yi),e(we,el),e(L,tl),w(Ze,L,null),e(L,ol),w(Je,L,null),e(L,nl),w(Ke,L,null),z(t,Ns,g),z(t,Te,g),e(Te,Ge),e(Ge,Sn),w(oo,Sn,null),e(Te,sl),e(Te,Ln),e(Ln,al),z(t,Ms,g),z(t,A,g),w(no,A,null),e(A,rl),e(A,In),e(In,il),e(A,ll),e(A,so),e(so,dl),e(so,Do),e(Do,cl),e(so,hl),e(A,pl),e(A,ao),e(ao,ml),e(ao,ro),e(ro,ul),e(ao,fl),e(A,gl),e(A,V),w(io,V,null),e(V,_l),e(V,$e),e($e,bl),e($e,Wo),e(Wo,zl),e($e,kl),e($e,Dn),e(Dn,vl),e($e,wl),e(V,Tl),w(Xe,V,null),e(V,$l),w(Ye,V,null),z(t,Fs,g),z(t,ye,g),e(ye,et),e(et,Wn),w(lo,Wn,null),e(ye,yl),e(ye,Hn),e(Hn,Nl),z(t,xs,g),z(t,O,g),w(co,O,null),e(O,Ml),e(O,Bn),e(Bn,Fl),e(O,xl),e(O,ho),e(ho,jl),e(ho,Ho),e(Ho,Pl),e(ho,ql),e(O,Cl),e(O,po),e(po,El),e(po,mo),e(mo,Al),e(po,Ol),e(O,Sl),e(O,R),w(uo,R,null),e(R,Ll),e(R,Ne),e(Ne,Il),e(Ne,Bo),e(Bo,Dl),e(Ne,Wl),e(Ne,Qn),e(Qn,Hl),e(Ne,Bl),e(R,Ql),w(tt,R,null),e(R,Ul),w(ot,R,null),z(t,js,g),z(t,Me,g),e(Me,nt),e(nt,Un),w(fo,Un,null),e(Me,Vl),e(Me,Vn),e(Vn,Rl),z(t,Ps,g),z(t,S,g),w(go,S,null),e(S,Zl),e(S,Fe),e(Fe,Jl),e(Fe,Rn),e(Rn,Kl),e(Fe,Gl),e(Fe,Zn),e(Zn,Xl),e(Fe,Yl),e(S,ed),e(S,_o),e(_o,td),e(_o,Qo),e(Qo,od),e(_o,nd),e(S,sd),e(S,bo),e(bo,ad),e(bo,zo),e(zo,rd),e(bo,id),e(S,ld),e(S,Z),w(ko,Z,null),e(Z,dd),e(Z,xe),e(xe,cd),e(xe,Uo),e(Uo,hd),e(xe,pd),e(xe,Jn),e(Jn,md),e(xe,ud),e(Z,fd),w(st,Z,null),e(Z,gd),w(at,Z,null),qs=!0},p(t,[g]){const vo={};g&2&&(vo.$$scope={dirty:g,ctx:t}),Ee.$set(vo);const Kn={};g&2&&(Kn.$$scope={dirty:g,ctx:t}),Oe.$set(Kn);const Gn={};g&2&&(Gn.$$scope={dirty:g,ctx:t}),Se.$set(Gn);const Xn={};g&2&&(Xn.$$scope={dirty:g,ctx:t}),Ie.$set(Xn);const wo={};g&2&&(wo.$$scope={dirty:g,ctx:t}),De.$set(wo);const Yn={};g&2&&(Yn.$$scope={dirty:g,ctx:t}),He.$set(Yn);const es={};g&2&&(es.$$scope={dirty:g,ctx:t}),Be.$set(es);const ts={};g&2&&(ts.$$scope={dirty:g,ctx:t}),Ue.$set(ts);const To={};g&2&&(To.$$scope={dirty:g,ctx:t}),Ve.$set(To);const os={};g&2&&(os.$$scope={dirty:g,ctx:t}),Ze.$set(os);const ns={};g&2&&(ns.$$scope={dirty:g,ctx:t}),Je.$set(ns);const ss={};g&2&&(ss.$$scope={dirty:g,ctx:t}),Ke.$set(ss);const as={};g&2&&(as.$$scope={dirty:g,ctx:t}),Xe.$set(as);const je={};g&2&&(je.$$scope={dirty:g,ctx:t}),Ye.$set(je);const rs={};g&2&&(rs.$$scope={dirty:g,ctx:t}),tt.$set(rs);const is={};g&2&&(is.$$scope={dirty:g,ctx:t}),ot.$set(is);const $o={};g&2&&($o.$$scope={dirty:g,ctx:t}),st.$set($o);const ls={};g&2&&(ls.$$scope={dirty:g,ctx:t}),at.$set(ls)},i(t){qs||(T(n.$$.fragment,t),T(ft.$$.fragment,t),T(zt.$$.fragment,t),T(kt.$$.fragment,t),T(Ee.$$.fragment,t),T(wt.$$.fragment,t),T(Tt.$$.fragment,t),T(xt.$$.fragment,t),T(Oe.$$.fragment,t),T(Se.$$.fragment,t),T(jt.$$.fragment,t),T(Pt.$$.fragment,t),T(At.$$.fragment,t),T(Ie.$$.fragment,t),T(De.$$.fragment,t),T(Ot.$$.fragment,t),T(St.$$.fragment,t),T(Ht.$$.fragment,t),T(He.$$.fragment,t),T(Be.$$.fragment,t),T(Bt.$$.fragment,t),T(Qt.$$.fragment,t),T(Jt.$$.fragment,t),T(Ue.$$.fragment,t),T(Ve.$$.fragment,t),T(Kt.$$.fragment,t),T(Gt.$$.fragment,t),T(to.$$.fragment,t),T(Ze.$$.fragment,t),T(Je.$$.fragment,t),T(Ke.$$.fragment,t),T(oo.$$.fragment,t),T(no.$$.fragment,t),T(io.$$.fragment,t),T(Xe.$$.fragment,t),T(Ye.$$.fragment,t),T(lo.$$.fragment,t),T(co.$$.fragment,t),T(uo.$$.fragment,t),T(tt.$$.fragment,t),T(ot.$$.fragment,t),T(fo.$$.fragment,t),T(go.$$.fragment,t),T(ko.$$.fragment,t),T(st.$$.fragment,t),T(at.$$.fragment,t),qs=!0)},o(t){$(n.$$.fragment,t),$(ft.$$.fragment,t),$(zt.$$.fragment,t),$(kt.$$.fragment,t),$(Ee.$$.fragment,t),$(wt.$$.fragment,t),$(Tt.$$.fragment,t),$(xt.$$.fragment,t),$(Oe.$$.fragment,t),$(Se.$$.fragment,t),$(jt.$$.fragment,t),$(Pt.$$.fragment,t),$(At.$$.fragment,t),$(Ie.$$.fragment,t),$(De.$$.fragment,t),$(Ot.$$.fragment,t),$(St.$$.fragment,t),$(Ht.$$.fragment,t),$(He.$$.fragment,t),$(Be.$$.fragment,t),$(Bt.$$.fragment,t),$(Qt.$$.fragment,t),$(Jt.$$.fragment,t),$(Ue.$$.fragment,t),$(Ve.$$.fragment,t),$(Kt.$$.fragment,t),$(Gt.$$.fragment,t),$(to.$$.fragment,t),$(Ze.$$.fragment,t),$(Je.$$.fragment,t),$(Ke.$$.fragment,t),$(oo.$$.fragment,t),$(no.$$.fragment,t),$(io.$$.fragment,t),$(Xe.$$.fragment,t),$(Ye.$$.fragment,t),$(lo.$$.fragment,t),$(co.$$.fragment,t),$(uo.$$.fragment,t),$(tt.$$.fragment,t),$(ot.$$.fragment,t),$(fo.$$.fragment,t),$(go.$$.fragment,t),$(ko.$$.fragment,t),$(st.$$.fragment,t),$(at.$$.fragment,t),qs=!1},d(t){o(d),t&&o(b),t&&o(m),y(n),t&&o(ds),t&&o(le),y(ft),t&&o(cs),t&&o(qe),t&&o(hs),t&&o(yo),t&&o(ps),t&&o(No),t&&o(ms),t&&o(K),t&&o(us),t&&o(de),y(zt),t&&o(fs),t&&o(W),y(kt),y(Ee),t&&o(gs),t&&o(pe),y(wt),t&&o(_s),t&&o(F),y(Tt),y(xt),y(Oe),y(Se),t&&o(bs),t&&o(ue),y(jt),t&&o(zs),t&&o(P),y(Pt),y(At),y(Ie),y(De),t&&o(ks),t&&o(_e),y(Ot),t&&o(vs),t&&o(q),y(St),y(Ht),y(He),y(Be),t&&o(ws),t&&o(ze),y(Bt),t&&o(Ts),t&&o(C),y(Qt),y(Jt),y(Ue),y(Ve),t&&o($s),t&&o(ve),y(Kt),t&&o(ys),t&&o(E),y(Gt),y(to),y(Ze),y(Je),y(Ke),t&&o(Ns),t&&o(Te),y(oo),t&&o(Ms),t&&o(A),y(no),y(io),y(Xe),y(Ye),t&&o(Fs),t&&o(ye),y(lo),t&&o(xs),t&&o(O),y(co),y(uo),y(tt),y(ot),t&&o(js),t&&o(Me),y(fo),t&&o(Ps),t&&o(S),y(go),y(ko),y(st),y(at)}}}const ph={local:"nezha",sections:[{local:"overview",title:"Overview"},{local:"transformers.NezhaConfig",title:"NezhaConfig"},{local:"transformers.NezhaModel",title:"NezhaModel"},{local:"transformers.NezhaForPreTraining",title:"NezhaForPreTraining"},{local:"transformers.NezhaForMaskedLM",title:"NezhaForMaskedLM"},{local:"transformers.NezhaForNextSentencePrediction",title:"NezhaForNextSentencePrediction"},{local:"transformers.NezhaForSequenceClassification",title:"NezhaForSequenceClassification"},{local:"transformers.NezhaForMultipleChoice",title:"NezhaForMultipleChoice"},{local:"transformers.NezhaForTokenClassification",title:"NezhaForTokenClassification"},{local:"transformers.NezhaForQuestionAnswering",title:"NezhaForQuestionAnswering"}],title:"Nezha"};function mh(N){return Vc(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class kh extends Hc{constructor(d){super();Bc(this,d,mh,hh,Qc,{})}}export{kh as default,ph as metadata};
