import{S as qh,i as Eh,s as Ch,e as s,k as u,w as z,t as i,M as Ah,c as a,d as t,m,a as r,x as k,h as l,b as p,G as e,g as b,y as w,q as T,o as $,B as y,v as Oh,L as le}from"../../chunks/vendor-hf-doc-builder.js";import{T as bt}from"../../chunks/Tip-hf-doc-builder.js";import{D as j}from"../../chunks/Docstring-hf-doc-builder.js";import{C as de}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as K}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ie}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Sh(N){let d,v,f,h,_;return h=new de({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=s("p"),v=i("Example:"),f=u(),z(h.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);v=l(c,"Example:"),c.forEach(t),f=m(n),k(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),b(n,f,c),w(h,n,c),_=!0},p:le,i(n){_||(T(h.$$.fragment,n),_=!0)},o(n){$(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),y(h,n)}}}function Lh(N){let d,v,f,h,_;return{c(){d=s("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),h=i("Module"),_=i(`
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=a(n,"P",{});var c=r(d);v=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(c,"CODE",{});var M=r(f);h=l(M,"Module"),M.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,v),e(d,f),e(f,h),e(d,_)},d(n){n&&t(d)}}}function Ih(N){let d,v,f,h,_;return h=new de({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=s("p"),v=i("Example:"),f=u(),z(h.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);v=l(c,"Example:"),c.forEach(t),f=m(n),k(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),b(n,f,c),w(h,n,c),_=!0},p:le,i(n){_||(T(h.$$.fragment,n),_=!0)},o(n){$(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),y(h,n)}}}function Dh(N){let d,v,f,h,_;return{c(){d=s("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),h=i("Module"),_=i(`
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=a(n,"P",{});var c=r(d);v=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(c,"CODE",{});var M=r(f);h=l(M,"Module"),M.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,v),e(d,f),e(f,h),e(d,_)},d(n){n&&t(d)}}}function Wh(N){let d,v,f,h,_;return h=new de({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=s("p"),v=i("Example:"),f=u(),z(h.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);v=l(c,"Example:"),c.forEach(t),f=m(n),k(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),b(n,f,c),w(h,n,c),_=!0},p:le,i(n){_||(T(h.$$.fragment,n),_=!0)},o(n){$(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),y(h,n)}}}function Hh(N){let d,v,f,h,_;return{c(){d=s("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),h=i("Module"),_=i(`
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=a(n,"P",{});var c=r(d);v=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(c,"CODE",{});var M=r(f);h=l(M,"Module"),M.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,v),e(d,f),e(f,h),e(d,_)},d(n){n&&t(d)}}}function Qh(N){let d,v,f,h,_;return h=new de({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=s("p"),v=i("Example:"),f=u(),z(h.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);v=l(c,"Example:"),c.forEach(t),f=m(n),k(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),b(n,f,c),w(h,n,c),_=!0},p:le,i(n){_||(T(h.$$.fragment,n),_=!0)},o(n){$(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),y(h,n)}}}function Uh(N){let d,v,f,h,_;return{c(){d=s("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),h=i("Module"),_=i(`
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=a(n,"P",{});var c=r(d);v=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(c,"CODE",{});var M=r(f);h=l(M,"Module"),M.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,v),e(d,f),e(f,h),e(d,_)},d(n){n&&t(d)}}}function Bh(N){let d,v,f,h,_;return h=new de({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=s("p"),v=i("Example:"),f=u(),z(h.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);v=l(c,"Example:"),c.forEach(t),f=m(n),k(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),b(n,f,c),w(h,n,c),_=!0},p:le,i(n){_||(T(h.$$.fragment,n),_=!0)},o(n){$(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),y(h,n)}}}function Vh(N){let d,v,f,h,_;return{c(){d=s("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),h=i("Module"),_=i(`
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=a(n,"P",{});var c=r(d);v=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(c,"CODE",{});var M=r(f);h=l(M,"Module"),M.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,v),e(d,f),e(f,h),e(d,_)},d(n){n&&t(d)}}}function Rh(N){let d,v,f,h,_;return h=new de({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=s("p"),v=i("Example of single-label classification:"),f=u(),z(h.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);v=l(c,"Example of single-label classification:"),c.forEach(t),f=m(n),k(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),b(n,f,c),w(h,n,c),_=!0},p:le,i(n){_||(T(h.$$.fragment,n),_=!0)},o(n){$(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),y(h,n)}}}function Zh(N){let d,v,f,h,_;return h=new de({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=s("p"),v=i("Example of multi-label classification:"),f=u(),z(h.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);v=l(c,"Example of multi-label classification:"),c.forEach(t),f=m(n),k(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),b(n,f,c),w(h,n,c),_=!0},p:le,i(n){_||(T(h.$$.fragment,n),_=!0)},o(n){$(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),y(h,n)}}}function Jh(N){let d,v,f,h,_;return{c(){d=s("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),h=i("Module"),_=i(`
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=a(n,"P",{});var c=r(d);v=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(c,"CODE",{});var M=r(f);h=l(M,"Module"),M.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,v),e(d,f),e(f,h),e(d,_)},d(n){n&&t(d)}}}function Kh(N){let d,v,f,h,_;return h=new de({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=s("p"),v=i("Example:"),f=u(),z(h.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);v=l(c,"Example:"),c.forEach(t),f=m(n),k(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),b(n,f,c),w(h,n,c),_=!0},p:le,i(n){_||(T(h.$$.fragment,n),_=!0)},o(n){$(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),y(h,n)}}}function Gh(N){let d,v,f,h,_;return{c(){d=s("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),h=i("Module"),_=i(`
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=a(n,"P",{});var c=r(d);v=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(c,"CODE",{});var M=r(f);h=l(M,"Module"),M.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,v),e(d,f),e(f,h),e(d,_)},d(n){n&&t(d)}}}function Xh(N){let d,v,f,h,_;return h=new de({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=s("p"),v=i("Example:"),f=u(),z(h.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);v=l(c,"Example:"),c.forEach(t),f=m(n),k(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),b(n,f,c),w(h,n,c),_=!0},p:le,i(n){_||(T(h.$$.fragment,n),_=!0)},o(n){$(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),y(h,n)}}}function Yh(N){let d,v,f,h,_;return{c(){d=s("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),h=i("Module"),_=i(`
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=a(n,"P",{});var c=r(d);v=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(c,"CODE",{});var M=r(f);h=l(M,"Module"),M.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,v),e(d,f),e(f,h),e(d,_)},d(n){n&&t(d)}}}function ep(N){let d,v,f,h,_;return h=new de({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=s("p"),v=i("Example:"),f=u(),z(h.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);v=l(c,"Example:"),c.forEach(t),f=m(n),k(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),b(n,f,c),w(h,n,c),_=!0},p:le,i(n){_||(T(h.$$.fragment,n),_=!0)},o(n){$(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),y(h,n)}}}function tp(N){let d,v,f,h,_,n,c,M,Na,Ns,ce,Ce,fn,vt,Ma,gn,Fa,Ms,Ae,xa,zt,ja,Pa,Fs,jo,qa,xs,Po,_n,Ea,js,G,Ca,kt,Aa,Oa,wt,Sa,La,Ps,he,Oe,bn,Tt,Ia,vn,Da,qs,L,zn,qo,Wa,Ha,kn,Eo,Qa,Ua,wn,Co,Ba,Va,Tn,Ao,Ra,Za,$n,Oo,Ja,Es,pe,Se,yn,$t,Ka,Nn,Ga,Cs,H,yt,Xa,ue,Ya,So,er,tr,Nt,or,nr,sr,me,ar,Lo,rr,ir,Io,lr,dr,cr,Le,As,fe,Ie,Mn,Mt,hr,Fn,pr,Os,F,Ft,ur,xn,mr,fr,xt,gr,Do,_r,br,vr,jt,zr,Pt,kr,wr,Tr,qt,$r,Et,yr,Nr,Mr,x,Fr,jn,xr,jr,Pn,Pr,qr,qn,Er,Cr,En,Ar,Or,Cn,Sr,Lr,An,Ir,Dr,Wr,Q,Ct,Hr,ge,Qr,Wo,Ur,Br,On,Vr,Rr,Zr,De,Jr,We,Ss,_e,He,Sn,At,Kr,Ln,Gr,Ls,P,Ot,Xr,be,Yr,In,ei,ti,Dn,oi,ni,si,St,ai,Ho,ri,ii,li,Lt,di,It,ci,hi,pi,U,Dt,ui,ve,mi,Qo,fi,gi,Wn,_i,bi,vi,Qe,zi,Ue,Is,ze,Be,Hn,Wt,ki,Qn,wi,Ds,q,Ht,Ti,Qt,$i,Un,yi,Ni,Mi,Ut,Fi,Uo,xi,ji,Pi,Bt,qi,Vt,Ei,Ci,Ai,B,Rt,Oi,ke,Si,Bo,Li,Ii,Bn,Di,Wi,Hi,Ve,Qi,Re,Ws,we,Ze,Vn,Zt,Ui,Rn,Bi,Hs,E,Jt,Vi,Kt,Ri,Zn,Zi,Ji,Ki,Gt,Gi,Vo,Xi,Yi,el,Xt,tl,Yt,ol,nl,sl,V,eo,al,Te,rl,Ro,il,ll,Jn,dl,cl,hl,Je,pl,Ke,Qs,$e,Ge,Kn,to,ul,Gn,ml,Us,C,oo,fl,Xn,gl,_l,no,bl,Zo,vl,zl,kl,so,wl,ao,Tl,$l,yl,I,ro,Nl,ye,Ml,Jo,Fl,xl,Yn,jl,Pl,ql,Xe,El,Ye,Cl,et,Bs,Ne,tt,es,io,Al,ts,Ol,Vs,A,lo,Sl,os,Ll,Il,co,Dl,Ko,Wl,Hl,Ql,ho,Ul,po,Bl,Vl,Rl,R,uo,Zl,Me,Jl,Go,Kl,Gl,ns,Xl,Yl,ed,ot,td,nt,Rs,Fe,st,ss,mo,od,as,nd,Zs,O,fo,sd,rs,ad,rd,go,id,Xo,ld,dd,cd,_o,hd,bo,pd,ud,md,Z,vo,fd,xe,gd,Yo,_d,bd,is,vd,zd,kd,at,wd,rt,Js,je,it,ls,zo,Td,ds,$d,Ks,S,ko,yd,Pe,Nd,cs,Md,Fd,hs,xd,jd,Pd,wo,qd,en,Ed,Cd,Ad,To,Od,$o,Sd,Ld,Id,J,yo,Dd,qe,Wd,tn,Hd,Qd,ps,Ud,Bd,Vd,lt,Rd,dt,Gs;return n=new K({}),vt=new K({}),Tt=new K({}),$t=new K({}),yt=new j({props:{name:"class transformers.NezhaConfig",anchor:"transformers.NezhaConfig",parameters:[{name:"vocab_size",val:" = 21128"},{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/v4.29.0/en/model_doc/nezha#transformers.NezhaModel">NezhaModel</a>.`,name:"vocab_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/v4.29.0/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/v4.29.0/src/transformers/models/nezha/configuration_nezha.py#L9"}}),Le=new ie({props:{anchor:"transformers.NezhaConfig.example",$$slots:{default:[Sh]},$$scope:{ctx:N}}}),Mt=new K({}),Ft=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/v4.29.0/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/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/nezha/modeling_nezha.py#L860"}}),Ct=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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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/v4.29.0/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/v4.29.0/src/transformers/models/nezha/modeling_nezha.py#L899",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/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/v4.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),De=new bt({props:{$$slots:{default:[Lh]},$$scope:{ctx:N}}}),We=new ie({props:{anchor:"transformers.NezhaModel.forward.example",$$slots:{default:[Ih]},$$scope:{ctx:N}}}),At=new K({}),Ot=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/v4.29.0/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/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/nezha/modeling_nezha.py#L1039"}}),Dt=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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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/v4.29.0/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/v4.29.0/src/transformers/models/nezha/modeling_nezha.py#L1057",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/v4.29.0/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>
`}}),Qe=new bt({props:{$$slots:{default:[Dh]},$$scope:{ctx:N}}}),Ue=new ie({props:{anchor:"transformers.NezhaForPreTraining.forward.example",$$slots:{default:[Wh]},$$scope:{ctx:N}}}),Wt=new K({}),Ht=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/v4.29.0/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/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/nezha/modeling_nezha.py#L1141"}}),Rt=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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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/v4.29.0/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/v4.29.0/src/transformers/models/nezha/modeling_nezha.py#L1166",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/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/v4.29.0/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ve=new bt({props:{$$slots:{default:[Hh]},$$scope:{ctx:N}}}),Re=new ie({props:{anchor:"transformers.NezhaForMaskedLM.forward.example",$$slots:{default:[Qh]},$$scope:{ctx:N}}}),Zt=new K({}),Jt=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/v4.29.0/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/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/nezha/modeling_nezha.py#L1248"}}),eo=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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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/v4.29.0/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/v4.29.0/src/transformers/models/nezha/modeling_nezha.py#L1258",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/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/v4.29.0/en/main_classes/output#transformers.modeling_outputs.NextSentencePredictorOutput"
>transformers.modeling_outputs.NextSentencePredictorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Je=new bt({props:{$$slots:{default:[Uh]},$$scope:{ctx:N}}}),Ke=new ie({props:{anchor:"transformers.NezhaForNextSentencePrediction.forward.example",$$slots:{default:[Bh]},$$scope:{ctx:N}}}),to=new K({}),oo=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/v4.29.0/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/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/nezha/modeling_nezha.py#L1351"}}),ro=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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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/v4.29.0/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/v4.29.0/src/transformers/models/nezha/modeling_nezha.py#L1367",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/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/v4.29.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Xe=new bt({props:{$$slots:{default:[Vh]},$$scope:{ctx:N}}}),Ye=new ie({props:{anchor:"transformers.NezhaForSequenceClassification.forward.example",$$slots:{default:[Rh]},$$scope:{ctx:N}}}),et=new ie({props:{anchor:"transformers.NezhaForSequenceClassification.forward.example-2",$$slots:{default:[Zh]},$$scope:{ctx:N}}}),io=new K({}),lo=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/v4.29.0/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/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/nezha/modeling_nezha.py#L1450"}}),uo=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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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/v4.29.0/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/v4.29.0/src/transformers/models/nezha/modeling_nezha.py#L1464",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/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/v4.29.0/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ot=new bt({props:{$$slots:{default:[Jh]},$$scope:{ctx:N}}}),nt=new ie({props:{anchor:"transformers.NezhaForMultipleChoice.forward.example",$$slots:{default:[Kh]},$$scope:{ctx:N}}}),mo=new K({}),fo=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/v4.29.0/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/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/nezha/modeling_nezha.py#L1542"}}),vo=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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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/v4.29.0/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/v4.29.0/src/transformers/models/nezha/modeling_nezha.py#L1559",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/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/v4.29.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),at=new bt({props:{$$slots:{default:[Gh]},$$scope:{ctx:N}}}),rt=new ie({props:{anchor:"transformers.NezhaForTokenClassification.forward.example",$$slots:{default:[Xh]},$$scope:{ctx:N}}}),zo=new K({}),ko=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/v4.29.0/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/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/nezha/modeling_nezha.py#L1623"}}),yo=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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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/v4.29.0/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/v4.29.0/src/transformers/models/nezha/modeling_nezha.py#L1636",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/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/v4.29.0/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),lt=new bt({props:{$$slots:{default:[Yh]},$$scope:{ctx:N}}}),dt=new ie({props:{anchor:"transformers.NezhaForQuestionAnswering.forward.example",$$slots:{default:[ep]},$$scope:{ctx:N}}}),{c(){d=s("meta"),v=u(),f=s("h1"),h=s("a"),_=s("span"),z(n.$$.fragment),c=u(),M=s("span"),Na=i("Nezha"),Ns=u(),ce=s("h2"),Ce=s("a"),fn=s("span"),z(vt.$$.fragment),Ma=u(),gn=s("span"),Fa=i("Overview"),Ms=u(),Ae=s("p"),xa=i("The Nezha model was proposed in "),zt=s("a"),ja=i("NEZHA: Neural Contextualized Representation for Chinese Language Understanding"),Pa=i(" by Junqiu Wei et al."),Fs=u(),jo=s("p"),qa=i("The abstract from the paper is the following:"),xs=u(),Po=s("p"),_n=s("em"),Ea=i(`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).`),js=u(),G=s("p"),Ca=i("This model was contributed by "),kt=s("a"),Aa=i("sijunhe"),Oa=i(". The original code can be found "),wt=s("a"),Sa=i("here"),La=i("."),Ps=u(),he=s("h2"),Oe=s("a"),bn=s("span"),z(Tt.$$.fragment),Ia=u(),vn=s("span"),Da=i("Documentation resources"),qs=u(),L=s("ul"),zn=s("li"),qo=s("a"),Wa=i("Text classification task guide"),Ha=u(),kn=s("li"),Eo=s("a"),Qa=i("Token classification task guide"),Ua=u(),wn=s("li"),Co=s("a"),Ba=i("Question answering task guide"),Va=u(),Tn=s("li"),Ao=s("a"),Ra=i("Masked language modeling task guide"),Za=u(),$n=s("li"),Oo=s("a"),Ja=i("Multiple choice task guide"),Es=u(),pe=s("h2"),Se=s("a"),yn=s("span"),z($t.$$.fragment),Ka=u(),Nn=s("span"),Ga=i("NezhaConfig"),Cs=u(),H=s("div"),z(yt.$$.fragment),Xa=u(),ue=s("p"),Ya=i("This is the configuration class to store the configuration of an "),So=s("a"),er=i("NezhaModel"),tr=i(`. 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
`),Nt=s("a"),or=i("sijunhe/nezha-cn-base"),nr=i(" architecture."),sr=u(),me=s("p"),ar=i("Configuration objects inherit from "),Lo=s("a"),rr=i("PretrainedConfig"),ir=i(` and can be used to control the model outputs. Read the
documentation from `),Io=s("a"),lr=i("PretrainedConfig"),dr=i(" for more information."),cr=u(),z(Le.$$.fragment),As=u(),fe=s("h2"),Ie=s("a"),Mn=s("span"),z(Mt.$$.fragment),hr=u(),Fn=s("span"),pr=i("NezhaModel"),Os=u(),F=s("div"),z(Ft.$$.fragment),ur=u(),xn=s("p"),mr=i("The bare Nezha Model transformer outputting raw hidden-states without any specific head on top."),fr=u(),xt=s("p"),gr=i("This model inherits from "),Do=s("a"),_r=i("PreTrainedModel"),br=i(`. 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.)`),vr=u(),jt=s("p"),zr=i("This model is also a PyTorch "),Pt=s("a"),kr=i("torch.nn.Module"),wr=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Tr=u(),qt=s("p"),$r=i(`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 `),Et=s("a"),yr=i(`Attention is
all you need`),Nr=i(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),Mr=u(),x=s("p"),Fr=i("To behave as an decoder the model needs to be initialized with the "),jn=s("code"),xr=i("is_decoder"),jr=i(` argument of the configuration set
to `),Pn=s("code"),Pr=i("True"),qr=i(". To be used in a Seq2Seq model, the model needs to initialized with both "),qn=s("code"),Er=i("is_decoder"),Cr=i(` argument and
`),En=s("code"),Ar=i("add_cross_attention"),Or=i(" set to "),Cn=s("code"),Sr=i("True"),Lr=i("; an "),An=s("code"),Ir=i("encoder_hidden_states"),Dr=i(" is then expected as an input to the forward pass."),Wr=u(),Q=s("div"),z(Ct.$$.fragment),Hr=u(),ge=s("p"),Qr=i("The "),Wo=s("a"),Ur=i("NezhaModel"),Br=i(" forward method, overrides the "),On=s("code"),Vr=i("__call__"),Rr=i(" special method."),Zr=u(),z(De.$$.fragment),Jr=u(),z(We.$$.fragment),Ss=u(),_e=s("h2"),He=s("a"),Sn=s("span"),z(At.$$.fragment),Kr=u(),Ln=s("span"),Gr=i("NezhaForPreTraining"),Ls=u(),P=s("div"),z(Ot.$$.fragment),Xr=u(),be=s("p"),Yr=i("Nezha Model with two heads on top as done during the pretraining: a "),In=s("code"),ei=i("masked language modeling"),ti=i(" head and a "),Dn=s("code"),oi=i("next sentence prediction (classification)"),ni=i(" head."),si=u(),St=s("p"),ai=i("This model inherits from "),Ho=s("a"),ri=i("PreTrainedModel"),ii=i(`. 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.)`),li=u(),Lt=s("p"),di=i("This model is also a PyTorch "),It=s("a"),ci=i("torch.nn.Module"),hi=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),pi=u(),U=s("div"),z(Dt.$$.fragment),ui=u(),ve=s("p"),mi=i("The "),Qo=s("a"),fi=i("NezhaForPreTraining"),gi=i(" forward method, overrides the "),Wn=s("code"),_i=i("__call__"),bi=i(" special method."),vi=u(),z(Qe.$$.fragment),zi=u(),z(Ue.$$.fragment),Is=u(),ze=s("h2"),Be=s("a"),Hn=s("span"),z(Wt.$$.fragment),ki=u(),Qn=s("span"),wi=i("NezhaForMaskedLM"),Ds=u(),q=s("div"),z(Ht.$$.fragment),Ti=u(),Qt=s("p"),$i=i("Nezha Model with a "),Un=s("code"),yi=i("language modeling"),Ni=i(" head on top."),Mi=u(),Ut=s("p"),Fi=i("This model inherits from "),Uo=s("a"),xi=i("PreTrainedModel"),ji=i(`. 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.)`),Pi=u(),Bt=s("p"),qi=i("This model is also a PyTorch "),Vt=s("a"),Ei=i("torch.nn.Module"),Ci=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ai=u(),B=s("div"),z(Rt.$$.fragment),Oi=u(),ke=s("p"),Si=i("The "),Bo=s("a"),Li=i("NezhaForMaskedLM"),Ii=i(" forward method, overrides the "),Bn=s("code"),Di=i("__call__"),Wi=i(" special method."),Hi=u(),z(Ve.$$.fragment),Qi=u(),z(Re.$$.fragment),Ws=u(),we=s("h2"),Ze=s("a"),Vn=s("span"),z(Zt.$$.fragment),Ui=u(),Rn=s("span"),Bi=i("NezhaForNextSentencePrediction"),Hs=u(),E=s("div"),z(Jt.$$.fragment),Vi=u(),Kt=s("p"),Ri=i("Nezha Model with a "),Zn=s("code"),Zi=i("next sentence prediction (classification)"),Ji=i(" head on top."),Ki=u(),Gt=s("p"),Gi=i("This model inherits from "),Vo=s("a"),Xi=i("PreTrainedModel"),Yi=i(`. 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.)`),el=u(),Xt=s("p"),tl=i("This model is also a PyTorch "),Yt=s("a"),ol=i("torch.nn.Module"),nl=i(` 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(),V=s("div"),z(eo.$$.fragment),al=u(),Te=s("p"),rl=i("The "),Ro=s("a"),il=i("NezhaForNextSentencePrediction"),ll=i(" forward method, overrides the "),Jn=s("code"),dl=i("__call__"),cl=i(" special method."),hl=u(),z(Je.$$.fragment),pl=u(),z(Ke.$$.fragment),Qs=u(),$e=s("h2"),Ge=s("a"),Kn=s("span"),z(to.$$.fragment),ul=u(),Gn=s("span"),ml=i("NezhaForSequenceClassification"),Us=u(),C=s("div"),z(oo.$$.fragment),fl=u(),Xn=s("p"),gl=i(`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.`),_l=u(),no=s("p"),bl=i("This model inherits from "),Zo=s("a"),vl=i("PreTrainedModel"),zl=i(`. 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.)`),kl=u(),so=s("p"),wl=i("This model is also a PyTorch "),ao=s("a"),Tl=i("torch.nn.Module"),$l=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),yl=u(),I=s("div"),z(ro.$$.fragment),Nl=u(),ye=s("p"),Ml=i("The "),Jo=s("a"),Fl=i("NezhaForSequenceClassification"),xl=i(" forward method, overrides the "),Yn=s("code"),jl=i("__call__"),Pl=i(" special method."),ql=u(),z(Xe.$$.fragment),El=u(),z(Ye.$$.fragment),Cl=u(),z(et.$$.fragment),Bs=u(),Ne=s("h2"),tt=s("a"),es=s("span"),z(io.$$.fragment),Al=u(),ts=s("span"),Ol=i("NezhaForMultipleChoice"),Vs=u(),A=s("div"),z(lo.$$.fragment),Sl=u(),os=s("p"),Ll=i(`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.`),Il=u(),co=s("p"),Dl=i("This model inherits from "),Ko=s("a"),Wl=i("PreTrainedModel"),Hl=i(`. 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.)`),Ql=u(),ho=s("p"),Ul=i("This model is also a PyTorch "),po=s("a"),Bl=i("torch.nn.Module"),Vl=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Rl=u(),R=s("div"),z(uo.$$.fragment),Zl=u(),Me=s("p"),Jl=i("The "),Go=s("a"),Kl=i("NezhaForMultipleChoice"),Gl=i(" forward method, overrides the "),ns=s("code"),Xl=i("__call__"),Yl=i(" special method."),ed=u(),z(ot.$$.fragment),td=u(),z(nt.$$.fragment),Rs=u(),Fe=s("h2"),st=s("a"),ss=s("span"),z(mo.$$.fragment),od=u(),as=s("span"),nd=i("NezhaForTokenClassification"),Zs=u(),O=s("div"),z(fo.$$.fragment),sd=u(),rs=s("p"),ad=i(`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.`),rd=u(),go=s("p"),id=i("This model inherits from "),Xo=s("a"),ld=i("PreTrainedModel"),dd=i(`. 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.)`),cd=u(),_o=s("p"),hd=i("This model is also a PyTorch "),bo=s("a"),pd=i("torch.nn.Module"),ud=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),md=u(),Z=s("div"),z(vo.$$.fragment),fd=u(),xe=s("p"),gd=i("The "),Yo=s("a"),_d=i("NezhaForTokenClassification"),bd=i(" forward method, overrides the "),is=s("code"),vd=i("__call__"),zd=i(" special method."),kd=u(),z(at.$$.fragment),wd=u(),z(rt.$$.fragment),Js=u(),je=s("h2"),it=s("a"),ls=s("span"),z(zo.$$.fragment),Td=u(),ds=s("span"),$d=i("NezhaForQuestionAnswering"),Ks=u(),S=s("div"),z(ko.$$.fragment),yd=u(),Pe=s("p"),Nd=i(`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 `),cs=s("code"),Md=i("span start logits"),Fd=i(" and "),hs=s("code"),xd=i("span end logits"),jd=i(")."),Pd=u(),wo=s("p"),qd=i("This model inherits from "),en=s("a"),Ed=i("PreTrainedModel"),Cd=i(`. 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.)`),Ad=u(),To=s("p"),Od=i("This model is also a PyTorch "),$o=s("a"),Sd=i("torch.nn.Module"),Ld=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Id=u(),J=s("div"),z(yo.$$.fragment),Dd=u(),qe=s("p"),Wd=i("The "),tn=s("a"),Hd=i("NezhaForQuestionAnswering"),Qd=i(" forward method, overrides the "),ps=s("code"),Ud=i("__call__"),Bd=i(" special method."),Vd=u(),z(lt.$$.fragment),Rd=u(),z(dt.$$.fragment),this.h()},l(o){const g=Ah('[data-svelte="svelte-1phssyn"]',document.head);d=a(g,"META",{name:!0,content:!0}),g.forEach(t),v=m(o),f=a(o,"H1",{class:!0});var No=r(f);h=a(No,"A",{id:!0,class:!0,href:!0});var us=r(h);_=a(us,"SPAN",{});var ms=r(_);k(n.$$.fragment,ms),ms.forEach(t),us.forEach(t),c=m(No),M=a(No,"SPAN",{});var fs=r(M);Na=l(fs,"Nezha"),fs.forEach(t),No.forEach(t),Ns=m(o),ce=a(o,"H2",{class:!0});var Mo=r(ce);Ce=a(Mo,"A",{id:!0,class:!0,href:!0});var gs=r(Ce);fn=a(gs,"SPAN",{});var _s=r(fn);k(vt.$$.fragment,_s),_s.forEach(t),gs.forEach(t),Ma=m(Mo),gn=a(Mo,"SPAN",{});var bs=r(gn);Fa=l(bs,"Overview"),bs.forEach(t),Mo.forEach(t),Ms=m(o),Ae=a(o,"P",{});var Fo=r(Ae);xa=l(Fo,"The Nezha model was proposed in "),zt=a(Fo,"A",{href:!0,rel:!0});var vs=r(zt);ja=l(vs,"NEZHA: Neural Contextualized Representation for Chinese Language Understanding"),vs.forEach(t),Pa=l(Fo," by Junqiu Wei et al."),Fo.forEach(t),Fs=m(o),jo=a(o,"P",{});var zs=r(jo);qa=l(zs,"The abstract from the paper is the following:"),zs.forEach(t),xs=m(o),Po=a(o,"P",{});var ks=r(Po);_n=a(ks,"EM",{});var ws=r(_n);Ea=l(ws,`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).`),ws.forEach(t),ks.forEach(t),js=m(o),G=a(o,"P",{});var Ee=r(G);Ca=l(Ee,"This model was contributed by "),kt=a(Ee,"A",{href:!0,rel:!0});var Ts=r(kt);Aa=l(Ts,"sijunhe"),Ts.forEach(t),Oa=l(Ee,". The original code can be found "),wt=a(Ee,"A",{href:!0,rel:!0});var $s=r(wt);Sa=l($s,"here"),$s.forEach(t),La=l(Ee,"."),Ee.forEach(t),Ps=m(o),he=a(o,"H2",{class:!0});var xo=r(he);Oe=a(xo,"A",{id:!0,class:!0,href:!0});var ys=r(Oe);bn=a(ys,"SPAN",{});var Zd=r(bn);k(Tt.$$.fragment,Zd),Zd.forEach(t),ys.forEach(t),Ia=m(xo),vn=a(xo,"SPAN",{});var Jd=r(vn);Da=l(Jd,"Documentation resources"),Jd.forEach(t),xo.forEach(t),qs=m(o),L=a(o,"UL",{});var X=r(L);zn=a(X,"LI",{});var Kd=r(zn);qo=a(Kd,"A",{href:!0});var Gd=r(qo);Wa=l(Gd,"Text classification task guide"),Gd.forEach(t),Kd.forEach(t),Ha=m(X),kn=a(X,"LI",{});var Xd=r(kn);Eo=a(Xd,"A",{href:!0});var Yd=r(Eo);Qa=l(Yd,"Token classification task guide"),Yd.forEach(t),Xd.forEach(t),Ua=m(X),wn=a(X,"LI",{});var ec=r(wn);Co=a(ec,"A",{href:!0});var tc=r(Co);Ba=l(tc,"Question answering task guide"),tc.forEach(t),ec.forEach(t),Va=m(X),Tn=a(X,"LI",{});var oc=r(Tn);Ao=a(oc,"A",{href:!0});var nc=r(Ao);Ra=l(nc,"Masked language modeling task guide"),nc.forEach(t),oc.forEach(t),Za=m(X),$n=a(X,"LI",{});var sc=r($n);Oo=a(sc,"A",{href:!0});var ac=r(Oo);Ja=l(ac,"Multiple choice task guide"),ac.forEach(t),sc.forEach(t),X.forEach(t),Es=m(o),pe=a(o,"H2",{class:!0});var Xs=r(pe);Se=a(Xs,"A",{id:!0,class:!0,href:!0});var rc=r(Se);yn=a(rc,"SPAN",{});var ic=r(yn);k($t.$$.fragment,ic),ic.forEach(t),rc.forEach(t),Ka=m(Xs),Nn=a(Xs,"SPAN",{});var lc=r(Nn);Ga=l(lc,"NezhaConfig"),lc.forEach(t),Xs.forEach(t),Cs=m(o),H=a(o,"DIV",{class:!0});var ct=r(H);k(yt.$$.fragment,ct),Xa=m(ct),ue=a(ct,"P",{});var on=r(ue);Ya=l(on,"This is the configuration class to store the configuration of an "),So=a(on,"A",{href:!0});var dc=r(So);er=l(dc,"NezhaModel"),dc.forEach(t),tr=l(on,`. 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
`),Nt=a(on,"A",{href:!0,rel:!0});var cc=r(Nt);or=l(cc,"sijunhe/nezha-cn-base"),cc.forEach(t),nr=l(on," architecture."),on.forEach(t),sr=m(ct),me=a(ct,"P",{});var nn=r(me);ar=l(nn,"Configuration objects inherit from "),Lo=a(nn,"A",{href:!0});var hc=r(Lo);rr=l(hc,"PretrainedConfig"),hc.forEach(t),ir=l(nn,` and can be used to control the model outputs. Read the
documentation from `),Io=a(nn,"A",{href:!0});var pc=r(Io);lr=l(pc,"PretrainedConfig"),pc.forEach(t),dr=l(nn," for more information."),nn.forEach(t),cr=m(ct),k(Le.$$.fragment,ct),ct.forEach(t),As=m(o),fe=a(o,"H2",{class:!0});var Ys=r(fe);Ie=a(Ys,"A",{id:!0,class:!0,href:!0});var uc=r(Ie);Mn=a(uc,"SPAN",{});var mc=r(Mn);k(Mt.$$.fragment,mc),mc.forEach(t),uc.forEach(t),hr=m(Ys),Fn=a(Ys,"SPAN",{});var fc=r(Fn);pr=l(fc,"NezhaModel"),fc.forEach(t),Ys.forEach(t),Os=m(o),F=a(o,"DIV",{class:!0});var D=r(F);k(Ft.$$.fragment,D),ur=m(D),xn=a(D,"P",{});var gc=r(xn);mr=l(gc,"The bare Nezha Model transformer outputting raw hidden-states without any specific head on top."),gc.forEach(t),fr=m(D),xt=a(D,"P",{});var ea=r(xt);gr=l(ea,"This model inherits from "),Do=a(ea,"A",{href:!0});var _c=r(Do);_r=l(_c,"PreTrainedModel"),_c.forEach(t),br=l(ea,`. 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.)`),ea.forEach(t),vr=m(D),jt=a(D,"P",{});var ta=r(jt);zr=l(ta,"This model is also a PyTorch "),Pt=a(ta,"A",{href:!0,rel:!0});var bc=r(Pt);kr=l(bc,"torch.nn.Module"),bc.forEach(t),wr=l(ta,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ta.forEach(t),Tr=m(D),qt=a(D,"P",{});var oa=r(qt);$r=l(oa,`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 `),Et=a(oa,"A",{href:!0,rel:!0});var vc=r(Et);yr=l(vc,`Attention is
all you need`),vc.forEach(t),Nr=l(oa,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),oa.forEach(t),Mr=m(D),x=a(D,"P",{});var W=r(x);Fr=l(W,"To behave as an decoder the model needs to be initialized with the "),jn=a(W,"CODE",{});var zc=r(jn);xr=l(zc,"is_decoder"),zc.forEach(t),jr=l(W,` argument of the configuration set
to `),Pn=a(W,"CODE",{});var kc=r(Pn);Pr=l(kc,"True"),kc.forEach(t),qr=l(W,". To be used in a Seq2Seq model, the model needs to initialized with both "),qn=a(W,"CODE",{});var wc=r(qn);Er=l(wc,"is_decoder"),wc.forEach(t),Cr=l(W,` argument and
`),En=a(W,"CODE",{});var Tc=r(En);Ar=l(Tc,"add_cross_attention"),Tc.forEach(t),Or=l(W," set to "),Cn=a(W,"CODE",{});var $c=r(Cn);Sr=l($c,"True"),$c.forEach(t),Lr=l(W,"; an "),An=a(W,"CODE",{});var yc=r(An);Ir=l(yc,"encoder_hidden_states"),yc.forEach(t),Dr=l(W," is then expected as an input to the forward pass."),W.forEach(t),Wr=m(D),Q=a(D,"DIV",{class:!0});var ht=r(Q);k(Ct.$$.fragment,ht),Hr=m(ht),ge=a(ht,"P",{});var sn=r(ge);Qr=l(sn,"The "),Wo=a(sn,"A",{href:!0});var Nc=r(Wo);Ur=l(Nc,"NezhaModel"),Nc.forEach(t),Br=l(sn," forward method, overrides the "),On=a(sn,"CODE",{});var Mc=r(On);Vr=l(Mc,"__call__"),Mc.forEach(t),Rr=l(sn," special method."),sn.forEach(t),Zr=m(ht),k(De.$$.fragment,ht),Jr=m(ht),k(We.$$.fragment,ht),ht.forEach(t),D.forEach(t),Ss=m(o),_e=a(o,"H2",{class:!0});var na=r(_e);He=a(na,"A",{id:!0,class:!0,href:!0});var Fc=r(He);Sn=a(Fc,"SPAN",{});var xc=r(Sn);k(At.$$.fragment,xc),xc.forEach(t),Fc.forEach(t),Kr=m(na),Ln=a(na,"SPAN",{});var jc=r(Ln);Gr=l(jc,"NezhaForPreTraining"),jc.forEach(t),na.forEach(t),Ls=m(o),P=a(o,"DIV",{class:!0});var Y=r(P);k(Ot.$$.fragment,Y),Xr=m(Y),be=a(Y,"P",{});var an=r(be);Yr=l(an,"Nezha Model with two heads on top as done during the pretraining: a "),In=a(an,"CODE",{});var Pc=r(In);ei=l(Pc,"masked language modeling"),Pc.forEach(t),ti=l(an," head and a "),Dn=a(an,"CODE",{});var qc=r(Dn);oi=l(qc,"next sentence prediction (classification)"),qc.forEach(t),ni=l(an," head."),an.forEach(t),si=m(Y),St=a(Y,"P",{});var sa=r(St);ai=l(sa,"This model inherits from "),Ho=a(sa,"A",{href:!0});var Ec=r(Ho);ri=l(Ec,"PreTrainedModel"),Ec.forEach(t),ii=l(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(t),li=m(Y),Lt=a(Y,"P",{});var aa=r(Lt);di=l(aa,"This model is also a PyTorch "),It=a(aa,"A",{href:!0,rel:!0});var Cc=r(It);ci=l(Cc,"torch.nn.Module"),Cc.forEach(t),hi=l(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(t),pi=m(Y),U=a(Y,"DIV",{class:!0});var pt=r(U);k(Dt.$$.fragment,pt),ui=m(pt),ve=a(pt,"P",{});var rn=r(ve);mi=l(rn,"The "),Qo=a(rn,"A",{href:!0});var Ac=r(Qo);fi=l(Ac,"NezhaForPreTraining"),Ac.forEach(t),gi=l(rn," forward method, overrides the "),Wn=a(rn,"CODE",{});var Oc=r(Wn);_i=l(Oc,"__call__"),Oc.forEach(t),bi=l(rn," special method."),rn.forEach(t),vi=m(pt),k(Qe.$$.fragment,pt),zi=m(pt),k(Ue.$$.fragment,pt),pt.forEach(t),Y.forEach(t),Is=m(o),ze=a(o,"H2",{class:!0});var ra=r(ze);Be=a(ra,"A",{id:!0,class:!0,href:!0});var Sc=r(Be);Hn=a(Sc,"SPAN",{});var Lc=r(Hn);k(Wt.$$.fragment,Lc),Lc.forEach(t),Sc.forEach(t),ki=m(ra),Qn=a(ra,"SPAN",{});var Ic=r(Qn);wi=l(Ic,"NezhaForMaskedLM"),Ic.forEach(t),ra.forEach(t),Ds=m(o),q=a(o,"DIV",{class:!0});var ee=r(q);k(Ht.$$.fragment,ee),Ti=m(ee),Qt=a(ee,"P",{});var ia=r(Qt);$i=l(ia,"Nezha Model with a "),Un=a(ia,"CODE",{});var Dc=r(Un);yi=l(Dc,"language modeling"),Dc.forEach(t),Ni=l(ia," head on top."),ia.forEach(t),Mi=m(ee),Ut=a(ee,"P",{});var la=r(Ut);Fi=l(la,"This model inherits from "),Uo=a(la,"A",{href:!0});var Wc=r(Uo);xi=l(Wc,"PreTrainedModel"),Wc.forEach(t),ji=l(la,`. 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.)`),la.forEach(t),Pi=m(ee),Bt=a(ee,"P",{});var da=r(Bt);qi=l(da,"This model is also a PyTorch "),Vt=a(da,"A",{href:!0,rel:!0});var Hc=r(Vt);Ei=l(Hc,"torch.nn.Module"),Hc.forEach(t),Ci=l(da,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),da.forEach(t),Ai=m(ee),B=a(ee,"DIV",{class:!0});var ut=r(B);k(Rt.$$.fragment,ut),Oi=m(ut),ke=a(ut,"P",{});var ln=r(ke);Si=l(ln,"The "),Bo=a(ln,"A",{href:!0});var Qc=r(Bo);Li=l(Qc,"NezhaForMaskedLM"),Qc.forEach(t),Ii=l(ln," forward method, overrides the "),Bn=a(ln,"CODE",{});var Uc=r(Bn);Di=l(Uc,"__call__"),Uc.forEach(t),Wi=l(ln," special method."),ln.forEach(t),Hi=m(ut),k(Ve.$$.fragment,ut),Qi=m(ut),k(Re.$$.fragment,ut),ut.forEach(t),ee.forEach(t),Ws=m(o),we=a(o,"H2",{class:!0});var ca=r(we);Ze=a(ca,"A",{id:!0,class:!0,href:!0});var Bc=r(Ze);Vn=a(Bc,"SPAN",{});var Vc=r(Vn);k(Zt.$$.fragment,Vc),Vc.forEach(t),Bc.forEach(t),Ui=m(ca),Rn=a(ca,"SPAN",{});var Rc=r(Rn);Bi=l(Rc,"NezhaForNextSentencePrediction"),Rc.forEach(t),ca.forEach(t),Hs=m(o),E=a(o,"DIV",{class:!0});var te=r(E);k(Jt.$$.fragment,te),Vi=m(te),Kt=a(te,"P",{});var ha=r(Kt);Ri=l(ha,"Nezha Model with a "),Zn=a(ha,"CODE",{});var Zc=r(Zn);Zi=l(Zc,"next sentence prediction (classification)"),Zc.forEach(t),Ji=l(ha," head on top."),ha.forEach(t),Ki=m(te),Gt=a(te,"P",{});var pa=r(Gt);Gi=l(pa,"This model inherits from "),Vo=a(pa,"A",{href:!0});var Jc=r(Vo);Xi=l(Jc,"PreTrainedModel"),Jc.forEach(t),Yi=l(pa,`. 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.)`),pa.forEach(t),el=m(te),Xt=a(te,"P",{});var ua=r(Xt);tl=l(ua,"This model is also a PyTorch "),Yt=a(ua,"A",{href:!0,rel:!0});var Kc=r(Yt);ol=l(Kc,"torch.nn.Module"),Kc.forEach(t),nl=l(ua,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ua.forEach(t),sl=m(te),V=a(te,"DIV",{class:!0});var mt=r(V);k(eo.$$.fragment,mt),al=m(mt),Te=a(mt,"P",{});var dn=r(Te);rl=l(dn,"The "),Ro=a(dn,"A",{href:!0});var Gc=r(Ro);il=l(Gc,"NezhaForNextSentencePrediction"),Gc.forEach(t),ll=l(dn," forward method, overrides the "),Jn=a(dn,"CODE",{});var Xc=r(Jn);dl=l(Xc,"__call__"),Xc.forEach(t),cl=l(dn," special method."),dn.forEach(t),hl=m(mt),k(Je.$$.fragment,mt),pl=m(mt),k(Ke.$$.fragment,mt),mt.forEach(t),te.forEach(t),Qs=m(o),$e=a(o,"H2",{class:!0});var ma=r($e);Ge=a(ma,"A",{id:!0,class:!0,href:!0});var Yc=r(Ge);Kn=a(Yc,"SPAN",{});var eh=r(Kn);k(to.$$.fragment,eh),eh.forEach(t),Yc.forEach(t),ul=m(ma),Gn=a(ma,"SPAN",{});var th=r(Gn);ml=l(th,"NezhaForSequenceClassification"),th.forEach(t),ma.forEach(t),Us=m(o),C=a(o,"DIV",{class:!0});var oe=r(C);k(oo.$$.fragment,oe),fl=m(oe),Xn=a(oe,"P",{});var oh=r(Xn);gl=l(oh,`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.`),oh.forEach(t),_l=m(oe),no=a(oe,"P",{});var fa=r(no);bl=l(fa,"This model inherits from "),Zo=a(fa,"A",{href:!0});var nh=r(Zo);vl=l(nh,"PreTrainedModel"),nh.forEach(t),zl=l(fa,`. 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.)`),fa.forEach(t),kl=m(oe),so=a(oe,"P",{});var ga=r(so);wl=l(ga,"This model is also a PyTorch "),ao=a(ga,"A",{href:!0,rel:!0});var sh=r(ao);Tl=l(sh,"torch.nn.Module"),sh.forEach(t),$l=l(ga,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ga.forEach(t),yl=m(oe),I=a(oe,"DIV",{class:!0});var ne=r(I);k(ro.$$.fragment,ne),Nl=m(ne),ye=a(ne,"P",{});var cn=r(ye);Ml=l(cn,"The "),Jo=a(cn,"A",{href:!0});var ah=r(Jo);Fl=l(ah,"NezhaForSequenceClassification"),ah.forEach(t),xl=l(cn," forward method, overrides the "),Yn=a(cn,"CODE",{});var rh=r(Yn);jl=l(rh,"__call__"),rh.forEach(t),Pl=l(cn," special method."),cn.forEach(t),ql=m(ne),k(Xe.$$.fragment,ne),El=m(ne),k(Ye.$$.fragment,ne),Cl=m(ne),k(et.$$.fragment,ne),ne.forEach(t),oe.forEach(t),Bs=m(o),Ne=a(o,"H2",{class:!0});var _a=r(Ne);tt=a(_a,"A",{id:!0,class:!0,href:!0});var ih=r(tt);es=a(ih,"SPAN",{});var lh=r(es);k(io.$$.fragment,lh),lh.forEach(t),ih.forEach(t),Al=m(_a),ts=a(_a,"SPAN",{});var dh=r(ts);Ol=l(dh,"NezhaForMultipleChoice"),dh.forEach(t),_a.forEach(t),Vs=m(o),A=a(o,"DIV",{class:!0});var se=r(A);k(lo.$$.fragment,se),Sl=m(se),os=a(se,"P",{});var ch=r(os);Ll=l(ch,`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.`),ch.forEach(t),Il=m(se),co=a(se,"P",{});var ba=r(co);Dl=l(ba,"This model inherits from "),Ko=a(ba,"A",{href:!0});var hh=r(Ko);Wl=l(hh,"PreTrainedModel"),hh.forEach(t),Hl=l(ba,`. 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.)`),ba.forEach(t),Ql=m(se),ho=a(se,"P",{});var va=r(ho);Ul=l(va,"This model is also a PyTorch "),po=a(va,"A",{href:!0,rel:!0});var ph=r(po);Bl=l(ph,"torch.nn.Module"),ph.forEach(t),Vl=l(va,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),va.forEach(t),Rl=m(se),R=a(se,"DIV",{class:!0});var ft=r(R);k(uo.$$.fragment,ft),Zl=m(ft),Me=a(ft,"P",{});var hn=r(Me);Jl=l(hn,"The "),Go=a(hn,"A",{href:!0});var uh=r(Go);Kl=l(uh,"NezhaForMultipleChoice"),uh.forEach(t),Gl=l(hn," forward method, overrides the "),ns=a(hn,"CODE",{});var mh=r(ns);Xl=l(mh,"__call__"),mh.forEach(t),Yl=l(hn," special method."),hn.forEach(t),ed=m(ft),k(ot.$$.fragment,ft),td=m(ft),k(nt.$$.fragment,ft),ft.forEach(t),se.forEach(t),Rs=m(o),Fe=a(o,"H2",{class:!0});var za=r(Fe);st=a(za,"A",{id:!0,class:!0,href:!0});var fh=r(st);ss=a(fh,"SPAN",{});var gh=r(ss);k(mo.$$.fragment,gh),gh.forEach(t),fh.forEach(t),od=m(za),as=a(za,"SPAN",{});var _h=r(as);nd=l(_h,"NezhaForTokenClassification"),_h.forEach(t),za.forEach(t),Zs=m(o),O=a(o,"DIV",{class:!0});var ae=r(O);k(fo.$$.fragment,ae),sd=m(ae),rs=a(ae,"P",{});var bh=r(rs);ad=l(bh,`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.`),bh.forEach(t),rd=m(ae),go=a(ae,"P",{});var ka=r(go);id=l(ka,"This model inherits from "),Xo=a(ka,"A",{href:!0});var vh=r(Xo);ld=l(vh,"PreTrainedModel"),vh.forEach(t),dd=l(ka,`. 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.)`),ka.forEach(t),cd=m(ae),_o=a(ae,"P",{});var wa=r(_o);hd=l(wa,"This model is also a PyTorch "),bo=a(wa,"A",{href:!0,rel:!0});var zh=r(bo);pd=l(zh,"torch.nn.Module"),zh.forEach(t),ud=l(wa,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),wa.forEach(t),md=m(ae),Z=a(ae,"DIV",{class:!0});var gt=r(Z);k(vo.$$.fragment,gt),fd=m(gt),xe=a(gt,"P",{});var pn=r(xe);gd=l(pn,"The "),Yo=a(pn,"A",{href:!0});var kh=r(Yo);_d=l(kh,"NezhaForTokenClassification"),kh.forEach(t),bd=l(pn," forward method, overrides the "),is=a(pn,"CODE",{});var wh=r(is);vd=l(wh,"__call__"),wh.forEach(t),zd=l(pn," special method."),pn.forEach(t),kd=m(gt),k(at.$$.fragment,gt),wd=m(gt),k(rt.$$.fragment,gt),gt.forEach(t),ae.forEach(t),Js=m(o),je=a(o,"H2",{class:!0});var Ta=r(je);it=a(Ta,"A",{id:!0,class:!0,href:!0});var Th=r(it);ls=a(Th,"SPAN",{});var $h=r(ls);k(zo.$$.fragment,$h),$h.forEach(t),Th.forEach(t),Td=m(Ta),ds=a(Ta,"SPAN",{});var yh=r(ds);$d=l(yh,"NezhaForQuestionAnswering"),yh.forEach(t),Ta.forEach(t),Ks=m(o),S=a(o,"DIV",{class:!0});var re=r(S);k(ko.$$.fragment,re),yd=m(re),Pe=a(re,"P",{});var un=r(Pe);Nd=l(un,`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 `),cs=a(un,"CODE",{});var Nh=r(cs);Md=l(Nh,"span start logits"),Nh.forEach(t),Fd=l(un," and "),hs=a(un,"CODE",{});var Mh=r(hs);xd=l(Mh,"span end logits"),Mh.forEach(t),jd=l(un,")."),un.forEach(t),Pd=m(re),wo=a(re,"P",{});var $a=r(wo);qd=l($a,"This model inherits from "),en=a($a,"A",{href:!0});var Fh=r(en);Ed=l(Fh,"PreTrainedModel"),Fh.forEach(t),Cd=l($a,`. 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.)`),$a.forEach(t),Ad=m(re),To=a(re,"P",{});var ya=r(To);Od=l(ya,"This model is also a PyTorch "),$o=a(ya,"A",{href:!0,rel:!0});var xh=r($o);Sd=l(xh,"torch.nn.Module"),xh.forEach(t),Ld=l(ya,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ya.forEach(t),Id=m(re),J=a(re,"DIV",{class:!0});var _t=r(J);k(yo.$$.fragment,_t),Dd=m(_t),qe=a(_t,"P",{});var mn=r(qe);Wd=l(mn,"The "),tn=a(mn,"A",{href:!0});var jh=r(tn);Hd=l(jh,"NezhaForQuestionAnswering"),jh.forEach(t),Qd=l(mn," forward method, overrides the "),ps=a(mn,"CODE",{});var Ph=r(ps);Ud=l(Ph,"__call__"),Ph.forEach(t),Bd=l(mn," special method."),mn.forEach(t),Vd=m(_t),k(lt.$$.fragment,_t),Rd=m(_t),k(dt.$$.fragment,_t),_t.forEach(t),re.forEach(t),this.h()},h(){p(d,"name","hf:doc:metadata"),p(d,"content",JSON.stringify(op)),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(f,"class","relative group"),p(Ce,"id","overview"),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","#overview"),p(ce,"class","relative group"),p(zt,"href","https://arxiv.org/abs/1909.00204"),p(zt,"rel","nofollow"),p(kt,"href","https://huggingface.co/sijunhe"),p(kt,"rel","nofollow"),p(wt,"href","https://github.com/huawei-noah/Pretrained-Language-Model/tree/master/NEZHA-PyTorch"),p(wt,"rel","nofollow"),p(Oe,"id","documentation-resources"),p(Oe,"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(Oe,"href","#documentation-resources"),p(he,"class","relative group"),p(qo,"href","../tasks/sequence_classification"),p(Eo,"href","../tasks/token_classification"),p(Co,"href","../tasks/question_answering"),p(Ao,"href","../tasks/masked_language_modeling"),p(Oo,"href","../tasks/multiple_choice"),p(Se,"id","transformers.NezhaConfig"),p(Se,"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(Se,"href","#transformers.NezhaConfig"),p(pe,"class","relative group"),p(So,"href","/docs/transformers/v4.29.0/en/model_doc/nezha#transformers.NezhaModel"),p(Nt,"href","https://huggingface.co/sijunhe/nezha-cn-base"),p(Nt,"rel","nofollow"),p(Lo,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),p(Io,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),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(Ie,"id","transformers.NezhaModel"),p(Ie,"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(Ie,"href","#transformers.NezhaModel"),p(fe,"class","relative group"),p(Do,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),p(Pt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Pt,"rel","nofollow"),p(Et,"href","https://arxiv.org/abs/1706.03762"),p(Et,"rel","nofollow"),p(Wo,"href","/docs/transformers/v4.29.0/en/model_doc/nezha#transformers.NezhaModel"),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(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(He,"id","transformers.NezhaForPreTraining"),p(He,"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(He,"href","#transformers.NezhaForPreTraining"),p(_e,"class","relative group"),p(Ho,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),p(It,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(It,"rel","nofollow"),p(Qo,"href","/docs/transformers/v4.29.0/en/model_doc/nezha#transformers.NezhaForPreTraining"),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(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(Be,"id","transformers.NezhaForMaskedLM"),p(Be,"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(Be,"href","#transformers.NezhaForMaskedLM"),p(ze,"class","relative group"),p(Uo,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),p(Vt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Vt,"rel","nofollow"),p(Bo,"href","/docs/transformers/v4.29.0/en/model_doc/nezha#transformers.NezhaForMaskedLM"),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(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(Ze,"id","transformers.NezhaForNextSentencePrediction"),p(Ze,"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(Ze,"href","#transformers.NezhaForNextSentencePrediction"),p(we,"class","relative group"),p(Vo,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),p(Yt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Yt,"rel","nofollow"),p(Ro,"href","/docs/transformers/v4.29.0/en/model_doc/nezha#transformers.NezhaForNextSentencePrediction"),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(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.NezhaForSequenceClassification"),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.NezhaForSequenceClassification"),p($e,"class","relative group"),p(Zo,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),p(ao,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(ao,"rel","nofollow"),p(Jo,"href","/docs/transformers/v4.29.0/en/model_doc/nezha#transformers.NezhaForSequenceClassification"),p(I,"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(tt,"id","transformers.NezhaForMultipleChoice"),p(tt,"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(tt,"href","#transformers.NezhaForMultipleChoice"),p(Ne,"class","relative group"),p(Ko,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),p(po,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(po,"rel","nofollow"),p(Go,"href","/docs/transformers/v4.29.0/en/model_doc/nezha#transformers.NezhaForMultipleChoice"),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(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(st,"id","transformers.NezhaForTokenClassification"),p(st,"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(st,"href","#transformers.NezhaForTokenClassification"),p(Fe,"class","relative group"),p(Xo,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),p(bo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(bo,"rel","nofollow"),p(Yo,"href","/docs/transformers/v4.29.0/en/model_doc/nezha#transformers.NezhaForTokenClassification"),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(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(it,"id","transformers.NezhaForQuestionAnswering"),p(it,"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(it,"href","#transformers.NezhaForQuestionAnswering"),p(je,"class","relative group"),p(en,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),p($o,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p($o,"rel","nofollow"),p(tn,"href","/docs/transformers/v4.29.0/en/model_doc/nezha#transformers.NezhaForQuestionAnswering"),p(J,"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(o,g){e(document.head,d),b(o,v,g),b(o,f,g),e(f,h),e(h,_),w(n,_,null),e(f,c),e(f,M),e(M,Na),b(o,Ns,g),b(o,ce,g),e(ce,Ce),e(Ce,fn),w(vt,fn,null),e(ce,Ma),e(ce,gn),e(gn,Fa),b(o,Ms,g),b(o,Ae,g),e(Ae,xa),e(Ae,zt),e(zt,ja),e(Ae,Pa),b(o,Fs,g),b(o,jo,g),e(jo,qa),b(o,xs,g),b(o,Po,g),e(Po,_n),e(_n,Ea),b(o,js,g),b(o,G,g),e(G,Ca),e(G,kt),e(kt,Aa),e(G,Oa),e(G,wt),e(wt,Sa),e(G,La),b(o,Ps,g),b(o,he,g),e(he,Oe),e(Oe,bn),w(Tt,bn,null),e(he,Ia),e(he,vn),e(vn,Da),b(o,qs,g),b(o,L,g),e(L,zn),e(zn,qo),e(qo,Wa),e(L,Ha),e(L,kn),e(kn,Eo),e(Eo,Qa),e(L,Ua),e(L,wn),e(wn,Co),e(Co,Ba),e(L,Va),e(L,Tn),e(Tn,Ao),e(Ao,Ra),e(L,Za),e(L,$n),e($n,Oo),e(Oo,Ja),b(o,Es,g),b(o,pe,g),e(pe,Se),e(Se,yn),w($t,yn,null),e(pe,Ka),e(pe,Nn),e(Nn,Ga),b(o,Cs,g),b(o,H,g),w(yt,H,null),e(H,Xa),e(H,ue),e(ue,Ya),e(ue,So),e(So,er),e(ue,tr),e(ue,Nt),e(Nt,or),e(ue,nr),e(H,sr),e(H,me),e(me,ar),e(me,Lo),e(Lo,rr),e(me,ir),e(me,Io),e(Io,lr),e(me,dr),e(H,cr),w(Le,H,null),b(o,As,g),b(o,fe,g),e(fe,Ie),e(Ie,Mn),w(Mt,Mn,null),e(fe,hr),e(fe,Fn),e(Fn,pr),b(o,Os,g),b(o,F,g),w(Ft,F,null),e(F,ur),e(F,xn),e(xn,mr),e(F,fr),e(F,xt),e(xt,gr),e(xt,Do),e(Do,_r),e(xt,br),e(F,vr),e(F,jt),e(jt,zr),e(jt,Pt),e(Pt,kr),e(jt,wr),e(F,Tr),e(F,qt),e(qt,$r),e(qt,Et),e(Et,yr),e(qt,Nr),e(F,Mr),e(F,x),e(x,Fr),e(x,jn),e(jn,xr),e(x,jr),e(x,Pn),e(Pn,Pr),e(x,qr),e(x,qn),e(qn,Er),e(x,Cr),e(x,En),e(En,Ar),e(x,Or),e(x,Cn),e(Cn,Sr),e(x,Lr),e(x,An),e(An,Ir),e(x,Dr),e(F,Wr),e(F,Q),w(Ct,Q,null),e(Q,Hr),e(Q,ge),e(ge,Qr),e(ge,Wo),e(Wo,Ur),e(ge,Br),e(ge,On),e(On,Vr),e(ge,Rr),e(Q,Zr),w(De,Q,null),e(Q,Jr),w(We,Q,null),b(o,Ss,g),b(o,_e,g),e(_e,He),e(He,Sn),w(At,Sn,null),e(_e,Kr),e(_e,Ln),e(Ln,Gr),b(o,Ls,g),b(o,P,g),w(Ot,P,null),e(P,Xr),e(P,be),e(be,Yr),e(be,In),e(In,ei),e(be,ti),e(be,Dn),e(Dn,oi),e(be,ni),e(P,si),e(P,St),e(St,ai),e(St,Ho),e(Ho,ri),e(St,ii),e(P,li),e(P,Lt),e(Lt,di),e(Lt,It),e(It,ci),e(Lt,hi),e(P,pi),e(P,U),w(Dt,U,null),e(U,ui),e(U,ve),e(ve,mi),e(ve,Qo),e(Qo,fi),e(ve,gi),e(ve,Wn),e(Wn,_i),e(ve,bi),e(U,vi),w(Qe,U,null),e(U,zi),w(Ue,U,null),b(o,Is,g),b(o,ze,g),e(ze,Be),e(Be,Hn),w(Wt,Hn,null),e(ze,ki),e(ze,Qn),e(Qn,wi),b(o,Ds,g),b(o,q,g),w(Ht,q,null),e(q,Ti),e(q,Qt),e(Qt,$i),e(Qt,Un),e(Un,yi),e(Qt,Ni),e(q,Mi),e(q,Ut),e(Ut,Fi),e(Ut,Uo),e(Uo,xi),e(Ut,ji),e(q,Pi),e(q,Bt),e(Bt,qi),e(Bt,Vt),e(Vt,Ei),e(Bt,Ci),e(q,Ai),e(q,B),w(Rt,B,null),e(B,Oi),e(B,ke),e(ke,Si),e(ke,Bo),e(Bo,Li),e(ke,Ii),e(ke,Bn),e(Bn,Di),e(ke,Wi),e(B,Hi),w(Ve,B,null),e(B,Qi),w(Re,B,null),b(o,Ws,g),b(o,we,g),e(we,Ze),e(Ze,Vn),w(Zt,Vn,null),e(we,Ui),e(we,Rn),e(Rn,Bi),b(o,Hs,g),b(o,E,g),w(Jt,E,null),e(E,Vi),e(E,Kt),e(Kt,Ri),e(Kt,Zn),e(Zn,Zi),e(Kt,Ji),e(E,Ki),e(E,Gt),e(Gt,Gi),e(Gt,Vo),e(Vo,Xi),e(Gt,Yi),e(E,el),e(E,Xt),e(Xt,tl),e(Xt,Yt),e(Yt,ol),e(Xt,nl),e(E,sl),e(E,V),w(eo,V,null),e(V,al),e(V,Te),e(Te,rl),e(Te,Ro),e(Ro,il),e(Te,ll),e(Te,Jn),e(Jn,dl),e(Te,cl),e(V,hl),w(Je,V,null),e(V,pl),w(Ke,V,null),b(o,Qs,g),b(o,$e,g),e($e,Ge),e(Ge,Kn),w(to,Kn,null),e($e,ul),e($e,Gn),e(Gn,ml),b(o,Us,g),b(o,C,g),w(oo,C,null),e(C,fl),e(C,Xn),e(Xn,gl),e(C,_l),e(C,no),e(no,bl),e(no,Zo),e(Zo,vl),e(no,zl),e(C,kl),e(C,so),e(so,wl),e(so,ao),e(ao,Tl),e(so,$l),e(C,yl),e(C,I),w(ro,I,null),e(I,Nl),e(I,ye),e(ye,Ml),e(ye,Jo),e(Jo,Fl),e(ye,xl),e(ye,Yn),e(Yn,jl),e(ye,Pl),e(I,ql),w(Xe,I,null),e(I,El),w(Ye,I,null),e(I,Cl),w(et,I,null),b(o,Bs,g),b(o,Ne,g),e(Ne,tt),e(tt,es),w(io,es,null),e(Ne,Al),e(Ne,ts),e(ts,Ol),b(o,Vs,g),b(o,A,g),w(lo,A,null),e(A,Sl),e(A,os),e(os,Ll),e(A,Il),e(A,co),e(co,Dl),e(co,Ko),e(Ko,Wl),e(co,Hl),e(A,Ql),e(A,ho),e(ho,Ul),e(ho,po),e(po,Bl),e(ho,Vl),e(A,Rl),e(A,R),w(uo,R,null),e(R,Zl),e(R,Me),e(Me,Jl),e(Me,Go),e(Go,Kl),e(Me,Gl),e(Me,ns),e(ns,Xl),e(Me,Yl),e(R,ed),w(ot,R,null),e(R,td),w(nt,R,null),b(o,Rs,g),b(o,Fe,g),e(Fe,st),e(st,ss),w(mo,ss,null),e(Fe,od),e(Fe,as),e(as,nd),b(o,Zs,g),b(o,O,g),w(fo,O,null),e(O,sd),e(O,rs),e(rs,ad),e(O,rd),e(O,go),e(go,id),e(go,Xo),e(Xo,ld),e(go,dd),e(O,cd),e(O,_o),e(_o,hd),e(_o,bo),e(bo,pd),e(_o,ud),e(O,md),e(O,Z),w(vo,Z,null),e(Z,fd),e(Z,xe),e(xe,gd),e(xe,Yo),e(Yo,_d),e(xe,bd),e(xe,is),e(is,vd),e(xe,zd),e(Z,kd),w(at,Z,null),e(Z,wd),w(rt,Z,null),b(o,Js,g),b(o,je,g),e(je,it),e(it,ls),w(zo,ls,null),e(je,Td),e(je,ds),e(ds,$d),b(o,Ks,g),b(o,S,g),w(ko,S,null),e(S,yd),e(S,Pe),e(Pe,Nd),e(Pe,cs),e(cs,Md),e(Pe,Fd),e(Pe,hs),e(hs,xd),e(Pe,jd),e(S,Pd),e(S,wo),e(wo,qd),e(wo,en),e(en,Ed),e(wo,Cd),e(S,Ad),e(S,To),e(To,Od),e(To,$o),e($o,Sd),e(To,Ld),e(S,Id),e(S,J),w(yo,J,null),e(J,Dd),e(J,qe),e(qe,Wd),e(qe,tn),e(tn,Hd),e(qe,Qd),e(qe,ps),e(ps,Ud),e(qe,Bd),e(J,Vd),w(lt,J,null),e(J,Rd),w(dt,J,null),Gs=!0},p(o,[g]){const No={};g&2&&(No.$$scope={dirty:g,ctx:o}),Le.$set(No);const us={};g&2&&(us.$$scope={dirty:g,ctx:o}),De.$set(us);const ms={};g&2&&(ms.$$scope={dirty:g,ctx:o}),We.$set(ms);const fs={};g&2&&(fs.$$scope={dirty:g,ctx:o}),Qe.$set(fs);const Mo={};g&2&&(Mo.$$scope={dirty:g,ctx:o}),Ue.$set(Mo);const gs={};g&2&&(gs.$$scope={dirty:g,ctx:o}),Ve.$set(gs);const _s={};g&2&&(_s.$$scope={dirty:g,ctx:o}),Re.$set(_s);const bs={};g&2&&(bs.$$scope={dirty:g,ctx:o}),Je.$set(bs);const Fo={};g&2&&(Fo.$$scope={dirty:g,ctx:o}),Ke.$set(Fo);const vs={};g&2&&(vs.$$scope={dirty:g,ctx:o}),Xe.$set(vs);const zs={};g&2&&(zs.$$scope={dirty:g,ctx:o}),Ye.$set(zs);const ks={};g&2&&(ks.$$scope={dirty:g,ctx:o}),et.$set(ks);const ws={};g&2&&(ws.$$scope={dirty:g,ctx:o}),ot.$set(ws);const Ee={};g&2&&(Ee.$$scope={dirty:g,ctx:o}),nt.$set(Ee);const Ts={};g&2&&(Ts.$$scope={dirty:g,ctx:o}),at.$set(Ts);const $s={};g&2&&($s.$$scope={dirty:g,ctx:o}),rt.$set($s);const xo={};g&2&&(xo.$$scope={dirty:g,ctx:o}),lt.$set(xo);const ys={};g&2&&(ys.$$scope={dirty:g,ctx:o}),dt.$set(ys)},i(o){Gs||(T(n.$$.fragment,o),T(vt.$$.fragment,o),T(Tt.$$.fragment,o),T($t.$$.fragment,o),T(yt.$$.fragment,o),T(Le.$$.fragment,o),T(Mt.$$.fragment,o),T(Ft.$$.fragment,o),T(Ct.$$.fragment,o),T(De.$$.fragment,o),T(We.$$.fragment,o),T(At.$$.fragment,o),T(Ot.$$.fragment,o),T(Dt.$$.fragment,o),T(Qe.$$.fragment,o),T(Ue.$$.fragment,o),T(Wt.$$.fragment,o),T(Ht.$$.fragment,o),T(Rt.$$.fragment,o),T(Ve.$$.fragment,o),T(Re.$$.fragment,o),T(Zt.$$.fragment,o),T(Jt.$$.fragment,o),T(eo.$$.fragment,o),T(Je.$$.fragment,o),T(Ke.$$.fragment,o),T(to.$$.fragment,o),T(oo.$$.fragment,o),T(ro.$$.fragment,o),T(Xe.$$.fragment,o),T(Ye.$$.fragment,o),T(et.$$.fragment,o),T(io.$$.fragment,o),T(lo.$$.fragment,o),T(uo.$$.fragment,o),T(ot.$$.fragment,o),T(nt.$$.fragment,o),T(mo.$$.fragment,o),T(fo.$$.fragment,o),T(vo.$$.fragment,o),T(at.$$.fragment,o),T(rt.$$.fragment,o),T(zo.$$.fragment,o),T(ko.$$.fragment,o),T(yo.$$.fragment,o),T(lt.$$.fragment,o),T(dt.$$.fragment,o),Gs=!0)},o(o){$(n.$$.fragment,o),$(vt.$$.fragment,o),$(Tt.$$.fragment,o),$($t.$$.fragment,o),$(yt.$$.fragment,o),$(Le.$$.fragment,o),$(Mt.$$.fragment,o),$(Ft.$$.fragment,o),$(Ct.$$.fragment,o),$(De.$$.fragment,o),$(We.$$.fragment,o),$(At.$$.fragment,o),$(Ot.$$.fragment,o),$(Dt.$$.fragment,o),$(Qe.$$.fragment,o),$(Ue.$$.fragment,o),$(Wt.$$.fragment,o),$(Ht.$$.fragment,o),$(Rt.$$.fragment,o),$(Ve.$$.fragment,o),$(Re.$$.fragment,o),$(Zt.$$.fragment,o),$(Jt.$$.fragment,o),$(eo.$$.fragment,o),$(Je.$$.fragment,o),$(Ke.$$.fragment,o),$(to.$$.fragment,o),$(oo.$$.fragment,o),$(ro.$$.fragment,o),$(Xe.$$.fragment,o),$(Ye.$$.fragment,o),$(et.$$.fragment,o),$(io.$$.fragment,o),$(lo.$$.fragment,o),$(uo.$$.fragment,o),$(ot.$$.fragment,o),$(nt.$$.fragment,o),$(mo.$$.fragment,o),$(fo.$$.fragment,o),$(vo.$$.fragment,o),$(at.$$.fragment,o),$(rt.$$.fragment,o),$(zo.$$.fragment,o),$(ko.$$.fragment,o),$(yo.$$.fragment,o),$(lt.$$.fragment,o),$(dt.$$.fragment,o),Gs=!1},d(o){t(d),o&&t(v),o&&t(f),y(n),o&&t(Ns),o&&t(ce),y(vt),o&&t(Ms),o&&t(Ae),o&&t(Fs),o&&t(jo),o&&t(xs),o&&t(Po),o&&t(js),o&&t(G),o&&t(Ps),o&&t(he),y(Tt),o&&t(qs),o&&t(L),o&&t(Es),o&&t(pe),y($t),o&&t(Cs),o&&t(H),y(yt),y(Le),o&&t(As),o&&t(fe),y(Mt),o&&t(Os),o&&t(F),y(Ft),y(Ct),y(De),y(We),o&&t(Ss),o&&t(_e),y(At),o&&t(Ls),o&&t(P),y(Ot),y(Dt),y(Qe),y(Ue),o&&t(Is),o&&t(ze),y(Wt),o&&t(Ds),o&&t(q),y(Ht),y(Rt),y(Ve),y(Re),o&&t(Ws),o&&t(we),y(Zt),o&&t(Hs),o&&t(E),y(Jt),y(eo),y(Je),y(Ke),o&&t(Qs),o&&t($e),y(to),o&&t(Us),o&&t(C),y(oo),y(ro),y(Xe),y(Ye),y(et),o&&t(Bs),o&&t(Ne),y(io),o&&t(Vs),o&&t(A),y(lo),y(uo),y(ot),y(nt),o&&t(Rs),o&&t(Fe),y(mo),o&&t(Zs),o&&t(O),y(fo),y(vo),y(at),y(rt),o&&t(Js),o&&t(je),y(zo),o&&t(Ks),o&&t(S),y(ko),y(yo),y(lt),y(dt)}}}const op={local:"nezha",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{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 np(N){return Oh(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class cp extends qh{constructor(d){super();Eh(this,d,np,tp,Ch,{})}}export{cp as default,op as metadata};
