import{S as GC,i as XC,s as YC,e as o,k as c,w as T,t as r,M as ZC,c as n,d as t,m as p,a,x as b,h as i,b as m,N as JC,G as e,g,y as w,q as E,o as $,B as F,v as eP,L as Le}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ie}from"../../chunks/Tip-hf-doc-builder.js";import{D as N}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Oe}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as De}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ae}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function tP(x){let d,v,u,f,_;return f=new Oe({props:{code:`from transformers import ElectraConfig, ElectraModel

# Initializing a ELECTRA electra-base-uncased style configuration
configuration = ElectraConfig()

# Initializing a model (with random weights) from the electra-base-uncased style configuration
model = ElectraModel(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> ElectraConfig, ElectraModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ELECTRA electra-base-uncased style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = ElectraConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the electra-base-uncased style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ElectraModel(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=o("p"),v=r("Examples:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Examples:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function oP(x){let d,v,u,f,_;return f=new Oe({props:{code:`0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
| first sequence    | second sequence |`,highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){d=o("p"),v=r("sequence pair mask has the following format:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"sequence pair mask has the following format:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function nP(x){let d,v,u,f,_;return f=new Oe({props:{code:`0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
| first sequence    | second sequence |`,highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){d=o("p"),v=r("sequence pair mask has the following format:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"sequence pair mask has the following format:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function sP(x){let d,v,u,f,_;return{c(){d=o("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var z=a(u);f=i(z,"Module"),z.forEach(t),_=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,u),e(u,f),e(d,_)},d(l){l&&t(d)}}}function aP(x){let d,v,u,f,_;return f=new Oe({props:{code:`from transformers import AutoTokenizer, ElectraModel
import torch

tokenizer = AutoTokenizer.from_pretrained("google/electra-small-discriminator")
model = ElectraModel.from_pretrained("google/electra-small-discriminator")

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, ElectraModel
<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;google/electra-small-discriminator&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ElectraModel.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&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=o("p"),v=r("Example:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Example:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function rP(x){let d,v,u,f,_;return{c(){d=o("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var z=a(u);f=i(z,"Module"),z.forEach(t),_=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,u),e(u,f),e(d,_)},d(l){l&&t(d)}}}function iP(x){let d,v,u,f,_;return f=new Oe({props:{code:`from transformers import ElectraForPreTraining, AutoTokenizer
import torch

discriminator = ElectraForPreTraining.from_pretrained("google/electra-base-discriminator")
tokenizer = AutoTokenizer.from_pretrained("google/electra-base-discriminator")

sentence = "The quick brown fox jumps over the lazy dog"
fake_sentence = "The quick brown fox fake over the lazy dog"

fake_tokens = tokenizer.tokenize(fake_sentence, add_special_tokens=True)
fake_inputs = tokenizer.encode(fake_sentence, return_tensors="pt")
discriminator_outputs = discriminator(fake_inputs)
predictions = torch.round((torch.sign(discriminator_outputs[0]) + 1) / 2)

fake_tokens

predictions.squeeze().tolist()`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ElectraForPreTraining, AutoTokenizer
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>discriminator = ElectraForPreTraining.from_pretrained(<span class="hljs-string">&quot;google/electra-base-discriminator&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/electra-base-discriminator&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>sentence = <span class="hljs-string">&quot;The quick brown fox jumps over the lazy dog&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>fake_sentence = <span class="hljs-string">&quot;The quick brown fox fake over the lazy dog&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>fake_tokens = tokenizer.tokenize(fake_sentence, add_special_tokens=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>fake_inputs = tokenizer.encode(fake_sentence, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>discriminator_outputs = discriminator(fake_inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>predictions = torch.<span class="hljs-built_in">round</span>((torch.sign(discriminator_outputs[<span class="hljs-number">0</span>]) + <span class="hljs-number">1</span>) / <span class="hljs-number">2</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>fake_tokens
[<span class="hljs-string">&#x27;[CLS]&#x27;</span>, <span class="hljs-string">&#x27;the&#x27;</span>, <span class="hljs-string">&#x27;quick&#x27;</span>, <span class="hljs-string">&#x27;brown&#x27;</span>, <span class="hljs-string">&#x27;fox&#x27;</span>, <span class="hljs-string">&#x27;fake&#x27;</span>, <span class="hljs-string">&#x27;over&#x27;</span>, <span class="hljs-string">&#x27;the&#x27;</span>, <span class="hljs-string">&#x27;lazy&#x27;</span>, <span class="hljs-string">&#x27;dog&#x27;</span>, <span class="hljs-string">&#x27;[SEP]&#x27;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>predictions.squeeze().tolist()
[<span class="hljs-number">0.0</span>, <span class="hljs-number">0.0</span>, <span class="hljs-number">0.0</span>, <span class="hljs-number">0.0</span>, <span class="hljs-number">0.0</span>, <span class="hljs-number">1.0</span>, <span class="hljs-number">0.0</span>, <span class="hljs-number">0.0</span>, <span class="hljs-number">0.0</span>, <span class="hljs-number">0.0</span>, <span class="hljs-number">0.0</span>]`}}),{c(){d=o("p"),v=r("Examples:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Examples:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function lP(x){let d,v,u,f,_;return{c(){d=o("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var z=a(u);f=i(z,"Module"),z.forEach(t),_=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,u),e(u,f),e(d,_)},d(l){l&&t(d)}}}function dP(x){let d,v,u,f,_;return f=new Oe({props:{code:`from transformers import AutoTokenizer, ElectraForCausalLM, ElectraConfig
import torch

tokenizer = AutoTokenizer.from_pretrained("google/electra-base-generator")
config = ElectraConfig.from_pretrained("google/electra-base-generator")
config.is_decoder = True
model = ElectraForCausalLM.from_pretrained("google/electra-base-generator", config=config)

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

prediction_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, ElectraForCausalLM, ElectraConfig
<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;google/electra-base-generator&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>config = ElectraConfig.from_pretrained(<span class="hljs-string">&quot;google/electra-base-generator&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>config.is_decoder = <span class="hljs-literal">True</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ElectraForCausalLM.from_pretrained(<span class="hljs-string">&quot;google/electra-base-generator&quot;</span>, config=config)

<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.logits`}}),{c(){d=o("p"),v=r("Example:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Example:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function cP(x){let d,v,u,f,_;return{c(){d=o("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var z=a(u);f=i(z,"Module"),z.forEach(t),_=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,u),e(u,f),e(d,_)},d(l){l&&t(d)}}}function pP(x){let d,v,u,f,_;return f=new Oe({props:{code:`from transformers import AutoTokenizer, ElectraForMaskedLM
import torch

tokenizer = AutoTokenizer.from_pretrained("google/electra-small-generator")
model = ElectraForMaskedLM.from_pretrained("google/electra-small-generator")

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)
tokenizer.decode(predicted_token_id)

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)
round(outputs.loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, ElectraForMaskedLM
<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;google/electra-small-generator&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ElectraForMaskedLM.from_pretrained(<span class="hljs-string">&quot;google/electra-small-generator&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>tokenizer.decode(predicted_token_id)
<span class="hljs-string">&#x27;paris&#x27;</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)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(outputs.loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">1.22</span>`}}),{c(){d=o("p"),v=r("Example:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Example:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function hP(x){let d,v,u,f,_;return{c(){d=o("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var z=a(u);f=i(z,"Module"),z.forEach(t),_=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,u),e(u,f),e(d,_)},d(l){l&&t(d)}}}function mP(x){let d,v,u,f,_;return f=new Oe({props:{code:`import torch
from transformers import AutoTokenizer, ElectraForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("bhadresh-savani/electra-base-emotion")
model = ElectraForSequenceClassification.from_pretrained("bhadresh-savani/electra-base-emotion")

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

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

predicted_class_id = logits.argmax().item()
model.config.id2label[predicted_class_id]

# 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 = ElectraForSequenceClassification.from_pretrained("bhadresh-savani/electra-base-emotion", num_labels=num_labels)

labels = torch.tensor([1])
loss = model(**inputs, labels=labels).loss
round(loss.item(), 2)`,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, ElectraForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bhadresh-savani/electra-base-emotion&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ElectraForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;bhadresh-savani/electra-base-emotion&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>model.config.id2label[predicted_class_id]
<span class="hljs-string">&#x27;joy&#x27;</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 = ElectraForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;bhadresh-savani/electra-base-emotion&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
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">0.06</span>`}}),{c(){d=o("p"),v=r("Example of single-label classification:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Example of single-label classification:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function uP(x){let d,v,u,f,_;return f=new Oe({props:{code:`import torch
from transformers import AutoTokenizer, ElectraForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("bhadresh-savani/electra-base-emotion")
model = ElectraForSequenceClassification.from_pretrained("bhadresh-savani/electra-base-emotion", 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 = ElectraForSequenceClassification.from_pretrained(
    "bhadresh-savani/electra-base-emotion", 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, ElectraForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bhadresh-savani/electra-base-emotion&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ElectraForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;bhadresh-savani/electra-base-emotion&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 = ElectraForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;bhadresh-savani/electra-base-emotion&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=o("p"),v=r("Example of multi-label classification:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Example of multi-label classification:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function fP(x){let d,v,u,f,_;return{c(){d=o("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var z=a(u);f=i(z,"Module"),z.forEach(t),_=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,u),e(u,f),e(d,_)},d(l){l&&t(d)}}}function gP(x){let d,v,u,f,_;return f=new Oe({props:{code:`from transformers import AutoTokenizer, ElectraForMultipleChoice
import torch

tokenizer = AutoTokenizer.from_pretrained("google/electra-small-discriminator")
model = ElectraForMultipleChoice.from_pretrained("google/electra-small-discriminator")

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, ElectraForMultipleChoice
<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;google/electra-small-discriminator&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ElectraForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&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=o("p"),v=r("Example:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Example:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function _P(x){let d,v,u,f,_;return{c(){d=o("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var z=a(u);f=i(z,"Module"),z.forEach(t),_=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,u),e(u,f),e(d,_)},d(l){l&&t(d)}}}function kP(x){let d,v,u,f,_;return f=new Oe({props:{code:`from transformers import AutoTokenizer, ElectraForTokenClassification
import torch

tokenizer = AutoTokenizer.from_pretrained("bhadresh-savani/electra-base-discriminator-finetuned-conll03-english")
model = ElectraForTokenClassification.from_pretrained("bhadresh-savani/electra-base-discriminator-finetuned-conll03-english")

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]]
predicted_tokens_classes

labels = predicted_token_class_ids
loss = model(**inputs, labels=labels).loss
round(loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, ElectraForTokenClassification
<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;bhadresh-savani/electra-base-discriminator-finetuned-conll03-english&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ElectraForTokenClassification.from_pretrained(<span class="hljs-string">&quot;bhadresh-savani/electra-base-discriminator-finetuned-conll03-english&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>predicted_tokens_classes
[<span class="hljs-string">&#x27;B-LOC&#x27;</span>, <span class="hljs-string">&#x27;B-ORG&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;B-LOC&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;B-LOC&#x27;</span>, <span class="hljs-string">&#x27;I-LOC&#x27;</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
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">0.11</span>`}}),{c(){d=o("p"),v=r("Example:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Example:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function vP(x){let d,v,u,f,_;return{c(){d=o("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var z=a(u);f=i(z,"Module"),z.forEach(t),_=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,u),e(u,f),e(d,_)},d(l){l&&t(d)}}}function yP(x){let d,v,u,f,_;return f=new Oe({props:{code:`from transformers import AutoTokenizer, ElectraForQuestionAnswering
import torch

tokenizer = AutoTokenizer.from_pretrained("bhadresh-savani/electra-base-squad2")
model = ElectraForQuestionAnswering.from_pretrained("bhadresh-savani/electra-base-squad2")

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]
tokenizer.decode(predict_answer_tokens, skip_special_tokens=True)

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

outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
loss = outputs.loss
round(loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, ElectraForQuestionAnswering
<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;bhadresh-savani/electra-base-squad2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ElectraForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;bhadresh-savani/electra-base-squad2&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>tokenizer.decode(predict_answer_tokens, skip_special_tokens=<span class="hljs-literal">True</span>)
<span class="hljs-string">&#x27;a nice puppet&#x27;</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">11</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = torch.tensor([<span class="hljs-number">12</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
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">2.64</span>`}}),{c(){d=o("p"),v=r("Example:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Example:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function TP(x){let d,v,u,f,_,l,h,z,ve,fe,W,de,te,M,ye,Q,ce,Ne,G,ae,re,B,ie,Te,V,be,ge,H,we,le,ne,C,A,pe,Y,_e,he,J,Ee,ke,P,$e,X,se,me,Z,Fe,ue,S,xe,I,Me,ee,L,ze,O,qe,je;return{c(){d=o("p"),v=r("TensorFlow models and layers in "),u=o("code"),f=r("transformers"),_=r(" accept two formats as input:"),l=c(),h=o("ul"),z=o("li"),ve=r("having all inputs as keyword arguments (like PyTorch models), or"),fe=c(),W=o("li"),de=r("having all inputs as a list, tuple or dict in the first positional argument."),te=c(),M=o("p"),ye=r(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=o("code"),ce=r("model.fit()"),Ne=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),G=o("code"),ae=r("model.fit()"),re=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),B=o("code"),ie=r("fit()"),Te=r(" and "),V=o("code"),be=r("predict()"),ge=r(`, such as when creating your own layers or models with
the Keras `),H=o("code"),we=r("Functional"),le=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ne=c(),C=o("ul"),A=o("li"),pe=r("a single Tensor with "),Y=o("code"),_e=r("input_ids"),he=r(" only and nothing else: "),J=o("code"),Ee=r("model(input_ids)"),ke=c(),P=o("li"),$e=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),X=o("code"),se=r("model([input_ids, attention_mask])"),me=r(" or "),Z=o("code"),Fe=r("model([input_ids, attention_mask, token_type_ids])"),ue=c(),S=o("li"),xe=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),I=o("code"),Me=r('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ee=c(),L=o("p"),ze=r(`Note that when creating models and layers with
`),O=o("a"),qe=r("subclassing"),je=r(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(y){d=n(y,"P",{});var q=a(d);v=i(q,"TensorFlow models and layers in "),u=n(q,"CODE",{});var Qe=a(u);f=i(Qe,"transformers"),Qe.forEach(t),_=i(q," accept two formats as input:"),q.forEach(t),l=p(y),h=n(y,"UL",{});var oe=a(h);z=n(oe,"LI",{});var Ce=a(z);ve=i(Ce,"having all inputs as keyword arguments (like PyTorch models), or"),Ce.forEach(t),fe=p(oe),W=n(oe,"LI",{});var Be=a(W);de=i(Be,"having all inputs as a list, tuple or dict in the first positional argument."),Be.forEach(t),oe.forEach(t),te=p(y),M=n(y,"P",{});var j=a(M);ye=i(j,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=n(j,"CODE",{});var Ve=a(Q);ce=i(Ve,"model.fit()"),Ve.forEach(t),Ne=i(j,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),G=n(j,"CODE",{});var Je=a(G);ae=i(Je,"model.fit()"),Je.forEach(t),re=i(j,` supports! If, however, you want to use the second
format outside of Keras methods like `),B=n(j,"CODE",{});var We=a(B);ie=i(We,"fit()"),We.forEach(t),Te=i(j," and "),V=n(j,"CODE",{});var Ge=a(V);be=i(Ge,"predict()"),Ge.forEach(t),ge=i(j,`, such as when creating your own layers or models with
the Keras `),H=n(j,"CODE",{});var Xe=a(H);we=i(Xe,"Functional"),Xe.forEach(t),le=i(j,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),j.forEach(t),ne=p(y),C=n(y,"UL",{});var D=a(C);A=n(D,"LI",{});var U=a(A);pe=i(U,"a single Tensor with "),Y=n(U,"CODE",{});var Se=a(Y);_e=i(Se,"input_ids"),Se.forEach(t),he=i(U," only and nothing else: "),J=n(U,"CODE",{});var Ue=a(J);Ee=i(Ue,"model(input_ids)"),Ue.forEach(t),U.forEach(t),ke=p(D),P=n(D,"LI",{});var K=a(P);$e=i(K,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),X=n(K,"CODE",{});var Ye=a(X);se=i(Ye,"model([input_ids, attention_mask])"),Ye.forEach(t),me=i(K," or "),Z=n(K,"CODE",{});var Re=a(Z);Fe=i(Re,"model([input_ids, attention_mask, token_type_ids])"),Re.forEach(t),K.forEach(t),ue=p(D),S=n(D,"LI",{});var Pe=a(S);xe=i(Pe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),I=n(Pe,"CODE",{});var Ke=a(I);Me=i(Ke,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ke.forEach(t),Pe.forEach(t),D.forEach(t),ee=p(y),L=n(y,"P",{});var R=a(L);ze=i(R,`Note that when creating models and layers with
`),O=n(R,"A",{href:!0,rel:!0});var He=a(O);qe=i(He,"subclassing"),He.forEach(t),je=i(R,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),R.forEach(t),this.h()},h(){m(O,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(O,"rel","nofollow")},m(y,q){g(y,d,q),e(d,v),e(d,u),e(u,f),e(d,_),g(y,l,q),g(y,h,q),e(h,z),e(z,ve),e(h,fe),e(h,W),e(W,de),g(y,te,q),g(y,M,q),e(M,ye),e(M,Q),e(Q,ce),e(M,Ne),e(M,G),e(G,ae),e(M,re),e(M,B),e(B,ie),e(M,Te),e(M,V),e(V,be),e(M,ge),e(M,H),e(H,we),e(M,le),g(y,ne,q),g(y,C,q),e(C,A),e(A,pe),e(A,Y),e(Y,_e),e(A,he),e(A,J),e(J,Ee),e(C,ke),e(C,P),e(P,$e),e(P,X),e(X,se),e(P,me),e(P,Z),e(Z,Fe),e(C,ue),e(C,S),e(S,xe),e(S,I),e(I,Me),g(y,ee,q),g(y,L,q),e(L,ze),e(L,O),e(O,qe),e(L,je)},d(y){y&&t(d),y&&t(l),y&&t(h),y&&t(te),y&&t(M),y&&t(ne),y&&t(C),y&&t(ee),y&&t(L)}}}function bP(x){let d,v,u,f,_;return{c(){d=o("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var z=a(u);f=i(z,"Module"),z.forEach(t),_=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,u),e(u,f),e(d,_)},d(l){l&&t(d)}}}function wP(x){let d,v,u,f,_;return f=new Oe({props:{code:`from transformers import AutoTokenizer, TFElectraModel
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("google/electra-small-discriminator")
model = TFElectraModel.from_pretrained("google/electra-small-discriminator")

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

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFElectraModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFElectraModel.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)

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

tokenizer = AutoTokenizer.from_pretrained("google/electra-small-discriminator")
model = TFElectraForPreTraining.from_pretrained("google/electra-small-discriminator")
input_ids = tf.constant(tokenizer.encode("Hello, my dog is cute"))[None, :]  # Batch size 1
outputs = model(input_ids)
scores = outputs[0]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFElectraForPreTraining

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFElectraForPreTraining.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tf.constant(tokenizer.encode(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>))[<span class="hljs-literal">None</span>, :]  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>scores = outputs[<span class="hljs-number">0</span>]`}}),{c(){d=o("p"),v=r("Examples:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Examples:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function xP(x){let d,v,u,f,_,l,h,z,ve,fe,W,de,te,M,ye,Q,ce,Ne,G,ae,re,B,ie,Te,V,be,ge,H,we,le,ne,C,A,pe,Y,_e,he,J,Ee,ke,P,$e,X,se,me,Z,Fe,ue,S,xe,I,Me,ee,L,ze,O,qe,je;return{c(){d=o("p"),v=r("TensorFlow models and layers in "),u=o("code"),f=r("transformers"),_=r(" accept two formats as input:"),l=c(),h=o("ul"),z=o("li"),ve=r("having all inputs as keyword arguments (like PyTorch models), or"),fe=c(),W=o("li"),de=r("having all inputs as a list, tuple or dict in the first positional argument."),te=c(),M=o("p"),ye=r(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=o("code"),ce=r("model.fit()"),Ne=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),G=o("code"),ae=r("model.fit()"),re=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),B=o("code"),ie=r("fit()"),Te=r(" and "),V=o("code"),be=r("predict()"),ge=r(`, such as when creating your own layers or models with
the Keras `),H=o("code"),we=r("Functional"),le=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ne=c(),C=o("ul"),A=o("li"),pe=r("a single Tensor with "),Y=o("code"),_e=r("input_ids"),he=r(" only and nothing else: "),J=o("code"),Ee=r("model(input_ids)"),ke=c(),P=o("li"),$e=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),X=o("code"),se=r("model([input_ids, attention_mask])"),me=r(" or "),Z=o("code"),Fe=r("model([input_ids, attention_mask, token_type_ids])"),ue=c(),S=o("li"),xe=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),I=o("code"),Me=r('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ee=c(),L=o("p"),ze=r(`Note that when creating models and layers with
`),O=o("a"),qe=r("subclassing"),je=r(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(y){d=n(y,"P",{});var q=a(d);v=i(q,"TensorFlow models and layers in "),u=n(q,"CODE",{});var Qe=a(u);f=i(Qe,"transformers"),Qe.forEach(t),_=i(q," accept two formats as input:"),q.forEach(t),l=p(y),h=n(y,"UL",{});var oe=a(h);z=n(oe,"LI",{});var Ce=a(z);ve=i(Ce,"having all inputs as keyword arguments (like PyTorch models), or"),Ce.forEach(t),fe=p(oe),W=n(oe,"LI",{});var Be=a(W);de=i(Be,"having all inputs as a list, tuple or dict in the first positional argument."),Be.forEach(t),oe.forEach(t),te=p(y),M=n(y,"P",{});var j=a(M);ye=i(j,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=n(j,"CODE",{});var Ve=a(Q);ce=i(Ve,"model.fit()"),Ve.forEach(t),Ne=i(j,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),G=n(j,"CODE",{});var Je=a(G);ae=i(Je,"model.fit()"),Je.forEach(t),re=i(j,` supports! If, however, you want to use the second
format outside of Keras methods like `),B=n(j,"CODE",{});var We=a(B);ie=i(We,"fit()"),We.forEach(t),Te=i(j," and "),V=n(j,"CODE",{});var Ge=a(V);be=i(Ge,"predict()"),Ge.forEach(t),ge=i(j,`, such as when creating your own layers or models with
the Keras `),H=n(j,"CODE",{});var Xe=a(H);we=i(Xe,"Functional"),Xe.forEach(t),le=i(j,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),j.forEach(t),ne=p(y),C=n(y,"UL",{});var D=a(C);A=n(D,"LI",{});var U=a(A);pe=i(U,"a single Tensor with "),Y=n(U,"CODE",{});var Se=a(Y);_e=i(Se,"input_ids"),Se.forEach(t),he=i(U," only and nothing else: "),J=n(U,"CODE",{});var Ue=a(J);Ee=i(Ue,"model(input_ids)"),Ue.forEach(t),U.forEach(t),ke=p(D),P=n(D,"LI",{});var K=a(P);$e=i(K,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),X=n(K,"CODE",{});var Ye=a(X);se=i(Ye,"model([input_ids, attention_mask])"),Ye.forEach(t),me=i(K," or "),Z=n(K,"CODE",{});var Re=a(Z);Fe=i(Re,"model([input_ids, attention_mask, token_type_ids])"),Re.forEach(t),K.forEach(t),ue=p(D),S=n(D,"LI",{});var Pe=a(S);xe=i(Pe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),I=n(Pe,"CODE",{});var Ke=a(I);Me=i(Ke,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ke.forEach(t),Pe.forEach(t),D.forEach(t),ee=p(y),L=n(y,"P",{});var R=a(L);ze=i(R,`Note that when creating models and layers with
`),O=n(R,"A",{href:!0,rel:!0});var He=a(O);qe=i(He,"subclassing"),He.forEach(t),je=i(R,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),R.forEach(t),this.h()},h(){m(O,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(O,"rel","nofollow")},m(y,q){g(y,d,q),e(d,v),e(d,u),e(u,f),e(d,_),g(y,l,q),g(y,h,q),e(h,z),e(z,ve),e(h,fe),e(h,W),e(W,de),g(y,te,q),g(y,M,q),e(M,ye),e(M,Q),e(Q,ce),e(M,Ne),e(M,G),e(G,ae),e(M,re),e(M,B),e(B,ie),e(M,Te),e(M,V),e(V,be),e(M,ge),e(M,H),e(H,we),e(M,le),g(y,ne,q),g(y,C,q),e(C,A),e(A,pe),e(A,Y),e(Y,_e),e(A,he),e(A,J),e(J,Ee),e(C,ke),e(C,P),e(P,$e),e(P,X),e(X,se),e(P,me),e(P,Z),e(Z,Fe),e(C,ue),e(C,S),e(S,xe),e(S,I),e(I,Me),g(y,ee,q),g(y,L,q),e(L,ze),e(L,O),e(O,qe),e(L,je)},d(y){y&&t(d),y&&t(l),y&&t(h),y&&t(te),y&&t(M),y&&t(ne),y&&t(C),y&&t(ee),y&&t(L)}}}function MP(x){let d,v,u,f,_;return{c(){d=o("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var z=a(u);f=i(z,"Module"),z.forEach(t),_=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,u),e(u,f),e(d,_)},d(l){l&&t(d)}}}function zP(x){let d,v,u,f,_;return f=new Oe({props:{code:`from transformers import AutoTokenizer, TFElectraForMaskedLM
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("google/electra-small-generator")
model = TFElectraForMaskedLM.from_pretrained("google/electra-small-generator")

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

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

predicted_token_id = tf.math.argmax(selected_logits, axis=-1)
tokenizer.decode(predicted_token_id)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFElectraForMaskedLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/electra-small-generator&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFElectraForMaskedLM.from_pretrained(<span class="hljs-string">&quot;google/electra-small-generator&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The capital of France is [MASK].&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># retrieve index of [MASK]</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_token_index = tf.where((inputs.input_ids == tokenizer.mask_token_id)[<span class="hljs-number">0</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>selected_logits = tf.gather_nd(logits[<span class="hljs-number">0</span>], indices=mask_token_index)

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_id = tf.math.argmax(selected_logits, axis=-<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.decode(predicted_token_id)
<span class="hljs-string">&#x27;paris&#x27;</span>`}}),{c(){d=o("p"),v=r("Example:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Example:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function qP(x){let d,v;return d=new Oe({props:{code:`labels = tokenizer("The capital of France is Paris.", return_tensors="tf")["input_ids"]
# mask labels of non-[MASK] tokens
labels = tf.where(inputs.input_ids == tokenizer.mask_token_id, labels, -100)

outputs = model(**inputs, labels=labels)
round(float(outputs.loss), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tokenizer(<span class="hljs-string">&quot;The capital of France is Paris.&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># mask labels of non-[MASK] tokens</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tf.where(inputs.input_ids == tokenizer.mask_token_id, labels, -<span class="hljs-number">100</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(<span class="hljs-built_in">float</span>(outputs.loss), <span class="hljs-number">2</span>)
<span class="hljs-number">1.22</span>`}}),{c(){T(d.$$.fragment)},l(u){b(d.$$.fragment,u)},m(u,f){w(d,u,f),v=!0},p:Le,i(u){v||(E(d.$$.fragment,u),v=!0)},o(u){$(d.$$.fragment,u),v=!1},d(u){F(d,u)}}}function jP(x){let d,v,u,f,_,l,h,z,ve,fe,W,de,te,M,ye,Q,ce,Ne,G,ae,re,B,ie,Te,V,be,ge,H,we,le,ne,C,A,pe,Y,_e,he,J,Ee,ke,P,$e,X,se,me,Z,Fe,ue,S,xe,I,Me,ee,L,ze,O,qe,je;return{c(){d=o("p"),v=r("TensorFlow models and layers in "),u=o("code"),f=r("transformers"),_=r(" accept two formats as input:"),l=c(),h=o("ul"),z=o("li"),ve=r("having all inputs as keyword arguments (like PyTorch models), or"),fe=c(),W=o("li"),de=r("having all inputs as a list, tuple or dict in the first positional argument."),te=c(),M=o("p"),ye=r(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=o("code"),ce=r("model.fit()"),Ne=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),G=o("code"),ae=r("model.fit()"),re=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),B=o("code"),ie=r("fit()"),Te=r(" and "),V=o("code"),be=r("predict()"),ge=r(`, such as when creating your own layers or models with
the Keras `),H=o("code"),we=r("Functional"),le=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ne=c(),C=o("ul"),A=o("li"),pe=r("a single Tensor with "),Y=o("code"),_e=r("input_ids"),he=r(" only and nothing else: "),J=o("code"),Ee=r("model(input_ids)"),ke=c(),P=o("li"),$e=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),X=o("code"),se=r("model([input_ids, attention_mask])"),me=r(" or "),Z=o("code"),Fe=r("model([input_ids, attention_mask, token_type_ids])"),ue=c(),S=o("li"),xe=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),I=o("code"),Me=r('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ee=c(),L=o("p"),ze=r(`Note that when creating models and layers with
`),O=o("a"),qe=r("subclassing"),je=r(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(y){d=n(y,"P",{});var q=a(d);v=i(q,"TensorFlow models and layers in "),u=n(q,"CODE",{});var Qe=a(u);f=i(Qe,"transformers"),Qe.forEach(t),_=i(q," accept two formats as input:"),q.forEach(t),l=p(y),h=n(y,"UL",{});var oe=a(h);z=n(oe,"LI",{});var Ce=a(z);ve=i(Ce,"having all inputs as keyword arguments (like PyTorch models), or"),Ce.forEach(t),fe=p(oe),W=n(oe,"LI",{});var Be=a(W);de=i(Be,"having all inputs as a list, tuple or dict in the first positional argument."),Be.forEach(t),oe.forEach(t),te=p(y),M=n(y,"P",{});var j=a(M);ye=i(j,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=n(j,"CODE",{});var Ve=a(Q);ce=i(Ve,"model.fit()"),Ve.forEach(t),Ne=i(j,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),G=n(j,"CODE",{});var Je=a(G);ae=i(Je,"model.fit()"),Je.forEach(t),re=i(j,` supports! If, however, you want to use the second
format outside of Keras methods like `),B=n(j,"CODE",{});var We=a(B);ie=i(We,"fit()"),We.forEach(t),Te=i(j," and "),V=n(j,"CODE",{});var Ge=a(V);be=i(Ge,"predict()"),Ge.forEach(t),ge=i(j,`, such as when creating your own layers or models with
the Keras `),H=n(j,"CODE",{});var Xe=a(H);we=i(Xe,"Functional"),Xe.forEach(t),le=i(j,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),j.forEach(t),ne=p(y),C=n(y,"UL",{});var D=a(C);A=n(D,"LI",{});var U=a(A);pe=i(U,"a single Tensor with "),Y=n(U,"CODE",{});var Se=a(Y);_e=i(Se,"input_ids"),Se.forEach(t),he=i(U," only and nothing else: "),J=n(U,"CODE",{});var Ue=a(J);Ee=i(Ue,"model(input_ids)"),Ue.forEach(t),U.forEach(t),ke=p(D),P=n(D,"LI",{});var K=a(P);$e=i(K,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),X=n(K,"CODE",{});var Ye=a(X);se=i(Ye,"model([input_ids, attention_mask])"),Ye.forEach(t),me=i(K," or "),Z=n(K,"CODE",{});var Re=a(Z);Fe=i(Re,"model([input_ids, attention_mask, token_type_ids])"),Re.forEach(t),K.forEach(t),ue=p(D),S=n(D,"LI",{});var Pe=a(S);xe=i(Pe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),I=n(Pe,"CODE",{});var Ke=a(I);Me=i(Ke,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ke.forEach(t),Pe.forEach(t),D.forEach(t),ee=p(y),L=n(y,"P",{});var R=a(L);ze=i(R,`Note that when creating models and layers with
`),O=n(R,"A",{href:!0,rel:!0});var He=a(O);qe=i(He,"subclassing"),He.forEach(t),je=i(R,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),R.forEach(t),this.h()},h(){m(O,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(O,"rel","nofollow")},m(y,q){g(y,d,q),e(d,v),e(d,u),e(u,f),e(d,_),g(y,l,q),g(y,h,q),e(h,z),e(z,ve),e(h,fe),e(h,W),e(W,de),g(y,te,q),g(y,M,q),e(M,ye),e(M,Q),e(Q,ce),e(M,Ne),e(M,G),e(G,ae),e(M,re),e(M,B),e(B,ie),e(M,Te),e(M,V),e(V,be),e(M,ge),e(M,H),e(H,we),e(M,le),g(y,ne,q),g(y,C,q),e(C,A),e(A,pe),e(A,Y),e(Y,_e),e(A,he),e(A,J),e(J,Ee),e(C,ke),e(C,P),e(P,$e),e(P,X),e(X,se),e(P,me),e(P,Z),e(Z,Fe),e(C,ue),e(C,S),e(S,xe),e(S,I),e(I,Me),g(y,ee,q),g(y,L,q),e(L,ze),e(L,O),e(O,qe),e(L,je)},d(y){y&&t(d),y&&t(l),y&&t(h),y&&t(te),y&&t(M),y&&t(ne),y&&t(C),y&&t(ee),y&&t(L)}}}function CP(x){let d,v,u,f,_;return{c(){d=o("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var z=a(u);f=i(z,"Module"),z.forEach(t),_=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,u),e(u,f),e(d,_)},d(l){l&&t(d)}}}function PP(x){let d,v,u,f,_;return f=new Oe({props:{code:`from transformers import AutoTokenizer, TFElectraForSequenceClassification
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("bhadresh-savani/electra-base-emotion")
model = TFElectraForSequenceClassification.from_pretrained("bhadresh-savani/electra-base-emotion")

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

logits = model(**inputs).logits

predicted_class_id = int(tf.math.argmax(logits, axis=-1)[0])
model.config.id2label[predicted_class_id]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFElectraForSequenceClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bhadresh-savani/electra-base-emotion&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFElectraForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;bhadresh-savani/electra-base-emotion&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>model.config.id2label[predicted_class_id]
<span class="hljs-string">&#x27;joy&#x27;</span>`}}),{c(){d=o("p"),v=r("Example:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Example:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function AP(x){let d,v;return d=new Oe({props:{code:'# To train a model on `num_labels` classes, you can pass `num_labels=num_labels` to `.from_pretrained(...)`\nnum_labels = len(model.config.id2label)\nmodel = TFElectraForSequenceClassification.from_pretrained("bhadresh-savani/electra-base-emotion", num_labels=num_labels)\n\nlabels = tf.constant(1)\nloss = model(**inputs, labels=labels).loss\nround(float(loss), 2)',highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<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 = TFElectraForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;bhadresh-savani/electra-base-emotion&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tf.constant(<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(<span class="hljs-built_in">float</span>(loss), <span class="hljs-number">2</span>)
<span class="hljs-number">0.06</span>`}}),{c(){T(d.$$.fragment)},l(u){b(d.$$.fragment,u)},m(u,f){w(d,u,f),v=!0},p:Le,i(u){v||(E(d.$$.fragment,u),v=!0)},o(u){$(d.$$.fragment,u),v=!1},d(u){F(d,u)}}}function LP(x){let d,v,u,f,_,l,h,z,ve,fe,W,de,te,M,ye,Q,ce,Ne,G,ae,re,B,ie,Te,V,be,ge,H,we,le,ne,C,A,pe,Y,_e,he,J,Ee,ke,P,$e,X,se,me,Z,Fe,ue,S,xe,I,Me,ee,L,ze,O,qe,je;return{c(){d=o("p"),v=r("TensorFlow models and layers in "),u=o("code"),f=r("transformers"),_=r(" accept two formats as input:"),l=c(),h=o("ul"),z=o("li"),ve=r("having all inputs as keyword arguments (like PyTorch models), or"),fe=c(),W=o("li"),de=r("having all inputs as a list, tuple or dict in the first positional argument."),te=c(),M=o("p"),ye=r(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=o("code"),ce=r("model.fit()"),Ne=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),G=o("code"),ae=r("model.fit()"),re=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),B=o("code"),ie=r("fit()"),Te=r(" and "),V=o("code"),be=r("predict()"),ge=r(`, such as when creating your own layers or models with
the Keras `),H=o("code"),we=r("Functional"),le=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ne=c(),C=o("ul"),A=o("li"),pe=r("a single Tensor with "),Y=o("code"),_e=r("input_ids"),he=r(" only and nothing else: "),J=o("code"),Ee=r("model(input_ids)"),ke=c(),P=o("li"),$e=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),X=o("code"),se=r("model([input_ids, attention_mask])"),me=r(" or "),Z=o("code"),Fe=r("model([input_ids, attention_mask, token_type_ids])"),ue=c(),S=o("li"),xe=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),I=o("code"),Me=r('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ee=c(),L=o("p"),ze=r(`Note that when creating models and layers with
`),O=o("a"),qe=r("subclassing"),je=r(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(y){d=n(y,"P",{});var q=a(d);v=i(q,"TensorFlow models and layers in "),u=n(q,"CODE",{});var Qe=a(u);f=i(Qe,"transformers"),Qe.forEach(t),_=i(q," accept two formats as input:"),q.forEach(t),l=p(y),h=n(y,"UL",{});var oe=a(h);z=n(oe,"LI",{});var Ce=a(z);ve=i(Ce,"having all inputs as keyword arguments (like PyTorch models), or"),Ce.forEach(t),fe=p(oe),W=n(oe,"LI",{});var Be=a(W);de=i(Be,"having all inputs as a list, tuple or dict in the first positional argument."),Be.forEach(t),oe.forEach(t),te=p(y),M=n(y,"P",{});var j=a(M);ye=i(j,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=n(j,"CODE",{});var Ve=a(Q);ce=i(Ve,"model.fit()"),Ve.forEach(t),Ne=i(j,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),G=n(j,"CODE",{});var Je=a(G);ae=i(Je,"model.fit()"),Je.forEach(t),re=i(j,` supports! If, however, you want to use the second
format outside of Keras methods like `),B=n(j,"CODE",{});var We=a(B);ie=i(We,"fit()"),We.forEach(t),Te=i(j," and "),V=n(j,"CODE",{});var Ge=a(V);be=i(Ge,"predict()"),Ge.forEach(t),ge=i(j,`, such as when creating your own layers or models with
the Keras `),H=n(j,"CODE",{});var Xe=a(H);we=i(Xe,"Functional"),Xe.forEach(t),le=i(j,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),j.forEach(t),ne=p(y),C=n(y,"UL",{});var D=a(C);A=n(D,"LI",{});var U=a(A);pe=i(U,"a single Tensor with "),Y=n(U,"CODE",{});var Se=a(Y);_e=i(Se,"input_ids"),Se.forEach(t),he=i(U," only and nothing else: "),J=n(U,"CODE",{});var Ue=a(J);Ee=i(Ue,"model(input_ids)"),Ue.forEach(t),U.forEach(t),ke=p(D),P=n(D,"LI",{});var K=a(P);$e=i(K,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),X=n(K,"CODE",{});var Ye=a(X);se=i(Ye,"model([input_ids, attention_mask])"),Ye.forEach(t),me=i(K," or "),Z=n(K,"CODE",{});var Re=a(Z);Fe=i(Re,"model([input_ids, attention_mask, token_type_ids])"),Re.forEach(t),K.forEach(t),ue=p(D),S=n(D,"LI",{});var Pe=a(S);xe=i(Pe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),I=n(Pe,"CODE",{});var Ke=a(I);Me=i(Ke,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ke.forEach(t),Pe.forEach(t),D.forEach(t),ee=p(y),L=n(y,"P",{});var R=a(L);ze=i(R,`Note that when creating models and layers with
`),O=n(R,"A",{href:!0,rel:!0});var He=a(O);qe=i(He,"subclassing"),He.forEach(t),je=i(R,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),R.forEach(t),this.h()},h(){m(O,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(O,"rel","nofollow")},m(y,q){g(y,d,q),e(d,v),e(d,u),e(u,f),e(d,_),g(y,l,q),g(y,h,q),e(h,z),e(z,ve),e(h,fe),e(h,W),e(W,de),g(y,te,q),g(y,M,q),e(M,ye),e(M,Q),e(Q,ce),e(M,Ne),e(M,G),e(G,ae),e(M,re),e(M,B),e(B,ie),e(M,Te),e(M,V),e(V,be),e(M,ge),e(M,H),e(H,we),e(M,le),g(y,ne,q),g(y,C,q),e(C,A),e(A,pe),e(A,Y),e(Y,_e),e(A,he),e(A,J),e(J,Ee),e(C,ke),e(C,P),e(P,$e),e(P,X),e(X,se),e(P,me),e(P,Z),e(Z,Fe),e(C,ue),e(C,S),e(S,xe),e(S,I),e(I,Me),g(y,ee,q),g(y,L,q),e(L,ze),e(L,O),e(O,qe),e(L,je)},d(y){y&&t(d),y&&t(l),y&&t(h),y&&t(te),y&&t(M),y&&t(ne),y&&t(C),y&&t(ee),y&&t(L)}}}function OP(x){let d,v,u,f,_;return{c(){d=o("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var z=a(u);f=i(z,"Module"),z.forEach(t),_=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,u),e(u,f),e(d,_)},d(l){l&&t(d)}}}function NP(x){let d,v,u,f,_;return f=new Oe({props:{code:`from transformers import AutoTokenizer, TFElectraForMultipleChoice
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("google/electra-small-discriminator")
model = TFElectraForMultipleChoice.from_pretrained("google/electra-small-discriminator")

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

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

# the linear classifier still needs to be trained
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFElectraForMultipleChoice
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFElectraForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice0 = <span class="hljs-string">&quot;It is eaten with a fork and a knife.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice1 = <span class="hljs-string">&quot;It is eaten while held in the hand.&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors=<span class="hljs-string">&quot;tf&quot;</span>, padding=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = {k: tf.expand_dims(v, <span class="hljs-number">0</span>) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> encoding.items()}
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)  <span class="hljs-comment"># batch size is 1</span>

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

tokenizer = AutoTokenizer.from_pretrained("bhadresh-savani/electra-base-discriminator-finetuned-conll03-english")
model = TFElectraForTokenClassification.from_pretrained("bhadresh-savani/electra-base-discriminator-finetuned-conll03-english")

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

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

# Note that tokens are classified rather then input words which means that
# there might be more predicted token classes than words.
# Multiple token classes might account for the same word
predicted_tokens_classes = [model.config.id2label[t] for t in predicted_token_class_ids[0].numpy().tolist()]
predicted_tokens_classes`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFElectraForTokenClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bhadresh-savani/electra-base-discriminator-finetuned-conll03-english&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFElectraForTokenClassification.from_pretrained(<span class="hljs-string">&quot;bhadresh-savani/electra-base-discriminator-finetuned-conll03-english&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;HuggingFace is a company based in Paris and New York&quot;</span>, add_special_tokens=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_class_ids = tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Note that tokens are classified rather then input words which means that</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># there might be more predicted token classes than words.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Multiple token classes might account for the same word</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_tokens_classes = [model.config.id2label[t] <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> predicted_token_class_ids[<span class="hljs-number">0</span>].numpy().tolist()]
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_tokens_classes
[<span class="hljs-string">&#x27;B-LOC&#x27;</span>, <span class="hljs-string">&#x27;B-ORG&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;B-LOC&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;B-LOC&#x27;</span>, <span class="hljs-string">&#x27;I-LOC&#x27;</span>]`}}),{c(){d=o("p"),v=r("Example:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Example:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function WP(x){let d,v;return d=new Oe({props:{code:`labels = predicted_token_class_ids
loss = tf.math.reduce_mean(model(**inputs, labels=labels).loss)
round(float(loss), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = tf.math.reduce_mean(model(**inputs, labels=labels).loss)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(<span class="hljs-built_in">float</span>(loss), <span class="hljs-number">2</span>)
<span class="hljs-number">0.11</span>`}}),{c(){T(d.$$.fragment)},l(u){b(d.$$.fragment,u)},m(u,f){w(d,u,f),v=!0},p:Le,i(u){v||(E(d.$$.fragment,u),v=!0)},o(u){$(d.$$.fragment,u),v=!1},d(u){F(d,u)}}}function UP(x){let d,v,u,f,_,l,h,z,ve,fe,W,de,te,M,ye,Q,ce,Ne,G,ae,re,B,ie,Te,V,be,ge,H,we,le,ne,C,A,pe,Y,_e,he,J,Ee,ke,P,$e,X,se,me,Z,Fe,ue,S,xe,I,Me,ee,L,ze,O,qe,je;return{c(){d=o("p"),v=r("TensorFlow models and layers in "),u=o("code"),f=r("transformers"),_=r(" accept two formats as input:"),l=c(),h=o("ul"),z=o("li"),ve=r("having all inputs as keyword arguments (like PyTorch models), or"),fe=c(),W=o("li"),de=r("having all inputs as a list, tuple or dict in the first positional argument."),te=c(),M=o("p"),ye=r(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=o("code"),ce=r("model.fit()"),Ne=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),G=o("code"),ae=r("model.fit()"),re=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),B=o("code"),ie=r("fit()"),Te=r(" and "),V=o("code"),be=r("predict()"),ge=r(`, such as when creating your own layers or models with
the Keras `),H=o("code"),we=r("Functional"),le=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ne=c(),C=o("ul"),A=o("li"),pe=r("a single Tensor with "),Y=o("code"),_e=r("input_ids"),he=r(" only and nothing else: "),J=o("code"),Ee=r("model(input_ids)"),ke=c(),P=o("li"),$e=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),X=o("code"),se=r("model([input_ids, attention_mask])"),me=r(" or "),Z=o("code"),Fe=r("model([input_ids, attention_mask, token_type_ids])"),ue=c(),S=o("li"),xe=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),I=o("code"),Me=r('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ee=c(),L=o("p"),ze=r(`Note that when creating models and layers with
`),O=o("a"),qe=r("subclassing"),je=r(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(y){d=n(y,"P",{});var q=a(d);v=i(q,"TensorFlow models and layers in "),u=n(q,"CODE",{});var Qe=a(u);f=i(Qe,"transformers"),Qe.forEach(t),_=i(q," accept two formats as input:"),q.forEach(t),l=p(y),h=n(y,"UL",{});var oe=a(h);z=n(oe,"LI",{});var Ce=a(z);ve=i(Ce,"having all inputs as keyword arguments (like PyTorch models), or"),Ce.forEach(t),fe=p(oe),W=n(oe,"LI",{});var Be=a(W);de=i(Be,"having all inputs as a list, tuple or dict in the first positional argument."),Be.forEach(t),oe.forEach(t),te=p(y),M=n(y,"P",{});var j=a(M);ye=i(j,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=n(j,"CODE",{});var Ve=a(Q);ce=i(Ve,"model.fit()"),Ve.forEach(t),Ne=i(j,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),G=n(j,"CODE",{});var Je=a(G);ae=i(Je,"model.fit()"),Je.forEach(t),re=i(j,` supports! If, however, you want to use the second
format outside of Keras methods like `),B=n(j,"CODE",{});var We=a(B);ie=i(We,"fit()"),We.forEach(t),Te=i(j," and "),V=n(j,"CODE",{});var Ge=a(V);be=i(Ge,"predict()"),Ge.forEach(t),ge=i(j,`, such as when creating your own layers or models with
the Keras `),H=n(j,"CODE",{});var Xe=a(H);we=i(Xe,"Functional"),Xe.forEach(t),le=i(j,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),j.forEach(t),ne=p(y),C=n(y,"UL",{});var D=a(C);A=n(D,"LI",{});var U=a(A);pe=i(U,"a single Tensor with "),Y=n(U,"CODE",{});var Se=a(Y);_e=i(Se,"input_ids"),Se.forEach(t),he=i(U," only and nothing else: "),J=n(U,"CODE",{});var Ue=a(J);Ee=i(Ue,"model(input_ids)"),Ue.forEach(t),U.forEach(t),ke=p(D),P=n(D,"LI",{});var K=a(P);$e=i(K,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),X=n(K,"CODE",{});var Ye=a(X);se=i(Ye,"model([input_ids, attention_mask])"),Ye.forEach(t),me=i(K," or "),Z=n(K,"CODE",{});var Re=a(Z);Fe=i(Re,"model([input_ids, attention_mask, token_type_ids])"),Re.forEach(t),K.forEach(t),ue=p(D),S=n(D,"LI",{});var Pe=a(S);xe=i(Pe,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),I=n(Pe,"CODE",{});var Ke=a(I);Me=i(Ke,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ke.forEach(t),Pe.forEach(t),D.forEach(t),ee=p(y),L=n(y,"P",{});var R=a(L);ze=i(R,`Note that when creating models and layers with
`),O=n(R,"A",{href:!0,rel:!0});var He=a(O);qe=i(He,"subclassing"),He.forEach(t),je=i(R,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),R.forEach(t),this.h()},h(){m(O,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(O,"rel","nofollow")},m(y,q){g(y,d,q),e(d,v),e(d,u),e(u,f),e(d,_),g(y,l,q),g(y,h,q),e(h,z),e(z,ve),e(h,fe),e(h,W),e(W,de),g(y,te,q),g(y,M,q),e(M,ye),e(M,Q),e(Q,ce),e(M,Ne),e(M,G),e(G,ae),e(M,re),e(M,B),e(B,ie),e(M,Te),e(M,V),e(V,be),e(M,ge),e(M,H),e(H,we),e(M,le),g(y,ne,q),g(y,C,q),e(C,A),e(A,pe),e(A,Y),e(Y,_e),e(A,he),e(A,J),e(J,Ee),e(C,ke),e(C,P),e(P,$e),e(P,X),e(X,se),e(P,me),e(P,Z),e(Z,Fe),e(C,ue),e(C,S),e(S,xe),e(S,I),e(I,Me),g(y,ee,q),g(y,L,q),e(L,ze),e(L,O),e(O,qe),e(L,je)},d(y){y&&t(d),y&&t(l),y&&t(h),y&&t(te),y&&t(M),y&&t(ne),y&&t(C),y&&t(ee),y&&t(L)}}}function RP(x){let d,v,u,f,_;return{c(){d=o("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var z=a(u);f=i(z,"Module"),z.forEach(t),_=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,u),e(u,f),e(d,_)},d(l){l&&t(d)}}}function HP(x){let d,v,u,f,_;return f=new Oe({props:{code:`from transformers import AutoTokenizer, TFElectraForQuestionAnswering
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("bhadresh-savani/electra-base-squad2")
model = TFElectraForQuestionAnswering.from_pretrained("bhadresh-savani/electra-base-squad2")

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

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

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

predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]
tokenizer.decode(predict_answer_tokens)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFElectraForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bhadresh-savani/electra-base-squad2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFElectraForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;bhadresh-savani/electra-base-squad2&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>question, text = <span class="hljs-string">&quot;Who was Jim Henson?&quot;</span>, <span class="hljs-string">&quot;Jim Henson was a nice puppet&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(question, text, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>answer_start_index = <span class="hljs-built_in">int</span>(tf.math.argmax(outputs.start_logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>answer_end_index = <span class="hljs-built_in">int</span>(tf.math.argmax(outputs.end_logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.decode(predict_answer_tokens)
<span class="hljs-string">&#x27;a nice puppet&#x27;</span>`}}),{c(){d=o("p"),v=r("Example:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Example:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function KP(x){let d,v;return d=new Oe({props:{code:`# target is "nice puppet"
target_start_index = tf.constant([11])
target_end_index = tf.constant([12])

outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
loss = tf.math.reduce_mean(outputs.loss)
round(float(loss), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># target is &quot;nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_start_index = tf.constant([<span class="hljs-number">11</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = tf.constant([<span class="hljs-number">12</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = tf.math.reduce_mean(outputs.loss)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(<span class="hljs-built_in">float</span>(loss), <span class="hljs-number">2</span>)
<span class="hljs-number">2.64</span>`}}),{c(){T(d.$$.fragment)},l(u){b(d.$$.fragment,u)},m(u,f){w(d,u,f),v=!0},p:Le,i(u){v||(E(d.$$.fragment,u),v=!0)},o(u){$(d.$$.fragment,u),v=!1},d(u){F(d,u)}}}function QP(x){let d,v,u,f,_;return{c(){d=o("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var z=a(u);f=i(z,"Module"),z.forEach(t),_=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,u),e(u,f),e(d,_)},d(l){l&&t(d)}}}function BP(x){let d,v,u,f,_;return f=new Oe({props:{code:`from transformers import AutoTokenizer, FlaxElectraModel

tokenizer = AutoTokenizer.from_pretrained("google/electra-small-discriminator")
model = FlaxElectraModel.from_pretrained("google/electra-small-discriminator")

inputs = tokenizer("Hello, my dog is cute", return_tensors="jax")
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, FlaxElectraModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxElectraModel.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&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;jax&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=o("p"),v=r("Example:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Example:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function VP(x){let d,v,u,f,_;return{c(){d=o("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var z=a(u);f=i(z,"Module"),z.forEach(t),_=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,u),e(u,f),e(d,_)},d(l){l&&t(d)}}}function JP(x){let d,v,u,f,_;return f=new Oe({props:{code:`from transformers import AutoTokenizer, FlaxElectraForPreTraining

tokenizer = AutoTokenizer.from_pretrained("google/electra-small-discriminator")
model = FlaxElectraForPreTraining.from_pretrained("google/electra-small-discriminator")

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

prediction_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, FlaxElectraForPreTraining

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxElectraForPreTraining.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&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;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>prediction_logits = outputs.logits`}}),{c(){d=o("p"),v=r("Example:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Example:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function GP(x){let d,v,u,f,_;return{c(){d=o("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var z=a(u);f=i(z,"Module"),z.forEach(t),_=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,u),e(u,f),e(d,_)},d(l){l&&t(d)}}}function XP(x){let d,v,u,f,_;return f=new Oe({props:{code:`from transformers import AutoTokenizer, FlaxElectraForCausalLM

tokenizer = AutoTokenizer.from_pretrained("google/electra-small-discriminator")
model = FlaxElectraForCausalLM.from_pretrained("google/electra-small-discriminator")

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

# retrieve logts for next token
next_token_logits = outputs.logits[:, -1]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxElectraForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxElectraForCausalLM.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&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;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># retrieve logts for next token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>next_token_logits = outputs.logits[:, -<span class="hljs-number">1</span>]`}}),{c(){d=o("p"),v=r("Example:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Example:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function YP(x){let d,v,u,f,_;return{c(){d=o("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var z=a(u);f=i(z,"Module"),z.forEach(t),_=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,u),e(u,f),e(d,_)},d(l){l&&t(d)}}}function ZP(x){let d,v,u,f,_;return f=new Oe({props:{code:`from transformers import AutoTokenizer, FlaxElectraForMaskedLM

tokenizer = AutoTokenizer.from_pretrained("google/electra-small-discriminator")
model = FlaxElectraForMaskedLM.from_pretrained("google/electra-small-discriminator")

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

outputs = model(**inputs)
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxElectraForMaskedLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxElectraForMaskedLM.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&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;jax&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=o("p"),v=r("Example:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Example:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function eA(x){let d,v,u,f,_;return{c(){d=o("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var z=a(u);f=i(z,"Module"),z.forEach(t),_=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,u),e(u,f),e(d,_)},d(l){l&&t(d)}}}function tA(x){let d,v,u,f,_;return f=new Oe({props:{code:`from transformers import AutoTokenizer, FlaxElectraForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("google/electra-small-discriminator")
model = FlaxElectraForSequenceClassification.from_pretrained("google/electra-small-discriminator")

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

outputs = model(**inputs)
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxElectraForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxElectraForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&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;jax&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=o("p"),v=r("Example:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Example:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function oA(x){let d,v,u,f,_;return{c(){d=o("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var z=a(u);f=i(z,"Module"),z.forEach(t),_=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,u),e(u,f),e(d,_)},d(l){l&&t(d)}}}function nA(x){let d,v,u,f,_;return f=new Oe({props:{code:`from transformers import AutoTokenizer, FlaxElectraForMultipleChoice

tokenizer = AutoTokenizer.from_pretrained("google/electra-small-discriminator")
model = FlaxElectraForMultipleChoice.from_pretrained("google/electra-small-discriminator")

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

encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors="jax", padding=True)
outputs = model(**{k: v[None, :] for k, v in encoding.items()})

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, FlaxElectraForMultipleChoice

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxElectraForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice0 = <span class="hljs-string">&quot;It is eaten with a fork and a knife.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice1 = <span class="hljs-string">&quot;It is eaten while held in the hand.&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors=<span class="hljs-string">&quot;jax&quot;</span>, padding=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**{k: v[<span class="hljs-literal">None</span>, :] <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> encoding.items()})

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=o("p"),v=r("Example:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Example:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function sA(x){let d,v,u,f,_;return{c(){d=o("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var z=a(u);f=i(z,"Module"),z.forEach(t),_=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,u),e(u,f),e(d,_)},d(l){l&&t(d)}}}function aA(x){let d,v,u,f,_;return f=new Oe({props:{code:`from transformers import AutoTokenizer, FlaxElectraForTokenClassification

tokenizer = AutoTokenizer.from_pretrained("google/electra-small-discriminator")
model = FlaxElectraForTokenClassification.from_pretrained("google/electra-small-discriminator")

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

outputs = model(**inputs)
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxElectraForTokenClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxElectraForTokenClassification.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&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;jax&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=o("p"),v=r("Example:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Example:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function rA(x){let d,v,u,f,_;return{c(){d=o("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var z=a(u);f=i(z,"Module"),z.forEach(t),_=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){g(l,d,h),e(d,v),e(d,u),e(u,f),e(d,_)},d(l){l&&t(d)}}}function iA(x){let d,v,u,f,_;return f=new Oe({props:{code:`from transformers import AutoTokenizer, FlaxElectraForQuestionAnswering

tokenizer = AutoTokenizer.from_pretrained("google/electra-small-discriminator")
model = FlaxElectraForQuestionAnswering.from_pretrained("google/electra-small-discriminator")

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"
inputs = tokenizer(question, text, return_tensors="jax")

outputs = model(**inputs)
start_scores = outputs.start_logits
end_scores = outputs.end_logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxElectraForQuestionAnswering

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxElectraForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;google/electra-small-discriminator&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;jax&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>start_scores = outputs.start_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>end_scores = outputs.end_logits`}}),{c(){d=o("p"),v=r("Example:"),u=c(),T(f.$$.fragment)},l(l){d=n(l,"P",{});var h=a(d);v=i(h,"Example:"),h.forEach(t),u=p(l),b(f.$$.fragment,l)},m(l,h){g(l,d,h),e(d,v),g(l,u,h),w(f,l,h),_=!0},p:Le,i(l){_||(E(f.$$.fragment,l),_=!0)},o(l){$(f.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function lA(x){let d,v,u,f,_,l,h,z,ve,fe,W,de,te,M,ye,Q,ce,Ne,G,ae,re,B,ie,Te,V,be,ge,H,we,le,ne,C,A,pe,Y,_e,he,J,Ee,ke,P,$e,X,se,me,Z,Fe,ue,S,xe,I,Me,ee,L,ze,O,qe,je,y,q,Qe,oe,Ce,Be,j,Ve,Je,We,Ge,Xe,D,U,Se,Ue,K,Ye,Re,Pe,Ke,R,He,Bd,fk,gk,$p,Vd,_k,kk,Fp,Jd,vk,yk,xp,Gd,Tk,bk,Mp,Xd,wk,Ek,zp,Yd,$k,Of,Uo,Gn,qp,rr,Fk,jp,xk,Nf,Ut,ir,Mk,_o,zk,Zd,qk,jk,ec,Ck,Pk,lr,Ak,Lk,Ok,Ro,Nk,tc,Ik,Dk,oc,Sk,Wk,Uk,Xn,If,Ho,Yn,Cp,dr,Rk,Pp,Hk,Df,tt,cr,Kk,Ap,Qk,Bk,pr,Vk,nc,Jk,Gk,Xk,zo,hr,Yk,Lp,Zk,ev,mr,sc,tv,Op,ov,nv,ac,sv,Np,av,rv,Zn,ur,iv,Ip,lv,dv,Rt,fr,cv,Dp,pv,hv,es,mv,Ko,uv,Sp,fv,gv,Wp,_v,kv,vv,ts,gr,yv,_r,Tv,Up,bv,wv,Sf,Qo,os,Rp,kr,Ev,Hp,$v,Wf,Tt,vr,Fv,yr,xv,Kp,Mv,zv,qv,Tr,jv,rc,Cv,Pv,Av,qo,br,Lv,Qp,Ov,Nv,wr,ic,Iv,Bp,Dv,Sv,lc,Wv,Vp,Uv,Rv,Ht,Er,Hv,Jp,Kv,Qv,ns,Bv,Bo,Vv,Gp,Jv,Gv,Xp,Xv,Yv,Uf,Vo,ss,Yp,$r,Zv,Zp,ey,Rf,Jo,Fr,ty,xr,oy,dc,ny,sy,Hf,Go,Mr,ay,zr,ry,cc,iy,ly,Kf,Xo,as,eh,qr,dy,th,cy,Qf,bt,jr,py,oh,hy,my,Cr,uy,pc,fy,gy,_y,Pr,ky,Ar,vy,yy,Ty,Kt,Lr,by,Yo,wy,hc,Ey,$y,nh,Fy,xy,My,rs,zy,is,Bf,Zo,ls,sh,Or,qy,ah,jy,Vf,pt,Nr,Cy,rh,Py,Ay,ih,Ly,Oy,Ir,Ny,mc,Iy,Dy,Sy,Dr,Wy,Sr,Uy,Ry,Hy,Qt,Wr,Ky,en,Qy,uc,By,Vy,lh,Jy,Gy,Xy,ds,Yy,cs,Jf,tn,ps,dh,Ur,Zy,ch,eT,Gf,wt,Rr,tT,Hr,oT,ph,nT,sT,aT,Kr,rT,fc,iT,lT,dT,Qr,cT,Br,pT,hT,mT,Bt,Vr,uT,on,fT,gc,gT,_T,hh,kT,vT,yT,hs,TT,ms,Xf,nn,us,mh,Jr,bT,uh,wT,Yf,ht,Gr,ET,fh,$T,FT,gh,xT,MT,Xr,zT,_c,qT,jT,CT,Yr,PT,Zr,AT,LT,OT,Vt,ei,NT,sn,IT,kc,DT,ST,_h,WT,UT,RT,fs,HT,gs,Zf,an,_s,kh,ti,KT,vh,QT,eg,Et,oi,BT,yh,VT,JT,ni,GT,vc,XT,YT,ZT,si,eb,ai,tb,ob,nb,Mt,ri,sb,rn,ab,yc,rb,ib,Th,lb,db,cb,ks,pb,vs,hb,ys,tg,ln,Ts,bh,ii,mb,wh,ub,og,$t,li,fb,Eh,gb,_b,di,kb,Tc,vb,yb,Tb,ci,bb,pi,wb,Eb,$b,Jt,hi,Fb,dn,xb,bc,Mb,zb,$h,qb,jb,Cb,bs,Pb,ws,ng,cn,Es,Fh,mi,Ab,xh,Lb,sg,mt,ui,Ob,Mh,Nb,Ib,zh,Db,Sb,fi,Wb,wc,Ub,Rb,Hb,gi,Kb,_i,Qb,Bb,Vb,Gt,ki,Jb,pn,Gb,Ec,Xb,Yb,qh,Zb,ew,tw,$s,ow,Fs,ag,hn,xs,jh,vi,nw,Ch,sw,rg,Ft,yi,aw,mn,rw,Ph,iw,lw,Ah,dw,cw,pw,Ti,hw,$c,mw,uw,fw,bi,gw,wi,_w,kw,vw,Xt,Ei,yw,un,Tw,Fc,bw,ww,Lh,Ew,$w,Fw,Ms,xw,zs,ig,fn,qs,Oh,$i,Mw,Nh,zw,lg,ut,Fi,qw,Ih,jw,Cw,xi,Pw,xc,Aw,Lw,Ow,Mi,Nw,zi,Iw,Dw,Sw,js,Ww,Yt,qi,Uw,gn,Rw,Mc,Hw,Kw,Dh,Qw,Bw,Vw,Cs,Jw,Ps,dg,_n,As,Sh,ji,Gw,Wh,Xw,cg,ot,Ci,Yw,Uh,Zw,eE,Rh,tE,oE,Pi,nE,zc,sE,aE,rE,Ai,iE,Li,lE,dE,cE,Ls,pE,Zt,Oi,hE,kn,mE,qc,uE,fE,Hh,gE,_E,kE,Os,vE,Ns,pg,vn,Is,Kh,Ni,yE,Qh,TE,hg,nt,Ii,bE,Bh,wE,EE,Vh,$E,FE,Di,xE,jc,ME,zE,qE,Si,jE,Wi,CE,PE,AE,Ds,LE,zt,Ui,OE,yn,NE,Cc,IE,DE,Jh,SE,WE,UE,Ss,RE,Ws,HE,Us,mg,Tn,Rs,Gh,Ri,KE,Xh,QE,ug,ft,Hi,BE,Yh,VE,JE,Ki,GE,Pc,XE,YE,ZE,Qi,e2,Bi,t2,o2,n2,Hs,s2,qt,Vi,a2,bn,r2,Ac,i2,l2,Zh,d2,c2,p2,Ks,h2,Qs,m2,Bs,fg,wn,Vs,em,Ji,u2,tm,f2,gg,gt,Gi,g2,om,_2,k2,Xi,v2,Lc,y2,T2,b2,Yi,w2,Zi,E2,$2,F2,Js,x2,eo,el,M2,En,z2,Oc,q2,j2,nm,C2,P2,A2,Gs,L2,Xs,_g,$n,Ys,sm,tl,O2,am,N2,kg,st,ol,I2,rm,D2,S2,im,W2,U2,nl,R2,Nc,H2,K2,Q2,sl,B2,al,V2,J2,G2,Zs,X2,jt,rl,Y2,Fn,Z2,Ic,e1,t1,lm,o1,n1,s1,ea,a1,ta,r1,oa,vg,xn,na,dm,il,i1,cm,l1,yg,_t,ll,d1,Mn,c1,pm,p1,h1,hm,m1,u1,f1,dl,g1,Dc,_1,k1,v1,cl,y1,pl,T1,b1,w1,sa,E1,Ct,hl,$1,zn,F1,Sc,x1,M1,mm,z1,q1,j1,aa,C1,ra,P1,ia,Tg,qn,la,um,ml,A1,fm,L1,bg,at,ul,O1,gm,N1,I1,fl,D1,Wc,S1,W1,U1,gl,R1,_l,H1,K1,Q1,_m,B1,V1,ko,km,kl,J1,G1,vm,vl,X1,Y1,ym,yl,Z1,e$,Tm,Tl,t$,o$,to,bl,n$,jn,s$,bm,a$,r$,wm,i$,l$,d$,da,c$,ca,wg,Cn,pa,Em,wl,p$,$m,h$,Eg,Ze,El,m$,Fm,u$,f$,xm,g$,_$,$l,k$,Uc,v$,y$,T$,Fl,b$,xl,w$,E$,$$,Mm,F$,x$,vo,zm,Ml,M$,z$,qm,zl,q$,j$,jm,ql,C$,P$,Cm,jl,A$,L$,oo,Cl,O$,Pn,N$,Pm,I$,D$,Am,S$,W$,U$,ha,R$,ma,$g,An,ua,Lm,Pl,H$,Om,K$,Fg,rt,Al,Q$,Nm,B$,V$,Ll,J$,Rc,G$,X$,Y$,Ol,Z$,Nl,e0,t0,o0,Im,n0,s0,yo,Dm,Il,a0,r0,Sm,Dl,i0,l0,Wm,Sl,d0,c0,Um,Wl,p0,h0,no,Ul,m0,Ln,u0,Rm,f0,g0,Hm,_0,k0,v0,fa,y0,ga,xg,On,_a,Km,Rl,T0,Qm,b0,Mg,it,Hl,w0,Kl,E0,Bm,$0,F0,x0,Ql,M0,Hc,z0,q0,j0,Bl,C0,Vl,P0,A0,L0,Vm,O0,N0,To,Jm,Jl,I0,D0,Gm,Gl,S0,W0,Xm,Xl,U0,R0,Ym,Yl,H0,K0,so,Zl,Q0,Nn,B0,Zm,V0,J0,eu,G0,X0,Y0,ka,Z0,va,zg,In,ya,tu,ed,eF,ou,tF,qg,lt,td,oF,nu,nF,sF,od,aF,Kc,rF,iF,lF,nd,dF,sd,cF,pF,hF,su,mF,uF,bo,au,ad,fF,gF,ru,rd,_F,kF,iu,id,vF,yF,lu,ld,TF,bF,ao,dd,wF,Dn,EF,du,$F,FF,cu,xF,MF,zF,Ta,qF,ba,jg,Sn,wa,pu,cd,jF,hu,CF,Cg,dt,pd,PF,mu,AF,LF,hd,OF,Qc,NF,IF,DF,md,SF,ud,WF,UF,RF,uu,HF,KF,wo,fu,fd,QF,BF,gu,gd,VF,JF,_u,_d,GF,XF,ku,kd,YF,ZF,ro,vd,e4,Wn,t4,vu,o4,n4,yu,s4,a4,r4,Ea,i4,$a,Pg,Un,Fa,Tu,yd,l4,bu,d4,Ag,et,Td,c4,wu,p4,h4,Eu,m4,u4,bd,f4,Bc,g4,_4,k4,wd,v4,Ed,y4,T4,b4,$u,w4,E4,Eo,Fu,$d,$4,F4,xu,Fd,x4,M4,Mu,xd,z4,q4,zu,Md,j4,C4,io,zd,P4,Rn,A4,qu,L4,O4,ju,N4,I4,D4,xa,S4,Ma,Lg,Hn,za,Cu,qd,W4,Pu,U4,Og,ct,jd,R4,Kn,H4,Au,K4,Q4,Lu,B4,V4,J4,Cd,G4,Vc,X4,Y4,Z4,Pd,ex,Ad,tx,ox,nx,Ou,sx,ax,$o,Nu,Ld,rx,ix,Iu,Od,lx,dx,Du,Nd,cx,px,Su,Id,hx,mx,lo,Dd,ux,Qn,fx,Wu,gx,_x,Uu,kx,vx,yx,qa,Tx,ja,Ng;return l=new De({}),ie=new De({}),K=new De({}),rr=new De({}),ir=new N({props:{name:"class transformers.ElectraConfig",anchor:"transformers.ElectraConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"embedding_size",val:" = 128"},{name:"hidden_size",val:" = 256"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 4"},{name:"intermediate_size",val:" = 1024"},{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:"type_vocab_size",val:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"summary_type",val:" = 'first'"},{name:"summary_use_proj",val:" = True"},{name:"summary_activation",val:" = 'gelu'"},{name:"summary_last_dropout",val:" = 0.1"},{name:"pad_token_id",val:" = 0"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"use_cache",val:" = True"},{name:"classifier_dropout",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ElectraConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the ELECTRA model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraModel">ElectraModel</a> or <a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.TFElectraModel">TFElectraModel</a>.`,name:"vocab_size"},{anchor:"transformers.ElectraConfig.embedding_size",description:`<strong>embedding_size</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"embedding_size"},{anchor:"transformers.ElectraConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.ElectraConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.ElectraConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.ElectraConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.ElectraConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.ElectraConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.ElectraConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.ElectraConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.ElectraConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraModel">ElectraModel</a> or <a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.TFElectraModel">TFElectraModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.ElectraConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.ElectraConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.ElectraConfig.summary_type",description:`<strong>summary_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;first&quot;</code>) &#x2014;
Argument used when doing sequence summary. Used in the sequence classification and multiple choice models.</p>
<p>Has to be one of the following options:</p>
<ul>
<li><code>&quot;last&quot;</code>: Take the last token hidden state (like XLNet).</li>
<li><code>&quot;first&quot;</code>: Take the first token hidden state (like BERT).</li>
<li><code>&quot;mean&quot;</code>: Take the mean of all tokens hidden states.</li>
<li><code>&quot;cls_index&quot;</code>: Supply a Tensor of classification token position (like GPT/GPT-2).</li>
<li><code>&quot;attn&quot;</code>: Not implemented now, use multi-head attention.</li>
</ul>`,name:"summary_type"},{anchor:"transformers.ElectraConfig.summary_use_proj",description:`<strong>summary_use_proj</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Argument used when doing sequence summary. Used in the sequence classification and multiple choice models.</p>
<p>Whether or not to add a projection after the vector extraction.`,name:"summary_use_proj"},{anchor:"transformers.ElectraConfig.summary_activation",description:`<strong>summary_activation</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Argument used when doing sequence summary. Used in the sequence classification and multiple choice models.</p>
<p>Pass <code>&quot;gelu&quot;</code> for a gelu activation to the output, any other value will result in no activation.`,name:"summary_activation"},{anchor:"transformers.ElectraConfig.summary_last_dropout",description:`<strong>summary_last_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Argument used when doing sequence summary. Used in the sequence classification and multiple choice models.</p>
<p>The dropout ratio to be used after the projection and activation.`,name:"summary_last_dropout"},{anchor:"transformers.ElectraConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;</code>. For
positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.ElectraConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.ElectraConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The dropout ratio for the classification head.`,name:"classifier_dropout"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/configuration_electra.py#L44"}}),Xn=new Ae({props:{anchor:"transformers.ElectraConfig.example",$$slots:{default:[tP]},$$scope:{ctx:x}}}),dr=new De({}),cr=new N({props:{name:"class transformers.ElectraTokenizer",anchor:"transformers.ElectraTokenizer",parameters:[{name:"vocab_file",val:""},{name:"do_lower_case",val:" = True"},{name:"do_basic_tokenize",val:" = True"},{name:"never_split",val:" = None"},{name:"unk_token",val:" = '[UNK]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ElectraTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.ElectraTokenizer.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.ElectraTokenizer.do_basic_tokenize",description:`<strong>do_basic_tokenize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to do basic tokenization before WordPiece.`,name:"do_basic_tokenize"},{anchor:"transformers.ElectraTokenizer.never_split",description:`<strong>never_split</strong> (<code>Iterable</code>, <em>optional</em>) &#x2014;
Collection of tokens which will never be split during tokenization. Only has an effect when
<code>do_basic_tokenize=True</code>`,name:"never_split"},{anchor:"transformers.ElectraTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[UNK]&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.ElectraTokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[SEP]&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.ElectraTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[PAD]&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.ElectraTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[CLS]&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.ElectraTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[MASK]&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.ElectraTokenizer.tokenize_chinese_chars",description:`<strong>tokenize_chinese_chars</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to tokenize Chinese characters.</p>
<p>This should likely be deactivated for Japanese (see this
<a href="https://github.com/huggingface/transformers/issues/328" rel="nofollow">issue</a>).`,name:"tokenize_chinese_chars"},{anchor:"transformers.ElectraTokenizer.strip_accents",description:`<strong>strip_accents</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
value for <code>lowercase</code> (as in the original Electra).`,name:"strip_accents"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/tokenization_electra.py#L93"}}),hr=new N({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.ElectraTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.ElectraTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.ElectraTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/tokenization_electra.py#L223",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),ur=new N({props:{name:"convert_tokens_to_string",anchor:"transformers.ElectraTokenizer.convert_tokens_to_string",parameters:[{name:"tokens",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/tokenization_electra.py#L218"}}),fr=new N({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.ElectraTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.ElectraTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.ElectraTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/tokenization_electra.py#L276",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),es=new Ae({props:{anchor:"transformers.ElectraTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[oP]},$$scope:{ctx:x}}}),gr=new N({props:{name:"get_special_tokens_mask",anchor:"transformers.ElectraTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.ElectraTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.ElectraTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.ElectraTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/tokenization_electra.py#L248",returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),kr=new De({}),vr=new N({props:{name:"class transformers.ElectraTokenizerFast",anchor:"transformers.ElectraTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"do_lower_case",val:" = True"},{name:"unk_token",val:" = '[UNK]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ElectraTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.ElectraTokenizerFast.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.ElectraTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[UNK]&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.ElectraTokenizerFast.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[SEP]&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.ElectraTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[PAD]&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.ElectraTokenizerFast.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[CLS]&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.ElectraTokenizerFast.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[MASK]&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.ElectraTokenizerFast.clean_text",description:`<strong>clean_text</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to clean the text before tokenization by removing any control characters and replacing all
whitespaces by the classic one.`,name:"clean_text"},{anchor:"transformers.ElectraTokenizerFast.tokenize_chinese_chars",description:`<strong>tokenize_chinese_chars</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to tokenize Chinese characters. This should likely be deactivated for Japanese (see <a href="https://github.com/huggingface/transformers/issues/328" rel="nofollow">this
issue</a>).`,name:"tokenize_chinese_chars"},{anchor:"transformers.ElectraTokenizerFast.strip_accents",description:`<strong>strip_accents</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
value for <code>lowercase</code> (as in the original ELECTRA).`,name:"strip_accents"},{anchor:"transformers.ElectraTokenizerFast.wordpieces_prefix",description:`<strong>wordpieces_prefix</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;##&quot;</code>) &#x2014;
The prefix for subwords.`,name:"wordpieces_prefix"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/tokenization_electra_fast.py#L88"}}),br=new N({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.ElectraTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:""},{name:"token_ids_1",val:" = None"}],parametersDescription:[{anchor:"transformers.ElectraTokenizerFast.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.ElectraTokenizerFast.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/tokenization_electra_fast.py#L176",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Er=new N({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.ElectraTokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.ElectraTokenizerFast.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.ElectraTokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/tokenization_electra_fast.py#L200",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),ns=new Ae({props:{anchor:"transformers.ElectraTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[nP]},$$scope:{ctx:x}}}),$r=new De({}),Fr=new N({props:{name:"class transformers.models.electra.modeling_electra.ElectraForPreTrainingOutput",anchor:"transformers.models.electra.modeling_electra.ElectraForPreTrainingOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"logits",val:": FloatTensor = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.electra.modeling_electra.ElectraForPreTrainingOutput.loss",description:`<strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) &#x2014;
Total loss of the ELECTRA objective.`,name:"loss"},{anchor:"transformers.models.electra.modeling_electra.ElectraForPreTrainingOutput.logits",description:`<strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Prediction scores of the head (scores for each token before SoftMax).`,name:"logits"},{anchor:"transformers.models.electra.modeling_electra.ElectraForPreTrainingOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.electra.modeling_electra.ElectraForPreTrainingOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/modeling_electra.py#L701"}}),Mr=new N({props:{name:"class transformers.models.electra.modeling_tf_electra.TFElectraForPreTrainingOutput",anchor:"transformers.models.electra.modeling_tf_electra.TFElectraForPreTrainingOutput",parameters:[{name:"logits",val:": Tensor = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"}],parametersDescription:[{anchor:"transformers.models.electra.modeling_tf_electra.TFElectraForPreTrainingOutput.loss",description:`<strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>tf.Tensor</code> of shape <code>(1,)</code>) &#x2014;
Total loss of the ELECTRA objective.`,name:"loss"},{anchor:"transformers.models.electra.modeling_tf_electra.TFElectraForPreTrainingOutput.logits",description:`<strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Prediction scores of the head (scores for each token before SoftMax).`,name:"logits"},{anchor:"transformers.models.electra.modeling_tf_electra.TFElectraForPreTrainingOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.electra.modeling_tf_electra.TFElectraForPreTrainingOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/modeling_tf_electra.py#L813"}}),qr=new De({}),jr=new N({props:{name:"class transformers.ElectraModel",anchor:"transformers.ElectraModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ElectraModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig">ElectraConfig</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/electra/modeling_electra.py#L813"}}),Lr=new N({props:{name:"forward",anchor:"transformers.ElectraModel.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:"position_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.ElectraModel.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.ElectraModel.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.ElectraModel.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.ElectraModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ElectraModel.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.ElectraModel.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.ElectraModel.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.ElectraModel.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 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.ElectraModel.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.ElectraModel.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.ElectraModel.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"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/modeling_electra.py#L840",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithCrossAttentions</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/electra#transformers.ElectraConfig"
>ElectraConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),rs=new Ie({props:{$$slots:{default:[sP]},$$scope:{ctx:x}}}),is=new Ae({props:{anchor:"transformers.ElectraModel.forward.example",$$slots:{default:[aP]},$$scope:{ctx:x}}}),Or=new De({}),Nr=new N({props:{name:"class transformers.ElectraForPreTraining",anchor:"transformers.ElectraForPreTraining",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ElectraForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig">ElectraConfig</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/electra/modeling_electra.py#L1062"}}),Wr=new N({props:{name:"forward",anchor:"transformers.ElectraForPreTraining.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:"position_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.ElectraForPreTraining.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.ElectraForPreTraining.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.ElectraForPreTraining.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.ElectraForPreTraining.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ElectraForPreTraining.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.ElectraForPreTraining.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.ElectraForPreTraining.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.ElectraForPreTraining.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 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.ElectraForPreTraining.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.ElectraForPreTraining.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.ElectraForPreTraining.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.ElectraForPreTraining.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 ELECTRA loss. Input should be a sequence of tokens (see <code>input_ids</code> docstring)
Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates the token is an original token,</li>
<li>1 indicates the token was replaced.</li>
</ul>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/modeling_electra.py#L1071",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.models.electra.modeling_electra.ElectraForPreTrainingOutput"
>transformers.models.electra.modeling_electra.ElectraForPreTrainingOutput</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/electra#transformers.ElectraConfig"
>ElectraConfig</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 of the ELECTRA objective.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Prediction scores of the head (scores for each 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 + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.models.electra.modeling_electra.ElectraForPreTrainingOutput"
>transformers.models.electra.modeling_electra.ElectraForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ds=new Ie({props:{$$slots:{default:[rP]},$$scope:{ctx:x}}}),cs=new Ae({props:{anchor:"transformers.ElectraForPreTraining.forward.example",$$slots:{default:[iP]},$$scope:{ctx:x}}}),Ur=new De({}),Rr=new N({props:{name:"class transformers.ElectraForCausalLM",anchor:"transformers.ElectraForCausalLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ElectraForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig">ElectraConfig</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/electra/modeling_electra.py#L1535"}}),Vr=new N({props:{name:"forward",anchor:"transformers.ElectraForCausalLM.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:"position_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:"past_key_values",val:": typing.Optional[typing.List[torch.Tensor]] = 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.ElectraForCausalLM.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.ElectraForCausalLM.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.ElectraForCausalLM.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.ElectraForCausalLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ElectraForCausalLM.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.ElectraForCausalLM.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.ElectraForCausalLM.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.ElectraForCausalLM.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 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.ElectraForCausalLM.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.ElectraForCausalLM.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.ElectraForCausalLM.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.ElectraForCausalLM.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.ElectraForCausalLM.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.ElectraForCausalLM.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 left-to-right language modeling loss (next word prediction). 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"},{anchor:"transformers.ElectraForCausalLM.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.ElectraForCausalLM.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/electra/modeling_electra.py#L1556",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</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/electra#transformers.ElectraConfig"
>ElectraConfig</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 Language modeling loss (for next-token prediction).</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>
<li>
<p><strong>cross_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>Cross attentions weights 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>torch.FloatTensor</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key,
value states of the self-attention and the cross-attention layers if model is used in encoder-decoder
setting. Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the 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.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),hs=new Ie({props:{$$slots:{default:[lP]},$$scope:{ctx:x}}}),ms=new Ae({props:{anchor:"transformers.ElectraForCausalLM.forward.example",$$slots:{default:[dP]},$$scope:{ctx:x}}}),Jr=new De({}),Gr=new N({props:{name:"class transformers.ElectraForMaskedLM",anchor:"transformers.ElectraForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ElectraForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig">ElectraConfig</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/electra/modeling_electra.py#L1168"}}),ei=new N({props:{name:"forward",anchor:"transformers.ElectraForMaskedLM.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:"position_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.ElectraForMaskedLM.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.ElectraForMaskedLM.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.ElectraForMaskedLM.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.ElectraForMaskedLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ElectraForMaskedLM.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.ElectraForMaskedLM.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.ElectraForMaskedLM.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.ElectraForMaskedLM.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 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.ElectraForMaskedLM.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.ElectraForMaskedLM.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.ElectraForMaskedLM.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.ElectraForMaskedLM.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/electra/modeling_electra.py#L1187",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/electra#transformers.ElectraConfig"
>ElectraConfig</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>
`}}),fs=new Ie({props:{$$slots:{default:[cP]},$$scope:{ctx:x}}}),gs=new Ae({props:{anchor:"transformers.ElectraForMaskedLM.forward.example",$$slots:{default:[pP]},$$scope:{ctx:x}}}),ti=new De({}),oi=new N({props:{name:"class transformers.ElectraForSequenceClassification",anchor:"transformers.ElectraForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ElectraForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig">ElectraConfig</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/electra/modeling_electra.py#L964"}}),ri=new N({props:{name:"forward",anchor:"transformers.ElectraForSequenceClassification.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:"position_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.ElectraForSequenceClassification.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.ElectraForSequenceClassification.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.ElectraForSequenceClassification.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.ElectraForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ElectraForSequenceClassification.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.ElectraForSequenceClassification.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.ElectraForSequenceClassification.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.ElectraForSequenceClassification.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 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.ElectraForSequenceClassification.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.ElectraForSequenceClassification.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.ElectraForSequenceClassification.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.ElectraForSequenceClassification.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/electra/modeling_electra.py#L975",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/electra#transformers.ElectraConfig"
>ElectraConfig</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>
`}}),ks=new Ie({props:{$$slots:{default:[hP]},$$scope:{ctx:x}}}),vs=new Ae({props:{anchor:"transformers.ElectraForSequenceClassification.forward.example",$$slots:{default:[mP]},$$scope:{ctx:x}}}),ys=new Ae({props:{anchor:"transformers.ElectraForSequenceClassification.forward.example-2",$$slots:{default:[uP]},$$scope:{ctx:x}}}),ii=new De({}),li=new N({props:{name:"class transformers.ElectraForMultipleChoice",anchor:"transformers.ElectraForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ElectraForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig">ElectraConfig</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/electra/modeling_electra.py#L1448"}}),hi=new N({props:{name:"forward",anchor:"transformers.ElectraForMultipleChoice.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:"position_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.ElectraForMultipleChoice.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.ElectraForMultipleChoice.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.ElectraForMultipleChoice.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.ElectraForMultipleChoice.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ElectraForMultipleChoice.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.ElectraForMultipleChoice.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.ElectraForMultipleChoice.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, 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.ElectraForMultipleChoice.forward.encoder_attention_mask",description:`<strong>encoder_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 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 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.ElectraForMultipleChoice.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.ElectraForMultipleChoice.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.ElectraForMultipleChoice.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.ElectraForMultipleChoice.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/electra/modeling_electra.py#L1459",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/electra#transformers.ElectraConfig"
>ElectraConfig</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>
`}}),bs=new Ie({props:{$$slots:{default:[fP]},$$scope:{ctx:x}}}),ws=new Ae({props:{anchor:"transformers.ElectraForMultipleChoice.forward.example",$$slots:{default:[gP]},$$scope:{ctx:x}}}),mi=new De({}),ui=new N({props:{name:"class transformers.ElectraForTokenClassification",anchor:"transformers.ElectraForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ElectraForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig">ElectraConfig</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/electra/modeling_electra.py#L1259"}}),ki=new N({props:{name:"forward",anchor:"transformers.ElectraForTokenClassification.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:"position_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.ElectraForTokenClassification.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.ElectraForTokenClassification.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.ElectraForTokenClassification.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.ElectraForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ElectraForTokenClassification.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.ElectraForTokenClassification.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.ElectraForTokenClassification.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.ElectraForTokenClassification.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 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.ElectraForTokenClassification.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.ElectraForTokenClassification.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.ElectraForTokenClassification.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.ElectraForTokenClassification.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/electra/modeling_electra.py#L1273",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/electra#transformers.ElectraConfig"
>ElectraConfig</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>
`}}),$s=new Ie({props:{$$slots:{default:[_P]},$$scope:{ctx:x}}}),Fs=new Ae({props:{anchor:"transformers.ElectraForTokenClassification.forward.example",$$slots:{default:[kP]},$$scope:{ctx:x}}}),vi=new De({}),yi=new N({props:{name:"class transformers.ElectraForQuestionAnswering",anchor:"transformers.ElectraForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ElectraForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig">ElectraConfig</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/electra/modeling_electra.py#L1340"}}),Ei=new N({props:{name:"forward",anchor:"transformers.ElectraForQuestionAnswering.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:"position_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.ElectraForQuestionAnswering.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.ElectraForQuestionAnswering.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.ElectraForQuestionAnswering.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.ElectraForQuestionAnswering.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ElectraForQuestionAnswering.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.ElectraForQuestionAnswering.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.ElectraForQuestionAnswering.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.ElectraForQuestionAnswering.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 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.ElectraForQuestionAnswering.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.ElectraForQuestionAnswering.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.ElectraForQuestionAnswering.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.ElectraForQuestionAnswering.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.ElectraForQuestionAnswering.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/electra/modeling_electra.py#L1354",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/electra#transformers.ElectraConfig"
>ElectraConfig</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>
`}}),Ms=new Ie({props:{$$slots:{default:[vP]},$$scope:{ctx:x}}}),zs=new Ae({props:{anchor:"transformers.ElectraForQuestionAnswering.forward.example",$$slots:{default:[yP]},$$scope:{ctx:x}}}),$i=new De({}),Fi=new N({props:{name:"class transformers.TFElectraModel",anchor:"transformers.TFElectraModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFElectraModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig">ElectraConfig</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/electra/modeling_tf_electra.py#L938"}}),js=new Ie({props:{$$slots:{default:[TP]},$$scope:{ctx:x}}}),qi=new N({props:{name:"call",anchor:"transformers.TFElectraModel.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_hidden_states",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor]]], NoneType] = 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"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFElectraModel.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFElectraModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFElectraModel.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFElectraModel.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFElectraModel.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFElectraModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFElectraModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFElectraModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFElectraModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFElectraModel.call.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>tf.Tensor</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.TFElectraModel.call.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>tf.Tensor</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.TFElectraModel.call.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[tf.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
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.TFElectraModel.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#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>). Set to <code>False</code> during training, <code>True</code> during generation`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/modeling_tf_electra.py#L944",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPastAndCrossAttentions</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig"
>ElectraConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Cs=new Ie({props:{$$slots:{default:[bP]},$$scope:{ctx:x}}}),Ps=new Ae({props:{anchor:"transformers.TFElectraModel.call.example",$$slots:{default:[wP]},$$scope:{ctx:x}}}),ji=new De({}),Ci=new N({props:{name:"class transformers.TFElectraForPreTraining",anchor:"transformers.TFElectraForPreTraining",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFElectraForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig">ElectraConfig</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/electra/modeling_tf_electra.py#L1034"}}),Ls=new Ie({props:{$$slots:{default:[EP]},$$scope:{ctx:x}}}),Oi=new N({props:{name:"call",anchor:"transformers.TFElectraForPreTraining.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFElectraForPreTraining.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFElectraForPreTraining.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFElectraForPreTraining.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFElectraForPreTraining.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFElectraForPreTraining.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFElectraForPreTraining.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFElectraForPreTraining.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFElectraForPreTraining.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFElectraForPreTraining.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/modeling_tf_electra.py#L1041",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.models.electra.modeling_tf_electra.TFElectraForPreTrainingOutput"
>transformers.models.electra.modeling_tf_electra.TFElectraForPreTrainingOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig"
>ElectraConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>tf.Tensor</code> of shape <code>(1,)</code>) \u2014 Total loss of the ELECTRA objective.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Prediction scores of the head (scores for each token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.models.electra.modeling_tf_electra.TFElectraForPreTrainingOutput"
>transformers.models.electra.modeling_tf_electra.TFElectraForPreTrainingOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Os=new Ie({props:{$$slots:{default:[$P]},$$scope:{ctx:x}}}),Ns=new Ae({props:{anchor:"transformers.TFElectraForPreTraining.call.example",$$slots:{default:[FP]},$$scope:{ctx:x}}}),Ni=new De({}),Ii=new N({props:{name:"class transformers.TFElectraForMaskedLM",anchor:"transformers.TFElectraForMaskedLM",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFElectraForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig">ElectraConfig</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/electra/modeling_tf_electra.py#L1149"}}),Ds=new Ie({props:{$$slots:{default:[xP]},$$scope:{ctx:x}}}),Ui=new N({props:{name:"call",anchor:"transformers.TFElectraForMaskedLM.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFElectraForMaskedLM.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFElectraForMaskedLM.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFElectraForMaskedLM.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFElectraForMaskedLM.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFElectraForMaskedLM.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFElectraForMaskedLM.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFElectraForMaskedLM.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFElectraForMaskedLM.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFElectraForMaskedLM.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFElectraForMaskedLM.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/modeling_tf_electra.py#L1171",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFMaskedLMOutput"
>transformers.modeling_tf_outputs.TFMaskedLMOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig"
>ElectraConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFMaskedLMOutput"
>transformers.modeling_tf_outputs.TFMaskedLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Ss=new Ie({props:{$$slots:{default:[MP]},$$scope:{ctx:x}}}),Ws=new Ae({props:{anchor:"transformers.TFElectraForMaskedLM.call.example",$$slots:{default:[zP]},$$scope:{ctx:x}}}),Us=new Ae({props:{anchor:"transformers.TFElectraForMaskedLM.call.example-2",$$slots:{default:[qP]},$$scope:{ctx:x}}}),Ri=new De({}),Hi=new N({props:{name:"class transformers.TFElectraForSequenceClassification",anchor:"transformers.TFElectraForSequenceClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFElectraForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig">ElectraConfig</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/electra/modeling_tf_electra.py#L1275"}}),Hs=new Ie({props:{$$slots:{default:[jP]},$$scope:{ctx:x}}}),Vi=new N({props:{name:"call",anchor:"transformers.TFElectraForSequenceClassification.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFElectraForSequenceClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFElectraForSequenceClassification.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFElectraForSequenceClassification.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFElectraForSequenceClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFElectraForSequenceClassification.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFElectraForSequenceClassification.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFElectraForSequenceClassification.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFElectraForSequenceClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFElectraForSequenceClassification.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFElectraForSequenceClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/modeling_tf_electra.py#L1282",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig"
>ElectraConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, )</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Ks=new Ie({props:{$$slots:{default:[CP]},$$scope:{ctx:x}}}),Qs=new Ae({props:{anchor:"transformers.TFElectraForSequenceClassification.call.example",$$slots:{default:[PP]},$$scope:{ctx:x}}}),Bs=new Ae({props:{anchor:"transformers.TFElectraForSequenceClassification.call.example-2",$$slots:{default:[AP]},$$scope:{ctx:x}}}),Ji=new De({}),Gi=new N({props:{name:"class transformers.TFElectraForMultipleChoice",anchor:"transformers.TFElectraForMultipleChoice",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFElectraForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig">ElectraConfig</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/electra/modeling_tf_electra.py#L1353"}}),Js=new Ie({props:{$$slots:{default:[LP]},$$scope:{ctx:x}}}),el=new N({props:{name:"call",anchor:"transformers.TFElectraForMultipleChoice.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFElectraForMultipleChoice.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFElectraForMultipleChoice.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFElectraForMultipleChoice.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFElectraForMultipleChoice.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFElectraForMultipleChoice.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFElectraForMultipleChoice.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFElectraForMultipleChoice.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFElectraForMultipleChoice.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFElectraForMultipleChoice.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFElectraForMultipleChoice.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the multiple choice classification loss. Indices should be in <code>[0, ..., num_choices]</code>
where <code>num_choices</code> is the size of the second dimension of the input tensors. (See <code>input_ids</code> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/modeling_tf_electra.py#L1375",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput"
>transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig"
>ElectraConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <em>(batch_size, )</em>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_choices)</code>) \u2014 <em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput"
>transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Gs=new Ie({props:{$$slots:{default:[OP]},$$scope:{ctx:x}}}),Xs=new Ae({props:{anchor:"transformers.TFElectraForMultipleChoice.call.example",$$slots:{default:[NP]},$$scope:{ctx:x}}}),tl=new De({}),ol=new N({props:{name:"class transformers.TFElectraForTokenClassification",anchor:"transformers.TFElectraForTokenClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFElectraForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig">ElectraConfig</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/electra/modeling_tf_electra.py#L1478"}}),Zs=new Ie({props:{$$slots:{default:[IP]},$$scope:{ctx:x}}}),rl=new N({props:{name:"call",anchor:"transformers.TFElectraForTokenClassification.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFElectraForTokenClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFElectraForTokenClassification.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFElectraForTokenClassification.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFElectraForTokenClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFElectraForTokenClassification.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFElectraForTokenClassification.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFElectraForTokenClassification.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFElectraForTokenClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFElectraForTokenClassification.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFElectraForTokenClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/modeling_tf_electra.py#L1491",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFTokenClassifierOutput"
>transformers.modeling_tf_outputs.TFTokenClassifierOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig"
>ElectraConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of unmasked labels, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFTokenClassifierOutput"
>transformers.modeling_tf_outputs.TFTokenClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ea=new Ie({props:{$$slots:{default:[DP]},$$scope:{ctx:x}}}),ta=new Ae({props:{anchor:"transformers.TFElectraForTokenClassification.call.example",$$slots:{default:[SP]},$$scope:{ctx:x}}}),oa=new Ae({props:{anchor:"transformers.TFElectraForTokenClassification.call.example-2",$$slots:{default:[WP]},$$scope:{ctx:x}}}),il=new De({}),ll=new N({props:{name:"class transformers.TFElectraForQuestionAnswering",anchor:"transformers.TFElectraForQuestionAnswering",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFElectraForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig">ElectraConfig</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/electra/modeling_tf_electra.py#L1562"}}),sa=new Ie({props:{$$slots:{default:[UP]},$$scope:{ctx:x}}}),hl=new N({props:{name:"call",anchor:"transformers.TFElectraForQuestionAnswering.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"start_positions",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"end_positions",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFElectraForQuestionAnswering.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFElectraForQuestionAnswering.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFElectraForQuestionAnswering.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFElectraForQuestionAnswering.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFElectraForQuestionAnswering.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFElectraForQuestionAnswering.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFElectraForQuestionAnswering.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFElectraForQuestionAnswering.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFElectraForQuestionAnswering.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFElectraForQuestionAnswering.call.start_positions",description:`<strong>start_positions</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.TFElectraForQuestionAnswering.call.end_positions",description:`<strong>end_positions</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/modeling_tf_electra.py#L1572",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput"
>transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig"
>ElectraConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, )</code>, <em>optional</em>, returned when <code>start_positions</code> and <code>end_positions</code> are provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput"
>transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),aa=new Ie({props:{$$slots:{default:[RP]},$$scope:{ctx:x}}}),ra=new Ae({props:{anchor:"transformers.TFElectraForQuestionAnswering.call.example",$$slots:{default:[HP]},$$scope:{ctx:x}}}),ia=new Ae({props:{anchor:"transformers.TFElectraForQuestionAnswering.call.example-2",$$slots:{default:[KP]},$$scope:{ctx:x}}}),ml=new De({}),ul=new N({props:{name:"class transformers.FlaxElectraModel",anchor:"transformers.FlaxElectraModel",parameters:[{name:"config",val:": ElectraConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxElectraModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig">ElectraConfig</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/electra/modeling_flax_electra.py#L920"}}),bl=new N({props:{name:"__call__",anchor:"transformers.FlaxElectraModel.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{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:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxElectraModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</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.FlaxElectraModel.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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.FlaxElectraModel.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</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.FlaxElectraModel.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxElectraModel.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</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.FlaxElectraModel.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/modeling_flax_electra.py#L770",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</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/electra#transformers.ElectraConfig"
>ElectraConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</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_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),da=new Ie({props:{$$slots:{default:[QP]},$$scope:{ctx:x}}}),ca=new Ae({props:{anchor:"transformers.FlaxElectraModel.__call__.example",$$slots:{default:[BP]},$$scope:{ctx:x}}}),wl=new De({}),El=new N({props:{name:"class transformers.FlaxElectraForPreTraining",anchor:"transformers.FlaxElectraForPreTraining",parameters:[{name:"config",val:": ElectraConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxElectraForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig">ElectraConfig</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/electra/modeling_flax_electra.py#L1071"}}),Cl=new N({props:{name:"__call__",anchor:"transformers.FlaxElectraForPreTraining.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{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:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxElectraForPreTraining.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</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.FlaxElectraForPreTraining.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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.FlaxElectraForPreTraining.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</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.FlaxElectraForPreTraining.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxElectraForPreTraining.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</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.FlaxElectraForPreTraining.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/modeling_flax_electra.py#L770",returnDescription:`
<p>A <code>transformers.models.electra.modeling_flax_electra.FlaxElectraForPreTrainingOutput</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/electra#transformers.ElectraConfig"
>ElectraConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</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.electra.modeling_flax_electra.FlaxElectraForPreTrainingOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ha=new Ie({props:{$$slots:{default:[VP]},$$scope:{ctx:x}}}),ma=new Ae({props:{anchor:"transformers.FlaxElectraForPreTraining.__call__.example",$$slots:{default:[JP]},$$scope:{ctx:x}}}),Pl=new De({}),Al=new N({props:{name:"class transformers.FlaxElectraForCausalLM",anchor:"transformers.FlaxElectraForCausalLM",parameters:[{name:"config",val:": ElectraConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxElectraForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig">ElectraConfig</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/electra/modeling_flax_electra.py#L1565"}}),Ul=new N({props:{name:"__call__",anchor:"transformers.FlaxElectraForCausalLM.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{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:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxElectraForCausalLM.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</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.FlaxElectraForCausalLM.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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.FlaxElectraForCausalLM.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</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.FlaxElectraForCausalLM.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxElectraForCausalLM.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</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.FlaxElectraForCausalLM.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/modeling_flax_electra.py#L770",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</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/electra#transformers.ElectraConfig"
>ElectraConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights 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(jnp.ndarray))</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>jnp.ndarray</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key, value
states of the self-attention and the cross-attention layers if model is used in encoder-decoder setting.
Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the 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_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),fa=new Ie({props:{$$slots:{default:[GP]},$$scope:{ctx:x}}}),ga=new Ae({props:{anchor:"transformers.FlaxElectraForCausalLM.__call__.example",$$slots:{default:[XP]},$$scope:{ctx:x}}}),Rl=new De({}),Hl=new N({props:{name:"class transformers.FlaxElectraForMaskedLM",anchor:"transformers.FlaxElectraForMaskedLM",parameters:[{name:"config",val:": ElectraConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxElectraForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig">ElectraConfig</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/electra/modeling_flax_electra.py#L1007"}}),Zl=new N({props:{name:"__call__",anchor:"transformers.FlaxElectraForMaskedLM.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{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:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxElectraForMaskedLM.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</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.FlaxElectraForMaskedLM.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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.FlaxElectraForMaskedLM.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</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.FlaxElectraForMaskedLM.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxElectraForMaskedLM.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</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.FlaxElectraForMaskedLM.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/modeling_flax_electra.py#L770",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</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/electra#transformers.ElectraConfig"
>ElectraConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</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_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ka=new Ie({props:{$$slots:{default:[YP]},$$scope:{ctx:x}}}),va=new Ae({props:{anchor:"transformers.FlaxElectraForMaskedLM.__call__.example",$$slots:{default:[ZP]},$$scope:{ctx:x}}}),ed=new De({}),td=new N({props:{name:"class transformers.FlaxElectraForSequenceClassification",anchor:"transformers.FlaxElectraForSequenceClassification",parameters:[{name:"config",val:": ElectraConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxElectraForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig">ElectraConfig</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/electra/modeling_flax_electra.py#L1481"}}),dd=new N({props:{name:"__call__",anchor:"transformers.FlaxElectraForSequenceClassification.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{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:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxElectraForSequenceClassification.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</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.FlaxElectraForSequenceClassification.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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.FlaxElectraForSequenceClassification.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</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.FlaxElectraForSequenceClassification.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxElectraForSequenceClassification.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</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.FlaxElectraForSequenceClassification.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/modeling_flax_electra.py#L770",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput</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/electra#transformers.ElectraConfig"
>ElectraConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</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_flax_outputs.FlaxSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ta=new Ie({props:{$$slots:{default:[eA]},$$scope:{ctx:x}}}),ba=new Ae({props:{anchor:"transformers.FlaxElectraForSequenceClassification.__call__.example",$$slots:{default:[tA]},$$scope:{ctx:x}}}),cd=new De({}),pd=new N({props:{name:"class transformers.FlaxElectraForMultipleChoice",anchor:"transformers.FlaxElectraForMultipleChoice",parameters:[{name:"config",val:": ElectraConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxElectraForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig">ElectraConfig</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/electra/modeling_flax_electra.py#L1313"}}),vd=new N({props:{name:"__call__",anchor:"transformers.FlaxElectraForMultipleChoice.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{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:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxElectraForMultipleChoice.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</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.FlaxElectraForMultipleChoice.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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.FlaxElectraForMultipleChoice.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</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.FlaxElectraForMultipleChoice.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxElectraForMultipleChoice.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</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.FlaxElectraForMultipleChoice.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/modeling_flax_electra.py#L770",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput"
>transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput</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/electra#transformers.ElectraConfig"
>ElectraConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</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_flax_outputs.FlaxMultipleChoiceModelOutput"
>transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ea=new Ie({props:{$$slots:{default:[oA]},$$scope:{ctx:x}}}),$a=new Ae({props:{anchor:"transformers.FlaxElectraForMultipleChoice.__call__.example",$$slots:{default:[nA]},$$scope:{ctx:x}}}),yd=new De({}),Td=new N({props:{name:"class transformers.FlaxElectraForTokenClassification",anchor:"transformers.FlaxElectraForTokenClassification",parameters:[{name:"config",val:": ElectraConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxElectraForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig">ElectraConfig</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/electra/modeling_flax_electra.py#L1166"}}),zd=new N({props:{name:"__call__",anchor:"transformers.FlaxElectraForTokenClassification.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{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:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxElectraForTokenClassification.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</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.FlaxElectraForTokenClassification.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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.FlaxElectraForTokenClassification.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</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.FlaxElectraForTokenClassification.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxElectraForTokenClassification.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</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.FlaxElectraForTokenClassification.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/modeling_flax_electra.py#L770",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxTokenClassifierOutput"
>transformers.modeling_flax_outputs.FlaxTokenClassifierOutput</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/electra#transformers.ElectraConfig"
>ElectraConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</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_flax_outputs.FlaxTokenClassifierOutput"
>transformers.modeling_flax_outputs.FlaxTokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),xa=new Ie({props:{$$slots:{default:[sA]},$$scope:{ctx:x}}}),Ma=new Ae({props:{anchor:"transformers.FlaxElectraForTokenClassification.__call__.example",$$slots:{default:[aA]},$$scope:{ctx:x}}}),qd=new De({}),jd=new N({props:{name:"class transformers.FlaxElectraForQuestionAnswering",anchor:"transformers.FlaxElectraForQuestionAnswering",parameters:[{name:"config",val:": ElectraConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxElectraForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraConfig">ElectraConfig</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/electra/modeling_flax_electra.py#L1388"}}),Dd=new N({props:{name:"__call__",anchor:"transformers.FlaxElectraForQuestionAnswering.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{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:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxElectraForQuestionAnswering.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</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.FlaxElectraForQuestionAnswering.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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.FlaxElectraForQuestionAnswering.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</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.FlaxElectraForQuestionAnswering.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxElectraForQuestionAnswering.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</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.FlaxElectraForQuestionAnswering.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/electra/modeling_flax_electra.py#L770",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput"
>transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput</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/electra#transformers.ElectraConfig"
>ElectraConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>start_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</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_flax_outputs.FlaxQuestionAnsweringModelOutput"
>transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),qa=new Ie({props:{$$slots:{default:[rA]},$$scope:{ctx:x}}}),ja=new Ae({props:{anchor:"transformers.FlaxElectraForQuestionAnswering.__call__.example",$$slots:{default:[iA]},$$scope:{ctx:x}}}),{c(){d=o("meta"),v=c(),u=o("h1"),f=o("a"),_=o("span"),T(l.$$.fragment),h=c(),z=o("span"),ve=r("ELECTRA"),fe=c(),W=o("div"),de=o("a"),te=o("img"),ye=c(),Q=o("a"),ce=o("img"),G=c(),ae=o("h2"),re=o("a"),B=o("span"),T(ie.$$.fragment),Te=c(),V=o("span"),be=r("Overview"),ge=c(),H=o("p"),we=r("The ELECTRA model was proposed in the paper "),le=o("a"),ne=r(`ELECTRA: Pre-training Text Encoders as Discriminators Rather Than
Generators`),C=r(`. ELECTRA is a new pretraining approach which trains two
transformer models: the generator and the discriminator. The generator\u2019s role is to replace tokens in a sequence, and
is therefore trained as a masked language model. The discriminator, which is the model we\u2019re interested in, tries to
identify which tokens were replaced by the generator in the sequence.`),A=c(),pe=o("p"),Y=r("The abstract from the paper is the following:"),_e=c(),he=o("p"),J=o("em"),Ee=r(`Masked language modeling (MLM) pretraining methods such as BERT corrupt the input by replacing some tokens with [MASK]
and then train a model to reconstruct the original tokens. While they produce good results when transferred to
downstream NLP tasks, they generally require large amounts of compute to be effective. As an alternative, we propose a
more sample-efficient pretraining task called replaced token detection. Instead of masking the input, our approach
corrupts it by replacing some tokens with plausible alternatives sampled from a small generator network. Then, instead
of training a model that predicts the original identities of the corrupted tokens, we train a discriminative model that
predicts whether each token in the corrupted input was replaced by a generator sample or not. Thorough experiments
demonstrate this new pretraining task is more efficient than MLM because the task is defined over all input tokens
rather than just the small subset that was masked out. As a result, the contextual representations learned by our
approach substantially outperform the ones learned by BERT given the same model size, data, and compute. The gains are
particularly strong for small models; for example, we train a model on one GPU for 4 days that outperforms GPT (trained
using 30x more compute) on the GLUE natural language understanding benchmark. Our approach also works well at scale,
where it performs comparably to RoBERTa and XLNet while using less than 1/4 of their compute and outperforms them when
using the same amount of compute.`),ke=c(),P=o("p"),$e=r("Tips:"),X=c(),se=o("ul"),me=o("li"),Z=r(`ELECTRA is the pretraining approach, therefore there is nearly no changes done to the underlying model: BERT. The
only change is the separation of the embedding size and the hidden size: the embedding size is generally smaller,
while the hidden size is larger. An additional projection layer (linear) is used to project the embeddings from their
embedding size to the hidden size. In the case where the embedding size is the same as the hidden size, no projection
layer is used.`),Fe=c(),ue=o("li"),S=r("ELECTRA is a transformer model pretrained with the use of another (small) masked language model. The inputs are corrupted by that language model, which takes an input text that is randomly masked and outputs a text in which ELECTRA has to predict which token is an original and which one has been replaced. Like for GAN training, the small language model is trained for a few steps (but with the original texts as objective, not to fool the ELECTRA model like in a traditional GAN setting) then the ELECTRA model is trained for a few steps."),xe=c(),I=o("li"),Me=r("The ELECTRA checkpoints saved using "),ee=o("a"),L=r("Google Research\u2019s implementation"),ze=r(`
contain both the generator and discriminator. The conversion script requires the user to name which model to export
into the correct architecture. Once converted to the HuggingFace format, these checkpoints may be loaded into all
available ELECTRA models, however. This means that the discriminator may be loaded in the
`),O=o("a"),qe=r("ElectraForMaskedLM"),je=r(` model, and the generator may be loaded in the
`),y=o("a"),q=r("ElectraForPreTraining"),Qe=r(` model (the classification head will be randomly initialized as it
doesn\u2019t exist in the generator).`),oe=c(),Ce=o("p"),Be=r("This model was contributed by "),j=o("a"),Ve=r("lysandre"),Je=r(". The original code can be found "),We=o("a"),Ge=r("here"),Xe=r("."),D=c(),U=o("h2"),Se=o("a"),Ue=o("span"),T(K.$$.fragment),Ye=c(),Re=o("span"),Pe=r("Documentation resources"),Ke=c(),R=o("ul"),He=o("li"),Bd=o("a"),fk=r("Text classification task guide"),gk=c(),$p=o("li"),Vd=o("a"),_k=r("Token classification task guide"),kk=c(),Fp=o("li"),Jd=o("a"),vk=r("Question answering task guide"),yk=c(),xp=o("li"),Gd=o("a"),Tk=r("Causal language modeling task guide"),bk=c(),Mp=o("li"),Xd=o("a"),wk=r("Masked language modeling task guide"),Ek=c(),zp=o("li"),Yd=o("a"),$k=r("Multiple choice task guide"),Of=c(),Uo=o("h2"),Gn=o("a"),qp=o("span"),T(rr.$$.fragment),Fk=c(),jp=o("span"),xk=r("ElectraConfig"),Nf=c(),Ut=o("div"),T(ir.$$.fragment),Mk=c(),_o=o("p"),zk=r("This is the configuration class to store the configuration of a "),Zd=o("a"),qk=r("ElectraModel"),jk=r(" or a "),ec=o("a"),Ck=r("TFElectraModel"),Pk=r(`. It is
used to instantiate a ELECTRA 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 ELECTRA
`),lr=o("a"),Ak=r("google/electra-small-discriminator"),Lk=r(" architecture."),Ok=c(),Ro=o("p"),Nk=r("Configuration objects inherit from "),tc=o("a"),Ik=r("PretrainedConfig"),Dk=r(` and can be used to control the model outputs. Read the
documentation from `),oc=o("a"),Sk=r("PretrainedConfig"),Wk=r(" for more information."),Uk=c(),T(Xn.$$.fragment),If=c(),Ho=o("h2"),Yn=o("a"),Cp=o("span"),T(dr.$$.fragment),Rk=c(),Pp=o("span"),Hk=r("ElectraTokenizer"),Df=c(),tt=o("div"),T(cr.$$.fragment),Kk=c(),Ap=o("p"),Qk=r("Construct a Electra tokenizer. Based on WordPiece."),Bk=c(),pr=o("p"),Vk=r("This tokenizer inherits from "),nc=o("a"),Jk=r("PreTrainedTokenizer"),Gk=r(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Xk=c(),zo=o("div"),T(hr.$$.fragment),Yk=c(),Lp=o("p"),Zk=r(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A Electra sequence has the following format:`),ev=c(),mr=o("ul"),sc=o("li"),tv=r("single sequence: "),Op=o("code"),ov=r("[CLS] X [SEP]"),nv=c(),ac=o("li"),sv=r("pair of sequences: "),Np=o("code"),av=r("[CLS] A [SEP] B [SEP]"),rv=c(),Zn=o("div"),T(ur.$$.fragment),iv=c(),Ip=o("p"),lv=r("Converts a sequence of tokens (string) in a single string."),dv=c(),Rt=o("div"),T(fr.$$.fragment),cv=c(),Dp=o("p"),pv=r("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A Electra"),hv=c(),T(es.$$.fragment),mv=c(),Ko=o("p"),uv=r("If "),Sp=o("code"),fv=r("token_ids_1"),gv=r(" is "),Wp=o("code"),_v=r("None"),kv=r(", this method only returns the first portion of the mask (0s)."),vv=c(),ts=o("div"),T(gr.$$.fragment),yv=c(),_r=o("p"),Tv=r(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Up=o("code"),bv=r("prepare_for_model"),wv=r(" method."),Sf=c(),Qo=o("h2"),os=o("a"),Rp=o("span"),T(kr.$$.fragment),Ev=c(),Hp=o("span"),$v=r("ElectraTokenizerFast"),Wf=c(),Tt=o("div"),T(vr.$$.fragment),Fv=c(),yr=o("p"),xv=r("Construct a \u201Cfast\u201D ELECTRA tokenizer (backed by HuggingFace\u2019s "),Kp=o("em"),Mv=r("tokenizers"),zv=r(" library). Based on WordPiece."),qv=c(),Tr=o("p"),jv=r("This tokenizer inherits from "),rc=o("a"),Cv=r("PreTrainedTokenizerFast"),Pv=r(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Av=c(),qo=o("div"),T(br.$$.fragment),Lv=c(),Qp=o("p"),Ov=r(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A ELECTRA sequence has the following format:`),Nv=c(),wr=o("ul"),ic=o("li"),Iv=r("single sequence: "),Bp=o("code"),Dv=r("[CLS] X [SEP]"),Sv=c(),lc=o("li"),Wv=r("pair of sequences: "),Vp=o("code"),Uv=r("[CLS] A [SEP] B [SEP]"),Rv=c(),Ht=o("div"),T(Er.$$.fragment),Hv=c(),Jp=o("p"),Kv=r("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A ELECTRA"),Qv=c(),T(ns.$$.fragment),Bv=c(),Bo=o("p"),Vv=r("If "),Gp=o("code"),Jv=r("token_ids_1"),Gv=r(" is "),Xp=o("code"),Xv=r("None"),Yv=r(", this method only returns the first portion of the mask (0s)."),Uf=c(),Vo=o("h2"),ss=o("a"),Yp=o("span"),T($r.$$.fragment),Zv=c(),Zp=o("span"),ey=r("Electra specific outputs"),Rf=c(),Jo=o("div"),T(Fr.$$.fragment),ty=c(),xr=o("p"),oy=r("Output type of "),dc=o("a"),ny=r("ElectraForPreTraining"),sy=r("."),Hf=c(),Go=o("div"),T(Mr.$$.fragment),ay=c(),zr=o("p"),ry=r("Output type of "),cc=o("a"),iy=r("TFElectraForPreTraining"),ly=r("."),Kf=c(),Xo=o("h2"),as=o("a"),eh=o("span"),T(qr.$$.fragment),dy=c(),th=o("span"),cy=r("ElectraModel"),Qf=c(),bt=o("div"),T(jr.$$.fragment),py=c(),oh=o("p"),hy=r("The bare Electra Model transformer outputting raw hidden-states without any specific head on top. Identical to the BERT model except that it uses an additional linear layer between the embedding layer and the encoder if the hidden size and embedding size are different. Both the generator and discriminator checkpoints may be loaded into this model."),my=c(),Cr=o("p"),uy=r("This model inherits from "),pc=o("a"),fy=r("PreTrainedModel"),gy=r(`. 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.)`),_y=c(),Pr=o("p"),ky=r("This model is also a PyTorch "),Ar=o("a"),vy=r("torch.nn.Module"),yy=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ty=c(),Kt=o("div"),T(Lr.$$.fragment),by=c(),Yo=o("p"),wy=r("The "),hc=o("a"),Ey=r("ElectraModel"),$y=r(" forward method, overrides the "),nh=o("code"),Fy=r("__call__"),xy=r(" special method."),My=c(),T(rs.$$.fragment),zy=c(),T(is.$$.fragment),Bf=c(),Zo=o("h2"),ls=o("a"),sh=o("span"),T(Or.$$.fragment),qy=c(),ah=o("span"),jy=r("ElectraForPreTraining"),Vf=c(),pt=o("div"),T(Nr.$$.fragment),Cy=c(),rh=o("p"),Py=r("Electra model with a binary classification head on top as used during pretraining for identifying generated tokens."),Ay=c(),ih=o("p"),Ly=r("It is recommended to load the discriminator checkpoint into that model."),Oy=c(),Ir=o("p"),Ny=r("This model inherits from "),mc=o("a"),Iy=r("PreTrainedModel"),Dy=r(`. 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.)`),Sy=c(),Dr=o("p"),Wy=r("This model is also a PyTorch "),Sr=o("a"),Uy=r("torch.nn.Module"),Ry=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Hy=c(),Qt=o("div"),T(Wr.$$.fragment),Ky=c(),en=o("p"),Qy=r("The "),uc=o("a"),By=r("ElectraForPreTraining"),Vy=r(" forward method, overrides the "),lh=o("code"),Jy=r("__call__"),Gy=r(" special method."),Xy=c(),T(ds.$$.fragment),Yy=c(),T(cs.$$.fragment),Jf=c(),tn=o("h2"),ps=o("a"),dh=o("span"),T(Ur.$$.fragment),Zy=c(),ch=o("span"),eT=r("ElectraForCausalLM"),Gf=c(),wt=o("div"),T(Rr.$$.fragment),tT=c(),Hr=o("p"),oT=r("ELECTRA Model with a "),ph=o("code"),nT=r("language modeling"),sT=r(" head on top for CLM fine-tuning."),aT=c(),Kr=o("p"),rT=r("This model inherits from "),fc=o("a"),iT=r("PreTrainedModel"),lT=r(`. 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.)`),dT=c(),Qr=o("p"),cT=r("This model is also a PyTorch "),Br=o("a"),pT=r("torch.nn.Module"),hT=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),mT=c(),Bt=o("div"),T(Vr.$$.fragment),uT=c(),on=o("p"),fT=r("The "),gc=o("a"),gT=r("ElectraForCausalLM"),_T=r(" forward method, overrides the "),hh=o("code"),kT=r("__call__"),vT=r(" special method."),yT=c(),T(hs.$$.fragment),TT=c(),T(ms.$$.fragment),Xf=c(),nn=o("h2"),us=o("a"),mh=o("span"),T(Jr.$$.fragment),bT=c(),uh=o("span"),wT=r("ElectraForMaskedLM"),Yf=c(),ht=o("div"),T(Gr.$$.fragment),ET=c(),fh=o("p"),$T=r("Electra model with a language modeling head on top."),FT=c(),gh=o("p"),xT=r(`Even though both the discriminator and generator may be loaded into this model, the generator is the only model of
the two to have been trained for the masked language modeling task.`),MT=c(),Xr=o("p"),zT=r("This model inherits from "),_c=o("a"),qT=r("PreTrainedModel"),jT=r(`. 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.)`),CT=c(),Yr=o("p"),PT=r("This model is also a PyTorch "),Zr=o("a"),AT=r("torch.nn.Module"),LT=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),OT=c(),Vt=o("div"),T(ei.$$.fragment),NT=c(),sn=o("p"),IT=r("The "),kc=o("a"),DT=r("ElectraForMaskedLM"),ST=r(" forward method, overrides the "),_h=o("code"),WT=r("__call__"),UT=r(" special method."),RT=c(),T(fs.$$.fragment),HT=c(),T(gs.$$.fragment),Zf=c(),an=o("h2"),_s=o("a"),kh=o("span"),T(ti.$$.fragment),KT=c(),vh=o("span"),QT=r("ElectraForSequenceClassification"),eg=c(),Et=o("div"),T(oi.$$.fragment),BT=c(),yh=o("p"),VT=r(`ELECTRA Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),JT=c(),ni=o("p"),GT=r("This model inherits from "),vc=o("a"),XT=r("PreTrainedModel"),YT=r(`. 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.)`),ZT=c(),si=o("p"),eb=r("This model is also a PyTorch "),ai=o("a"),tb=r("torch.nn.Module"),ob=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),nb=c(),Mt=o("div"),T(ri.$$.fragment),sb=c(),rn=o("p"),ab=r("The "),yc=o("a"),rb=r("ElectraForSequenceClassification"),ib=r(" forward method, overrides the "),Th=o("code"),lb=r("__call__"),db=r(" special method."),cb=c(),T(ks.$$.fragment),pb=c(),T(vs.$$.fragment),hb=c(),T(ys.$$.fragment),tg=c(),ln=o("h2"),Ts=o("a"),bh=o("span"),T(ii.$$.fragment),mb=c(),wh=o("span"),ub=r("ElectraForMultipleChoice"),og=c(),$t=o("div"),T(li.$$.fragment),fb=c(),Eh=o("p"),gb=r(`ELECTRA 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.`),_b=c(),di=o("p"),kb=r("This model inherits from "),Tc=o("a"),vb=r("PreTrainedModel"),yb=r(`. 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.)`),Tb=c(),ci=o("p"),bb=r("This model is also a PyTorch "),pi=o("a"),wb=r("torch.nn.Module"),Eb=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),$b=c(),Jt=o("div"),T(hi.$$.fragment),Fb=c(),dn=o("p"),xb=r("The "),bc=o("a"),Mb=r("ElectraForMultipleChoice"),zb=r(" forward method, overrides the "),$h=o("code"),qb=r("__call__"),jb=r(" special method."),Cb=c(),T(bs.$$.fragment),Pb=c(),T(ws.$$.fragment),ng=c(),cn=o("h2"),Es=o("a"),Fh=o("span"),T(mi.$$.fragment),Ab=c(),xh=o("span"),Lb=r("ElectraForTokenClassification"),sg=c(),mt=o("div"),T(ui.$$.fragment),Ob=c(),Mh=o("p"),Nb=r("Electra model with a token classification head on top."),Ib=c(),zh=o("p"),Db=r("Both the discriminator and generator may be loaded into this model."),Sb=c(),fi=o("p"),Wb=r("This model inherits from "),wc=o("a"),Ub=r("PreTrainedModel"),Rb=r(`. 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.)`),Hb=c(),gi=o("p"),Kb=r("This model is also a PyTorch "),_i=o("a"),Qb=r("torch.nn.Module"),Bb=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Vb=c(),Gt=o("div"),T(ki.$$.fragment),Jb=c(),pn=o("p"),Gb=r("The "),Ec=o("a"),Xb=r("ElectraForTokenClassification"),Yb=r(" forward method, overrides the "),qh=o("code"),Zb=r("__call__"),ew=r(" special method."),tw=c(),T($s.$$.fragment),ow=c(),T(Fs.$$.fragment),ag=c(),hn=o("h2"),xs=o("a"),jh=o("span"),T(vi.$$.fragment),nw=c(),Ch=o("span"),sw=r("ElectraForQuestionAnswering"),rg=c(),Ft=o("div"),T(yi.$$.fragment),aw=c(),mn=o("p"),rw=r(`ELECTRA 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 `),Ph=o("code"),iw=r("span start logits"),lw=r(" and "),Ah=o("code"),dw=r("span end logits"),cw=r(")."),pw=c(),Ti=o("p"),hw=r("This model inherits from "),$c=o("a"),mw=r("PreTrainedModel"),uw=r(`. 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.)`),fw=c(),bi=o("p"),gw=r("This model is also a PyTorch "),wi=o("a"),_w=r("torch.nn.Module"),kw=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),vw=c(),Xt=o("div"),T(Ei.$$.fragment),yw=c(),un=o("p"),Tw=r("The "),Fc=o("a"),bw=r("ElectraForQuestionAnswering"),ww=r(" forward method, overrides the "),Lh=o("code"),Ew=r("__call__"),$w=r(" special method."),Fw=c(),T(Ms.$$.fragment),xw=c(),T(zs.$$.fragment),ig=c(),fn=o("h2"),qs=o("a"),Oh=o("span"),T($i.$$.fragment),Mw=c(),Nh=o("span"),zw=r("TFElectraModel"),lg=c(),ut=o("div"),T(Fi.$$.fragment),qw=c(),Ih=o("p"),jw=r("The bare Electra Model transformer outputting raw hidden-states without any specific head on top. Identical to the BERT model except that it uses an additional linear layer between the embedding layer and the encoder if the hidden size and embedding size are different. Both the generator and discriminator checkpoints may be loaded into this model."),Cw=c(),xi=o("p"),Pw=r("This model inherits from "),xc=o("a"),Aw=r("TFPreTrainedModel"),Lw=r(`. 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.)`),Ow=c(),Mi=o("p"),Nw=r("This model is also a "),zi=o("a"),Iw=r("tf.keras.Model"),Dw=r(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Sw=c(),T(js.$$.fragment),Ww=c(),Yt=o("div"),T(qi.$$.fragment),Uw=c(),gn=o("p"),Rw=r("The "),Mc=o("a"),Hw=r("TFElectraModel"),Kw=r(" forward method, overrides the "),Dh=o("code"),Qw=r("__call__"),Bw=r(" special method."),Vw=c(),T(Cs.$$.fragment),Jw=c(),T(Ps.$$.fragment),dg=c(),_n=o("h2"),As=o("a"),Sh=o("span"),T(ji.$$.fragment),Gw=c(),Wh=o("span"),Xw=r("TFElectraForPreTraining"),cg=c(),ot=o("div"),T(Ci.$$.fragment),Yw=c(),Uh=o("p"),Zw=r("Electra model with a binary classification head on top as used during pretraining for identifying generated tokens."),eE=c(),Rh=o("p"),tE=r(`Even though both the discriminator and generator may be loaded into this model, the discriminator is the only model
of the two to have the correct classification head to be used for this model.`),oE=c(),Pi=o("p"),nE=r("This model inherits from "),zc=o("a"),sE=r("TFPreTrainedModel"),aE=r(`. 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.)`),rE=c(),Ai=o("p"),iE=r("This model is also a "),Li=o("a"),lE=r("tf.keras.Model"),dE=r(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),cE=c(),T(Ls.$$.fragment),pE=c(),Zt=o("div"),T(Oi.$$.fragment),hE=c(),kn=o("p"),mE=r("The "),qc=o("a"),uE=r("TFElectraForPreTraining"),fE=r(" forward method, overrides the "),Hh=o("code"),gE=r("__call__"),_E=r(" special method."),kE=c(),T(Os.$$.fragment),vE=c(),T(Ns.$$.fragment),pg=c(),vn=o("h2"),Is=o("a"),Kh=o("span"),T(Ni.$$.fragment),yE=c(),Qh=o("span"),TE=r("TFElectraForMaskedLM"),hg=c(),nt=o("div"),T(Ii.$$.fragment),bE=c(),Bh=o("p"),wE=r("Electra model with a language modeling head on top."),EE=c(),Vh=o("p"),$E=r(`Even though both the discriminator and generator may be loaded into this model, the generator is the only model of
the two to have been trained for the masked language modeling task.`),FE=c(),Di=o("p"),xE=r("This model inherits from "),jc=o("a"),ME=r("TFPreTrainedModel"),zE=r(`. 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.)`),qE=c(),Si=o("p"),jE=r("This model is also a "),Wi=o("a"),CE=r("tf.keras.Model"),PE=r(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),AE=c(),T(Ds.$$.fragment),LE=c(),zt=o("div"),T(Ui.$$.fragment),OE=c(),yn=o("p"),NE=r("The "),Cc=o("a"),IE=r("TFElectraForMaskedLM"),DE=r(" forward method, overrides the "),Jh=o("code"),SE=r("__call__"),WE=r(" special method."),UE=c(),T(Ss.$$.fragment),RE=c(),T(Ws.$$.fragment),HE=c(),T(Us.$$.fragment),mg=c(),Tn=o("h2"),Rs=o("a"),Gh=o("span"),T(Ri.$$.fragment),KE=c(),Xh=o("span"),QE=r("TFElectraForSequenceClassification"),ug=c(),ft=o("div"),T(Hi.$$.fragment),BE=c(),Yh=o("p"),VE=r(`ELECTRA Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),JE=c(),Ki=o("p"),GE=r("This model inherits from "),Pc=o("a"),XE=r("TFPreTrainedModel"),YE=r(`. 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.)`),ZE=c(),Qi=o("p"),e2=r("This model is also a "),Bi=o("a"),t2=r("tf.keras.Model"),o2=r(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),n2=c(),T(Hs.$$.fragment),s2=c(),qt=o("div"),T(Vi.$$.fragment),a2=c(),bn=o("p"),r2=r("The "),Ac=o("a"),i2=r("TFElectraForSequenceClassification"),l2=r(" forward method, overrides the "),Zh=o("code"),d2=r("__call__"),c2=r(" special method."),p2=c(),T(Ks.$$.fragment),h2=c(),T(Qs.$$.fragment),m2=c(),T(Bs.$$.fragment),fg=c(),wn=o("h2"),Vs=o("a"),em=o("span"),T(Ji.$$.fragment),u2=c(),tm=o("span"),f2=r("TFElectraForMultipleChoice"),gg=c(),gt=o("div"),T(Gi.$$.fragment),g2=c(),om=o("p"),_2=r(`ELECTRA 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.`),k2=c(),Xi=o("p"),v2=r("This model inherits from "),Lc=o("a"),y2=r("TFPreTrainedModel"),T2=r(`. 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.)`),b2=c(),Yi=o("p"),w2=r("This model is also a "),Zi=o("a"),E2=r("tf.keras.Model"),$2=r(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),F2=c(),T(Js.$$.fragment),x2=c(),eo=o("div"),T(el.$$.fragment),M2=c(),En=o("p"),z2=r("The "),Oc=o("a"),q2=r("TFElectraForMultipleChoice"),j2=r(" forward method, overrides the "),nm=o("code"),C2=r("__call__"),P2=r(" special method."),A2=c(),T(Gs.$$.fragment),L2=c(),T(Xs.$$.fragment),_g=c(),$n=o("h2"),Ys=o("a"),sm=o("span"),T(tl.$$.fragment),O2=c(),am=o("span"),N2=r("TFElectraForTokenClassification"),kg=c(),st=o("div"),T(ol.$$.fragment),I2=c(),rm=o("p"),D2=r("Electra model with a token classification head on top."),S2=c(),im=o("p"),W2=r("Both the discriminator and generator may be loaded into this model."),U2=c(),nl=o("p"),R2=r("This model inherits from "),Nc=o("a"),H2=r("TFPreTrainedModel"),K2=r(`. 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.)`),Q2=c(),sl=o("p"),B2=r("This model is also a "),al=o("a"),V2=r("tf.keras.Model"),J2=r(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),G2=c(),T(Zs.$$.fragment),X2=c(),jt=o("div"),T(rl.$$.fragment),Y2=c(),Fn=o("p"),Z2=r("The "),Ic=o("a"),e1=r("TFElectraForTokenClassification"),t1=r(" forward method, overrides the "),lm=o("code"),o1=r("__call__"),n1=r(" special method."),s1=c(),T(ea.$$.fragment),a1=c(),T(ta.$$.fragment),r1=c(),T(oa.$$.fragment),vg=c(),xn=o("h2"),na=o("a"),dm=o("span"),T(il.$$.fragment),i1=c(),cm=o("span"),l1=r("TFElectraForQuestionAnswering"),yg=c(),_t=o("div"),T(ll.$$.fragment),d1=c(),Mn=o("p"),c1=r(`Electra 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 `),pm=o("code"),p1=r("span start logits"),h1=r(" and "),hm=o("code"),m1=r("span end logits"),u1=r(")."),f1=c(),dl=o("p"),g1=r("This model inherits from "),Dc=o("a"),_1=r("TFPreTrainedModel"),k1=r(`. 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.)`),v1=c(),cl=o("p"),y1=r("This model is also a "),pl=o("a"),T1=r("tf.keras.Model"),b1=r(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),w1=c(),T(sa.$$.fragment),E1=c(),Ct=o("div"),T(hl.$$.fragment),$1=c(),zn=o("p"),F1=r("The "),Sc=o("a"),x1=r("TFElectraForQuestionAnswering"),M1=r(" forward method, overrides the "),mm=o("code"),z1=r("__call__"),q1=r(" special method."),j1=c(),T(aa.$$.fragment),C1=c(),T(ra.$$.fragment),P1=c(),T(ia.$$.fragment),Tg=c(),qn=o("h2"),la=o("a"),um=o("span"),T(ml.$$.fragment),A1=c(),fm=o("span"),L1=r("FlaxElectraModel"),bg=c(),at=o("div"),T(ul.$$.fragment),O1=c(),gm=o("p"),N1=r("The bare Electra Model transformer outputting raw hidden-states without any specific head on top."),I1=c(),fl=o("p"),D1=r("This model inherits from "),Wc=o("a"),S1=r("FlaxPreTrainedModel"),W1=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),U1=c(),gl=o("p"),R1=r(`This model is also a Flax Linen
`),_l=o("a"),H1=r("flax.nn.Module"),K1=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Q1=c(),_m=o("p"),B1=r("Finally, this model supports inherent JAX features such as:"),V1=c(),ko=o("ul"),km=o("li"),kl=o("a"),J1=r("Just-In-Time (JIT) compilation"),G1=c(),vm=o("li"),vl=o("a"),X1=r("Automatic Differentiation"),Y1=c(),ym=o("li"),yl=o("a"),Z1=r("Vectorization"),e$=c(),Tm=o("li"),Tl=o("a"),t$=r("Parallelization"),o$=c(),to=o("div"),T(bl.$$.fragment),n$=c(),jn=o("p"),s$=r("The "),bm=o("code"),a$=r("FlaxElectraPreTrainedModel"),r$=r(" forward method, overrides the "),wm=o("code"),i$=r("__call__"),l$=r(" special method."),d$=c(),T(da.$$.fragment),c$=c(),T(ca.$$.fragment),wg=c(),Cn=o("h2"),pa=o("a"),Em=o("span"),T(wl.$$.fragment),p$=c(),$m=o("span"),h$=r("FlaxElectraForPreTraining"),Eg=c(),Ze=o("div"),T(El.$$.fragment),m$=c(),Fm=o("p"),u$=r("Electra model with a binary classification head on top as used during pretraining for identifying generated tokens."),f$=c(),xm=o("p"),g$=r("It is recommended to load the discriminator checkpoint into that model."),_$=c(),$l=o("p"),k$=r("This model inherits from "),Uc=o("a"),v$=r("FlaxPreTrainedModel"),y$=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),T$=c(),Fl=o("p"),b$=r(`This model is also a Flax Linen
`),xl=o("a"),w$=r("flax.nn.Module"),E$=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),$$=c(),Mm=o("p"),F$=r("Finally, this model supports inherent JAX features such as:"),x$=c(),vo=o("ul"),zm=o("li"),Ml=o("a"),M$=r("Just-In-Time (JIT) compilation"),z$=c(),qm=o("li"),zl=o("a"),q$=r("Automatic Differentiation"),j$=c(),jm=o("li"),ql=o("a"),C$=r("Vectorization"),P$=c(),Cm=o("li"),jl=o("a"),A$=r("Parallelization"),L$=c(),oo=o("div"),T(Cl.$$.fragment),O$=c(),Pn=o("p"),N$=r("The "),Pm=o("code"),I$=r("FlaxElectraPreTrainedModel"),D$=r(" forward method, overrides the "),Am=o("code"),S$=r("__call__"),W$=r(" special method."),U$=c(),T(ha.$$.fragment),R$=c(),T(ma.$$.fragment),$g=c(),An=o("h2"),ua=o("a"),Lm=o("span"),T(Pl.$$.fragment),H$=c(),Om=o("span"),K$=r("FlaxElectraForCausalLM"),Fg=c(),rt=o("div"),T(Al.$$.fragment),Q$=c(),Nm=o("p"),B$=r(`Electra Model with a language modeling head on top (a linear layer on top of the hidden-states output) e.g for
autoregressive tasks.`),V$=c(),Ll=o("p"),J$=r("This model inherits from "),Rc=o("a"),G$=r("FlaxPreTrainedModel"),X$=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),Y$=c(),Ol=o("p"),Z$=r(`This model is also a Flax Linen
`),Nl=o("a"),e0=r("flax.nn.Module"),t0=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),o0=c(),Im=o("p"),n0=r("Finally, this model supports inherent JAX features such as:"),s0=c(),yo=o("ul"),Dm=o("li"),Il=o("a"),a0=r("Just-In-Time (JIT) compilation"),r0=c(),Sm=o("li"),Dl=o("a"),i0=r("Automatic Differentiation"),l0=c(),Wm=o("li"),Sl=o("a"),d0=r("Vectorization"),c0=c(),Um=o("li"),Wl=o("a"),p0=r("Parallelization"),h0=c(),no=o("div"),T(Ul.$$.fragment),m0=c(),Ln=o("p"),u0=r("The "),Rm=o("code"),f0=r("FlaxElectraPreTrainedModel"),g0=r(" forward method, overrides the "),Hm=o("code"),_0=r("__call__"),k0=r(" special method."),v0=c(),T(fa.$$.fragment),y0=c(),T(ga.$$.fragment),xg=c(),On=o("h2"),_a=o("a"),Km=o("span"),T(Rl.$$.fragment),T0=c(),Qm=o("span"),b0=r("FlaxElectraForMaskedLM"),Mg=c(),it=o("div"),T(Hl.$$.fragment),w0=c(),Kl=o("p"),E0=r("Electra Model with a "),Bm=o("code"),$0=r("language modeling"),F0=r(" head on top."),x0=c(),Ql=o("p"),M0=r("This model inherits from "),Hc=o("a"),z0=r("FlaxPreTrainedModel"),q0=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),j0=c(),Bl=o("p"),C0=r(`This model is also a Flax Linen
`),Vl=o("a"),P0=r("flax.nn.Module"),A0=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),L0=c(),Vm=o("p"),O0=r("Finally, this model supports inherent JAX features such as:"),N0=c(),To=o("ul"),Jm=o("li"),Jl=o("a"),I0=r("Just-In-Time (JIT) compilation"),D0=c(),Gm=o("li"),Gl=o("a"),S0=r("Automatic Differentiation"),W0=c(),Xm=o("li"),Xl=o("a"),U0=r("Vectorization"),R0=c(),Ym=o("li"),Yl=o("a"),H0=r("Parallelization"),K0=c(),so=o("div"),T(Zl.$$.fragment),Q0=c(),Nn=o("p"),B0=r("The "),Zm=o("code"),V0=r("FlaxElectraPreTrainedModel"),J0=r(" forward method, overrides the "),eu=o("code"),G0=r("__call__"),X0=r(" special method."),Y0=c(),T(ka.$$.fragment),Z0=c(),T(va.$$.fragment),zg=c(),In=o("h2"),ya=o("a"),tu=o("span"),T(ed.$$.fragment),eF=c(),ou=o("span"),tF=r("FlaxElectraForSequenceClassification"),qg=c(),lt=o("div"),T(td.$$.fragment),oF=c(),nu=o("p"),nF=r(`Electra Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),sF=c(),od=o("p"),aF=r("This model inherits from "),Kc=o("a"),rF=r("FlaxPreTrainedModel"),iF=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),lF=c(),nd=o("p"),dF=r(`This model is also a Flax Linen
`),sd=o("a"),cF=r("flax.nn.Module"),pF=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),hF=c(),su=o("p"),mF=r("Finally, this model supports inherent JAX features such as:"),uF=c(),bo=o("ul"),au=o("li"),ad=o("a"),fF=r("Just-In-Time (JIT) compilation"),gF=c(),ru=o("li"),rd=o("a"),_F=r("Automatic Differentiation"),kF=c(),iu=o("li"),id=o("a"),vF=r("Vectorization"),yF=c(),lu=o("li"),ld=o("a"),TF=r("Parallelization"),bF=c(),ao=o("div"),T(dd.$$.fragment),wF=c(),Dn=o("p"),EF=r("The "),du=o("code"),$F=r("FlaxElectraPreTrainedModel"),FF=r(" forward method, overrides the "),cu=o("code"),xF=r("__call__"),MF=r(" special method."),zF=c(),T(Ta.$$.fragment),qF=c(),T(ba.$$.fragment),jg=c(),Sn=o("h2"),wa=o("a"),pu=o("span"),T(cd.$$.fragment),jF=c(),hu=o("span"),CF=r("FlaxElectraForMultipleChoice"),Cg=c(),dt=o("div"),T(pd.$$.fragment),PF=c(),mu=o("p"),AF=r(`ELECTRA 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.`),LF=c(),hd=o("p"),OF=r("This model inherits from "),Qc=o("a"),NF=r("FlaxPreTrainedModel"),IF=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),DF=c(),md=o("p"),SF=r(`This model is also a Flax Linen
`),ud=o("a"),WF=r("flax.nn.Module"),UF=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),RF=c(),uu=o("p"),HF=r("Finally, this model supports inherent JAX features such as:"),KF=c(),wo=o("ul"),fu=o("li"),fd=o("a"),QF=r("Just-In-Time (JIT) compilation"),BF=c(),gu=o("li"),gd=o("a"),VF=r("Automatic Differentiation"),JF=c(),_u=o("li"),_d=o("a"),GF=r("Vectorization"),XF=c(),ku=o("li"),kd=o("a"),YF=r("Parallelization"),ZF=c(),ro=o("div"),T(vd.$$.fragment),e4=c(),Wn=o("p"),t4=r("The "),vu=o("code"),o4=r("FlaxElectraPreTrainedModel"),n4=r(" forward method, overrides the "),yu=o("code"),s4=r("__call__"),a4=r(" special method."),r4=c(),T(Ea.$$.fragment),i4=c(),T($a.$$.fragment),Pg=c(),Un=o("h2"),Fa=o("a"),Tu=o("span"),T(yd.$$.fragment),l4=c(),bu=o("span"),d4=r("FlaxElectraForTokenClassification"),Ag=c(),et=o("div"),T(Td.$$.fragment),c4=c(),wu=o("p"),p4=r("Electra model with a token classification head on top."),h4=c(),Eu=o("p"),m4=r("Both the discriminator and generator may be loaded into this model."),u4=c(),bd=o("p"),f4=r("This model inherits from "),Bc=o("a"),g4=r("FlaxPreTrainedModel"),_4=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),k4=c(),wd=o("p"),v4=r(`This model is also a Flax Linen
`),Ed=o("a"),y4=r("flax.nn.Module"),T4=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),b4=c(),$u=o("p"),w4=r("Finally, this model supports inherent JAX features such as:"),E4=c(),Eo=o("ul"),Fu=o("li"),$d=o("a"),$4=r("Just-In-Time (JIT) compilation"),F4=c(),xu=o("li"),Fd=o("a"),x4=r("Automatic Differentiation"),M4=c(),Mu=o("li"),xd=o("a"),z4=r("Vectorization"),q4=c(),zu=o("li"),Md=o("a"),j4=r("Parallelization"),C4=c(),io=o("div"),T(zd.$$.fragment),P4=c(),Rn=o("p"),A4=r("The "),qu=o("code"),L4=r("FlaxElectraPreTrainedModel"),O4=r(" forward method, overrides the "),ju=o("code"),N4=r("__call__"),I4=r(" special method."),D4=c(),T(xa.$$.fragment),S4=c(),T(Ma.$$.fragment),Lg=c(),Hn=o("h2"),za=o("a"),Cu=o("span"),T(qd.$$.fragment),W4=c(),Pu=o("span"),U4=r("FlaxElectraForQuestionAnswering"),Og=c(),ct=o("div"),T(jd.$$.fragment),R4=c(),Kn=o("p"),H4=r(`ELECTRA 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 `),Au=o("code"),K4=r("span start logits"),Q4=r(" and "),Lu=o("code"),B4=r("span end logits"),V4=r(")."),J4=c(),Cd=o("p"),G4=r("This model inherits from "),Vc=o("a"),X4=r("FlaxPreTrainedModel"),Y4=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),Z4=c(),Pd=o("p"),ex=r(`This model is also a Flax Linen
`),Ad=o("a"),tx=r("flax.nn.Module"),ox=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),nx=c(),Ou=o("p"),sx=r("Finally, this model supports inherent JAX features such as:"),ax=c(),$o=o("ul"),Nu=o("li"),Ld=o("a"),rx=r("Just-In-Time (JIT) compilation"),ix=c(),Iu=o("li"),Od=o("a"),lx=r("Automatic Differentiation"),dx=c(),Du=o("li"),Nd=o("a"),cx=r("Vectorization"),px=c(),Su=o("li"),Id=o("a"),hx=r("Parallelization"),mx=c(),lo=o("div"),T(Dd.$$.fragment),ux=c(),Qn=o("p"),fx=r("The "),Wu=o("code"),gx=r("FlaxElectraPreTrainedModel"),_x=r(" forward method, overrides the "),Uu=o("code"),kx=r("__call__"),vx=r(" special method."),yx=c(),T(qa.$$.fragment),Tx=c(),T(ja.$$.fragment),this.h()},l(s){const k=ZC('[data-svelte="svelte-1phssyn"]',document.head);d=n(k,"META",{name:!0,content:!0}),k.forEach(t),v=p(s),u=n(s,"H1",{class:!0});var Sd=a(u);f=n(Sd,"A",{id:!0,class:!0,href:!0});var Ru=a(f);_=n(Ru,"SPAN",{});var Hu=a(_);b(l.$$.fragment,Hu),Hu.forEach(t),Ru.forEach(t),h=p(Sd),z=n(Sd,"SPAN",{});var Ku=a(z);ve=i(Ku,"ELECTRA"),Ku.forEach(t),Sd.forEach(t),fe=p(s),W=n(s,"DIV",{class:!0});var Wd=a(W);de=n(Wd,"A",{href:!0});var Qu=a(de);te=n(Qu,"IMG",{alt:!0,src:!0}),Qu.forEach(t),ye=p(Wd),Q=n(Wd,"A",{href:!0});var Bu=a(Q);ce=n(Bu,"IMG",{alt:!0,src:!0}),Bu.forEach(t),Wd.forEach(t),G=p(s),ae=n(s,"H2",{class:!0});var Ud=a(ae);re=n(Ud,"A",{id:!0,class:!0,href:!0});var Vu=a(re);B=n(Vu,"SPAN",{});var Ju=a(B);b(ie.$$.fragment,Ju),Ju.forEach(t),Vu.forEach(t),Te=p(Ud),V=n(Ud,"SPAN",{});var Gu=a(V);be=i(Gu,"Overview"),Gu.forEach(t),Ud.forEach(t),ge=p(s),H=n(s,"P",{});var Rd=a(H);we=i(Rd,"The ELECTRA model was proposed in the paper "),le=n(Rd,"A",{href:!0,rel:!0});var Xu=a(le);ne=i(Xu,`ELECTRA: Pre-training Text Encoders as Discriminators Rather Than
Generators`),Xu.forEach(t),C=i(Rd,`. ELECTRA is a new pretraining approach which trains two
transformer models: the generator and the discriminator. The generator\u2019s role is to replace tokens in a sequence, and
is therefore trained as a masked language model. The discriminator, which is the model we\u2019re interested in, tries to
identify which tokens were replaced by the generator in the sequence.`),Rd.forEach(t),A=p(s),pe=n(s,"P",{});var Yu=a(pe);Y=i(Yu,"The abstract from the paper is the following:"),Yu.forEach(t),_e=p(s),he=n(s,"P",{});var Zu=a(he);J=n(Zu,"EM",{});var ef=a(J);Ee=i(ef,`Masked language modeling (MLM) pretraining methods such as BERT corrupt the input by replacing some tokens with [MASK]
and then train a model to reconstruct the original tokens. While they produce good results when transferred to
downstream NLP tasks, they generally require large amounts of compute to be effective. As an alternative, we propose a
more sample-efficient pretraining task called replaced token detection. Instead of masking the input, our approach
corrupts it by replacing some tokens with plausible alternatives sampled from a small generator network. Then, instead
of training a model that predicts the original identities of the corrupted tokens, we train a discriminative model that
predicts whether each token in the corrupted input was replaced by a generator sample or not. Thorough experiments
demonstrate this new pretraining task is more efficient than MLM because the task is defined over all input tokens
rather than just the small subset that was masked out. As a result, the contextual representations learned by our
approach substantially outperform the ones learned by BERT given the same model size, data, and compute. The gains are
particularly strong for small models; for example, we train a model on one GPU for 4 days that outperforms GPT (trained
using 30x more compute) on the GLUE natural language understanding benchmark. Our approach also works well at scale,
where it performs comparably to RoBERTa and XLNet while using less than 1/4 of their compute and outperforms them when
using the same amount of compute.`),ef.forEach(t),Zu.forEach(t),ke=p(s),P=n(s,"P",{});var tf=a(P);$e=i(tf,"Tips:"),tf.forEach(t),X=p(s),se=n(s,"UL",{});var Bn=a(se);me=n(Bn,"LI",{});var of=a(me);Z=i(of,`ELECTRA is the pretraining approach, therefore there is nearly no changes done to the underlying model: BERT. The
only change is the separation of the embedding size and the hidden size: the embedding size is generally smaller,
while the hidden size is larger. An additional projection layer (linear) is used to project the embeddings from their
embedding size to the hidden size. In the case where the embedding size is the same as the hidden size, no projection
layer is used.`),of.forEach(t),Fe=p(Bn),ue=n(Bn,"LI",{});var nf=a(ue);S=i(nf,"ELECTRA is a transformer model pretrained with the use of another (small) masked language model. The inputs are corrupted by that language model, which takes an input text that is randomly masked and outputs a text in which ELECTRA has to predict which token is an original and which one has been replaced. Like for GAN training, the small language model is trained for a few steps (but with the original texts as objective, not to fool the ELECTRA model like in a traditional GAN setting) then the ELECTRA model is trained for a few steps."),nf.forEach(t),xe=p(Bn),I=n(Bn,"LI",{});var Fo=a(I);Me=i(Fo,"The ELECTRA checkpoints saved using "),ee=n(Fo,"A",{href:!0,rel:!0});var sf=a(ee);L=i(sf,"Google Research\u2019s implementation"),sf.forEach(t),ze=i(Fo,`
contain both the generator and discriminator. The conversion script requires the user to name which model to export
into the correct architecture. Once converted to the HuggingFace format, these checkpoints may be loaded into all
available ELECTRA models, however. This means that the discriminator may be loaded in the
`),O=n(Fo,"A",{href:!0});var af=a(O);qe=i(af,"ElectraForMaskedLM"),af.forEach(t),je=i(Fo,` model, and the generator may be loaded in the
`),y=n(Fo,"A",{href:!0});var rf=a(y);q=i(rf,"ElectraForPreTraining"),rf.forEach(t),Qe=i(Fo,` model (the classification head will be randomly initialized as it
doesn\u2019t exist in the generator).`),Fo.forEach(t),Bn.forEach(t),oe=p(s),Ce=n(s,"P",{});var Vn=a(Ce);Be=i(Vn,"This model was contributed by "),j=n(Vn,"A",{href:!0,rel:!0});var lf=a(j);Ve=i(lf,"lysandre"),lf.forEach(t),Je=i(Vn,". The original code can be found "),We=n(Vn,"A",{href:!0,rel:!0});var df=a(We);Ge=i(df,"here"),df.forEach(t),Xe=i(Vn,"."),Vn.forEach(t),D=p(s),U=n(s,"H2",{class:!0});var Hd=a(U);Se=n(Hd,"A",{id:!0,class:!0,href:!0});var cf=a(Se);Ue=n(cf,"SPAN",{});var pf=a(Ue);b(K.$$.fragment,pf),pf.forEach(t),cf.forEach(t),Ye=p(Hd),Re=n(Hd,"SPAN",{});var hf=a(Re);Pe=i(hf,"Documentation resources"),hf.forEach(t),Hd.forEach(t),Ke=p(s),R=n(s,"UL",{});var xt=a(R);He=n(xt,"LI",{});var mf=a(He);Bd=n(mf,"A",{href:!0});var uf=a(Bd);fk=i(uf,"Text classification task guide"),uf.forEach(t),mf.forEach(t),gk=p(xt),$p=n(xt,"LI",{});var ff=a($p);Vd=n(ff,"A",{href:!0});var gf=a(Vd);_k=i(gf,"Token classification task guide"),gf.forEach(t),ff.forEach(t),kk=p(xt),Fp=n(xt,"LI",{});var _f=a(Fp);Jd=n(_f,"A",{href:!0});var kf=a(Jd);vk=i(kf,"Question answering task guide"),kf.forEach(t),_f.forEach(t),yk=p(xt),xp=n(xt,"LI",{});var vf=a(xp);Gd=n(vf,"A",{href:!0});var yf=a(Gd);Tk=i(yf,"Causal language modeling task guide"),yf.forEach(t),vf.forEach(t),bk=p(xt),Mp=n(xt,"LI",{});var Tf=a(Mp);Xd=n(Tf,"A",{href:!0});var bf=a(Xd);wk=i(bf,"Masked language modeling task guide"),bf.forEach(t),Tf.forEach(t),Ek=p(xt),zp=n(xt,"LI",{});var wf=a(zp);Yd=n(wf,"A",{href:!0});var Ef=a(Yd);$k=i(Ef,"Multiple choice task guide"),Ef.forEach(t),wf.forEach(t),xt.forEach(t),Of=p(s),Uo=n(s,"H2",{class:!0});var Kd=a(Uo);Gn=n(Kd,"A",{id:!0,class:!0,href:!0});var $f=a(Gn);qp=n($f,"SPAN",{});var Ff=a(qp);b(rr.$$.fragment,Ff),Ff.forEach(t),$f.forEach(t),Fk=p(Kd),jp=n(Kd,"SPAN",{});var xf=a(jp);xk=i(xf,"ElectraConfig"),xf.forEach(t),Kd.forEach(t),Nf=p(s),Ut=n(s,"DIV",{class:!0});var xo=a(Ut);b(ir.$$.fragment,xo),Mk=p(xo),_o=n(xo,"P",{});var Mo=a(_o);zk=i(Mo,"This is the configuration class to store the configuration of a "),Zd=n(Mo,"A",{href:!0});var Mf=a(Zd);qk=i(Mf,"ElectraModel"),Mf.forEach(t),jk=i(Mo," or a "),ec=n(Mo,"A",{href:!0});var zf=a(ec);Ck=i(zf,"TFElectraModel"),zf.forEach(t),Pk=i(Mo,`. It is
used to instantiate a ELECTRA 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 ELECTRA
`),lr=n(Mo,"A",{href:!0,rel:!0});var qf=a(lr);Ak=i(qf,"google/electra-small-discriminator"),qf.forEach(t),Lk=i(Mo," architecture."),Mo.forEach(t),Ok=p(xo),Ro=n(xo,"P",{});var Jn=a(Ro);Nk=i(Jn,"Configuration objects inherit from "),tc=n(Jn,"A",{href:!0});var jf=a(tc);Ik=i(jf,"PretrainedConfig"),jf.forEach(t),Dk=i(Jn,` and can be used to control the model outputs. Read the
documentation from `),oc=n(Jn,"A",{href:!0});var Cf=a(oc);Sk=i(Cf,"PretrainedConfig"),Cf.forEach(t),Wk=i(Jn," for more information."),Jn.forEach(t),Uk=p(xo),b(Xn.$$.fragment,xo),xo.forEach(t),If=p(s),Ho=n(s,"H2",{class:!0});var Qd=a(Ho);Yn=n(Qd,"A",{id:!0,class:!0,href:!0});var Pf=a(Yn);Cp=n(Pf,"SPAN",{});var Af=a(Cp);b(dr.$$.fragment,Af),Af.forEach(t),Pf.forEach(t),Rk=p(Qd),Pp=n(Qd,"SPAN",{});var Lf=a(Pp);Hk=i(Lf,"ElectraTokenizer"),Lf.forEach(t),Qd.forEach(t),Df=p(s),tt=n(s,"DIV",{class:!0});var kt=a(tt);b(cr.$$.fragment,kt),Kk=p(kt),Ap=n(kt,"P",{});var Fx=a(Ap);Qk=i(Fx,"Construct a Electra tokenizer. Based on WordPiece."),Fx.forEach(t),Bk=p(kt),pr=n(kt,"P",{});var Ig=a(pr);Vk=i(Ig,"This tokenizer inherits from "),nc=n(Ig,"A",{href:!0});var xx=a(nc);Jk=i(xx,"PreTrainedTokenizer"),xx.forEach(t),Gk=i(Ig,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Ig.forEach(t),Xk=p(kt),zo=n(kt,"DIV",{class:!0});var Jc=a(zo);b(hr.$$.fragment,Jc),Yk=p(Jc),Lp=n(Jc,"P",{});var Mx=a(Lp);Zk=i(Mx,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A Electra sequence has the following format:`),Mx.forEach(t),ev=p(Jc),mr=n(Jc,"UL",{});var Dg=a(mr);sc=n(Dg,"LI",{});var bx=a(sc);tv=i(bx,"single sequence: "),Op=n(bx,"CODE",{});var zx=a(Op);ov=i(zx,"[CLS] X [SEP]"),zx.forEach(t),bx.forEach(t),nv=p(Dg),ac=n(Dg,"LI",{});var wx=a(ac);sv=i(wx,"pair of sequences: "),Np=n(wx,"CODE",{});var qx=a(Np);av=i(qx,"[CLS] A [SEP] B [SEP]"),qx.forEach(t),wx.forEach(t),Dg.forEach(t),Jc.forEach(t),rv=p(kt),Zn=n(kt,"DIV",{class:!0});var Sg=a(Zn);b(ur.$$.fragment,Sg),iv=p(Sg),Ip=n(Sg,"P",{});var jx=a(Ip);lv=i(jx,"Converts a sequence of tokens (string) in a single string."),jx.forEach(t),Sg.forEach(t),dv=p(kt),Rt=n(kt,"DIV",{class:!0});var Ca=a(Rt);b(fr.$$.fragment,Ca),cv=p(Ca),Dp=n(Ca,"P",{});var Cx=a(Dp);pv=i(Cx,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A Electra"),Cx.forEach(t),hv=p(Ca),b(es.$$.fragment,Ca),mv=p(Ca),Ko=n(Ca,"P",{});var Gc=a(Ko);uv=i(Gc,"If "),Sp=n(Gc,"CODE",{});var Px=a(Sp);fv=i(Px,"token_ids_1"),Px.forEach(t),gv=i(Gc," is "),Wp=n(Gc,"CODE",{});var Ax=a(Wp);_v=i(Ax,"None"),Ax.forEach(t),kv=i(Gc,", this method only returns the first portion of the mask (0s)."),Gc.forEach(t),Ca.forEach(t),vv=p(kt),ts=n(kt,"DIV",{class:!0});var Wg=a(ts);b(gr.$$.fragment,Wg),yv=p(Wg),_r=n(Wg,"P",{});var Ug=a(_r);Tv=i(Ug,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Up=n(Ug,"CODE",{});var Lx=a(Up);bv=i(Lx,"prepare_for_model"),Lx.forEach(t),wv=i(Ug," method."),Ug.forEach(t),Wg.forEach(t),kt.forEach(t),Sf=p(s),Qo=n(s,"H2",{class:!0});var Rg=a(Qo);os=n(Rg,"A",{id:!0,class:!0,href:!0});var Ox=a(os);Rp=n(Ox,"SPAN",{});var Nx=a(Rp);b(kr.$$.fragment,Nx),Nx.forEach(t),Ox.forEach(t),Ev=p(Rg),Hp=n(Rg,"SPAN",{});var Ix=a(Hp);$v=i(Ix,"ElectraTokenizerFast"),Ix.forEach(t),Rg.forEach(t),Wf=p(s),Tt=n(s,"DIV",{class:!0});var jo=a(Tt);b(vr.$$.fragment,jo),Fv=p(jo),yr=n(jo,"P",{});var Hg=a(yr);xv=i(Hg,"Construct a \u201Cfast\u201D ELECTRA tokenizer (backed by HuggingFace\u2019s "),Kp=n(Hg,"EM",{});var Dx=a(Kp);Mv=i(Dx,"tokenizers"),Dx.forEach(t),zv=i(Hg," library). Based on WordPiece."),Hg.forEach(t),qv=p(jo),Tr=n(jo,"P",{});var Kg=a(Tr);jv=i(Kg,"This tokenizer inherits from "),rc=n(Kg,"A",{href:!0});var Sx=a(rc);Cv=i(Sx,"PreTrainedTokenizerFast"),Sx.forEach(t),Pv=i(Kg,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Kg.forEach(t),Av=p(jo),qo=n(jo,"DIV",{class:!0});var Xc=a(qo);b(br.$$.fragment,Xc),Lv=p(Xc),Qp=n(Xc,"P",{});var Wx=a(Qp);Ov=i(Wx,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A ELECTRA sequence has the following format:`),Wx.forEach(t),Nv=p(Xc),wr=n(Xc,"UL",{});var Qg=a(wr);ic=n(Qg,"LI",{});var Ex=a(ic);Iv=i(Ex,"single sequence: "),Bp=n(Ex,"CODE",{});var Ux=a(Bp);Dv=i(Ux,"[CLS] X [SEP]"),Ux.forEach(t),Ex.forEach(t),Sv=p(Qg),lc=n(Qg,"LI",{});var $x=a(lc);Wv=i($x,"pair of sequences: "),Vp=n($x,"CODE",{});var Rx=a(Vp);Uv=i(Rx,"[CLS] A [SEP] B [SEP]"),Rx.forEach(t),$x.forEach(t),Qg.forEach(t),Xc.forEach(t),Rv=p(jo),Ht=n(jo,"DIV",{class:!0});var Pa=a(Ht);b(Er.$$.fragment,Pa),Hv=p(Pa),Jp=n(Pa,"P",{});var Hx=a(Jp);Kv=i(Hx,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A ELECTRA"),Hx.forEach(t),Qv=p(Pa),b(ns.$$.fragment,Pa),Bv=p(Pa),Bo=n(Pa,"P",{});var Yc=a(Bo);Vv=i(Yc,"If "),Gp=n(Yc,"CODE",{});var Kx=a(Gp);Jv=i(Kx,"token_ids_1"),Kx.forEach(t),Gv=i(Yc," is "),Xp=n(Yc,"CODE",{});var Qx=a(Xp);Xv=i(Qx,"None"),Qx.forEach(t),Yv=i(Yc,", this method only returns the first portion of the mask (0s)."),Yc.forEach(t),Pa.forEach(t),jo.forEach(t),Uf=p(s),Vo=n(s,"H2",{class:!0});var Bg=a(Vo);ss=n(Bg,"A",{id:!0,class:!0,href:!0});var Bx=a(ss);Yp=n(Bx,"SPAN",{});var Vx=a(Yp);b($r.$$.fragment,Vx),Vx.forEach(t),Bx.forEach(t),Zv=p(Bg),Zp=n(Bg,"SPAN",{});var Jx=a(Zp);ey=i(Jx,"Electra specific outputs"),Jx.forEach(t),Bg.forEach(t),Rf=p(s),Jo=n(s,"DIV",{class:!0});var Vg=a(Jo);b(Fr.$$.fragment,Vg),ty=p(Vg),xr=n(Vg,"P",{});var Jg=a(xr);oy=i(Jg,"Output type of "),dc=n(Jg,"A",{href:!0});var Gx=a(dc);ny=i(Gx,"ElectraForPreTraining"),Gx.forEach(t),sy=i(Jg,"."),Jg.forEach(t),Vg.forEach(t),Hf=p(s),Go=n(s,"DIV",{class:!0});var Gg=a(Go);b(Mr.$$.fragment,Gg),ay=p(Gg),zr=n(Gg,"P",{});var Xg=a(zr);ry=i(Xg,"Output type of "),cc=n(Xg,"A",{href:!0});var Xx=a(cc);iy=i(Xx,"TFElectraForPreTraining"),Xx.forEach(t),ly=i(Xg,"."),Xg.forEach(t),Gg.forEach(t),Kf=p(s),Xo=n(s,"H2",{class:!0});var Yg=a(Xo);as=n(Yg,"A",{id:!0,class:!0,href:!0});var Yx=a(as);eh=n(Yx,"SPAN",{});var Zx=a(eh);b(qr.$$.fragment,Zx),Zx.forEach(t),Yx.forEach(t),dy=p(Yg),th=n(Yg,"SPAN",{});var eM=a(th);cy=i(eM,"ElectraModel"),eM.forEach(t),Yg.forEach(t),Qf=p(s),bt=n(s,"DIV",{class:!0});var Co=a(bt);b(jr.$$.fragment,Co),py=p(Co),oh=n(Co,"P",{});var tM=a(oh);hy=i(tM,"The bare Electra Model transformer outputting raw hidden-states without any specific head on top. Identical to the BERT model except that it uses an additional linear layer between the embedding layer and the encoder if the hidden size and embedding size are different. Both the generator and discriminator checkpoints may be loaded into this model."),tM.forEach(t),my=p(Co),Cr=n(Co,"P",{});var Zg=a(Cr);uy=i(Zg,"This model inherits from "),pc=n(Zg,"A",{href:!0});var oM=a(pc);fy=i(oM,"PreTrainedModel"),oM.forEach(t),gy=i(Zg,`. 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.)`),Zg.forEach(t),_y=p(Co),Pr=n(Co,"P",{});var e_=a(Pr);ky=i(e_,"This model is also a PyTorch "),Ar=n(e_,"A",{href:!0,rel:!0});var nM=a(Ar);vy=i(nM,"torch.nn.Module"),nM.forEach(t),yy=i(e_,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),e_.forEach(t),Ty=p(Co),Kt=n(Co,"DIV",{class:!0});var Aa=a(Kt);b(Lr.$$.fragment,Aa),by=p(Aa),Yo=n(Aa,"P",{});var Zc=a(Yo);wy=i(Zc,"The "),hc=n(Zc,"A",{href:!0});var sM=a(hc);Ey=i(sM,"ElectraModel"),sM.forEach(t),$y=i(Zc," forward method, overrides the "),nh=n(Zc,"CODE",{});var aM=a(nh);Fy=i(aM,"__call__"),aM.forEach(t),xy=i(Zc," special method."),Zc.forEach(t),My=p(Aa),b(rs.$$.fragment,Aa),zy=p(Aa),b(is.$$.fragment,Aa),Aa.forEach(t),Co.forEach(t),Bf=p(s),Zo=n(s,"H2",{class:!0});var t_=a(Zo);ls=n(t_,"A",{id:!0,class:!0,href:!0});var rM=a(ls);sh=n(rM,"SPAN",{});var iM=a(sh);b(Or.$$.fragment,iM),iM.forEach(t),rM.forEach(t),qy=p(t_),ah=n(t_,"SPAN",{});var lM=a(ah);jy=i(lM,"ElectraForPreTraining"),lM.forEach(t),t_.forEach(t),Vf=p(s),pt=n(s,"DIV",{class:!0});var co=a(pt);b(Nr.$$.fragment,co),Cy=p(co),rh=n(co,"P",{});var dM=a(rh);Py=i(dM,"Electra model with a binary classification head on top as used during pretraining for identifying generated tokens."),dM.forEach(t),Ay=p(co),ih=n(co,"P",{});var cM=a(ih);Ly=i(cM,"It is recommended to load the discriminator checkpoint into that model."),cM.forEach(t),Oy=p(co),Ir=n(co,"P",{});var o_=a(Ir);Ny=i(o_,"This model inherits from "),mc=n(o_,"A",{href:!0});var pM=a(mc);Iy=i(pM,"PreTrainedModel"),pM.forEach(t),Dy=i(o_,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),o_.forEach(t),Sy=p(co),Dr=n(co,"P",{});var n_=a(Dr);Wy=i(n_,"This model is also a PyTorch "),Sr=n(n_,"A",{href:!0,rel:!0});var hM=a(Sr);Uy=i(hM,"torch.nn.Module"),hM.forEach(t),Ry=i(n_,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),n_.forEach(t),Hy=p(co),Qt=n(co,"DIV",{class:!0});var La=a(Qt);b(Wr.$$.fragment,La),Ky=p(La),en=n(La,"P",{});var ep=a(en);Qy=i(ep,"The "),uc=n(ep,"A",{href:!0});var mM=a(uc);By=i(mM,"ElectraForPreTraining"),mM.forEach(t),Vy=i(ep," forward method, overrides the "),lh=n(ep,"CODE",{});var uM=a(lh);Jy=i(uM,"__call__"),uM.forEach(t),Gy=i(ep," special method."),ep.forEach(t),Xy=p(La),b(ds.$$.fragment,La),Yy=p(La),b(cs.$$.fragment,La),La.forEach(t),co.forEach(t),Jf=p(s),tn=n(s,"H2",{class:!0});var s_=a(tn);ps=n(s_,"A",{id:!0,class:!0,href:!0});var fM=a(ps);dh=n(fM,"SPAN",{});var gM=a(dh);b(Ur.$$.fragment,gM),gM.forEach(t),fM.forEach(t),Zy=p(s_),ch=n(s_,"SPAN",{});var _M=a(ch);eT=i(_M,"ElectraForCausalLM"),_M.forEach(t),s_.forEach(t),Gf=p(s),wt=n(s,"DIV",{class:!0});var Po=a(wt);b(Rr.$$.fragment,Po),tT=p(Po),Hr=n(Po,"P",{});var a_=a(Hr);oT=i(a_,"ELECTRA Model with a "),ph=n(a_,"CODE",{});var kM=a(ph);nT=i(kM,"language modeling"),kM.forEach(t),sT=i(a_," head on top for CLM fine-tuning."),a_.forEach(t),aT=p(Po),Kr=n(Po,"P",{});var r_=a(Kr);rT=i(r_,"This model inherits from "),fc=n(r_,"A",{href:!0});var vM=a(fc);iT=i(vM,"PreTrainedModel"),vM.forEach(t),lT=i(r_,`. 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.)`),r_.forEach(t),dT=p(Po),Qr=n(Po,"P",{});var i_=a(Qr);cT=i(i_,"This model is also a PyTorch "),Br=n(i_,"A",{href:!0,rel:!0});var yM=a(Br);pT=i(yM,"torch.nn.Module"),yM.forEach(t),hT=i(i_,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),i_.forEach(t),mT=p(Po),Bt=n(Po,"DIV",{class:!0});var Oa=a(Bt);b(Vr.$$.fragment,Oa),uT=p(Oa),on=n(Oa,"P",{});var tp=a(on);fT=i(tp,"The "),gc=n(tp,"A",{href:!0});var TM=a(gc);gT=i(TM,"ElectraForCausalLM"),TM.forEach(t),_T=i(tp," forward method, overrides the "),hh=n(tp,"CODE",{});var bM=a(hh);kT=i(bM,"__call__"),bM.forEach(t),vT=i(tp," special method."),tp.forEach(t),yT=p(Oa),b(hs.$$.fragment,Oa),TT=p(Oa),b(ms.$$.fragment,Oa),Oa.forEach(t),Po.forEach(t),Xf=p(s),nn=n(s,"H2",{class:!0});var l_=a(nn);us=n(l_,"A",{id:!0,class:!0,href:!0});var wM=a(us);mh=n(wM,"SPAN",{});var EM=a(mh);b(Jr.$$.fragment,EM),EM.forEach(t),wM.forEach(t),bT=p(l_),uh=n(l_,"SPAN",{});var $M=a(uh);wT=i($M,"ElectraForMaskedLM"),$M.forEach(t),l_.forEach(t),Yf=p(s),ht=n(s,"DIV",{class:!0});var po=a(ht);b(Gr.$$.fragment,po),ET=p(po),fh=n(po,"P",{});var FM=a(fh);$T=i(FM,"Electra model with a language modeling head on top."),FM.forEach(t),FT=p(po),gh=n(po,"P",{});var xM=a(gh);xT=i(xM,`Even though both the discriminator and generator may be loaded into this model, the generator is the only model of
the two to have been trained for the masked language modeling task.`),xM.forEach(t),MT=p(po),Xr=n(po,"P",{});var d_=a(Xr);zT=i(d_,"This model inherits from "),_c=n(d_,"A",{href:!0});var MM=a(_c);qT=i(MM,"PreTrainedModel"),MM.forEach(t),jT=i(d_,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),d_.forEach(t),CT=p(po),Yr=n(po,"P",{});var c_=a(Yr);PT=i(c_,"This model is also a PyTorch "),Zr=n(c_,"A",{href:!0,rel:!0});var zM=a(Zr);AT=i(zM,"torch.nn.Module"),zM.forEach(t),LT=i(c_,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),c_.forEach(t),OT=p(po),Vt=n(po,"DIV",{class:!0});var Na=a(Vt);b(ei.$$.fragment,Na),NT=p(Na),sn=n(Na,"P",{});var op=a(sn);IT=i(op,"The "),kc=n(op,"A",{href:!0});var qM=a(kc);DT=i(qM,"ElectraForMaskedLM"),qM.forEach(t),ST=i(op," forward method, overrides the "),_h=n(op,"CODE",{});var jM=a(_h);WT=i(jM,"__call__"),jM.forEach(t),UT=i(op," special method."),op.forEach(t),RT=p(Na),b(fs.$$.fragment,Na),HT=p(Na),b(gs.$$.fragment,Na),Na.forEach(t),po.forEach(t),Zf=p(s),an=n(s,"H2",{class:!0});var p_=a(an);_s=n(p_,"A",{id:!0,class:!0,href:!0});var CM=a(_s);kh=n(CM,"SPAN",{});var PM=a(kh);b(ti.$$.fragment,PM),PM.forEach(t),CM.forEach(t),KT=p(p_),vh=n(p_,"SPAN",{});var AM=a(vh);QT=i(AM,"ElectraForSequenceClassification"),AM.forEach(t),p_.forEach(t),eg=p(s),Et=n(s,"DIV",{class:!0});var Ao=a(Et);b(oi.$$.fragment,Ao),BT=p(Ao),yh=n(Ao,"P",{});var LM=a(yh);VT=i(LM,`ELECTRA Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),LM.forEach(t),JT=p(Ao),ni=n(Ao,"P",{});var h_=a(ni);GT=i(h_,"This model inherits from "),vc=n(h_,"A",{href:!0});var OM=a(vc);XT=i(OM,"PreTrainedModel"),OM.forEach(t),YT=i(h_,`. 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.)`),h_.forEach(t),ZT=p(Ao),si=n(Ao,"P",{});var m_=a(si);eb=i(m_,"This model is also a PyTorch "),ai=n(m_,"A",{href:!0,rel:!0});var NM=a(ai);tb=i(NM,"torch.nn.Module"),NM.forEach(t),ob=i(m_,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),m_.forEach(t),nb=p(Ao),Mt=n(Ao,"DIV",{class:!0});var Lo=a(Mt);b(ri.$$.fragment,Lo),sb=p(Lo),rn=n(Lo,"P",{});var np=a(rn);ab=i(np,"The "),yc=n(np,"A",{href:!0});var IM=a(yc);rb=i(IM,"ElectraForSequenceClassification"),IM.forEach(t),ib=i(np," forward method, overrides the "),Th=n(np,"CODE",{});var DM=a(Th);lb=i(DM,"__call__"),DM.forEach(t),db=i(np," special method."),np.forEach(t),cb=p(Lo),b(ks.$$.fragment,Lo),pb=p(Lo),b(vs.$$.fragment,Lo),hb=p(Lo),b(ys.$$.fragment,Lo),Lo.forEach(t),Ao.forEach(t),tg=p(s),ln=n(s,"H2",{class:!0});var u_=a(ln);Ts=n(u_,"A",{id:!0,class:!0,href:!0});var SM=a(Ts);bh=n(SM,"SPAN",{});var WM=a(bh);b(ii.$$.fragment,WM),WM.forEach(t),SM.forEach(t),mb=p(u_),wh=n(u_,"SPAN",{});var UM=a(wh);ub=i(UM,"ElectraForMultipleChoice"),UM.forEach(t),u_.forEach(t),og=p(s),$t=n(s,"DIV",{class:!0});var Oo=a($t);b(li.$$.fragment,Oo),fb=p(Oo),Eh=n(Oo,"P",{});var RM=a(Eh);gb=i(RM,`ELECTRA 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.`),RM.forEach(t),_b=p(Oo),di=n(Oo,"P",{});var f_=a(di);kb=i(f_,"This model inherits from "),Tc=n(f_,"A",{href:!0});var HM=a(Tc);vb=i(HM,"PreTrainedModel"),HM.forEach(t),yb=i(f_,`. 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.)`),f_.forEach(t),Tb=p(Oo),ci=n(Oo,"P",{});var g_=a(ci);bb=i(g_,"This model is also a PyTorch "),pi=n(g_,"A",{href:!0,rel:!0});var KM=a(pi);wb=i(KM,"torch.nn.Module"),KM.forEach(t),Eb=i(g_,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),g_.forEach(t),$b=p(Oo),Jt=n(Oo,"DIV",{class:!0});var Ia=a(Jt);b(hi.$$.fragment,Ia),Fb=p(Ia),dn=n(Ia,"P",{});var sp=a(dn);xb=i(sp,"The "),bc=n(sp,"A",{href:!0});var QM=a(bc);Mb=i(QM,"ElectraForMultipleChoice"),QM.forEach(t),zb=i(sp," forward method, overrides the "),$h=n(sp,"CODE",{});var BM=a($h);qb=i(BM,"__call__"),BM.forEach(t),jb=i(sp," special method."),sp.forEach(t),Cb=p(Ia),b(bs.$$.fragment,Ia),Pb=p(Ia),b(ws.$$.fragment,Ia),Ia.forEach(t),Oo.forEach(t),ng=p(s),cn=n(s,"H2",{class:!0});var __=a(cn);Es=n(__,"A",{id:!0,class:!0,href:!0});var VM=a(Es);Fh=n(VM,"SPAN",{});var JM=a(Fh);b(mi.$$.fragment,JM),JM.forEach(t),VM.forEach(t),Ab=p(__),xh=n(__,"SPAN",{});var GM=a(xh);Lb=i(GM,"ElectraForTokenClassification"),GM.forEach(t),__.forEach(t),sg=p(s),mt=n(s,"DIV",{class:!0});var ho=a(mt);b(ui.$$.fragment,ho),Ob=p(ho),Mh=n(ho,"P",{});var XM=a(Mh);Nb=i(XM,"Electra model with a token classification head on top."),XM.forEach(t),Ib=p(ho),zh=n(ho,"P",{});var YM=a(zh);Db=i(YM,"Both the discriminator and generator may be loaded into this model."),YM.forEach(t),Sb=p(ho),fi=n(ho,"P",{});var k_=a(fi);Wb=i(k_,"This model inherits from "),wc=n(k_,"A",{href:!0});var ZM=a(wc);Ub=i(ZM,"PreTrainedModel"),ZM.forEach(t),Rb=i(k_,`. 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.)`),k_.forEach(t),Hb=p(ho),gi=n(ho,"P",{});var v_=a(gi);Kb=i(v_,"This model is also a PyTorch "),_i=n(v_,"A",{href:!0,rel:!0});var ez=a(_i);Qb=i(ez,"torch.nn.Module"),ez.forEach(t),Bb=i(v_,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),v_.forEach(t),Vb=p(ho),Gt=n(ho,"DIV",{class:!0});var Da=a(Gt);b(ki.$$.fragment,Da),Jb=p(Da),pn=n(Da,"P",{});var ap=a(pn);Gb=i(ap,"The "),Ec=n(ap,"A",{href:!0});var tz=a(Ec);Xb=i(tz,"ElectraForTokenClassification"),tz.forEach(t),Yb=i(ap," forward method, overrides the "),qh=n(ap,"CODE",{});var oz=a(qh);Zb=i(oz,"__call__"),oz.forEach(t),ew=i(ap," special method."),ap.forEach(t),tw=p(Da),b($s.$$.fragment,Da),ow=p(Da),b(Fs.$$.fragment,Da),Da.forEach(t),ho.forEach(t),ag=p(s),hn=n(s,"H2",{class:!0});var y_=a(hn);xs=n(y_,"A",{id:!0,class:!0,href:!0});var nz=a(xs);jh=n(nz,"SPAN",{});var sz=a(jh);b(vi.$$.fragment,sz),sz.forEach(t),nz.forEach(t),nw=p(y_),Ch=n(y_,"SPAN",{});var az=a(Ch);sw=i(az,"ElectraForQuestionAnswering"),az.forEach(t),y_.forEach(t),rg=p(s),Ft=n(s,"DIV",{class:!0});var No=a(Ft);b(yi.$$.fragment,No),aw=p(No),mn=n(No,"P",{});var rp=a(mn);rw=i(rp,`ELECTRA 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 `),Ph=n(rp,"CODE",{});var rz=a(Ph);iw=i(rz,"span start logits"),rz.forEach(t),lw=i(rp," and "),Ah=n(rp,"CODE",{});var iz=a(Ah);dw=i(iz,"span end logits"),iz.forEach(t),cw=i(rp,")."),rp.forEach(t),pw=p(No),Ti=n(No,"P",{});var T_=a(Ti);hw=i(T_,"This model inherits from "),$c=n(T_,"A",{href:!0});var lz=a($c);mw=i(lz,"PreTrainedModel"),lz.forEach(t),uw=i(T_,`. 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.)`),T_.forEach(t),fw=p(No),bi=n(No,"P",{});var b_=a(bi);gw=i(b_,"This model is also a PyTorch "),wi=n(b_,"A",{href:!0,rel:!0});var dz=a(wi);_w=i(dz,"torch.nn.Module"),dz.forEach(t),kw=i(b_,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),b_.forEach(t),vw=p(No),Xt=n(No,"DIV",{class:!0});var Sa=a(Xt);b(Ei.$$.fragment,Sa),yw=p(Sa),un=n(Sa,"P",{});var ip=a(un);Tw=i(ip,"The "),Fc=n(ip,"A",{href:!0});var cz=a(Fc);bw=i(cz,"ElectraForQuestionAnswering"),cz.forEach(t),ww=i(ip," forward method, overrides the "),Lh=n(ip,"CODE",{});var pz=a(Lh);Ew=i(pz,"__call__"),pz.forEach(t),$w=i(ip," special method."),ip.forEach(t),Fw=p(Sa),b(Ms.$$.fragment,Sa),xw=p(Sa),b(zs.$$.fragment,Sa),Sa.forEach(t),No.forEach(t),ig=p(s),fn=n(s,"H2",{class:!0});var w_=a(fn);qs=n(w_,"A",{id:!0,class:!0,href:!0});var hz=a(qs);Oh=n(hz,"SPAN",{});var mz=a(Oh);b($i.$$.fragment,mz),mz.forEach(t),hz.forEach(t),Mw=p(w_),Nh=n(w_,"SPAN",{});var uz=a(Nh);zw=i(uz,"TFElectraModel"),uz.forEach(t),w_.forEach(t),lg=p(s),ut=n(s,"DIV",{class:!0});var mo=a(ut);b(Fi.$$.fragment,mo),qw=p(mo),Ih=n(mo,"P",{});var fz=a(Ih);jw=i(fz,"The bare Electra Model transformer outputting raw hidden-states without any specific head on top. Identical to the BERT model except that it uses an additional linear layer between the embedding layer and the encoder if the hidden size and embedding size are different. Both the generator and discriminator checkpoints may be loaded into this model."),fz.forEach(t),Cw=p(mo),xi=n(mo,"P",{});var E_=a(xi);Pw=i(E_,"This model inherits from "),xc=n(E_,"A",{href:!0});var gz=a(xc);Aw=i(gz,"TFPreTrainedModel"),gz.forEach(t),Lw=i(E_,`. 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.)`),E_.forEach(t),Ow=p(mo),Mi=n(mo,"P",{});var $_=a(Mi);Nw=i($_,"This model is also a "),zi=n($_,"A",{href:!0,rel:!0});var _z=a(zi);Iw=i(_z,"tf.keras.Model"),_z.forEach(t),Dw=i($_,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),$_.forEach(t),Sw=p(mo),b(js.$$.fragment,mo),Ww=p(mo),Yt=n(mo,"DIV",{class:!0});var Wa=a(Yt);b(qi.$$.fragment,Wa),Uw=p(Wa),gn=n(Wa,"P",{});var lp=a(gn);Rw=i(lp,"The "),Mc=n(lp,"A",{href:!0});var kz=a(Mc);Hw=i(kz,"TFElectraModel"),kz.forEach(t),Kw=i(lp," forward method, overrides the "),Dh=n(lp,"CODE",{});var vz=a(Dh);Qw=i(vz,"__call__"),vz.forEach(t),Bw=i(lp," special method."),lp.forEach(t),Vw=p(Wa),b(Cs.$$.fragment,Wa),Jw=p(Wa),b(Ps.$$.fragment,Wa),Wa.forEach(t),mo.forEach(t),dg=p(s),_n=n(s,"H2",{class:!0});var F_=a(_n);As=n(F_,"A",{id:!0,class:!0,href:!0});var yz=a(As);Sh=n(yz,"SPAN",{});var Tz=a(Sh);b(ji.$$.fragment,Tz),Tz.forEach(t),yz.forEach(t),Gw=p(F_),Wh=n(F_,"SPAN",{});var bz=a(Wh);Xw=i(bz,"TFElectraForPreTraining"),bz.forEach(t),F_.forEach(t),cg=p(s),ot=n(s,"DIV",{class:!0});var Pt=a(ot);b(Ci.$$.fragment,Pt),Yw=p(Pt),Uh=n(Pt,"P",{});var wz=a(Uh);Zw=i(wz,"Electra model with a binary classification head on top as used during pretraining for identifying generated tokens."),wz.forEach(t),eE=p(Pt),Rh=n(Pt,"P",{});var Ez=a(Rh);tE=i(Ez,`Even though both the discriminator and generator may be loaded into this model, the discriminator is the only model
of the two to have the correct classification head to be used for this model.`),Ez.forEach(t),oE=p(Pt),Pi=n(Pt,"P",{});var x_=a(Pi);nE=i(x_,"This model inherits from "),zc=n(x_,"A",{href:!0});var $z=a(zc);sE=i($z,"TFPreTrainedModel"),$z.forEach(t),aE=i(x_,`. 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.)`),x_.forEach(t),rE=p(Pt),Ai=n(Pt,"P",{});var M_=a(Ai);iE=i(M_,"This model is also a "),Li=n(M_,"A",{href:!0,rel:!0});var Fz=a(Li);lE=i(Fz,"tf.keras.Model"),Fz.forEach(t),dE=i(M_,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),M_.forEach(t),cE=p(Pt),b(Ls.$$.fragment,Pt),pE=p(Pt),Zt=n(Pt,"DIV",{class:!0});var Ua=a(Zt);b(Oi.$$.fragment,Ua),hE=p(Ua),kn=n(Ua,"P",{});var dp=a(kn);mE=i(dp,"The "),qc=n(dp,"A",{href:!0});var xz=a(qc);uE=i(xz,"TFElectraForPreTraining"),xz.forEach(t),fE=i(dp," forward method, overrides the "),Hh=n(dp,"CODE",{});var Mz=a(Hh);gE=i(Mz,"__call__"),Mz.forEach(t),_E=i(dp," special method."),dp.forEach(t),kE=p(Ua),b(Os.$$.fragment,Ua),vE=p(Ua),b(Ns.$$.fragment,Ua),Ua.forEach(t),Pt.forEach(t),pg=p(s),vn=n(s,"H2",{class:!0});var z_=a(vn);Is=n(z_,"A",{id:!0,class:!0,href:!0});var zz=a(Is);Kh=n(zz,"SPAN",{});var qz=a(Kh);b(Ni.$$.fragment,qz),qz.forEach(t),zz.forEach(t),yE=p(z_),Qh=n(z_,"SPAN",{});var jz=a(Qh);TE=i(jz,"TFElectraForMaskedLM"),jz.forEach(t),z_.forEach(t),hg=p(s),nt=n(s,"DIV",{class:!0});var At=a(nt);b(Ii.$$.fragment,At),bE=p(At),Bh=n(At,"P",{});var Cz=a(Bh);wE=i(Cz,"Electra model with a language modeling head on top."),Cz.forEach(t),EE=p(At),Vh=n(At,"P",{});var Pz=a(Vh);$E=i(Pz,`Even though both the discriminator and generator may be loaded into this model, the generator is the only model of
the two to have been trained for the masked language modeling task.`),Pz.forEach(t),FE=p(At),Di=n(At,"P",{});var q_=a(Di);xE=i(q_,"This model inherits from "),jc=n(q_,"A",{href:!0});var Az=a(jc);ME=i(Az,"TFPreTrainedModel"),Az.forEach(t),zE=i(q_,`. 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.)`),q_.forEach(t),qE=p(At),Si=n(At,"P",{});var j_=a(Si);jE=i(j_,"This model is also a "),Wi=n(j_,"A",{href:!0,rel:!0});var Lz=a(Wi);CE=i(Lz,"tf.keras.Model"),Lz.forEach(t),PE=i(j_,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),j_.forEach(t),AE=p(At),b(Ds.$$.fragment,At),LE=p(At),zt=n(At,"DIV",{class:!0});var Io=a(zt);b(Ui.$$.fragment,Io),OE=p(Io),yn=n(Io,"P",{});var cp=a(yn);NE=i(cp,"The "),Cc=n(cp,"A",{href:!0});var Oz=a(Cc);IE=i(Oz,"TFElectraForMaskedLM"),Oz.forEach(t),DE=i(cp," forward method, overrides the "),Jh=n(cp,"CODE",{});var Nz=a(Jh);SE=i(Nz,"__call__"),Nz.forEach(t),WE=i(cp," special method."),cp.forEach(t),UE=p(Io),b(Ss.$$.fragment,Io),RE=p(Io),b(Ws.$$.fragment,Io),HE=p(Io),b(Us.$$.fragment,Io),Io.forEach(t),At.forEach(t),mg=p(s),Tn=n(s,"H2",{class:!0});var C_=a(Tn);Rs=n(C_,"A",{id:!0,class:!0,href:!0});var Iz=a(Rs);Gh=n(Iz,"SPAN",{});var Dz=a(Gh);b(Ri.$$.fragment,Dz),Dz.forEach(t),Iz.forEach(t),KE=p(C_),Xh=n(C_,"SPAN",{});var Sz=a(Xh);QE=i(Sz,"TFElectraForSequenceClassification"),Sz.forEach(t),C_.forEach(t),ug=p(s),ft=n(s,"DIV",{class:!0});var uo=a(ft);b(Hi.$$.fragment,uo),BE=p(uo),Yh=n(uo,"P",{});var Wz=a(Yh);VE=i(Wz,`ELECTRA Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),Wz.forEach(t),JE=p(uo),Ki=n(uo,"P",{});var P_=a(Ki);GE=i(P_,"This model inherits from "),Pc=n(P_,"A",{href:!0});var Uz=a(Pc);XE=i(Uz,"TFPreTrainedModel"),Uz.forEach(t),YE=i(P_,`. 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.)`),P_.forEach(t),ZE=p(uo),Qi=n(uo,"P",{});var A_=a(Qi);e2=i(A_,"This model is also a "),Bi=n(A_,"A",{href:!0,rel:!0});var Rz=a(Bi);t2=i(Rz,"tf.keras.Model"),Rz.forEach(t),o2=i(A_,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),A_.forEach(t),n2=p(uo),b(Hs.$$.fragment,uo),s2=p(uo),qt=n(uo,"DIV",{class:!0});var Do=a(qt);b(Vi.$$.fragment,Do),a2=p(Do),bn=n(Do,"P",{});var pp=a(bn);r2=i(pp,"The "),Ac=n(pp,"A",{href:!0});var Hz=a(Ac);i2=i(Hz,"TFElectraForSequenceClassification"),Hz.forEach(t),l2=i(pp," forward method, overrides the "),Zh=n(pp,"CODE",{});var Kz=a(Zh);d2=i(Kz,"__call__"),Kz.forEach(t),c2=i(pp," special method."),pp.forEach(t),p2=p(Do),b(Ks.$$.fragment,Do),h2=p(Do),b(Qs.$$.fragment,Do),m2=p(Do),b(Bs.$$.fragment,Do),Do.forEach(t),uo.forEach(t),fg=p(s),wn=n(s,"H2",{class:!0});var L_=a(wn);Vs=n(L_,"A",{id:!0,class:!0,href:!0});var Qz=a(Vs);em=n(Qz,"SPAN",{});var Bz=a(em);b(Ji.$$.fragment,Bz),Bz.forEach(t),Qz.forEach(t),u2=p(L_),tm=n(L_,"SPAN",{});var Vz=a(tm);f2=i(Vz,"TFElectraForMultipleChoice"),Vz.forEach(t),L_.forEach(t),gg=p(s),gt=n(s,"DIV",{class:!0});var fo=a(gt);b(Gi.$$.fragment,fo),g2=p(fo),om=n(fo,"P",{});var Jz=a(om);_2=i(Jz,`ELECTRA 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.`),Jz.forEach(t),k2=p(fo),Xi=n(fo,"P",{});var O_=a(Xi);v2=i(O_,"This model inherits from "),Lc=n(O_,"A",{href:!0});var Gz=a(Lc);y2=i(Gz,"TFPreTrainedModel"),Gz.forEach(t),T2=i(O_,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),O_.forEach(t),b2=p(fo),Yi=n(fo,"P",{});var N_=a(Yi);w2=i(N_,"This model is also a "),Zi=n(N_,"A",{href:!0,rel:!0});var Xz=a(Zi);E2=i(Xz,"tf.keras.Model"),Xz.forEach(t),$2=i(N_,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),N_.forEach(t),F2=p(fo),b(Js.$$.fragment,fo),x2=p(fo),eo=n(fo,"DIV",{class:!0});var Ra=a(eo);b(el.$$.fragment,Ra),M2=p(Ra),En=n(Ra,"P",{});var hp=a(En);z2=i(hp,"The "),Oc=n(hp,"A",{href:!0});var Yz=a(Oc);q2=i(Yz,"TFElectraForMultipleChoice"),Yz.forEach(t),j2=i(hp," forward method, overrides the "),nm=n(hp,"CODE",{});var Zz=a(nm);C2=i(Zz,"__call__"),Zz.forEach(t),P2=i(hp," special method."),hp.forEach(t),A2=p(Ra),b(Gs.$$.fragment,Ra),L2=p(Ra),b(Xs.$$.fragment,Ra),Ra.forEach(t),fo.forEach(t),_g=p(s),$n=n(s,"H2",{class:!0});var I_=a($n);Ys=n(I_,"A",{id:!0,class:!0,href:!0});var eq=a(Ys);sm=n(eq,"SPAN",{});var tq=a(sm);b(tl.$$.fragment,tq),tq.forEach(t),eq.forEach(t),O2=p(I_),am=n(I_,"SPAN",{});var oq=a(am);N2=i(oq,"TFElectraForTokenClassification"),oq.forEach(t),I_.forEach(t),kg=p(s),st=n(s,"DIV",{class:!0});var Lt=a(st);b(ol.$$.fragment,Lt),I2=p(Lt),rm=n(Lt,"P",{});var nq=a(rm);D2=i(nq,"Electra model with a token classification head on top."),nq.forEach(t),S2=p(Lt),im=n(Lt,"P",{});var sq=a(im);W2=i(sq,"Both the discriminator and generator may be loaded into this model."),sq.forEach(t),U2=p(Lt),nl=n(Lt,"P",{});var D_=a(nl);R2=i(D_,"This model inherits from "),Nc=n(D_,"A",{href:!0});var aq=a(Nc);H2=i(aq,"TFPreTrainedModel"),aq.forEach(t),K2=i(D_,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),D_.forEach(t),Q2=p(Lt),sl=n(Lt,"P",{});var S_=a(sl);B2=i(S_,"This model is also a "),al=n(S_,"A",{href:!0,rel:!0});var rq=a(al);V2=i(rq,"tf.keras.Model"),rq.forEach(t),J2=i(S_,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),S_.forEach(t),G2=p(Lt),b(Zs.$$.fragment,Lt),X2=p(Lt),jt=n(Lt,"DIV",{class:!0});var So=a(jt);b(rl.$$.fragment,So),Y2=p(So),Fn=n(So,"P",{});var mp=a(Fn);Z2=i(mp,"The "),Ic=n(mp,"A",{href:!0});var iq=a(Ic);e1=i(iq,"TFElectraForTokenClassification"),iq.forEach(t),t1=i(mp," forward method, overrides the "),lm=n(mp,"CODE",{});var lq=a(lm);o1=i(lq,"__call__"),lq.forEach(t),n1=i(mp," special method."),mp.forEach(t),s1=p(So),b(ea.$$.fragment,So),a1=p(So),b(ta.$$.fragment,So),r1=p(So),b(oa.$$.fragment,So),So.forEach(t),Lt.forEach(t),vg=p(s),xn=n(s,"H2",{class:!0});var W_=a(xn);na=n(W_,"A",{id:!0,class:!0,href:!0});var dq=a(na);dm=n(dq,"SPAN",{});var cq=a(dm);b(il.$$.fragment,cq),cq.forEach(t),dq.forEach(t),i1=p(W_),cm=n(W_,"SPAN",{});var pq=a(cm);l1=i(pq,"TFElectraForQuestionAnswering"),pq.forEach(t),W_.forEach(t),yg=p(s),_t=n(s,"DIV",{class:!0});var go=a(_t);b(ll.$$.fragment,go),d1=p(go),Mn=n(go,"P",{});var up=a(Mn);c1=i(up,`Electra 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 `),pm=n(up,"CODE",{});var hq=a(pm);p1=i(hq,"span start logits"),hq.forEach(t),h1=i(up," and "),hm=n(up,"CODE",{});var mq=a(hm);m1=i(mq,"span end logits"),mq.forEach(t),u1=i(up,")."),up.forEach(t),f1=p(go),dl=n(go,"P",{});var U_=a(dl);g1=i(U_,"This model inherits from "),Dc=n(U_,"A",{href:!0});var uq=a(Dc);_1=i(uq,"TFPreTrainedModel"),uq.forEach(t),k1=i(U_,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),U_.forEach(t),v1=p(go),cl=n(go,"P",{});var R_=a(cl);y1=i(R_,"This model is also a "),pl=n(R_,"A",{href:!0,rel:!0});var fq=a(pl);T1=i(fq,"tf.keras.Model"),fq.forEach(t),b1=i(R_,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),R_.forEach(t),w1=p(go),b(sa.$$.fragment,go),E1=p(go),Ct=n(go,"DIV",{class:!0});var Wo=a(Ct);b(hl.$$.fragment,Wo),$1=p(Wo),zn=n(Wo,"P",{});var fp=a(zn);F1=i(fp,"The "),Sc=n(fp,"A",{href:!0});var gq=a(Sc);x1=i(gq,"TFElectraForQuestionAnswering"),gq.forEach(t),M1=i(fp," forward method, overrides the "),mm=n(fp,"CODE",{});var _q=a(mm);z1=i(_q,"__call__"),_q.forEach(t),q1=i(fp," special method."),fp.forEach(t),j1=p(Wo),b(aa.$$.fragment,Wo),C1=p(Wo),b(ra.$$.fragment,Wo),P1=p(Wo),b(ia.$$.fragment,Wo),Wo.forEach(t),go.forEach(t),Tg=p(s),qn=n(s,"H2",{class:!0});var H_=a(qn);la=n(H_,"A",{id:!0,class:!0,href:!0});var kq=a(la);um=n(kq,"SPAN",{});var vq=a(um);b(ml.$$.fragment,vq),vq.forEach(t),kq.forEach(t),A1=p(H_),fm=n(H_,"SPAN",{});var yq=a(fm);L1=i(yq,"FlaxElectraModel"),yq.forEach(t),H_.forEach(t),bg=p(s),at=n(s,"DIV",{class:!0});var Ot=a(at);b(ul.$$.fragment,Ot),O1=p(Ot),gm=n(Ot,"P",{});var Tq=a(gm);N1=i(Tq,"The bare Electra Model transformer outputting raw hidden-states without any specific head on top."),Tq.forEach(t),I1=p(Ot),fl=n(Ot,"P",{});var K_=a(fl);D1=i(K_,"This model inherits from "),Wc=n(K_,"A",{href:!0});var bq=a(Wc);S1=i(bq,"FlaxPreTrainedModel"),bq.forEach(t),W1=i(K_,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),K_.forEach(t),U1=p(Ot),gl=n(Ot,"P",{});var Q_=a(gl);R1=i(Q_,`This model is also a Flax Linen
`),_l=n(Q_,"A",{href:!0,rel:!0});var wq=a(_l);H1=i(wq,"flax.nn.Module"),wq.forEach(t),K1=i(Q_,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Q_.forEach(t),Q1=p(Ot),_m=n(Ot,"P",{});var Eq=a(_m);B1=i(Eq,"Finally, this model supports inherent JAX features such as:"),Eq.forEach(t),V1=p(Ot),ko=n(Ot,"UL",{});var Ha=a(ko);km=n(Ha,"LI",{});var $q=a(km);kl=n($q,"A",{href:!0,rel:!0});var Fq=a(kl);J1=i(Fq,"Just-In-Time (JIT) compilation"),Fq.forEach(t),$q.forEach(t),G1=p(Ha),vm=n(Ha,"LI",{});var xq=a(vm);vl=n(xq,"A",{href:!0,rel:!0});var Mq=a(vl);X1=i(Mq,"Automatic Differentiation"),Mq.forEach(t),xq.forEach(t),Y1=p(Ha),ym=n(Ha,"LI",{});var zq=a(ym);yl=n(zq,"A",{href:!0,rel:!0});var qq=a(yl);Z1=i(qq,"Vectorization"),qq.forEach(t),zq.forEach(t),e$=p(Ha),Tm=n(Ha,"LI",{});var jq=a(Tm);Tl=n(jq,"A",{href:!0,rel:!0});var Cq=a(Tl);t$=i(Cq,"Parallelization"),Cq.forEach(t),jq.forEach(t),Ha.forEach(t),o$=p(Ot),to=n(Ot,"DIV",{class:!0});var Ka=a(to);b(bl.$$.fragment,Ka),n$=p(Ka),jn=n(Ka,"P",{});var gp=a(jn);s$=i(gp,"The "),bm=n(gp,"CODE",{});var Pq=a(bm);a$=i(Pq,"FlaxElectraPreTrainedModel"),Pq.forEach(t),r$=i(gp," forward method, overrides the "),wm=n(gp,"CODE",{});var Aq=a(wm);i$=i(Aq,"__call__"),Aq.forEach(t),l$=i(gp," special method."),gp.forEach(t),d$=p(Ka),b(da.$$.fragment,Ka),c$=p(Ka),b(ca.$$.fragment,Ka),Ka.forEach(t),Ot.forEach(t),wg=p(s),Cn=n(s,"H2",{class:!0});var B_=a(Cn);pa=n(B_,"A",{id:!0,class:!0,href:!0});var Lq=a(pa);Em=n(Lq,"SPAN",{});var Oq=a(Em);b(wl.$$.fragment,Oq),Oq.forEach(t),Lq.forEach(t),p$=p(B_),$m=n(B_,"SPAN",{});var Nq=a($m);h$=i(Nq,"FlaxElectraForPreTraining"),Nq.forEach(t),B_.forEach(t),Eg=p(s),Ze=n(s,"DIV",{class:!0});var vt=a(Ze);b(El.$$.fragment,vt),m$=p(vt),Fm=n(vt,"P",{});var Iq=a(Fm);u$=i(Iq,"Electra model with a binary classification head on top as used during pretraining for identifying generated tokens."),Iq.forEach(t),f$=p(vt),xm=n(vt,"P",{});var Dq=a(xm);g$=i(Dq,"It is recommended to load the discriminator checkpoint into that model."),Dq.forEach(t),_$=p(vt),$l=n(vt,"P",{});var V_=a($l);k$=i(V_,"This model inherits from "),Uc=n(V_,"A",{href:!0});var Sq=a(Uc);v$=i(Sq,"FlaxPreTrainedModel"),Sq.forEach(t),y$=i(V_,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),V_.forEach(t),T$=p(vt),Fl=n(vt,"P",{});var J_=a(Fl);b$=i(J_,`This model is also a Flax Linen
`),xl=n(J_,"A",{href:!0,rel:!0});var Wq=a(xl);w$=i(Wq,"flax.nn.Module"),Wq.forEach(t),E$=i(J_,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),J_.forEach(t),$$=p(vt),Mm=n(vt,"P",{});var Uq=a(Mm);F$=i(Uq,"Finally, this model supports inherent JAX features such as:"),Uq.forEach(t),x$=p(vt),vo=n(vt,"UL",{});var Qa=a(vo);zm=n(Qa,"LI",{});var Rq=a(zm);Ml=n(Rq,"A",{href:!0,rel:!0});var Hq=a(Ml);M$=i(Hq,"Just-In-Time (JIT) compilation"),Hq.forEach(t),Rq.forEach(t),z$=p(Qa),qm=n(Qa,"LI",{});var Kq=a(qm);zl=n(Kq,"A",{href:!0,rel:!0});var Qq=a(zl);q$=i(Qq,"Automatic Differentiation"),Qq.forEach(t),Kq.forEach(t),j$=p(Qa),jm=n(Qa,"LI",{});var Bq=a(jm);ql=n(Bq,"A",{href:!0,rel:!0});var Vq=a(ql);C$=i(Vq,"Vectorization"),Vq.forEach(t),Bq.forEach(t),P$=p(Qa),Cm=n(Qa,"LI",{});var Jq=a(Cm);jl=n(Jq,"A",{href:!0,rel:!0});var Gq=a(jl);A$=i(Gq,"Parallelization"),Gq.forEach(t),Jq.forEach(t),Qa.forEach(t),L$=p(vt),oo=n(vt,"DIV",{class:!0});var Ba=a(oo);b(Cl.$$.fragment,Ba),O$=p(Ba),Pn=n(Ba,"P",{});var _p=a(Pn);N$=i(_p,"The "),Pm=n(_p,"CODE",{});var Xq=a(Pm);I$=i(Xq,"FlaxElectraPreTrainedModel"),Xq.forEach(t),D$=i(_p," forward method, overrides the "),Am=n(_p,"CODE",{});var Yq=a(Am);S$=i(Yq,"__call__"),Yq.forEach(t),W$=i(_p," special method."),_p.forEach(t),U$=p(Ba),b(ha.$$.fragment,Ba),R$=p(Ba),b(ma.$$.fragment,Ba),Ba.forEach(t),vt.forEach(t),$g=p(s),An=n(s,"H2",{class:!0});var G_=a(An);ua=n(G_,"A",{id:!0,class:!0,href:!0});var Zq=a(ua);Lm=n(Zq,"SPAN",{});var ej=a(Lm);b(Pl.$$.fragment,ej),ej.forEach(t),Zq.forEach(t),H$=p(G_),Om=n(G_,"SPAN",{});var tj=a(Om);K$=i(tj,"FlaxElectraForCausalLM"),tj.forEach(t),G_.forEach(t),Fg=p(s),rt=n(s,"DIV",{class:!0});var Nt=a(rt);b(Al.$$.fragment,Nt),Q$=p(Nt),Nm=n(Nt,"P",{});var oj=a(Nm);B$=i(oj,`Electra Model with a language modeling head on top (a linear layer on top of the hidden-states output) e.g for
autoregressive tasks.`),oj.forEach(t),V$=p(Nt),Ll=n(Nt,"P",{});var X_=a(Ll);J$=i(X_,"This model inherits from "),Rc=n(X_,"A",{href:!0});var nj=a(Rc);G$=i(nj,"FlaxPreTrainedModel"),nj.forEach(t),X$=i(X_,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),X_.forEach(t),Y$=p(Nt),Ol=n(Nt,"P",{});var Y_=a(Ol);Z$=i(Y_,`This model is also a Flax Linen
`),Nl=n(Y_,"A",{href:!0,rel:!0});var sj=a(Nl);e0=i(sj,"flax.nn.Module"),sj.forEach(t),t0=i(Y_,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Y_.forEach(t),o0=p(Nt),Im=n(Nt,"P",{});var aj=a(Im);n0=i(aj,"Finally, this model supports inherent JAX features such as:"),aj.forEach(t),s0=p(Nt),yo=n(Nt,"UL",{});var Va=a(yo);Dm=n(Va,"LI",{});var rj=a(Dm);Il=n(rj,"A",{href:!0,rel:!0});var ij=a(Il);a0=i(ij,"Just-In-Time (JIT) compilation"),ij.forEach(t),rj.forEach(t),r0=p(Va),Sm=n(Va,"LI",{});var lj=a(Sm);Dl=n(lj,"A",{href:!0,rel:!0});var dj=a(Dl);i0=i(dj,"Automatic Differentiation"),dj.forEach(t),lj.forEach(t),l0=p(Va),Wm=n(Va,"LI",{});var cj=a(Wm);Sl=n(cj,"A",{href:!0,rel:!0});var pj=a(Sl);d0=i(pj,"Vectorization"),pj.forEach(t),cj.forEach(t),c0=p(Va),Um=n(Va,"LI",{});var hj=a(Um);Wl=n(hj,"A",{href:!0,rel:!0});var mj=a(Wl);p0=i(mj,"Parallelization"),mj.forEach(t),hj.forEach(t),Va.forEach(t),h0=p(Nt),no=n(Nt,"DIV",{class:!0});var Ja=a(no);b(Ul.$$.fragment,Ja),m0=p(Ja),Ln=n(Ja,"P",{});var kp=a(Ln);u0=i(kp,"The "),Rm=n(kp,"CODE",{});var uj=a(Rm);f0=i(uj,"FlaxElectraPreTrainedModel"),uj.forEach(t),g0=i(kp," forward method, overrides the "),Hm=n(kp,"CODE",{});var fj=a(Hm);_0=i(fj,"__call__"),fj.forEach(t),k0=i(kp," special method."),kp.forEach(t),v0=p(Ja),b(fa.$$.fragment,Ja),y0=p(Ja),b(ga.$$.fragment,Ja),Ja.forEach(t),Nt.forEach(t),xg=p(s),On=n(s,"H2",{class:!0});var Z_=a(On);_a=n(Z_,"A",{id:!0,class:!0,href:!0});var gj=a(_a);Km=n(gj,"SPAN",{});var _j=a(Km);b(Rl.$$.fragment,_j),_j.forEach(t),gj.forEach(t),T0=p(Z_),Qm=n(Z_,"SPAN",{});var kj=a(Qm);b0=i(kj,"FlaxElectraForMaskedLM"),kj.forEach(t),Z_.forEach(t),Mg=p(s),it=n(s,"DIV",{class:!0});var It=a(it);b(Hl.$$.fragment,It),w0=p(It),Kl=n(It,"P",{});var ek=a(Kl);E0=i(ek,"Electra Model with a "),Bm=n(ek,"CODE",{});var vj=a(Bm);$0=i(vj,"language modeling"),vj.forEach(t),F0=i(ek," head on top."),ek.forEach(t),x0=p(It),Ql=n(It,"P",{});var tk=a(Ql);M0=i(tk,"This model inherits from "),Hc=n(tk,"A",{href:!0});var yj=a(Hc);z0=i(yj,"FlaxPreTrainedModel"),yj.forEach(t),q0=i(tk,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),tk.forEach(t),j0=p(It),Bl=n(It,"P",{});var ok=a(Bl);C0=i(ok,`This model is also a Flax Linen
`),Vl=n(ok,"A",{href:!0,rel:!0});var Tj=a(Vl);P0=i(Tj,"flax.nn.Module"),Tj.forEach(t),A0=i(ok,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),ok.forEach(t),L0=p(It),Vm=n(It,"P",{});var bj=a(Vm);O0=i(bj,"Finally, this model supports inherent JAX features such as:"),bj.forEach(t),N0=p(It),To=n(It,"UL",{});var Ga=a(To);Jm=n(Ga,"LI",{});var wj=a(Jm);Jl=n(wj,"A",{href:!0,rel:!0});var Ej=a(Jl);I0=i(Ej,"Just-In-Time (JIT) compilation"),Ej.forEach(t),wj.forEach(t),D0=p(Ga),Gm=n(Ga,"LI",{});var $j=a(Gm);Gl=n($j,"A",{href:!0,rel:!0});var Fj=a(Gl);S0=i(Fj,"Automatic Differentiation"),Fj.forEach(t),$j.forEach(t),W0=p(Ga),Xm=n(Ga,"LI",{});var xj=a(Xm);Xl=n(xj,"A",{href:!0,rel:!0});var Mj=a(Xl);U0=i(Mj,"Vectorization"),Mj.forEach(t),xj.forEach(t),R0=p(Ga),Ym=n(Ga,"LI",{});var zj=a(Ym);Yl=n(zj,"A",{href:!0,rel:!0});var qj=a(Yl);H0=i(qj,"Parallelization"),qj.forEach(t),zj.forEach(t),Ga.forEach(t),K0=p(It),so=n(It,"DIV",{class:!0});var Xa=a(so);b(Zl.$$.fragment,Xa),Q0=p(Xa),Nn=n(Xa,"P",{});var vp=a(Nn);B0=i(vp,"The "),Zm=n(vp,"CODE",{});var jj=a(Zm);V0=i(jj,"FlaxElectraPreTrainedModel"),jj.forEach(t),J0=i(vp," forward method, overrides the "),eu=n(vp,"CODE",{});var Cj=a(eu);G0=i(Cj,"__call__"),Cj.forEach(t),X0=i(vp," special method."),vp.forEach(t),Y0=p(Xa),b(ka.$$.fragment,Xa),Z0=p(Xa),b(va.$$.fragment,Xa),Xa.forEach(t),It.forEach(t),zg=p(s),In=n(s,"H2",{class:!0});var nk=a(In);ya=n(nk,"A",{id:!0,class:!0,href:!0});var Pj=a(ya);tu=n(Pj,"SPAN",{});var Aj=a(tu);b(ed.$$.fragment,Aj),Aj.forEach(t),Pj.forEach(t),eF=p(nk),ou=n(nk,"SPAN",{});var Lj=a(ou);tF=i(Lj,"FlaxElectraForSequenceClassification"),Lj.forEach(t),nk.forEach(t),qg=p(s),lt=n(s,"DIV",{class:!0});var Dt=a(lt);b(td.$$.fragment,Dt),oF=p(Dt),nu=n(Dt,"P",{});var Oj=a(nu);nF=i(Oj,`Electra Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),Oj.forEach(t),sF=p(Dt),od=n(Dt,"P",{});var sk=a(od);aF=i(sk,"This model inherits from "),Kc=n(sk,"A",{href:!0});var Nj=a(Kc);rF=i(Nj,"FlaxPreTrainedModel"),Nj.forEach(t),iF=i(sk,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),sk.forEach(t),lF=p(Dt),nd=n(Dt,"P",{});var ak=a(nd);dF=i(ak,`This model is also a Flax Linen
`),sd=n(ak,"A",{href:!0,rel:!0});var Ij=a(sd);cF=i(Ij,"flax.nn.Module"),Ij.forEach(t),pF=i(ak,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),ak.forEach(t),hF=p(Dt),su=n(Dt,"P",{});var Dj=a(su);mF=i(Dj,"Finally, this model supports inherent JAX features such as:"),Dj.forEach(t),uF=p(Dt),bo=n(Dt,"UL",{});var Ya=a(bo);au=n(Ya,"LI",{});var Sj=a(au);ad=n(Sj,"A",{href:!0,rel:!0});var Wj=a(ad);fF=i(Wj,"Just-In-Time (JIT) compilation"),Wj.forEach(t),Sj.forEach(t),gF=p(Ya),ru=n(Ya,"LI",{});var Uj=a(ru);rd=n(Uj,"A",{href:!0,rel:!0});var Rj=a(rd);_F=i(Rj,"Automatic Differentiation"),Rj.forEach(t),Uj.forEach(t),kF=p(Ya),iu=n(Ya,"LI",{});var Hj=a(iu);id=n(Hj,"A",{href:!0,rel:!0});var Kj=a(id);vF=i(Kj,"Vectorization"),Kj.forEach(t),Hj.forEach(t),yF=p(Ya),lu=n(Ya,"LI",{});var Qj=a(lu);ld=n(Qj,"A",{href:!0,rel:!0});var Bj=a(ld);TF=i(Bj,"Parallelization"),Bj.forEach(t),Qj.forEach(t),Ya.forEach(t),bF=p(Dt),ao=n(Dt,"DIV",{class:!0});var Za=a(ao);b(dd.$$.fragment,Za),wF=p(Za),Dn=n(Za,"P",{});var yp=a(Dn);EF=i(yp,"The "),du=n(yp,"CODE",{});var Vj=a(du);$F=i(Vj,"FlaxElectraPreTrainedModel"),Vj.forEach(t),FF=i(yp," forward method, overrides the "),cu=n(yp,"CODE",{});var Jj=a(cu);xF=i(Jj,"__call__"),Jj.forEach(t),MF=i(yp," special method."),yp.forEach(t),zF=p(Za),b(Ta.$$.fragment,Za),qF=p(Za),b(ba.$$.fragment,Za),Za.forEach(t),Dt.forEach(t),jg=p(s),Sn=n(s,"H2",{class:!0});var rk=a(Sn);wa=n(rk,"A",{id:!0,class:!0,href:!0});var Gj=a(wa);pu=n(Gj,"SPAN",{});var Xj=a(pu);b(cd.$$.fragment,Xj),Xj.forEach(t),Gj.forEach(t),jF=p(rk),hu=n(rk,"SPAN",{});var Yj=a(hu);CF=i(Yj,"FlaxElectraForMultipleChoice"),Yj.forEach(t),rk.forEach(t),Cg=p(s),dt=n(s,"DIV",{class:!0});var St=a(dt);b(pd.$$.fragment,St),PF=p(St),mu=n(St,"P",{});var Zj=a(mu);AF=i(Zj,`ELECTRA 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.`),Zj.forEach(t),LF=p(St),hd=n(St,"P",{});var ik=a(hd);OF=i(ik,"This model inherits from "),Qc=n(ik,"A",{href:!0});var eC=a(Qc);NF=i(eC,"FlaxPreTrainedModel"),eC.forEach(t),IF=i(ik,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),ik.forEach(t),DF=p(St),md=n(St,"P",{});var lk=a(md);SF=i(lk,`This model is also a Flax Linen
`),ud=n(lk,"A",{href:!0,rel:!0});var tC=a(ud);WF=i(tC,"flax.nn.Module"),tC.forEach(t),UF=i(lk,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),lk.forEach(t),RF=p(St),uu=n(St,"P",{});var oC=a(uu);HF=i(oC,"Finally, this model supports inherent JAX features such as:"),oC.forEach(t),KF=p(St),wo=n(St,"UL",{});var er=a(wo);fu=n(er,"LI",{});var nC=a(fu);fd=n(nC,"A",{href:!0,rel:!0});var sC=a(fd);QF=i(sC,"Just-In-Time (JIT) compilation"),sC.forEach(t),nC.forEach(t),BF=p(er),gu=n(er,"LI",{});var aC=a(gu);gd=n(aC,"A",{href:!0,rel:!0});var rC=a(gd);VF=i(rC,"Automatic Differentiation"),rC.forEach(t),aC.forEach(t),JF=p(er),_u=n(er,"LI",{});var iC=a(_u);_d=n(iC,"A",{href:!0,rel:!0});var lC=a(_d);GF=i(lC,"Vectorization"),lC.forEach(t),iC.forEach(t),XF=p(er),ku=n(er,"LI",{});var dC=a(ku);kd=n(dC,"A",{href:!0,rel:!0});var cC=a(kd);YF=i(cC,"Parallelization"),cC.forEach(t),dC.forEach(t),er.forEach(t),ZF=p(St),ro=n(St,"DIV",{class:!0});var tr=a(ro);b(vd.$$.fragment,tr),e4=p(tr),Wn=n(tr,"P",{});var Tp=a(Wn);t4=i(Tp,"The "),vu=n(Tp,"CODE",{});var pC=a(vu);o4=i(pC,"FlaxElectraPreTrainedModel"),pC.forEach(t),n4=i(Tp," forward method, overrides the "),yu=n(Tp,"CODE",{});var hC=a(yu);s4=i(hC,"__call__"),hC.forEach(t),a4=i(Tp," special method."),Tp.forEach(t),r4=p(tr),b(Ea.$$.fragment,tr),i4=p(tr),b($a.$$.fragment,tr),tr.forEach(t),St.forEach(t),Pg=p(s),Un=n(s,"H2",{class:!0});var dk=a(Un);Fa=n(dk,"A",{id:!0,class:!0,href:!0});var mC=a(Fa);Tu=n(mC,"SPAN",{});var uC=a(Tu);b(yd.$$.fragment,uC),uC.forEach(t),mC.forEach(t),l4=p(dk),bu=n(dk,"SPAN",{});var fC=a(bu);d4=i(fC,"FlaxElectraForTokenClassification"),fC.forEach(t),dk.forEach(t),Ag=p(s),et=n(s,"DIV",{class:!0});var yt=a(et);b(Td.$$.fragment,yt),c4=p(yt),wu=n(yt,"P",{});var gC=a(wu);p4=i(gC,"Electra model with a token classification head on top."),gC.forEach(t),h4=p(yt),Eu=n(yt,"P",{});var _C=a(Eu);m4=i(_C,"Both the discriminator and generator may be loaded into this model."),_C.forEach(t),u4=p(yt),bd=n(yt,"P",{});var ck=a(bd);f4=i(ck,"This model inherits from "),Bc=n(ck,"A",{href:!0});var kC=a(Bc);g4=i(kC,"FlaxPreTrainedModel"),kC.forEach(t),_4=i(ck,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),ck.forEach(t),k4=p(yt),wd=n(yt,"P",{});var pk=a(wd);v4=i(pk,`This model is also a Flax Linen
`),Ed=n(pk,"A",{href:!0,rel:!0});var vC=a(Ed);y4=i(vC,"flax.nn.Module"),vC.forEach(t),T4=i(pk,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),pk.forEach(t),b4=p(yt),$u=n(yt,"P",{});var yC=a($u);w4=i(yC,"Finally, this model supports inherent JAX features such as:"),yC.forEach(t),E4=p(yt),Eo=n(yt,"UL",{});var or=a(Eo);Fu=n(or,"LI",{});var TC=a(Fu);$d=n(TC,"A",{href:!0,rel:!0});var bC=a($d);$4=i(bC,"Just-In-Time (JIT) compilation"),bC.forEach(t),TC.forEach(t),F4=p(or),xu=n(or,"LI",{});var wC=a(xu);Fd=n(wC,"A",{href:!0,rel:!0});var EC=a(Fd);x4=i(EC,"Automatic Differentiation"),EC.forEach(t),wC.forEach(t),M4=p(or),Mu=n(or,"LI",{});var $C=a(Mu);xd=n($C,"A",{href:!0,rel:!0});var FC=a(xd);z4=i(FC,"Vectorization"),FC.forEach(t),$C.forEach(t),q4=p(or),zu=n(or,"LI",{});var xC=a(zu);Md=n(xC,"A",{href:!0,rel:!0});var MC=a(Md);j4=i(MC,"Parallelization"),MC.forEach(t),xC.forEach(t),or.forEach(t),C4=p(yt),io=n(yt,"DIV",{class:!0});var nr=a(io);b(zd.$$.fragment,nr),P4=p(nr),Rn=n(nr,"P",{});var bp=a(Rn);A4=i(bp,"The "),qu=n(bp,"CODE",{});var zC=a(qu);L4=i(zC,"FlaxElectraPreTrainedModel"),zC.forEach(t),O4=i(bp," forward method, overrides the "),ju=n(bp,"CODE",{});var qC=a(ju);N4=i(qC,"__call__"),qC.forEach(t),I4=i(bp," special method."),bp.forEach(t),D4=p(nr),b(xa.$$.fragment,nr),S4=p(nr),b(Ma.$$.fragment,nr),nr.forEach(t),yt.forEach(t),Lg=p(s),Hn=n(s,"H2",{class:!0});var hk=a(Hn);za=n(hk,"A",{id:!0,class:!0,href:!0});var jC=a(za);Cu=n(jC,"SPAN",{});var CC=a(Cu);b(qd.$$.fragment,CC),CC.forEach(t),jC.forEach(t),W4=p(hk),Pu=n(hk,"SPAN",{});var PC=a(Pu);U4=i(PC,"FlaxElectraForQuestionAnswering"),PC.forEach(t),hk.forEach(t),Og=p(s),ct=n(s,"DIV",{class:!0});var Wt=a(ct);b(jd.$$.fragment,Wt),R4=p(Wt),Kn=n(Wt,"P",{});var wp=a(Kn);H4=i(wp,`ELECTRA 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 `),Au=n(wp,"CODE",{});var AC=a(Au);K4=i(AC,"span start logits"),AC.forEach(t),Q4=i(wp," and "),Lu=n(wp,"CODE",{});var LC=a(Lu);B4=i(LC,"span end logits"),LC.forEach(t),V4=i(wp,")."),wp.forEach(t),J4=p(Wt),Cd=n(Wt,"P",{});var mk=a(Cd);G4=i(mk,"This model inherits from "),Vc=n(mk,"A",{href:!0});var OC=a(Vc);X4=i(OC,"FlaxPreTrainedModel"),OC.forEach(t),Y4=i(mk,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),mk.forEach(t),Z4=p(Wt),Pd=n(Wt,"P",{});var uk=a(Pd);ex=i(uk,`This model is also a Flax Linen
`),Ad=n(uk,"A",{href:!0,rel:!0});var NC=a(Ad);tx=i(NC,"flax.nn.Module"),NC.forEach(t),ox=i(uk,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),uk.forEach(t),nx=p(Wt),Ou=n(Wt,"P",{});var IC=a(Ou);sx=i(IC,"Finally, this model supports inherent JAX features such as:"),IC.forEach(t),ax=p(Wt),$o=n(Wt,"UL",{});var sr=a($o);Nu=n(sr,"LI",{});var DC=a(Nu);Ld=n(DC,"A",{href:!0,rel:!0});var SC=a(Ld);rx=i(SC,"Just-In-Time (JIT) compilation"),SC.forEach(t),DC.forEach(t),ix=p(sr),Iu=n(sr,"LI",{});var WC=a(Iu);Od=n(WC,"A",{href:!0,rel:!0});var UC=a(Od);lx=i(UC,"Automatic Differentiation"),UC.forEach(t),WC.forEach(t),dx=p(sr),Du=n(sr,"LI",{});var RC=a(Du);Nd=n(RC,"A",{href:!0,rel:!0});var HC=a(Nd);cx=i(HC,"Vectorization"),HC.forEach(t),RC.forEach(t),px=p(sr),Su=n(sr,"LI",{});var KC=a(Su);Id=n(KC,"A",{href:!0,rel:!0});var QC=a(Id);hx=i(QC,"Parallelization"),QC.forEach(t),KC.forEach(t),sr.forEach(t),mx=p(Wt),lo=n(Wt,"DIV",{class:!0});var ar=a(lo);b(Dd.$$.fragment,ar),ux=p(ar),Qn=n(ar,"P",{});var Ep=a(Qn);fx=i(Ep,"The "),Wu=n(Ep,"CODE",{});var BC=a(Wu);gx=i(BC,"FlaxElectraPreTrainedModel"),BC.forEach(t),_x=i(Ep," forward method, overrides the "),Uu=n(Ep,"CODE",{});var VC=a(Uu);kx=i(VC,"__call__"),VC.forEach(t),vx=i(Ep," special method."),Ep.forEach(t),yx=p(ar),b(qa.$$.fragment,ar),Tx=p(ar),b(ja.$$.fragment,ar),ar.forEach(t),Wt.forEach(t),this.h()},h(){m(d,"name","hf:doc:metadata"),m(d,"content",JSON.stringify(dA)),m(f,"id","electra"),m(f,"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"),m(f,"href","#electra"),m(u,"class","relative group"),m(te,"alt","Models"),JC(te.src,M="https://img.shields.io/badge/All_model_pages-electra-blueviolet")||m(te,"src",M),m(de,"href","https://huggingface.co/models?filter=electra"),m(ce,"alt","Spaces"),JC(ce.src,Ne="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||m(ce,"src",Ne),m(Q,"href","https://huggingface.co/spaces/docs-demos/electra_large_discriminator_squad2_512"),m(W,"class","flex flex-wrap space-x-1"),m(re,"id","overview"),m(re,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(re,"href","#overview"),m(ae,"class","relative group"),m(le,"href","https://openreview.net/pdf?id=r1xMH1BtvB"),m(le,"rel","nofollow"),m(ee,"href","https://github.com/google-research/electra"),m(ee,"rel","nofollow"),m(O,"href","/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraForMaskedLM"),m(y,"href","/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraForPreTraining"),m(j,"href","https://huggingface.co/lysandre"),m(j,"rel","nofollow"),m(We,"href","https://github.com/google-research/electra"),m(We,"rel","nofollow"),m(Se,"id","documentation-resources"),m(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"),m(Se,"href","#documentation-resources"),m(U,"class","relative group"),m(Bd,"href","../tasks/sequence_classification"),m(Vd,"href","../tasks/token_classification"),m(Jd,"href","../tasks/question_answering"),m(Gd,"href","../tasks/language_modeling"),m(Xd,"href","../tasks/masked_language_modeling"),m(Yd,"href","../tasks/multiple_choice"),m(Gn,"id","transformers.ElectraConfig"),m(Gn,"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"),m(Gn,"href","#transformers.ElectraConfig"),m(Uo,"class","relative group"),m(Zd,"href","/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraModel"),m(ec,"href","/docs/transformers/v4.29.0/en/model_doc/electra#transformers.TFElectraModel"),m(lr,"href","https://huggingface.co/google/electra-small-discriminator"),m(lr,"rel","nofollow"),m(tc,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),m(oc,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),m(Ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Yn,"id","transformers.ElectraTokenizer"),m(Yn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Yn,"href","#transformers.ElectraTokenizer"),m(Ho,"class","relative group"),m(nc,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),m(zo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Zn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ts,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(os,"id","transformers.ElectraTokenizerFast"),m(os,"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"),m(os,"href","#transformers.ElectraTokenizerFast"),m(Qo,"class","relative group"),m(rc,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),m(qo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ss,"id","transformers.models.electra.modeling_electra.ElectraForPreTrainingOutput"),m(ss,"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"),m(ss,"href","#transformers.models.electra.modeling_electra.ElectraForPreTrainingOutput"),m(Vo,"class","relative group"),m(dc,"href","/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraForPreTraining"),m(Jo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(cc,"href","/docs/transformers/v4.29.0/en/model_doc/electra#transformers.TFElectraForPreTraining"),m(Go,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(as,"id","transformers.ElectraModel"),m(as,"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"),m(as,"href","#transformers.ElectraModel"),m(Xo,"class","relative group"),m(pc,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),m(Ar,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Ar,"rel","nofollow"),m(hc,"href","/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraModel"),m(Kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ls,"id","transformers.ElectraForPreTraining"),m(ls,"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"),m(ls,"href","#transformers.ElectraForPreTraining"),m(Zo,"class","relative group"),m(mc,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),m(Sr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Sr,"rel","nofollow"),m(uc,"href","/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraForPreTraining"),m(Qt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ps,"id","transformers.ElectraForCausalLM"),m(ps,"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"),m(ps,"href","#transformers.ElectraForCausalLM"),m(tn,"class","relative group"),m(fc,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),m(Br,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Br,"rel","nofollow"),m(gc,"href","/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraForCausalLM"),m(Bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(wt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(us,"id","transformers.ElectraForMaskedLM"),m(us,"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"),m(us,"href","#transformers.ElectraForMaskedLM"),m(nn,"class","relative group"),m(_c,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),m(Zr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Zr,"rel","nofollow"),m(kc,"href","/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraForMaskedLM"),m(Vt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(_s,"id","transformers.ElectraForSequenceClassification"),m(_s,"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"),m(_s,"href","#transformers.ElectraForSequenceClassification"),m(an,"class","relative group"),m(vc,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),m(ai,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(ai,"rel","nofollow"),m(yc,"href","/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraForSequenceClassification"),m(Mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ts,"id","transformers.ElectraForMultipleChoice"),m(Ts,"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"),m(Ts,"href","#transformers.ElectraForMultipleChoice"),m(ln,"class","relative group"),m(Tc,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),m(pi,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(pi,"rel","nofollow"),m(bc,"href","/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraForMultipleChoice"),m(Jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m($t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Es,"id","transformers.ElectraForTokenClassification"),m(Es,"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"),m(Es,"href","#transformers.ElectraForTokenClassification"),m(cn,"class","relative group"),m(wc,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),m(_i,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(_i,"rel","nofollow"),m(Ec,"href","/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraForTokenClassification"),m(Gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(xs,"id","transformers.ElectraForQuestionAnswering"),m(xs,"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"),m(xs,"href","#transformers.ElectraForQuestionAnswering"),m(hn,"class","relative group"),m($c,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),m(wi,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(wi,"rel","nofollow"),m(Fc,"href","/docs/transformers/v4.29.0/en/model_doc/electra#transformers.ElectraForQuestionAnswering"),m(Xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(qs,"id","transformers.TFElectraModel"),m(qs,"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"),m(qs,"href","#transformers.TFElectraModel"),m(fn,"class","relative group"),m(xc,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),m(zi,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(zi,"rel","nofollow"),m(Mc,"href","/docs/transformers/v4.29.0/en/model_doc/electra#transformers.TFElectraModel"),m(Yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(As,"id","transformers.TFElectraForPreTraining"),m(As,"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"),m(As,"href","#transformers.TFElectraForPreTraining"),m(_n,"class","relative group"),m(zc,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),m(Li,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(Li,"rel","nofollow"),m(qc,"href","/docs/transformers/v4.29.0/en/model_doc/electra#transformers.TFElectraForPreTraining"),m(Zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Is,"id","transformers.TFElectraForMaskedLM"),m(Is,"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"),m(Is,"href","#transformers.TFElectraForMaskedLM"),m(vn,"class","relative group"),m(jc,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),m(Wi,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(Wi,"rel","nofollow"),m(Cc,"href","/docs/transformers/v4.29.0/en/model_doc/electra#transformers.TFElectraForMaskedLM"),m(zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Rs,"id","transformers.TFElectraForSequenceClassification"),m(Rs,"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"),m(Rs,"href","#transformers.TFElectraForSequenceClassification"),m(Tn,"class","relative group"),m(Pc,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),m(Bi,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(Bi,"rel","nofollow"),m(Ac,"href","/docs/transformers/v4.29.0/en/model_doc/electra#transformers.TFElectraForSequenceClassification"),m(qt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Vs,"id","transformers.TFElectraForMultipleChoice"),m(Vs,"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"),m(Vs,"href","#transformers.TFElectraForMultipleChoice"),m(wn,"class","relative group"),m(Lc,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),m(Zi,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(Zi,"rel","nofollow"),m(Oc,"href","/docs/transformers/v4.29.0/en/model_doc/electra#transformers.TFElectraForMultipleChoice"),m(eo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ys,"id","transformers.TFElectraForTokenClassification"),m(Ys,"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"),m(Ys,"href","#transformers.TFElectraForTokenClassification"),m($n,"class","relative group"),m(Nc,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),m(al,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(al,"rel","nofollow"),m(Ic,"href","/docs/transformers/v4.29.0/en/model_doc/electra#transformers.TFElectraForTokenClassification"),m(jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(na,"id","transformers.TFElectraForQuestionAnswering"),m(na,"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"),m(na,"href","#transformers.TFElectraForQuestionAnswering"),m(xn,"class","relative group"),m(Dc,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),m(pl,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(pl,"rel","nofollow"),m(Sc,"href","/docs/transformers/v4.29.0/en/model_doc/electra#transformers.TFElectraForQuestionAnswering"),m(Ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(_t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(la,"id","transformers.FlaxElectraModel"),m(la,"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"),m(la,"href","#transformers.FlaxElectraModel"),m(qn,"class","relative group"),m(Wc,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),m(_l,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),m(_l,"rel","nofollow"),m(kl,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),m(kl,"rel","nofollow"),m(vl,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),m(vl,"rel","nofollow"),m(yl,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),m(yl,"rel","nofollow"),m(Tl,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),m(Tl,"rel","nofollow"),m(to,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(pa,"id","transformers.FlaxElectraForPreTraining"),m(pa,"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"),m(pa,"href","#transformers.FlaxElectraForPreTraining"),m(Cn,"class","relative group"),m(Uc,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),m(xl,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),m(xl,"rel","nofollow"),m(Ml,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),m(Ml,"rel","nofollow"),m(zl,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),m(zl,"rel","nofollow"),m(ql,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),m(ql,"rel","nofollow"),m(jl,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),m(jl,"rel","nofollow"),m(oo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ua,"id","transformers.FlaxElectraForCausalLM"),m(ua,"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"),m(ua,"href","#transformers.FlaxElectraForCausalLM"),m(An,"class","relative group"),m(Rc,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),m(Nl,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),m(Nl,"rel","nofollow"),m(Il,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),m(Il,"rel","nofollow"),m(Dl,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),m(Dl,"rel","nofollow"),m(Sl,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),m(Sl,"rel","nofollow"),m(Wl,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),m(Wl,"rel","nofollow"),m(no,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(_a,"id","transformers.FlaxElectraForMaskedLM"),m(_a,"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"),m(_a,"href","#transformers.FlaxElectraForMaskedLM"),m(On,"class","relative group"),m(Hc,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),m(Vl,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),m(Vl,"rel","nofollow"),m(Jl,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),m(Jl,"rel","nofollow"),m(Gl,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),m(Gl,"rel","nofollow"),m(Xl,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),m(Xl,"rel","nofollow"),m(Yl,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),m(Yl,"rel","nofollow"),m(so,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(it,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ya,"id","transformers.FlaxElectraForSequenceClassification"),m(ya,"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"),m(ya,"href","#transformers.FlaxElectraForSequenceClassification"),m(In,"class","relative group"),m(Kc,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),m(sd,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),m(sd,"rel","nofollow"),m(ad,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),m(ad,"rel","nofollow"),m(rd,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),m(rd,"rel","nofollow"),m(id,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),m(id,"rel","nofollow"),m(ld,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),m(ld,"rel","nofollow"),m(ao,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(wa,"id","transformers.FlaxElectraForMultipleChoice"),m(wa,"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"),m(wa,"href","#transformers.FlaxElectraForMultipleChoice"),m(Sn,"class","relative group"),m(Qc,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),m(ud,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),m(ud,"rel","nofollow"),m(fd,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),m(fd,"rel","nofollow"),m(gd,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),m(gd,"rel","nofollow"),m(_d,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),m(_d,"rel","nofollow"),m(kd,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),m(kd,"rel","nofollow"),m(ro,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Fa,"id","transformers.FlaxElectraForTokenClassification"),m(Fa,"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"),m(Fa,"href","#transformers.FlaxElectraForTokenClassification"),m(Un,"class","relative group"),m(Bc,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),m(Ed,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),m(Ed,"rel","nofollow"),m($d,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),m($d,"rel","nofollow"),m(Fd,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),m(Fd,"rel","nofollow"),m(xd,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),m(xd,"rel","nofollow"),m(Md,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),m(Md,"rel","nofollow"),m(io,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(za,"id","transformers.FlaxElectraForQuestionAnswering"),m(za,"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"),m(za,"href","#transformers.FlaxElectraForQuestionAnswering"),m(Hn,"class","relative group"),m(Vc,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),m(Ad,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),m(Ad,"rel","nofollow"),m(Ld,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),m(Ld,"rel","nofollow"),m(Od,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),m(Od,"rel","nofollow"),m(Nd,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),m(Nd,"rel","nofollow"),m(Id,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),m(Id,"rel","nofollow"),m(lo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(s,k){e(document.head,d),g(s,v,k),g(s,u,k),e(u,f),e(f,_),w(l,_,null),e(u,h),e(u,z),e(z,ve),g(s,fe,k),g(s,W,k),e(W,de),e(de,te),e(W,ye),e(W,Q),e(Q,ce),g(s,G,k),g(s,ae,k),e(ae,re),e(re,B),w(ie,B,null),e(ae,Te),e(ae,V),e(V,be),g(s,ge,k),g(s,H,k),e(H,we),e(H,le),e(le,ne),e(H,C),g(s,A,k),g(s,pe,k),e(pe,Y),g(s,_e,k),g(s,he,k),e(he,J),e(J,Ee),g(s,ke,k),g(s,P,k),e(P,$e),g(s,X,k),g(s,se,k),e(se,me),e(me,Z),e(se,Fe),e(se,ue),e(ue,S),e(se,xe),e(se,I),e(I,Me),e(I,ee),e(ee,L),e(I,ze),e(I,O),e(O,qe),e(I,je),e(I,y),e(y,q),e(I,Qe),g(s,oe,k),g(s,Ce,k),e(Ce,Be),e(Ce,j),e(j,Ve),e(Ce,Je),e(Ce,We),e(We,Ge),e(Ce,Xe),g(s,D,k),g(s,U,k),e(U,Se),e(Se,Ue),w(K,Ue,null),e(U,Ye),e(U,Re),e(Re,Pe),g(s,Ke,k),g(s,R,k),e(R,He),e(He,Bd),e(Bd,fk),e(R,gk),e(R,$p),e($p,Vd),e(Vd,_k),e(R,kk),e(R,Fp),e(Fp,Jd),e(Jd,vk),e(R,yk),e(R,xp),e(xp,Gd),e(Gd,Tk),e(R,bk),e(R,Mp),e(Mp,Xd),e(Xd,wk),e(R,Ek),e(R,zp),e(zp,Yd),e(Yd,$k),g(s,Of,k),g(s,Uo,k),e(Uo,Gn),e(Gn,qp),w(rr,qp,null),e(Uo,Fk),e(Uo,jp),e(jp,xk),g(s,Nf,k),g(s,Ut,k),w(ir,Ut,null),e(Ut,Mk),e(Ut,_o),e(_o,zk),e(_o,Zd),e(Zd,qk),e(_o,jk),e(_o,ec),e(ec,Ck),e(_o,Pk),e(_o,lr),e(lr,Ak),e(_o,Lk),e(Ut,Ok),e(Ut,Ro),e(Ro,Nk),e(Ro,tc),e(tc,Ik),e(Ro,Dk),e(Ro,oc),e(oc,Sk),e(Ro,Wk),e(Ut,Uk),w(Xn,Ut,null),g(s,If,k),g(s,Ho,k),e(Ho,Yn),e(Yn,Cp),w(dr,Cp,null),e(Ho,Rk),e(Ho,Pp),e(Pp,Hk),g(s,Df,k),g(s,tt,k),w(cr,tt,null),e(tt,Kk),e(tt,Ap),e(Ap,Qk),e(tt,Bk),e(tt,pr),e(pr,Vk),e(pr,nc),e(nc,Jk),e(pr,Gk),e(tt,Xk),e(tt,zo),w(hr,zo,null),e(zo,Yk),e(zo,Lp),e(Lp,Zk),e(zo,ev),e(zo,mr),e(mr,sc),e(sc,tv),e(sc,Op),e(Op,ov),e(mr,nv),e(mr,ac),e(ac,sv),e(ac,Np),e(Np,av),e(tt,rv),e(tt,Zn),w(ur,Zn,null),e(Zn,iv),e(Zn,Ip),e(Ip,lv),e(tt,dv),e(tt,Rt),w(fr,Rt,null),e(Rt,cv),e(Rt,Dp),e(Dp,pv),e(Rt,hv),w(es,Rt,null),e(Rt,mv),e(Rt,Ko),e(Ko,uv),e(Ko,Sp),e(Sp,fv),e(Ko,gv),e(Ko,Wp),e(Wp,_v),e(Ko,kv),e(tt,vv),e(tt,ts),w(gr,ts,null),e(ts,yv),e(ts,_r),e(_r,Tv),e(_r,Up),e(Up,bv),e(_r,wv),g(s,Sf,k),g(s,Qo,k),e(Qo,os),e(os,Rp),w(kr,Rp,null),e(Qo,Ev),e(Qo,Hp),e(Hp,$v),g(s,Wf,k),g(s,Tt,k),w(vr,Tt,null),e(Tt,Fv),e(Tt,yr),e(yr,xv),e(yr,Kp),e(Kp,Mv),e(yr,zv),e(Tt,qv),e(Tt,Tr),e(Tr,jv),e(Tr,rc),e(rc,Cv),e(Tr,Pv),e(Tt,Av),e(Tt,qo),w(br,qo,null),e(qo,Lv),e(qo,Qp),e(Qp,Ov),e(qo,Nv),e(qo,wr),e(wr,ic),e(ic,Iv),e(ic,Bp),e(Bp,Dv),e(wr,Sv),e(wr,lc),e(lc,Wv),e(lc,Vp),e(Vp,Uv),e(Tt,Rv),e(Tt,Ht),w(Er,Ht,null),e(Ht,Hv),e(Ht,Jp),e(Jp,Kv),e(Ht,Qv),w(ns,Ht,null),e(Ht,Bv),e(Ht,Bo),e(Bo,Vv),e(Bo,Gp),e(Gp,Jv),e(Bo,Gv),e(Bo,Xp),e(Xp,Xv),e(Bo,Yv),g(s,Uf,k),g(s,Vo,k),e(Vo,ss),e(ss,Yp),w($r,Yp,null),e(Vo,Zv),e(Vo,Zp),e(Zp,ey),g(s,Rf,k),g(s,Jo,k),w(Fr,Jo,null),e(Jo,ty),e(Jo,xr),e(xr,oy),e(xr,dc),e(dc,ny),e(xr,sy),g(s,Hf,k),g(s,Go,k),w(Mr,Go,null),e(Go,ay),e(Go,zr),e(zr,ry),e(zr,cc),e(cc,iy),e(zr,ly),g(s,Kf,k),g(s,Xo,k),e(Xo,as),e(as,eh),w(qr,eh,null),e(Xo,dy),e(Xo,th),e(th,cy),g(s,Qf,k),g(s,bt,k),w(jr,bt,null),e(bt,py),e(bt,oh),e(oh,hy),e(bt,my),e(bt,Cr),e(Cr,uy),e(Cr,pc),e(pc,fy),e(Cr,gy),e(bt,_y),e(bt,Pr),e(Pr,ky),e(Pr,Ar),e(Ar,vy),e(Pr,yy),e(bt,Ty),e(bt,Kt),w(Lr,Kt,null),e(Kt,by),e(Kt,Yo),e(Yo,wy),e(Yo,hc),e(hc,Ey),e(Yo,$y),e(Yo,nh),e(nh,Fy),e(Yo,xy),e(Kt,My),w(rs,Kt,null),e(Kt,zy),w(is,Kt,null),g(s,Bf,k),g(s,Zo,k),e(Zo,ls),e(ls,sh),w(Or,sh,null),e(Zo,qy),e(Zo,ah),e(ah,jy),g(s,Vf,k),g(s,pt,k),w(Nr,pt,null),e(pt,Cy),e(pt,rh),e(rh,Py),e(pt,Ay),e(pt,ih),e(ih,Ly),e(pt,Oy),e(pt,Ir),e(Ir,Ny),e(Ir,mc),e(mc,Iy),e(Ir,Dy),e(pt,Sy),e(pt,Dr),e(Dr,Wy),e(Dr,Sr),e(Sr,Uy),e(Dr,Ry),e(pt,Hy),e(pt,Qt),w(Wr,Qt,null),e(Qt,Ky),e(Qt,en),e(en,Qy),e(en,uc),e(uc,By),e(en,Vy),e(en,lh),e(lh,Jy),e(en,Gy),e(Qt,Xy),w(ds,Qt,null),e(Qt,Yy),w(cs,Qt,null),g(s,Jf,k),g(s,tn,k),e(tn,ps),e(ps,dh),w(Ur,dh,null),e(tn,Zy),e(tn,ch),e(ch,eT),g(s,Gf,k),g(s,wt,k),w(Rr,wt,null),e(wt,tT),e(wt,Hr),e(Hr,oT),e(Hr,ph),e(ph,nT),e(Hr,sT),e(wt,aT),e(wt,Kr),e(Kr,rT),e(Kr,fc),e(fc,iT),e(Kr,lT),e(wt,dT),e(wt,Qr),e(Qr,cT),e(Qr,Br),e(Br,pT),e(Qr,hT),e(wt,mT),e(wt,Bt),w(Vr,Bt,null),e(Bt,uT),e(Bt,on),e(on,fT),e(on,gc),e(gc,gT),e(on,_T),e(on,hh),e(hh,kT),e(on,vT),e(Bt,yT),w(hs,Bt,null),e(Bt,TT),w(ms,Bt,null),g(s,Xf,k),g(s,nn,k),e(nn,us),e(us,mh),w(Jr,mh,null),e(nn,bT),e(nn,uh),e(uh,wT),g(s,Yf,k),g(s,ht,k),w(Gr,ht,null),e(ht,ET),e(ht,fh),e(fh,$T),e(ht,FT),e(ht,gh),e(gh,xT),e(ht,MT),e(ht,Xr),e(Xr,zT),e(Xr,_c),e(_c,qT),e(Xr,jT),e(ht,CT),e(ht,Yr),e(Yr,PT),e(Yr,Zr),e(Zr,AT),e(Yr,LT),e(ht,OT),e(ht,Vt),w(ei,Vt,null),e(Vt,NT),e(Vt,sn),e(sn,IT),e(sn,kc),e(kc,DT),e(sn,ST),e(sn,_h),e(_h,WT),e(sn,UT),e(Vt,RT),w(fs,Vt,null),e(Vt,HT),w(gs,Vt,null),g(s,Zf,k),g(s,an,k),e(an,_s),e(_s,kh),w(ti,kh,null),e(an,KT),e(an,vh),e(vh,QT),g(s,eg,k),g(s,Et,k),w(oi,Et,null),e(Et,BT),e(Et,yh),e(yh,VT),e(Et,JT),e(Et,ni),e(ni,GT),e(ni,vc),e(vc,XT),e(ni,YT),e(Et,ZT),e(Et,si),e(si,eb),e(si,ai),e(ai,tb),e(si,ob),e(Et,nb),e(Et,Mt),w(ri,Mt,null),e(Mt,sb),e(Mt,rn),e(rn,ab),e(rn,yc),e(yc,rb),e(rn,ib),e(rn,Th),e(Th,lb),e(rn,db),e(Mt,cb),w(ks,Mt,null),e(Mt,pb),w(vs,Mt,null),e(Mt,hb),w(ys,Mt,null),g(s,tg,k),g(s,ln,k),e(ln,Ts),e(Ts,bh),w(ii,bh,null),e(ln,mb),e(ln,wh),e(wh,ub),g(s,og,k),g(s,$t,k),w(li,$t,null),e($t,fb),e($t,Eh),e(Eh,gb),e($t,_b),e($t,di),e(di,kb),e(di,Tc),e(Tc,vb),e(di,yb),e($t,Tb),e($t,ci),e(ci,bb),e(ci,pi),e(pi,wb),e(ci,Eb),e($t,$b),e($t,Jt),w(hi,Jt,null),e(Jt,Fb),e(Jt,dn),e(dn,xb),e(dn,bc),e(bc,Mb),e(dn,zb),e(dn,$h),e($h,qb),e(dn,jb),e(Jt,Cb),w(bs,Jt,null),e(Jt,Pb),w(ws,Jt,null),g(s,ng,k),g(s,cn,k),e(cn,Es),e(Es,Fh),w(mi,Fh,null),e(cn,Ab),e(cn,xh),e(xh,Lb),g(s,sg,k),g(s,mt,k),w(ui,mt,null),e(mt,Ob),e(mt,Mh),e(Mh,Nb),e(mt,Ib),e(mt,zh),e(zh,Db),e(mt,Sb),e(mt,fi),e(fi,Wb),e(fi,wc),e(wc,Ub),e(fi,Rb),e(mt,Hb),e(mt,gi),e(gi,Kb),e(gi,_i),e(_i,Qb),e(gi,Bb),e(mt,Vb),e(mt,Gt),w(ki,Gt,null),e(Gt,Jb),e(Gt,pn),e(pn,Gb),e(pn,Ec),e(Ec,Xb),e(pn,Yb),e(pn,qh),e(qh,Zb),e(pn,ew),e(Gt,tw),w($s,Gt,null),e(Gt,ow),w(Fs,Gt,null),g(s,ag,k),g(s,hn,k),e(hn,xs),e(xs,jh),w(vi,jh,null),e(hn,nw),e(hn,Ch),e(Ch,sw),g(s,rg,k),g(s,Ft,k),w(yi,Ft,null),e(Ft,aw),e(Ft,mn),e(mn,rw),e(mn,Ph),e(Ph,iw),e(mn,lw),e(mn,Ah),e(Ah,dw),e(mn,cw),e(Ft,pw),e(Ft,Ti),e(Ti,hw),e(Ti,$c),e($c,mw),e(Ti,uw),e(Ft,fw),e(Ft,bi),e(bi,gw),e(bi,wi),e(wi,_w),e(bi,kw),e(Ft,vw),e(Ft,Xt),w(Ei,Xt,null),e(Xt,yw),e(Xt,un),e(un,Tw),e(un,Fc),e(Fc,bw),e(un,ww),e(un,Lh),e(Lh,Ew),e(un,$w),e(Xt,Fw),w(Ms,Xt,null),e(Xt,xw),w(zs,Xt,null),g(s,ig,k),g(s,fn,k),e(fn,qs),e(qs,Oh),w($i,Oh,null),e(fn,Mw),e(fn,Nh),e(Nh,zw),g(s,lg,k),g(s,ut,k),w(Fi,ut,null),e(ut,qw),e(ut,Ih),e(Ih,jw),e(ut,Cw),e(ut,xi),e(xi,Pw),e(xi,xc),e(xc,Aw),e(xi,Lw),e(ut,Ow),e(ut,Mi),e(Mi,Nw),e(Mi,zi),e(zi,Iw),e(Mi,Dw),e(ut,Sw),w(js,ut,null),e(ut,Ww),e(ut,Yt),w(qi,Yt,null),e(Yt,Uw),e(Yt,gn),e(gn,Rw),e(gn,Mc),e(Mc,Hw),e(gn,Kw),e(gn,Dh),e(Dh,Qw),e(gn,Bw),e(Yt,Vw),w(Cs,Yt,null),e(Yt,Jw),w(Ps,Yt,null),g(s,dg,k),g(s,_n,k),e(_n,As),e(As,Sh),w(ji,Sh,null),e(_n,Gw),e(_n,Wh),e(Wh,Xw),g(s,cg,k),g(s,ot,k),w(Ci,ot,null),e(ot,Yw),e(ot,Uh),e(Uh,Zw),e(ot,eE),e(ot,Rh),e(Rh,tE),e(ot,oE),e(ot,Pi),e(Pi,nE),e(Pi,zc),e(zc,sE),e(Pi,aE),e(ot,rE),e(ot,Ai),e(Ai,iE),e(Ai,Li),e(Li,lE),e(Ai,dE),e(ot,cE),w(Ls,ot,null),e(ot,pE),e(ot,Zt),w(Oi,Zt,null),e(Zt,hE),e(Zt,kn),e(kn,mE),e(kn,qc),e(qc,uE),e(kn,fE),e(kn,Hh),e(Hh,gE),e(kn,_E),e(Zt,kE),w(Os,Zt,null),e(Zt,vE),w(Ns,Zt,null),g(s,pg,k),g(s,vn,k),e(vn,Is),e(Is,Kh),w(Ni,Kh,null),e(vn,yE),e(vn,Qh),e(Qh,TE),g(s,hg,k),g(s,nt,k),w(Ii,nt,null),e(nt,bE),e(nt,Bh),e(Bh,wE),e(nt,EE),e(nt,Vh),e(Vh,$E),e(nt,FE),e(nt,Di),e(Di,xE),e(Di,jc),e(jc,ME),e(Di,zE),e(nt,qE),e(nt,Si),e(Si,jE),e(Si,Wi),e(Wi,CE),e(Si,PE),e(nt,AE),w(Ds,nt,null),e(nt,LE),e(nt,zt),w(Ui,zt,null),e(zt,OE),e(zt,yn),e(yn,NE),e(yn,Cc),e(Cc,IE),e(yn,DE),e(yn,Jh),e(Jh,SE),e(yn,WE),e(zt,UE),w(Ss,zt,null),e(zt,RE),w(Ws,zt,null),e(zt,HE),w(Us,zt,null),g(s,mg,k),g(s,Tn,k),e(Tn,Rs),e(Rs,Gh),w(Ri,Gh,null),e(Tn,KE),e(Tn,Xh),e(Xh,QE),g(s,ug,k),g(s,ft,k),w(Hi,ft,null),e(ft,BE),e(ft,Yh),e(Yh,VE),e(ft,JE),e(ft,Ki),e(Ki,GE),e(Ki,Pc),e(Pc,XE),e(Ki,YE),e(ft,ZE),e(ft,Qi),e(Qi,e2),e(Qi,Bi),e(Bi,t2),e(Qi,o2),e(ft,n2),w(Hs,ft,null),e(ft,s2),e(ft,qt),w(Vi,qt,null),e(qt,a2),e(qt,bn),e(bn,r2),e(bn,Ac),e(Ac,i2),e(bn,l2),e(bn,Zh),e(Zh,d2),e(bn,c2),e(qt,p2),w(Ks,qt,null),e(qt,h2),w(Qs,qt,null),e(qt,m2),w(Bs,qt,null),g(s,fg,k),g(s,wn,k),e(wn,Vs),e(Vs,em),w(Ji,em,null),e(wn,u2),e(wn,tm),e(tm,f2),g(s,gg,k),g(s,gt,k),w(Gi,gt,null),e(gt,g2),e(gt,om),e(om,_2),e(gt,k2),e(gt,Xi),e(Xi,v2),e(Xi,Lc),e(Lc,y2),e(Xi,T2),e(gt,b2),e(gt,Yi),e(Yi,w2),e(Yi,Zi),e(Zi,E2),e(Yi,$2),e(gt,F2),w(Js,gt,null),e(gt,x2),e(gt,eo),w(el,eo,null),e(eo,M2),e(eo,En),e(En,z2),e(En,Oc),e(Oc,q2),e(En,j2),e(En,nm),e(nm,C2),e(En,P2),e(eo,A2),w(Gs,eo,null),e(eo,L2),w(Xs,eo,null),g(s,_g,k),g(s,$n,k),e($n,Ys),e(Ys,sm),w(tl,sm,null),e($n,O2),e($n,am),e(am,N2),g(s,kg,k),g(s,st,k),w(ol,st,null),e(st,I2),e(st,rm),e(rm,D2),e(st,S2),e(st,im),e(im,W2),e(st,U2),e(st,nl),e(nl,R2),e(nl,Nc),e(Nc,H2),e(nl,K2),e(st,Q2),e(st,sl),e(sl,B2),e(sl,al),e(al,V2),e(sl,J2),e(st,G2),w(Zs,st,null),e(st,X2),e(st,jt),w(rl,jt,null),e(jt,Y2),e(jt,Fn),e(Fn,Z2),e(Fn,Ic),e(Ic,e1),e(Fn,t1),e(Fn,lm),e(lm,o1),e(Fn,n1),e(jt,s1),w(ea,jt,null),e(jt,a1),w(ta,jt,null),e(jt,r1),w(oa,jt,null),g(s,vg,k),g(s,xn,k),e(xn,na),e(na,dm),w(il,dm,null),e(xn,i1),e(xn,cm),e(cm,l1),g(s,yg,k),g(s,_t,k),w(ll,_t,null),e(_t,d1),e(_t,Mn),e(Mn,c1),e(Mn,pm),e(pm,p1),e(Mn,h1),e(Mn,hm),e(hm,m1),e(Mn,u1),e(_t,f1),e(_t,dl),e(dl,g1),e(dl,Dc),e(Dc,_1),e(dl,k1),e(_t,v1),e(_t,cl),e(cl,y1),e(cl,pl),e(pl,T1),e(cl,b1),e(_t,w1),w(sa,_t,null),e(_t,E1),e(_t,Ct),w(hl,Ct,null),e(Ct,$1),e(Ct,zn),e(zn,F1),e(zn,Sc),e(Sc,x1),e(zn,M1),e(zn,mm),e(mm,z1),e(zn,q1),e(Ct,j1),w(aa,Ct,null),e(Ct,C1),w(ra,Ct,null),e(Ct,P1),w(ia,Ct,null),g(s,Tg,k),g(s,qn,k),e(qn,la),e(la,um),w(ml,um,null),e(qn,A1),e(qn,fm),e(fm,L1),g(s,bg,k),g(s,at,k),w(ul,at,null),e(at,O1),e(at,gm),e(gm,N1),e(at,I1),e(at,fl),e(fl,D1),e(fl,Wc),e(Wc,S1),e(fl,W1),e(at,U1),e(at,gl),e(gl,R1),e(gl,_l),e(_l,H1),e(gl,K1),e(at,Q1),e(at,_m),e(_m,B1),e(at,V1),e(at,ko),e(ko,km),e(km,kl),e(kl,J1),e(ko,G1),e(ko,vm),e(vm,vl),e(vl,X1),e(ko,Y1),e(ko,ym),e(ym,yl),e(yl,Z1),e(ko,e$),e(ko,Tm),e(Tm,Tl),e(Tl,t$),e(at,o$),e(at,to),w(bl,to,null),e(to,n$),e(to,jn),e(jn,s$),e(jn,bm),e(bm,a$),e(jn,r$),e(jn,wm),e(wm,i$),e(jn,l$),e(to,d$),w(da,to,null),e(to,c$),w(ca,to,null),g(s,wg,k),g(s,Cn,k),e(Cn,pa),e(pa,Em),w(wl,Em,null),e(Cn,p$),e(Cn,$m),e($m,h$),g(s,Eg,k),g(s,Ze,k),w(El,Ze,null),e(Ze,m$),e(Ze,Fm),e(Fm,u$),e(Ze,f$),e(Ze,xm),e(xm,g$),e(Ze,_$),e(Ze,$l),e($l,k$),e($l,Uc),e(Uc,v$),e($l,y$),e(Ze,T$),e(Ze,Fl),e(Fl,b$),e(Fl,xl),e(xl,w$),e(Fl,E$),e(Ze,$$),e(Ze,Mm),e(Mm,F$),e(Ze,x$),e(Ze,vo),e(vo,zm),e(zm,Ml),e(Ml,M$),e(vo,z$),e(vo,qm),e(qm,zl),e(zl,q$),e(vo,j$),e(vo,jm),e(jm,ql),e(ql,C$),e(vo,P$),e(vo,Cm),e(Cm,jl),e(jl,A$),e(Ze,L$),e(Ze,oo),w(Cl,oo,null),e(oo,O$),e(oo,Pn),e(Pn,N$),e(Pn,Pm),e(Pm,I$),e(Pn,D$),e(Pn,Am),e(Am,S$),e(Pn,W$),e(oo,U$),w(ha,oo,null),e(oo,R$),w(ma,oo,null),g(s,$g,k),g(s,An,k),e(An,ua),e(ua,Lm),w(Pl,Lm,null),e(An,H$),e(An,Om),e(Om,K$),g(s,Fg,k),g(s,rt,k),w(Al,rt,null),e(rt,Q$),e(rt,Nm),e(Nm,B$),e(rt,V$),e(rt,Ll),e(Ll,J$),e(Ll,Rc),e(Rc,G$),e(Ll,X$),e(rt,Y$),e(rt,Ol),e(Ol,Z$),e(Ol,Nl),e(Nl,e0),e(Ol,t0),e(rt,o0),e(rt,Im),e(Im,n0),e(rt,s0),e(rt,yo),e(yo,Dm),e(Dm,Il),e(Il,a0),e(yo,r0),e(yo,Sm),e(Sm,Dl),e(Dl,i0),e(yo,l0),e(yo,Wm),e(Wm,Sl),e(Sl,d0),e(yo,c0),e(yo,Um),e(Um,Wl),e(Wl,p0),e(rt,h0),e(rt,no),w(Ul,no,null),e(no,m0),e(no,Ln),e(Ln,u0),e(Ln,Rm),e(Rm,f0),e(Ln,g0),e(Ln,Hm),e(Hm,_0),e(Ln,k0),e(no,v0),w(fa,no,null),e(no,y0),w(ga,no,null),g(s,xg,k),g(s,On,k),e(On,_a),e(_a,Km),w(Rl,Km,null),e(On,T0),e(On,Qm),e(Qm,b0),g(s,Mg,k),g(s,it,k),w(Hl,it,null),e(it,w0),e(it,Kl),e(Kl,E0),e(Kl,Bm),e(Bm,$0),e(Kl,F0),e(it,x0),e(it,Ql),e(Ql,M0),e(Ql,Hc),e(Hc,z0),e(Ql,q0),e(it,j0),e(it,Bl),e(Bl,C0),e(Bl,Vl),e(Vl,P0),e(Bl,A0),e(it,L0),e(it,Vm),e(Vm,O0),e(it,N0),e(it,To),e(To,Jm),e(Jm,Jl),e(Jl,I0),e(To,D0),e(To,Gm),e(Gm,Gl),e(Gl,S0),e(To,W0),e(To,Xm),e(Xm,Xl),e(Xl,U0),e(To,R0),e(To,Ym),e(Ym,Yl),e(Yl,H0),e(it,K0),e(it,so),w(Zl,so,null),e(so,Q0),e(so,Nn),e(Nn,B0),e(Nn,Zm),e(Zm,V0),e(Nn,J0),e(Nn,eu),e(eu,G0),e(Nn,X0),e(so,Y0),w(ka,so,null),e(so,Z0),w(va,so,null),g(s,zg,k),g(s,In,k),e(In,ya),e(ya,tu),w(ed,tu,null),e(In,eF),e(In,ou),e(ou,tF),g(s,qg,k),g(s,lt,k),w(td,lt,null),e(lt,oF),e(lt,nu),e(nu,nF),e(lt,sF),e(lt,od),e(od,aF),e(od,Kc),e(Kc,rF),e(od,iF),e(lt,lF),e(lt,nd),e(nd,dF),e(nd,sd),e(sd,cF),e(nd,pF),e(lt,hF),e(lt,su),e(su,mF),e(lt,uF),e(lt,bo),e(bo,au),e(au,ad),e(ad,fF),e(bo,gF),e(bo,ru),e(ru,rd),e(rd,_F),e(bo,kF),e(bo,iu),e(iu,id),e(id,vF),e(bo,yF),e(bo,lu),e(lu,ld),e(ld,TF),e(lt,bF),e(lt,ao),w(dd,ao,null),e(ao,wF),e(ao,Dn),e(Dn,EF),e(Dn,du),e(du,$F),e(Dn,FF),e(Dn,cu),e(cu,xF),e(Dn,MF),e(ao,zF),w(Ta,ao,null),e(ao,qF),w(ba,ao,null),g(s,jg,k),g(s,Sn,k),e(Sn,wa),e(wa,pu),w(cd,pu,null),e(Sn,jF),e(Sn,hu),e(hu,CF),g(s,Cg,k),g(s,dt,k),w(pd,dt,null),e(dt,PF),e(dt,mu),e(mu,AF),e(dt,LF),e(dt,hd),e(hd,OF),e(hd,Qc),e(Qc,NF),e(hd,IF),e(dt,DF),e(dt,md),e(md,SF),e(md,ud),e(ud,WF),e(md,UF),e(dt,RF),e(dt,uu),e(uu,HF),e(dt,KF),e(dt,wo),e(wo,fu),e(fu,fd),e(fd,QF),e(wo,BF),e(wo,gu),e(gu,gd),e(gd,VF),e(wo,JF),e(wo,_u),e(_u,_d),e(_d,GF),e(wo,XF),e(wo,ku),e(ku,kd),e(kd,YF),e(dt,ZF),e(dt,ro),w(vd,ro,null),e(ro,e4),e(ro,Wn),e(Wn,t4),e(Wn,vu),e(vu,o4),e(Wn,n4),e(Wn,yu),e(yu,s4),e(Wn,a4),e(ro,r4),w(Ea,ro,null),e(ro,i4),w($a,ro,null),g(s,Pg,k),g(s,Un,k),e(Un,Fa),e(Fa,Tu),w(yd,Tu,null),e(Un,l4),e(Un,bu),e(bu,d4),g(s,Ag,k),g(s,et,k),w(Td,et,null),e(et,c4),e(et,wu),e(wu,p4),e(et,h4),e(et,Eu),e(Eu,m4),e(et,u4),e(et,bd),e(bd,f4),e(bd,Bc),e(Bc,g4),e(bd,_4),e(et,k4),e(et,wd),e(wd,v4),e(wd,Ed),e(Ed,y4),e(wd,T4),e(et,b4),e(et,$u),e($u,w4),e(et,E4),e(et,Eo),e(Eo,Fu),e(Fu,$d),e($d,$4),e(Eo,F4),e(Eo,xu),e(xu,Fd),e(Fd,x4),e(Eo,M4),e(Eo,Mu),e(Mu,xd),e(xd,z4),e(Eo,q4),e(Eo,zu),e(zu,Md),e(Md,j4),e(et,C4),e(et,io),w(zd,io,null),e(io,P4),e(io,Rn),e(Rn,A4),e(Rn,qu),e(qu,L4),e(Rn,O4),e(Rn,ju),e(ju,N4),e(Rn,I4),e(io,D4),w(xa,io,null),e(io,S4),w(Ma,io,null),g(s,Lg,k),g(s,Hn,k),e(Hn,za),e(za,Cu),w(qd,Cu,null),e(Hn,W4),e(Hn,Pu),e(Pu,U4),g(s,Og,k),g(s,ct,k),w(jd,ct,null),e(ct,R4),e(ct,Kn),e(Kn,H4),e(Kn,Au),e(Au,K4),e(Kn,Q4),e(Kn,Lu),e(Lu,B4),e(Kn,V4),e(ct,J4),e(ct,Cd),e(Cd,G4),e(Cd,Vc),e(Vc,X4),e(Cd,Y4),e(ct,Z4),e(ct,Pd),e(Pd,ex),e(Pd,Ad),e(Ad,tx),e(Pd,ox),e(ct,nx),e(ct,Ou),e(Ou,sx),e(ct,ax),e(ct,$o),e($o,Nu),e(Nu,Ld),e(Ld,rx),e($o,ix),e($o,Iu),e(Iu,Od),e(Od,lx),e($o,dx),e($o,Du),e(Du,Nd),e(Nd,cx),e($o,px),e($o,Su),e(Su,Id),e(Id,hx),e(ct,mx),e(ct,lo),w(Dd,lo,null),e(lo,ux),e(lo,Qn),e(Qn,fx),e(Qn,Wu),e(Wu,gx),e(Qn,_x),e(Qn,Uu),e(Uu,kx),e(Qn,vx),e(lo,yx),w(qa,lo,null),e(lo,Tx),w(ja,lo,null),Ng=!0},p(s,[k]){const Sd={};k&2&&(Sd.$$scope={dirty:k,ctx:s}),Xn.$set(Sd);const Ru={};k&2&&(Ru.$$scope={dirty:k,ctx:s}),es.$set(Ru);const Hu={};k&2&&(Hu.$$scope={dirty:k,ctx:s}),ns.$set(Hu);const Ku={};k&2&&(Ku.$$scope={dirty:k,ctx:s}),rs.$set(Ku);const Wd={};k&2&&(Wd.$$scope={dirty:k,ctx:s}),is.$set(Wd);const Qu={};k&2&&(Qu.$$scope={dirty:k,ctx:s}),ds.$set(Qu);const Bu={};k&2&&(Bu.$$scope={dirty:k,ctx:s}),cs.$set(Bu);const Ud={};k&2&&(Ud.$$scope={dirty:k,ctx:s}),hs.$set(Ud);const Vu={};k&2&&(Vu.$$scope={dirty:k,ctx:s}),ms.$set(Vu);const Ju={};k&2&&(Ju.$$scope={dirty:k,ctx:s}),fs.$set(Ju);const Gu={};k&2&&(Gu.$$scope={dirty:k,ctx:s}),gs.$set(Gu);const Rd={};k&2&&(Rd.$$scope={dirty:k,ctx:s}),ks.$set(Rd);const Xu={};k&2&&(Xu.$$scope={dirty:k,ctx:s}),vs.$set(Xu);const Yu={};k&2&&(Yu.$$scope={dirty:k,ctx:s}),ys.$set(Yu);const Zu={};k&2&&(Zu.$$scope={dirty:k,ctx:s}),bs.$set(Zu);const ef={};k&2&&(ef.$$scope={dirty:k,ctx:s}),ws.$set(ef);const tf={};k&2&&(tf.$$scope={dirty:k,ctx:s}),$s.$set(tf);const Bn={};k&2&&(Bn.$$scope={dirty:k,ctx:s}),Fs.$set(Bn);const of={};k&2&&(of.$$scope={dirty:k,ctx:s}),Ms.$set(of);const nf={};k&2&&(nf.$$scope={dirty:k,ctx:s}),zs.$set(nf);const Fo={};k&2&&(Fo.$$scope={dirty:k,ctx:s}),js.$set(Fo);const sf={};k&2&&(sf.$$scope={dirty:k,ctx:s}),Cs.$set(sf);const af={};k&2&&(af.$$scope={dirty:k,ctx:s}),Ps.$set(af);const rf={};k&2&&(rf.$$scope={dirty:k,ctx:s}),Ls.$set(rf);const Vn={};k&2&&(Vn.$$scope={dirty:k,ctx:s}),Os.$set(Vn);const lf={};k&2&&(lf.$$scope={dirty:k,ctx:s}),Ns.$set(lf);const df={};k&2&&(df.$$scope={dirty:k,ctx:s}),Ds.$set(df);const Hd={};k&2&&(Hd.$$scope={dirty:k,ctx:s}),Ss.$set(Hd);const cf={};k&2&&(cf.$$scope={dirty:k,ctx:s}),Ws.$set(cf);const pf={};k&2&&(pf.$$scope={dirty:k,ctx:s}),Us.$set(pf);const hf={};k&2&&(hf.$$scope={dirty:k,ctx:s}),Hs.$set(hf);const xt={};k&2&&(xt.$$scope={dirty:k,ctx:s}),Ks.$set(xt);const mf={};k&2&&(mf.$$scope={dirty:k,ctx:s}),Qs.$set(mf);const uf={};k&2&&(uf.$$scope={dirty:k,ctx:s}),Bs.$set(uf);const ff={};k&2&&(ff.$$scope={dirty:k,ctx:s}),Js.$set(ff);const gf={};k&2&&(gf.$$scope={dirty:k,ctx:s}),Gs.$set(gf);const _f={};k&2&&(_f.$$scope={dirty:k,ctx:s}),Xs.$set(_f);const kf={};k&2&&(kf.$$scope={dirty:k,ctx:s}),Zs.$set(kf);const vf={};k&2&&(vf.$$scope={dirty:k,ctx:s}),ea.$set(vf);const yf={};k&2&&(yf.$$scope={dirty:k,ctx:s}),ta.$set(yf);const Tf={};k&2&&(Tf.$$scope={dirty:k,ctx:s}),oa.$set(Tf);const bf={};k&2&&(bf.$$scope={dirty:k,ctx:s}),sa.$set(bf);const wf={};k&2&&(wf.$$scope={dirty:k,ctx:s}),aa.$set(wf);const Ef={};k&2&&(Ef.$$scope={dirty:k,ctx:s}),ra.$set(Ef);const Kd={};k&2&&(Kd.$$scope={dirty:k,ctx:s}),ia.$set(Kd);const $f={};k&2&&($f.$$scope={dirty:k,ctx:s}),da.$set($f);const Ff={};k&2&&(Ff.$$scope={dirty:k,ctx:s}),ca.$set(Ff);const xf={};k&2&&(xf.$$scope={dirty:k,ctx:s}),ha.$set(xf);const xo={};k&2&&(xo.$$scope={dirty:k,ctx:s}),ma.$set(xo);const Mo={};k&2&&(Mo.$$scope={dirty:k,ctx:s}),fa.$set(Mo);const Mf={};k&2&&(Mf.$$scope={dirty:k,ctx:s}),ga.$set(Mf);const zf={};k&2&&(zf.$$scope={dirty:k,ctx:s}),ka.$set(zf);const qf={};k&2&&(qf.$$scope={dirty:k,ctx:s}),va.$set(qf);const Jn={};k&2&&(Jn.$$scope={dirty:k,ctx:s}),Ta.$set(Jn);const jf={};k&2&&(jf.$$scope={dirty:k,ctx:s}),ba.$set(jf);const Cf={};k&2&&(Cf.$$scope={dirty:k,ctx:s}),Ea.$set(Cf);const Qd={};k&2&&(Qd.$$scope={dirty:k,ctx:s}),$a.$set(Qd);const Pf={};k&2&&(Pf.$$scope={dirty:k,ctx:s}),xa.$set(Pf);const Af={};k&2&&(Af.$$scope={dirty:k,ctx:s}),Ma.$set(Af);const Lf={};k&2&&(Lf.$$scope={dirty:k,ctx:s}),qa.$set(Lf);const kt={};k&2&&(kt.$$scope={dirty:k,ctx:s}),ja.$set(kt)},i(s){Ng||(E(l.$$.fragment,s),E(ie.$$.fragment,s),E(K.$$.fragment,s),E(rr.$$.fragment,s),E(ir.$$.fragment,s),E(Xn.$$.fragment,s),E(dr.$$.fragment,s),E(cr.$$.fragment,s),E(hr.$$.fragment,s),E(ur.$$.fragment,s),E(fr.$$.fragment,s),E(es.$$.fragment,s),E(gr.$$.fragment,s),E(kr.$$.fragment,s),E(vr.$$.fragment,s),E(br.$$.fragment,s),E(Er.$$.fragment,s),E(ns.$$.fragment,s),E($r.$$.fragment,s),E(Fr.$$.fragment,s),E(Mr.$$.fragment,s),E(qr.$$.fragment,s),E(jr.$$.fragment,s),E(Lr.$$.fragment,s),E(rs.$$.fragment,s),E(is.$$.fragment,s),E(Or.$$.fragment,s),E(Nr.$$.fragment,s),E(Wr.$$.fragment,s),E(ds.$$.fragment,s),E(cs.$$.fragment,s),E(Ur.$$.fragment,s),E(Rr.$$.fragment,s),E(Vr.$$.fragment,s),E(hs.$$.fragment,s),E(ms.$$.fragment,s),E(Jr.$$.fragment,s),E(Gr.$$.fragment,s),E(ei.$$.fragment,s),E(fs.$$.fragment,s),E(gs.$$.fragment,s),E(ti.$$.fragment,s),E(oi.$$.fragment,s),E(ri.$$.fragment,s),E(ks.$$.fragment,s),E(vs.$$.fragment,s),E(ys.$$.fragment,s),E(ii.$$.fragment,s),E(li.$$.fragment,s),E(hi.$$.fragment,s),E(bs.$$.fragment,s),E(ws.$$.fragment,s),E(mi.$$.fragment,s),E(ui.$$.fragment,s),E(ki.$$.fragment,s),E($s.$$.fragment,s),E(Fs.$$.fragment,s),E(vi.$$.fragment,s),E(yi.$$.fragment,s),E(Ei.$$.fragment,s),E(Ms.$$.fragment,s),E(zs.$$.fragment,s),E($i.$$.fragment,s),E(Fi.$$.fragment,s),E(js.$$.fragment,s),E(qi.$$.fragment,s),E(Cs.$$.fragment,s),E(Ps.$$.fragment,s),E(ji.$$.fragment,s),E(Ci.$$.fragment,s),E(Ls.$$.fragment,s),E(Oi.$$.fragment,s),E(Os.$$.fragment,s),E(Ns.$$.fragment,s),E(Ni.$$.fragment,s),E(Ii.$$.fragment,s),E(Ds.$$.fragment,s),E(Ui.$$.fragment,s),E(Ss.$$.fragment,s),E(Ws.$$.fragment,s),E(Us.$$.fragment,s),E(Ri.$$.fragment,s),E(Hi.$$.fragment,s),E(Hs.$$.fragment,s),E(Vi.$$.fragment,s),E(Ks.$$.fragment,s),E(Qs.$$.fragment,s),E(Bs.$$.fragment,s),E(Ji.$$.fragment,s),E(Gi.$$.fragment,s),E(Js.$$.fragment,s),E(el.$$.fragment,s),E(Gs.$$.fragment,s),E(Xs.$$.fragment,s),E(tl.$$.fragment,s),E(ol.$$.fragment,s),E(Zs.$$.fragment,s),E(rl.$$.fragment,s),E(ea.$$.fragment,s),E(ta.$$.fragment,s),E(oa.$$.fragment,s),E(il.$$.fragment,s),E(ll.$$.fragment,s),E(sa.$$.fragment,s),E(hl.$$.fragment,s),E(aa.$$.fragment,s),E(ra.$$.fragment,s),E(ia.$$.fragment,s),E(ml.$$.fragment,s),E(ul.$$.fragment,s),E(bl.$$.fragment,s),E(da.$$.fragment,s),E(ca.$$.fragment,s),E(wl.$$.fragment,s),E(El.$$.fragment,s),E(Cl.$$.fragment,s),E(ha.$$.fragment,s),E(ma.$$.fragment,s),E(Pl.$$.fragment,s),E(Al.$$.fragment,s),E(Ul.$$.fragment,s),E(fa.$$.fragment,s),E(ga.$$.fragment,s),E(Rl.$$.fragment,s),E(Hl.$$.fragment,s),E(Zl.$$.fragment,s),E(ka.$$.fragment,s),E(va.$$.fragment,s),E(ed.$$.fragment,s),E(td.$$.fragment,s),E(dd.$$.fragment,s),E(Ta.$$.fragment,s),E(ba.$$.fragment,s),E(cd.$$.fragment,s),E(pd.$$.fragment,s),E(vd.$$.fragment,s),E(Ea.$$.fragment,s),E($a.$$.fragment,s),E(yd.$$.fragment,s),E(Td.$$.fragment,s),E(zd.$$.fragment,s),E(xa.$$.fragment,s),E(Ma.$$.fragment,s),E(qd.$$.fragment,s),E(jd.$$.fragment,s),E(Dd.$$.fragment,s),E(qa.$$.fragment,s),E(ja.$$.fragment,s),Ng=!0)},o(s){$(l.$$.fragment,s),$(ie.$$.fragment,s),$(K.$$.fragment,s),$(rr.$$.fragment,s),$(ir.$$.fragment,s),$(Xn.$$.fragment,s),$(dr.$$.fragment,s),$(cr.$$.fragment,s),$(hr.$$.fragment,s),$(ur.$$.fragment,s),$(fr.$$.fragment,s),$(es.$$.fragment,s),$(gr.$$.fragment,s),$(kr.$$.fragment,s),$(vr.$$.fragment,s),$(br.$$.fragment,s),$(Er.$$.fragment,s),$(ns.$$.fragment,s),$($r.$$.fragment,s),$(Fr.$$.fragment,s),$(Mr.$$.fragment,s),$(qr.$$.fragment,s),$(jr.$$.fragment,s),$(Lr.$$.fragment,s),$(rs.$$.fragment,s),$(is.$$.fragment,s),$(Or.$$.fragment,s),$(Nr.$$.fragment,s),$(Wr.$$.fragment,s),$(ds.$$.fragment,s),$(cs.$$.fragment,s),$(Ur.$$.fragment,s),$(Rr.$$.fragment,s),$(Vr.$$.fragment,s),$(hs.$$.fragment,s),$(ms.$$.fragment,s),$(Jr.$$.fragment,s),$(Gr.$$.fragment,s),$(ei.$$.fragment,s),$(fs.$$.fragment,s),$(gs.$$.fragment,s),$(ti.$$.fragment,s),$(oi.$$.fragment,s),$(ri.$$.fragment,s),$(ks.$$.fragment,s),$(vs.$$.fragment,s),$(ys.$$.fragment,s),$(ii.$$.fragment,s),$(li.$$.fragment,s),$(hi.$$.fragment,s),$(bs.$$.fragment,s),$(ws.$$.fragment,s),$(mi.$$.fragment,s),$(ui.$$.fragment,s),$(ki.$$.fragment,s),$($s.$$.fragment,s),$(Fs.$$.fragment,s),$(vi.$$.fragment,s),$(yi.$$.fragment,s),$(Ei.$$.fragment,s),$(Ms.$$.fragment,s),$(zs.$$.fragment,s),$($i.$$.fragment,s),$(Fi.$$.fragment,s),$(js.$$.fragment,s),$(qi.$$.fragment,s),$(Cs.$$.fragment,s),$(Ps.$$.fragment,s),$(ji.$$.fragment,s),$(Ci.$$.fragment,s),$(Ls.$$.fragment,s),$(Oi.$$.fragment,s),$(Os.$$.fragment,s),$(Ns.$$.fragment,s),$(Ni.$$.fragment,s),$(Ii.$$.fragment,s),$(Ds.$$.fragment,s),$(Ui.$$.fragment,s),$(Ss.$$.fragment,s),$(Ws.$$.fragment,s),$(Us.$$.fragment,s),$(Ri.$$.fragment,s),$(Hi.$$.fragment,s),$(Hs.$$.fragment,s),$(Vi.$$.fragment,s),$(Ks.$$.fragment,s),$(Qs.$$.fragment,s),$(Bs.$$.fragment,s),$(Ji.$$.fragment,s),$(Gi.$$.fragment,s),$(Js.$$.fragment,s),$(el.$$.fragment,s),$(Gs.$$.fragment,s),$(Xs.$$.fragment,s),$(tl.$$.fragment,s),$(ol.$$.fragment,s),$(Zs.$$.fragment,s),$(rl.$$.fragment,s),$(ea.$$.fragment,s),$(ta.$$.fragment,s),$(oa.$$.fragment,s),$(il.$$.fragment,s),$(ll.$$.fragment,s),$(sa.$$.fragment,s),$(hl.$$.fragment,s),$(aa.$$.fragment,s),$(ra.$$.fragment,s),$(ia.$$.fragment,s),$(ml.$$.fragment,s),$(ul.$$.fragment,s),$(bl.$$.fragment,s),$(da.$$.fragment,s),$(ca.$$.fragment,s),$(wl.$$.fragment,s),$(El.$$.fragment,s),$(Cl.$$.fragment,s),$(ha.$$.fragment,s),$(ma.$$.fragment,s),$(Pl.$$.fragment,s),$(Al.$$.fragment,s),$(Ul.$$.fragment,s),$(fa.$$.fragment,s),$(ga.$$.fragment,s),$(Rl.$$.fragment,s),$(Hl.$$.fragment,s),$(Zl.$$.fragment,s),$(ka.$$.fragment,s),$(va.$$.fragment,s),$(ed.$$.fragment,s),$(td.$$.fragment,s),$(dd.$$.fragment,s),$(Ta.$$.fragment,s),$(ba.$$.fragment,s),$(cd.$$.fragment,s),$(pd.$$.fragment,s),$(vd.$$.fragment,s),$(Ea.$$.fragment,s),$($a.$$.fragment,s),$(yd.$$.fragment,s),$(Td.$$.fragment,s),$(zd.$$.fragment,s),$(xa.$$.fragment,s),$(Ma.$$.fragment,s),$(qd.$$.fragment,s),$(jd.$$.fragment,s),$(Dd.$$.fragment,s),$(qa.$$.fragment,s),$(ja.$$.fragment,s),Ng=!1},d(s){t(d),s&&t(v),s&&t(u),F(l),s&&t(fe),s&&t(W),s&&t(G),s&&t(ae),F(ie),s&&t(ge),s&&t(H),s&&t(A),s&&t(pe),s&&t(_e),s&&t(he),s&&t(ke),s&&t(P),s&&t(X),s&&t(se),s&&t(oe),s&&t(Ce),s&&t(D),s&&t(U),F(K),s&&t(Ke),s&&t(R),s&&t(Of),s&&t(Uo),F(rr),s&&t(Nf),s&&t(Ut),F(ir),F(Xn),s&&t(If),s&&t(Ho),F(dr),s&&t(Df),s&&t(tt),F(cr),F(hr),F(ur),F(fr),F(es),F(gr),s&&t(Sf),s&&t(Qo),F(kr),s&&t(Wf),s&&t(Tt),F(vr),F(br),F(Er),F(ns),s&&t(Uf),s&&t(Vo),F($r),s&&t(Rf),s&&t(Jo),F(Fr),s&&t(Hf),s&&t(Go),F(Mr),s&&t(Kf),s&&t(Xo),F(qr),s&&t(Qf),s&&t(bt),F(jr),F(Lr),F(rs),F(is),s&&t(Bf),s&&t(Zo),F(Or),s&&t(Vf),s&&t(pt),F(Nr),F(Wr),F(ds),F(cs),s&&t(Jf),s&&t(tn),F(Ur),s&&t(Gf),s&&t(wt),F(Rr),F(Vr),F(hs),F(ms),s&&t(Xf),s&&t(nn),F(Jr),s&&t(Yf),s&&t(ht),F(Gr),F(ei),F(fs),F(gs),s&&t(Zf),s&&t(an),F(ti),s&&t(eg),s&&t(Et),F(oi),F(ri),F(ks),F(vs),F(ys),s&&t(tg),s&&t(ln),F(ii),s&&t(og),s&&t($t),F(li),F(hi),F(bs),F(ws),s&&t(ng),s&&t(cn),F(mi),s&&t(sg),s&&t(mt),F(ui),F(ki),F($s),F(Fs),s&&t(ag),s&&t(hn),F(vi),s&&t(rg),s&&t(Ft),F(yi),F(Ei),F(Ms),F(zs),s&&t(ig),s&&t(fn),F($i),s&&t(lg),s&&t(ut),F(Fi),F(js),F(qi),F(Cs),F(Ps),s&&t(dg),s&&t(_n),F(ji),s&&t(cg),s&&t(ot),F(Ci),F(Ls),F(Oi),F(Os),F(Ns),s&&t(pg),s&&t(vn),F(Ni),s&&t(hg),s&&t(nt),F(Ii),F(Ds),F(Ui),F(Ss),F(Ws),F(Us),s&&t(mg),s&&t(Tn),F(Ri),s&&t(ug),s&&t(ft),F(Hi),F(Hs),F(Vi),F(Ks),F(Qs),F(Bs),s&&t(fg),s&&t(wn),F(Ji),s&&t(gg),s&&t(gt),F(Gi),F(Js),F(el),F(Gs),F(Xs),s&&t(_g),s&&t($n),F(tl),s&&t(kg),s&&t(st),F(ol),F(Zs),F(rl),F(ea),F(ta),F(oa),s&&t(vg),s&&t(xn),F(il),s&&t(yg),s&&t(_t),F(ll),F(sa),F(hl),F(aa),F(ra),F(ia),s&&t(Tg),s&&t(qn),F(ml),s&&t(bg),s&&t(at),F(ul),F(bl),F(da),F(ca),s&&t(wg),s&&t(Cn),F(wl),s&&t(Eg),s&&t(Ze),F(El),F(Cl),F(ha),F(ma),s&&t($g),s&&t(An),F(Pl),s&&t(Fg),s&&t(rt),F(Al),F(Ul),F(fa),F(ga),s&&t(xg),s&&t(On),F(Rl),s&&t(Mg),s&&t(it),F(Hl),F(Zl),F(ka),F(va),s&&t(zg),s&&t(In),F(ed),s&&t(qg),s&&t(lt),F(td),F(dd),F(Ta),F(ba),s&&t(jg),s&&t(Sn),F(cd),s&&t(Cg),s&&t(dt),F(pd),F(vd),F(Ea),F($a),s&&t(Pg),s&&t(Un),F(yd),s&&t(Ag),s&&t(et),F(Td),F(zd),F(xa),F(Ma),s&&t(Lg),s&&t(Hn),F(qd),s&&t(Og),s&&t(ct),F(jd),F(Dd),F(qa),F(ja)}}}const dA={local:"electra",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.ElectraConfig",title:"ElectraConfig"},{local:"transformers.ElectraTokenizer",title:"ElectraTokenizer"},{local:"transformers.ElectraTokenizerFast",title:"ElectraTokenizerFast"},{local:"transformers.models.electra.modeling_electra.ElectraForPreTrainingOutput",title:"Electra specific outputs"},{local:"transformers.ElectraModel",title:"ElectraModel"},{local:"transformers.ElectraForPreTraining",title:"ElectraForPreTraining"},{local:"transformers.ElectraForCausalLM",title:"ElectraForCausalLM"},{local:"transformers.ElectraForMaskedLM",title:"ElectraForMaskedLM"},{local:"transformers.ElectraForSequenceClassification",title:"ElectraForSequenceClassification"},{local:"transformers.ElectraForMultipleChoice",title:"ElectraForMultipleChoice"},{local:"transformers.ElectraForTokenClassification",title:"ElectraForTokenClassification"},{local:"transformers.ElectraForQuestionAnswering",title:"ElectraForQuestionAnswering"},{local:"transformers.TFElectraModel",title:"TFElectraModel"},{local:"transformers.TFElectraForPreTraining",title:"TFElectraForPreTraining"},{local:"transformers.TFElectraForMaskedLM",title:"TFElectraForMaskedLM"},{local:"transformers.TFElectraForSequenceClassification",title:"TFElectraForSequenceClassification"},{local:"transformers.TFElectraForMultipleChoice",title:"TFElectraForMultipleChoice"},{local:"transformers.TFElectraForTokenClassification",title:"TFElectraForTokenClassification"},{local:"transformers.TFElectraForQuestionAnswering",title:"TFElectraForQuestionAnswering"},{local:"transformers.FlaxElectraModel",title:"FlaxElectraModel"},{local:"transformers.FlaxElectraForPreTraining",title:"FlaxElectraForPreTraining"},{local:"transformers.FlaxElectraForCausalLM",title:"FlaxElectraForCausalLM"},{local:"transformers.FlaxElectraForMaskedLM",title:"FlaxElectraForMaskedLM"},{local:"transformers.FlaxElectraForSequenceClassification",title:"FlaxElectraForSequenceClassification"},{local:"transformers.FlaxElectraForMultipleChoice",title:"FlaxElectraForMultipleChoice"},{local:"transformers.FlaxElectraForTokenClassification",title:"FlaxElectraForTokenClassification"},{local:"transformers.FlaxElectraForQuestionAnswering",title:"FlaxElectraForQuestionAnswering"}],title:"ELECTRA"};function cA(x){return eP(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class _A extends GC{constructor(d){super();XC(this,d,cA,lA,YC,{})}}export{_A as default,dA as metadata};
