import{S as DU,i as YU,s as HU,e as o,k as c,w as k,t as r,M as KU,c as n,d as t,m as p,a,x as v,h as l,b as m,N as QU,G as e,g,y as w,q as M,o as E,B as $,v as eI,L as We}from"../../chunks/vendor-hf-doc-builder.js";import{T as qe}from"../../chunks/Tip-hf-doc-builder.js";import{D as Z}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ne}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ae}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ie}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function tI(F){let d,b,u,f,_;return f=new Ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEVsZWN0cmFDb25maWclMkMlMjBFbGVjdHJhTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwRUxFQ1RSQSUyMGVsZWN0cmEtYmFzZS11bmNhc2VkJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMEVsZWN0cmFDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwZWxlY3RyYS1iYXNlLXVuY2FzZWQlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMEVsZWN0cmFNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",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"),b=r("Examples:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Examples:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function oI(F){let d,b,u,f,_;return f=new Ne({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMEElN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTIwJTIwJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",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"),b=r("sequence pair mask has the following format:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"sequence pair mask has the following format:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function nI(F){let d,b,u,f,_;return f=new Ne({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMEElN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTIwJTIwJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",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"),b=r("sequence pair mask has the following format:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"sequence pair mask has the following format:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function sI(F){let d,b,u,f,_;return{c(){d=o("p"),b=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(i){d=n(i,"P",{});var h=a(d);b=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var x=a(u);f=l(x,"Module"),x.forEach(t),_=l(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(i,h){g(i,d,h),e(d,b),e(d,u),e(u,f),e(d,_)},d(i){i&&t(d)}}}function aI(F){let d,b,u,f,_;return f=new Ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBFbGVjdHJhTW9kZWwlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmVsZWN0cmEtc21hbGwtZGlzY3JpbWluYXRvciUyMiklMEFtb2RlbCUyMCUzRCUyMEVsZWN0cmFNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZWxlY3RyYS1zbWFsbC1kaXNjcmltaW5hdG9yJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",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"),b=r("Example:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Example:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function rI(F){let d,b,u,f,_;return{c(){d=o("p"),b=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(i){d=n(i,"P",{});var h=a(d);b=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var x=a(u);f=l(x,"Module"),x.forEach(t),_=l(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(i,h){g(i,d,h),e(d,b),e(d,u),e(u,f),e(d,_)},d(i){i&&t(d)}}}function lI(F){let d,b,u,f,_;return f=new Ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEVsZWN0cmFGb3JQcmVUcmFpbmluZyUyQyUyMEF1dG9Ub2tlbml6ZXIlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQWRpc2NyaW1pbmF0b3IlMjAlM0QlMjBFbGVjdHJhRm9yUHJlVHJhaW5pbmcuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmVsZWN0cmEtYmFzZS1kaXNjcmltaW5hdG9yJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmVsZWN0cmEtYmFzZS1kaXNjcmltaW5hdG9yJTIyKSUwQSUwQXNlbnRlbmNlJTIwJTNEJTIwJTIyVGhlJTIwcXVpY2slMjBicm93biUyMGZveCUyMGp1bXBzJTIwb3ZlciUyMHRoZSUyMGxhenklMjBkb2clMjIlMEFmYWtlX3NlbnRlbmNlJTIwJTNEJTIwJTIyVGhlJTIwcXVpY2slMjBicm93biUyMGZveCUyMGZha2UlMjBvdmVyJTIwdGhlJTIwbGF6eSUyMGRvZyUyMiUwQSUwQWZha2VfdG9rZW5zJTIwJTNEJTIwdG9rZW5pemVyLnRva2VuaXplKGZha2Vfc2VudGVuY2UlMkMlMjBhZGRfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSUwQWZha2VfaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyLmVuY29kZShmYWtlX3NlbnRlbmNlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFkaXNjcmltaW5hdG9yX291dHB1dHMlMjAlM0QlMjBkaXNjcmltaW5hdG9yKGZha2VfaW5wdXRzKSUwQXByZWRpY3Rpb25zJTIwJTNEJTIwdG9yY2gucm91bmQoKHRvcmNoLnNpZ24oZGlzY3JpbWluYXRvcl9vdXRwdXRzJTVCMCU1RCklMjAlMkIlMjAxKSUyMCUyRiUyMDIpJTBBJTBBZmFrZV90b2tlbnMlMEElMEFwcmVkaWN0aW9ucy5zcXVlZXplKCkudG9saXN0KCk=",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"),b=r("Examples:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Examples:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function iI(F){let d,b,u,f,_;return{c(){d=o("p"),b=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(i){d=n(i,"P",{});var h=a(d);b=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var x=a(u);f=l(x,"Module"),x.forEach(t),_=l(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(i,h){g(i,d,h),e(d,b),e(d,u),e(u,f),e(d,_)},d(i){i&&t(d)}}}function dI(F){let d,b,u,f,_;return f=new Ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBFbGVjdHJhRm9yQ2F1c2FsTE0lMkMlMjBFbGVjdHJhQ29uZmlnJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZlbGVjdHJhLWJhc2UtZ2VuZXJhdG9yJTIyKSUwQWNvbmZpZyUyMCUzRCUyMEVsZWN0cmFDb25maWcuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmVsZWN0cmEtYmFzZS1nZW5lcmF0b3IlMjIpJTBBY29uZmlnLmlzX2RlY29kZXIlMjAlM0QlMjBUcnVlJTBBbW9kZWwlMjAlM0QlMjBFbGVjdHJhRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmVsZWN0cmEtYmFzZS1nZW5lcmF0b3IlMjIlMkMlMjBjb25maWclM0Rjb25maWcpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFwcmVkaWN0aW9uX2xvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRz",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"),b=r("Example:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Example:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function cI(F){let d,b,u,f,_;return{c(){d=o("p"),b=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(i){d=n(i,"P",{});var h=a(d);b=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var x=a(u);f=l(x,"Module"),x.forEach(t),_=l(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(i,h){g(i,d,h),e(d,b),e(d,u),e(u,f),e(d,_)},d(i){i&&t(d)}}}function pI(F){let d,b,u,f,_;return f=new Ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBFbGVjdHJhRm9yTWFza2VkTE0lMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmVsZWN0cmEtc21hbGwtZ2VuZXJhdG9yJTIyKSUwQW1vZGVsJTIwJTNEJTIwRWxlY3RyYUZvck1hc2tlZExNLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZlbGVjdHJhLXNtYWxsLWdlbmVyYXRvciUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyVGhlJTIwY2FwaXRhbCUyMG9mJTIwRnJhbmNlJTIwaXMlMjAlNUJNQVNLJTVELiUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjByZXRyaWV2ZSUyMGluZGV4JTIwb2YlMjAlNUJNQVNLJTVEJTBBbWFza190b2tlbl9pbmRleCUyMCUzRCUyMChpbnB1dHMuaW5wdXRfaWRzJTIwJTNEJTNEJTIwdG9rZW5pemVyLm1hc2tfdG9rZW5faWQpJTVCMCU1RC5ub256ZXJvKGFzX3R1cGxlJTNEVHJ1ZSklNUIwJTVEJTBBJTBBcHJlZGljdGVkX3Rva2VuX2lkJTIwJTNEJTIwbG9naXRzJTVCMCUyQyUyMG1hc2tfdG9rZW5faW5kZXglNUQuYXJnbWF4KGF4aXMlM0QtMSklMEF0b2tlbml6ZXIuZGVjb2RlKHByZWRpY3RlZF90b2tlbl9pZCklMEElMEFsYWJlbHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyVGhlJTIwY2FwaXRhbCUyMG9mJTIwRnJhbmNlJTIwaXMlMjBQYXJpcy4lMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSU1QiUyMmlucHV0X2lkcyUyMiU1RCUwQSUyMyUyMG1hc2slMjBsYWJlbHMlMjBvZiUyMG5vbi0lNUJNQVNLJTVEJTIwdG9rZW5zJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2gud2hlcmUoaW5wdXRzLmlucHV0X2lkcyUyMCUzRCUzRCUyMHRva2VuaXplci5tYXNrX3Rva2VuX2lkJTJDJTIwbGFiZWxzJTJDJTIwLTEwMCklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBsYWJlbHMlM0RsYWJlbHMpJTBBcm91bmQob3V0cHV0cy5sb3NzLml0ZW0oKSUyQyUyMDIp",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"),b=r("Example:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Example:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function hI(F){let d,b,u,f,_;return{c(){d=o("p"),b=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(i){d=n(i,"P",{});var h=a(d);b=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var x=a(u);f=l(x,"Module"),x.forEach(t),_=l(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(i,h){g(i,d,h),e(d,b),e(d,u),e(u,f),e(d,_)},d(i){i&&t(d)}}}function mI(F){let d,b,u,f,_;return f=new Ne({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEVsZWN0cmFGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyYmhhZHJlc2gtc2F2YW5pJTJGZWxlY3RyYS1iYXNlLWVtb3Rpb24lMjIpJTBBbW9kZWwlMjAlM0QlMjBFbGVjdHJhRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyYmhhZHJlc2gtc2F2YW5pJTJGZWxlY3RyYS1iYXNlLWVtb3Rpb24lMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX2NsYXNzX2lkJTIwJTNEJTIwbG9naXRzLmFyZ21heCgpLml0ZW0oKSUwQW1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9jbGFzc19pZCU1RCUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyMEVsZWN0cmFGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJiaGFkcmVzaC1zYXZhbmklMkZlbGVjdHJhLWJhc2UtZW1vdGlvbiUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcyUwQXJvdW5kKGxvc3MuaXRlbSgpJTJDJTIwMik=",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"),b=r("Example of single-label classification:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Example of single-label classification:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function uI(F){let d,b,u,f,_;return f=new Ne({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEVsZWN0cmFGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyYmhhZHJlc2gtc2F2YW5pJTJGZWxlY3RyYS1iYXNlLWVtb3Rpb24lMjIpJTBBbW9kZWwlMjAlM0QlMjBFbGVjdHJhRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyYmhhZHJlc2gtc2F2YW5pJTJGZWxlY3RyYS1iYXNlLWVtb3Rpb24lMjIlMkMlMjBwcm9ibGVtX3R5cGUlM0QlMjJtdWx0aV9sYWJlbF9jbGFzc2lmaWNhdGlvbiUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWRzJTIwJTNEJTIwdG9yY2guYXJhbmdlKDAlMkMlMjBsb2dpdHMuc2hhcGUlNUItMSU1RCklNUJ0b3JjaC5zaWdtb2lkKGxvZ2l0cykuc3F1ZWV6ZShkaW0lM0QwKSUyMCUzRSUyMDAuNSU1RCUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyMEVsZWN0cmFGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJiaGFkcmVzaC1zYXZhbmklMkZlbGVjdHJhLWJhc2UtZW1vdGlvbiUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIlMEEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2guc3VtKCUwQSUyMCUyMCUyMCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwub25lX2hvdChwcmVkaWN0ZWRfY2xhc3NfaWRzJTVCTm9uZSUyQyUyMCUzQSU1RC5jbG9uZSgpJTJDJTIwbnVtX2NsYXNzZXMlM0RudW1fbGFiZWxzKSUyQyUyMGRpbSUzRDElMEEpLnRvKHRvcmNoLmZsb2F0KSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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"),b=r("Example of multi-label classification:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Example of multi-label classification:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function fI(F){let d,b,u,f,_;return{c(){d=o("p"),b=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(i){d=n(i,"P",{});var h=a(d);b=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var x=a(u);f=l(x,"Module"),x.forEach(t),_=l(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(i,h){g(i,d,h),e(d,b),e(d,u),e(u,f),e(d,_)},d(i){i&&t(d)}}}function gI(F){let d,b,u,f,_;return f=new Ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBFbGVjdHJhRm9yTXVsdGlwbGVDaG9pY2UlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmVsZWN0cmEtc21hbGwtZGlzY3JpbWluYXRvciUyMiklMEFtb2RlbCUyMCUzRCUyMEVsZWN0cmFGb3JNdWx0aXBsZUNob2ljZS5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZWxlY3RyYS1zbWFsbC1kaXNjcmltaW5hdG9yJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMkluJTIwSXRhbHklMkMlMjBwaXp6YSUyMHNlcnZlZCUyMGluJTIwZm9ybWFsJTIwc2V0dGluZ3MlMkMlMjBzdWNoJTIwYXMlMjBhdCUyMGElMjByZXN0YXVyYW50JTJDJTIwaXMlMjBwcmVzZW50ZWQlMjB1bnNsaWNlZC4lMjIlMEFjaG9pY2UwJTIwJTNEJTIwJTIySXQlMjBpcyUyMGVhdGVuJTIwd2l0aCUyMGElMjBmb3JrJTIwYW5kJTIwYSUyMGtuaWZlLiUyMiUwQWNob2ljZTElMjAlM0QlMjAlMjJJdCUyMGlzJTIwZWF0ZW4lMjB3aGlsZSUyMGhlbGQlMjBpbiUyMHRoZSUyMGhhbmQuJTIyJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2gudGVuc29yKDApLnVuc3F1ZWV6ZSgwKSUyMCUyMCUyMyUyMGNob2ljZTAlMjBpcyUyMGNvcnJlY3QlMjAoYWNjb3JkaW5nJTIwdG8lMjBXaWtpcGVkaWElMjAlM0IpKSUyQyUyMGJhdGNoJTIwc2l6ZSUyMDElMEElMEFlbmNvZGluZyUyMCUzRCUyMHRva2VuaXplciglNUJwcm9tcHQlMkMlMjBwcm9tcHQlNUQlMkMlMjAlNUJjaG9pY2UwJTJDJTIwY2hvaWNlMSU1RCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMkMlMjBwYWRkaW5nJTNEVHJ1ZSklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKiolN0JrJTNBJTIwdi51bnNxdWVlemUoMCklMjBmb3IlMjBrJTJDJTIwdiUyMGluJTIwZW5jb2RpbmcuaXRlbXMoKSU3RCUyQyUyMGxhYmVscyUzRGxhYmVscyklMjAlMjAlMjMlMjBiYXRjaCUyMHNpemUlMjBpcyUyMDElMEElMEElMjMlMjB0aGUlMjBsaW5lYXIlMjBjbGFzc2lmaWVyJTIwc3RpbGwlMjBuZWVkcyUyMHRvJTIwYmUlMjB0cmFpbmVkJTBBbG9zcyUyMCUzRCUyMG91dHB1dHMubG9zcyUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRz",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"),b=r("Example:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Example:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function _I(F){let d,b,u,f,_;return{c(){d=o("p"),b=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(i){d=n(i,"P",{});var h=a(d);b=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var x=a(u);f=l(x,"Module"),x.forEach(t),_=l(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(i,h){g(i,d,h),e(d,b),e(d,u),e(u,f),e(d,_)},d(i){i&&t(d)}}}function yI(F){let d,b,u,f,_;return f=new Ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBFbGVjdHJhRm9yVG9rZW5DbGFzc2lmaWNhdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyYmhhZHJlc2gtc2F2YW5pJTJGZWxlY3RyYS1iYXNlLWRpc2NyaW1pbmF0b3ItZmluZXR1bmVkLWNvbmxsMDMtZW5nbGlzaCUyMiklMEFtb2RlbCUyMCUzRCUyMEVsZWN0cmFGb3JUb2tlbkNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJiaGFkcmVzaC1zYXZhbmklMkZlbGVjdHJhLWJhc2UtZGlzY3JpbWluYXRvci1maW5ldHVuZWQtY29ubGwwMy1lbmdsaXNoJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMEElMjAlMjAlMjAlMjAlMjJIdWdnaW5nRmFjZSUyMGlzJTIwYSUyMGNvbXBhbnklMjBiYXNlZCUyMGluJTIwUGFyaXMlMjBhbmQlMjBOZXclMjBZb3JrJTIyJTJDJTIwYWRkX3NwZWNpYWxfdG9rZW5zJTNERmFsc2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTBBKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoLTEpJTBBJTBBJTIzJTIwTm90ZSUyMHRoYXQlMjB0b2tlbnMlMjBhcmUlMjBjbGFzc2lmaWVkJTIwcmF0aGVyJTIwdGhlbiUyMGlucHV0JTIwd29yZHMlMjB3aGljaCUyMG1lYW5zJTIwdGhhdCUwQSUyMyUyMHRoZXJlJTIwbWlnaHQlMjBiZSUyMG1vcmUlMjBwcmVkaWN0ZWQlMjB0b2tlbiUyMGNsYXNzZXMlMjB0aGFuJTIwd29yZHMuJTBBJTIzJTIwTXVsdGlwbGUlMjB0b2tlbiUyMGNsYXNzZXMlMjBtaWdodCUyMGFjY291bnQlMjBmb3IlMjB0aGUlMjBzYW1lJTIwd29yZCUwQXByZWRpY3RlZF90b2tlbnNfY2xhc3NlcyUyMCUzRCUyMCU1Qm1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnQuaXRlbSgpJTVEJTIwZm9yJTIwdCUyMGluJTIwcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyU1QjAlNUQlNUQlMEFwcmVkaWN0ZWRfdG9rZW5zX2NsYXNzZXMlMEElMEFsYWJlbHMlMjAlM0QlMjBwcmVkaWN0ZWRfdG9rZW5fY2xhc3NfaWRzJTBBbG9zcyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzJTJDJTIwbGFiZWxzJTNEbGFiZWxzKS5sb3NzJTBBcm91bmQobG9zcy5pdGVtKCklMkMlMjAyKQ==",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"),b=r("Example:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Example:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function bI(F){let d,b,u,f,_;return{c(){d=o("p"),b=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(i){d=n(i,"P",{});var h=a(d);b=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var x=a(u);f=l(x,"Module"),x.forEach(t),_=l(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(i,h){g(i,d,h),e(d,b),e(d,u),e(u,f),e(d,_)},d(i){i&&t(d)}}}function TI(F){let d,b,u,f,_;return f=new Ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBFbGVjdHJhRm9yUXVlc3Rpb25BbnN3ZXJpbmclMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmJoYWRyZXNoLXNhdmFuaSUyRmVsZWN0cmEtYmFzZS1zcXVhZDIlMjIpJTBBbW9kZWwlMjAlM0QlMjBFbGVjdHJhRm9yUXVlc3Rpb25BbnN3ZXJpbmcuZnJvbV9wcmV0cmFpbmVkKCUyMmJoYWRyZXNoLXNhdmFuaSUyRmVsZWN0cmEtYmFzZS1zcXVhZDIlMjIpJTBBJTBBcXVlc3Rpb24lMkMlMjB0ZXh0JTIwJTNEJTIwJTIyV2hvJTIwd2FzJTIwSmltJTIwSGVuc29uJTNGJTIyJTJDJTIwJTIySmltJTIwSGVuc29uJTIwd2FzJTIwYSUyMG5pY2UlMjBwdXBwZXQlMjIlMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIocXVlc3Rpb24lMkMlMjB0ZXh0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWFuc3dlcl9zdGFydF9pbmRleCUyMCUzRCUyMG91dHB1dHMuc3RhcnRfbG9naXRzLmFyZ21heCgpJTBBYW5zd2VyX2VuZF9pbmRleCUyMCUzRCUyMG91dHB1dHMuZW5kX2xvZ2l0cy5hcmdtYXgoKSUwQSUwQXByZWRpY3RfYW5zd2VyX3Rva2VucyUyMCUzRCUyMGlucHV0cy5pbnB1dF9pZHMlNUIwJTJDJTIwYW5zd2VyX3N0YXJ0X2luZGV4JTIwJTNBJTIwYW5zd2VyX2VuZF9pbmRleCUyMCUyQiUyMDElNUQlMEF0b2tlbml6ZXIuZGVjb2RlKHByZWRpY3RfYW5zd2VyX3Rva2VucyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSUwQSUwQSUyMyUyMHRhcmdldCUyMGlzJTIwJTIybmljZSUyMHB1cHBldCUyMiUwQXRhcmdldF9zdGFydF9pbmRleCUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxMSU1RCklMEF0YXJnZXRfZW5kX2luZGV4JTIwJTNEJTIwdG9yY2gudGVuc29yKCU1QjEyJTVEKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMHN0YXJ0X3Bvc2l0aW9ucyUzRHRhcmdldF9zdGFydF9pbmRleCUyQyUyMGVuZF9wb3NpdGlvbnMlM0R0YXJnZXRfZW5kX2luZGV4KSUwQWxvc3MlMjAlM0QlMjBvdXRwdXRzLmxvc3MlMEFyb3VuZChsb3NzLml0ZW0oKSUyQyUyMDIp",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"),b=r("Example:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Example:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function kI(F){let d,b,u,f,_,i,h,x,be,fe,R,de,te,j,Te,X,ce,Ze,D,ae,re,L,le,ke,O,ve,ge,B,we,ie,ne,J,I,pe,H,_e,he,Q,Me,ye,U,Ee,Y,se,me,K,$e,ue,G,Fe,q,je,ee,W,xe,N,Ce,ze;return{c(){d=o("p"),b=r("TensorFlow models and layers in "),u=o("code"),f=r("transformers"),_=r(" accept two formats as input:"),i=c(),h=o("ul"),x=o("li"),be=r("having all inputs as keyword arguments (like PyTorch models), or"),fe=c(),R=o("li"),de=r("having all inputs as a list, tuple or dict in the first positional argument."),te=c(),j=o("p"),Te=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 `),X=o("code"),ce=r("model.fit()"),Ze=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=o("code"),ae=r("model.fit()"),re=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),L=o("code"),le=r("fit()"),ke=r(" and "),O=o("code"),ve=r("predict()"),ge=r(`, such as when creating your own layers or models with
the Keras `),B=o("code"),we=r("Functional"),ie=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ne=c(),J=o("ul"),I=o("li"),pe=r("a single Tensor with "),H=o("code"),_e=r("input_ids"),he=r(" only and nothing else: "),Q=o("code"),Me=r("model(input_ids)"),ye=c(),U=o("li"),Ee=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Y=o("code"),se=r("model([input_ids, attention_mask])"),me=r(" or "),K=o("code"),$e=r("model([input_ids, attention_mask, token_type_ids])"),ue=c(),G=o("li"),Fe=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),q=o("code"),je=r('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ee=c(),W=o("p"),xe=r(`Note that when creating models and layers with
`),N=o("a"),Ce=r("subclassing"),ze=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(T){d=n(T,"P",{});var C=a(d);b=l(C,"TensorFlow models and layers in "),u=n(C,"CODE",{});var Xe=a(u);f=l(Xe,"transformers"),Xe.forEach(t),_=l(C," accept two formats as input:"),C.forEach(t),i=p(T),h=n(T,"UL",{});var oe=a(h);x=n(oe,"LI",{});var Je=a(x);be=l(Je,"having all inputs as keyword arguments (like PyTorch models), or"),Je.forEach(t),fe=p(oe),R=n(oe,"LI",{});var Le=a(R);de=l(Le,"having all inputs as a list, tuple or dict in the first positional argument."),Le.forEach(t),oe.forEach(t),te=p(T),j=n(T,"P",{});var z=a(j);Te=l(z,`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 `),X=n(z,"CODE",{});var Oe=a(X);ce=l(Oe,"model.fit()"),Oe.forEach(t),Ze=l(z,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=n(z,"CODE",{});var Qe=a(D);ae=l(Qe,"model.fit()"),Qe.forEach(t),re=l(z,` supports! If, however, you want to use the second
format outside of Keras methods like `),L=n(z,"CODE",{});var Re=a(L);le=l(Re,"fit()"),Re.forEach(t),ke=l(z," and "),O=n(z,"CODE",{});var De=a(O);ve=l(De,"predict()"),De.forEach(t),ge=l(z,`, such as when creating your own layers or models with
the Keras `),B=n(z,"CODE",{});var Ye=a(B);we=l(Ye,"Functional"),Ye.forEach(t),ie=l(z,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),z.forEach(t),ne=p(T),J=n(T,"UL",{});var A=a(J);I=n(A,"LI",{});var P=a(I);pe=l(P,"a single Tensor with "),H=n(P,"CODE",{});var Ge=a(H);_e=l(Ge,"input_ids"),Ge.forEach(t),he=l(P," only and nothing else: "),Q=n(P,"CODE",{});var Pe=a(Q);Me=l(Pe,"model(input_ids)"),Pe.forEach(t),P.forEach(t),ye=p(A),U=n(A,"LI",{});var S=a(U);Ee=l(S,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Y=n(S,"CODE",{});var He=a(Y);se=l(He,"model([input_ids, attention_mask])"),He.forEach(t),me=l(S," or "),K=n(S,"CODE",{});var Ve=a(K);$e=l(Ve,"model([input_ids, attention_mask, token_type_ids])"),Ve.forEach(t),S.forEach(t),ue=p(A),G=n(A,"LI",{});var Ue=a(G);Fe=l(Ue,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),q=n(Ue,"CODE",{});var Se=a(q);je=l(Se,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Se.forEach(t),Ue.forEach(t),A.forEach(t),ee=p(T),W=n(T,"P",{});var V=a(W);xe=l(V,`Note that when creating models and layers with
`),N=n(V,"A",{href:!0,rel:!0});var Be=a(N);Ce=l(Be,"subclassing"),Be.forEach(t),ze=l(V,` 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!`),V.forEach(t),this.h()},h(){m(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(N,"rel","nofollow")},m(T,C){g(T,d,C),e(d,b),e(d,u),e(u,f),e(d,_),g(T,i,C),g(T,h,C),e(h,x),e(x,be),e(h,fe),e(h,R),e(R,de),g(T,te,C),g(T,j,C),e(j,Te),e(j,X),e(X,ce),e(j,Ze),e(j,D),e(D,ae),e(j,re),e(j,L),e(L,le),e(j,ke),e(j,O),e(O,ve),e(j,ge),e(j,B),e(B,we),e(j,ie),g(T,ne,C),g(T,J,C),e(J,I),e(I,pe),e(I,H),e(H,_e),e(I,he),e(I,Q),e(Q,Me),e(J,ye),e(J,U),e(U,Ee),e(U,Y),e(Y,se),e(U,me),e(U,K),e(K,$e),e(J,ue),e(J,G),e(G,Fe),e(G,q),e(q,je),g(T,ee,C),g(T,W,C),e(W,xe),e(W,N),e(N,Ce),e(W,ze)},d(T){T&&t(d),T&&t(i),T&&t(h),T&&t(te),T&&t(j),T&&t(ne),T&&t(J),T&&t(ee),T&&t(W)}}}function vI(F){let d,b,u,f,_;return{c(){d=o("p"),b=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(i){d=n(i,"P",{});var h=a(d);b=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var x=a(u);f=l(x,"Module"),x.forEach(t),_=l(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(i,h){g(i,d,h),e(d,b),e(d,u),e(u,f),e(d,_)},d(i){i&&t(d)}}}function wI(F){let d,b,u,f,_;return f=new Ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkVsZWN0cmFNb2RlbCUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZWxlY3RyYS1zbWFsbC1kaXNjcmltaW5hdG9yJTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZFbGVjdHJhTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmVsZWN0cmEtc21hbGwtZGlzY3JpbWluYXRvciUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",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"),b=r("Example:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Example:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function MI(F){let d,b,u,f,_,i,h,x,be,fe,R,de,te,j,Te,X,ce,Ze,D,ae,re,L,le,ke,O,ve,ge,B,we,ie,ne,J,I,pe,H,_e,he,Q,Me,ye,U,Ee,Y,se,me,K,$e,ue,G,Fe,q,je,ee,W,xe,N,Ce,ze;return{c(){d=o("p"),b=r("TensorFlow models and layers in "),u=o("code"),f=r("transformers"),_=r(" accept two formats as input:"),i=c(),h=o("ul"),x=o("li"),be=r("having all inputs as keyword arguments (like PyTorch models), or"),fe=c(),R=o("li"),de=r("having all inputs as a list, tuple or dict in the first positional argument."),te=c(),j=o("p"),Te=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 `),X=o("code"),ce=r("model.fit()"),Ze=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=o("code"),ae=r("model.fit()"),re=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),L=o("code"),le=r("fit()"),ke=r(" and "),O=o("code"),ve=r("predict()"),ge=r(`, such as when creating your own layers or models with
the Keras `),B=o("code"),we=r("Functional"),ie=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ne=c(),J=o("ul"),I=o("li"),pe=r("a single Tensor with "),H=o("code"),_e=r("input_ids"),he=r(" only and nothing else: "),Q=o("code"),Me=r("model(input_ids)"),ye=c(),U=o("li"),Ee=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Y=o("code"),se=r("model([input_ids, attention_mask])"),me=r(" or "),K=o("code"),$e=r("model([input_ids, attention_mask, token_type_ids])"),ue=c(),G=o("li"),Fe=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),q=o("code"),je=r('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ee=c(),W=o("p"),xe=r(`Note that when creating models and layers with
`),N=o("a"),Ce=r("subclassing"),ze=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(T){d=n(T,"P",{});var C=a(d);b=l(C,"TensorFlow models and layers in "),u=n(C,"CODE",{});var Xe=a(u);f=l(Xe,"transformers"),Xe.forEach(t),_=l(C," accept two formats as input:"),C.forEach(t),i=p(T),h=n(T,"UL",{});var oe=a(h);x=n(oe,"LI",{});var Je=a(x);be=l(Je,"having all inputs as keyword arguments (like PyTorch models), or"),Je.forEach(t),fe=p(oe),R=n(oe,"LI",{});var Le=a(R);de=l(Le,"having all inputs as a list, tuple or dict in the first positional argument."),Le.forEach(t),oe.forEach(t),te=p(T),j=n(T,"P",{});var z=a(j);Te=l(z,`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 `),X=n(z,"CODE",{});var Oe=a(X);ce=l(Oe,"model.fit()"),Oe.forEach(t),Ze=l(z,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=n(z,"CODE",{});var Qe=a(D);ae=l(Qe,"model.fit()"),Qe.forEach(t),re=l(z,` supports! If, however, you want to use the second
format outside of Keras methods like `),L=n(z,"CODE",{});var Re=a(L);le=l(Re,"fit()"),Re.forEach(t),ke=l(z," and "),O=n(z,"CODE",{});var De=a(O);ve=l(De,"predict()"),De.forEach(t),ge=l(z,`, such as when creating your own layers or models with
the Keras `),B=n(z,"CODE",{});var Ye=a(B);we=l(Ye,"Functional"),Ye.forEach(t),ie=l(z,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),z.forEach(t),ne=p(T),J=n(T,"UL",{});var A=a(J);I=n(A,"LI",{});var P=a(I);pe=l(P,"a single Tensor with "),H=n(P,"CODE",{});var Ge=a(H);_e=l(Ge,"input_ids"),Ge.forEach(t),he=l(P," only and nothing else: "),Q=n(P,"CODE",{});var Pe=a(Q);Me=l(Pe,"model(input_ids)"),Pe.forEach(t),P.forEach(t),ye=p(A),U=n(A,"LI",{});var S=a(U);Ee=l(S,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Y=n(S,"CODE",{});var He=a(Y);se=l(He,"model([input_ids, attention_mask])"),He.forEach(t),me=l(S," or "),K=n(S,"CODE",{});var Ve=a(K);$e=l(Ve,"model([input_ids, attention_mask, token_type_ids])"),Ve.forEach(t),S.forEach(t),ue=p(A),G=n(A,"LI",{});var Ue=a(G);Fe=l(Ue,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),q=n(Ue,"CODE",{});var Se=a(q);je=l(Se,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Se.forEach(t),Ue.forEach(t),A.forEach(t),ee=p(T),W=n(T,"P",{});var V=a(W);xe=l(V,`Note that when creating models and layers with
`),N=n(V,"A",{href:!0,rel:!0});var Be=a(N);Ce=l(Be,"subclassing"),Be.forEach(t),ze=l(V,` 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!`),V.forEach(t),this.h()},h(){m(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(N,"rel","nofollow")},m(T,C){g(T,d,C),e(d,b),e(d,u),e(u,f),e(d,_),g(T,i,C),g(T,h,C),e(h,x),e(x,be),e(h,fe),e(h,R),e(R,de),g(T,te,C),g(T,j,C),e(j,Te),e(j,X),e(X,ce),e(j,Ze),e(j,D),e(D,ae),e(j,re),e(j,L),e(L,le),e(j,ke),e(j,O),e(O,ve),e(j,ge),e(j,B),e(B,we),e(j,ie),g(T,ne,C),g(T,J,C),e(J,I),e(I,pe),e(I,H),e(H,_e),e(I,he),e(I,Q),e(Q,Me),e(J,ye),e(J,U),e(U,Ee),e(U,Y),e(Y,se),e(U,me),e(U,K),e(K,$e),e(J,ue),e(J,G),e(G,Fe),e(G,q),e(q,je),g(T,ee,C),g(T,W,C),e(W,xe),e(W,N),e(N,Ce),e(W,ze)},d(T){T&&t(d),T&&t(i),T&&t(h),T&&t(te),T&&t(j),T&&t(ne),T&&t(J),T&&t(ee),T&&t(W)}}}function EI(F){let d,b,u,f,_;return{c(){d=o("p"),b=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(i){d=n(i,"P",{});var h=a(d);b=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var x=a(u);f=l(x,"Module"),x.forEach(t),_=l(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(i,h){g(i,d,h),e(d,b),e(d,u),e(u,f),e(d,_)},d(i){i&&t(d)}}}function $I(F){let d,b,u,f,_;return f=new Ne({props:{code:"aW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMFRGRWxlY3RyYUZvclByZVRyYWluaW5nJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZWxlY3RyYS1zbWFsbC1kaXNjcmltaW5hdG9yJTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZFbGVjdHJhRm9yUHJlVHJhaW5pbmcuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmVsZWN0cmEtc21hbGwtZGlzY3JpbWluYXRvciUyMiklMEFpbnB1dF9pZHMlMjAlM0QlMjB0Zi5jb25zdGFudCh0b2tlbml6ZXIuZW5jb2RlKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIpKSU1Qk5vbmUlMkMlMjAlM0ElNUQlMjAlMjAlMjMlMjBCYXRjaCUyMHNpemUlMjAxJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0X2lkcyklMEFzY29yZXMlMjAlM0QlMjBvdXRwdXRzJTVCMCU1RA==",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"),b=r("Examples:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Examples:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function FI(F){let d,b,u,f,_,i,h,x,be,fe,R,de,te,j,Te,X,ce,Ze,D,ae,re,L,le,ke,O,ve,ge,B,we,ie,ne,J,I,pe,H,_e,he,Q,Me,ye,U,Ee,Y,se,me,K,$e,ue,G,Fe,q,je,ee,W,xe,N,Ce,ze;return{c(){d=o("p"),b=r("TensorFlow models and layers in "),u=o("code"),f=r("transformers"),_=r(" accept two formats as input:"),i=c(),h=o("ul"),x=o("li"),be=r("having all inputs as keyword arguments (like PyTorch models), or"),fe=c(),R=o("li"),de=r("having all inputs as a list, tuple or dict in the first positional argument."),te=c(),j=o("p"),Te=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 `),X=o("code"),ce=r("model.fit()"),Ze=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=o("code"),ae=r("model.fit()"),re=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),L=o("code"),le=r("fit()"),ke=r(" and "),O=o("code"),ve=r("predict()"),ge=r(`, such as when creating your own layers or models with
the Keras `),B=o("code"),we=r("Functional"),ie=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ne=c(),J=o("ul"),I=o("li"),pe=r("a single Tensor with "),H=o("code"),_e=r("input_ids"),he=r(" only and nothing else: "),Q=o("code"),Me=r("model(input_ids)"),ye=c(),U=o("li"),Ee=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Y=o("code"),se=r("model([input_ids, attention_mask])"),me=r(" or "),K=o("code"),$e=r("model([input_ids, attention_mask, token_type_ids])"),ue=c(),G=o("li"),Fe=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),q=o("code"),je=r('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ee=c(),W=o("p"),xe=r(`Note that when creating models and layers with
`),N=o("a"),Ce=r("subclassing"),ze=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(T){d=n(T,"P",{});var C=a(d);b=l(C,"TensorFlow models and layers in "),u=n(C,"CODE",{});var Xe=a(u);f=l(Xe,"transformers"),Xe.forEach(t),_=l(C," accept two formats as input:"),C.forEach(t),i=p(T),h=n(T,"UL",{});var oe=a(h);x=n(oe,"LI",{});var Je=a(x);be=l(Je,"having all inputs as keyword arguments (like PyTorch models), or"),Je.forEach(t),fe=p(oe),R=n(oe,"LI",{});var Le=a(R);de=l(Le,"having all inputs as a list, tuple or dict in the first positional argument."),Le.forEach(t),oe.forEach(t),te=p(T),j=n(T,"P",{});var z=a(j);Te=l(z,`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 `),X=n(z,"CODE",{});var Oe=a(X);ce=l(Oe,"model.fit()"),Oe.forEach(t),Ze=l(z,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=n(z,"CODE",{});var Qe=a(D);ae=l(Qe,"model.fit()"),Qe.forEach(t),re=l(z,` supports! If, however, you want to use the second
format outside of Keras methods like `),L=n(z,"CODE",{});var Re=a(L);le=l(Re,"fit()"),Re.forEach(t),ke=l(z," and "),O=n(z,"CODE",{});var De=a(O);ve=l(De,"predict()"),De.forEach(t),ge=l(z,`, such as when creating your own layers or models with
the Keras `),B=n(z,"CODE",{});var Ye=a(B);we=l(Ye,"Functional"),Ye.forEach(t),ie=l(z,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),z.forEach(t),ne=p(T),J=n(T,"UL",{});var A=a(J);I=n(A,"LI",{});var P=a(I);pe=l(P,"a single Tensor with "),H=n(P,"CODE",{});var Ge=a(H);_e=l(Ge,"input_ids"),Ge.forEach(t),he=l(P," only and nothing else: "),Q=n(P,"CODE",{});var Pe=a(Q);Me=l(Pe,"model(input_ids)"),Pe.forEach(t),P.forEach(t),ye=p(A),U=n(A,"LI",{});var S=a(U);Ee=l(S,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Y=n(S,"CODE",{});var He=a(Y);se=l(He,"model([input_ids, attention_mask])"),He.forEach(t),me=l(S," or "),K=n(S,"CODE",{});var Ve=a(K);$e=l(Ve,"model([input_ids, attention_mask, token_type_ids])"),Ve.forEach(t),S.forEach(t),ue=p(A),G=n(A,"LI",{});var Ue=a(G);Fe=l(Ue,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),q=n(Ue,"CODE",{});var Se=a(q);je=l(Se,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Se.forEach(t),Ue.forEach(t),A.forEach(t),ee=p(T),W=n(T,"P",{});var V=a(W);xe=l(V,`Note that when creating models and layers with
`),N=n(V,"A",{href:!0,rel:!0});var Be=a(N);Ce=l(Be,"subclassing"),Be.forEach(t),ze=l(V,` 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!`),V.forEach(t),this.h()},h(){m(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(N,"rel","nofollow")},m(T,C){g(T,d,C),e(d,b),e(d,u),e(u,f),e(d,_),g(T,i,C),g(T,h,C),e(h,x),e(x,be),e(h,fe),e(h,R),e(R,de),g(T,te,C),g(T,j,C),e(j,Te),e(j,X),e(X,ce),e(j,Ze),e(j,D),e(D,ae),e(j,re),e(j,L),e(L,le),e(j,ke),e(j,O),e(O,ve),e(j,ge),e(j,B),e(B,we),e(j,ie),g(T,ne,C),g(T,J,C),e(J,I),e(I,pe),e(I,H),e(H,_e),e(I,he),e(I,Q),e(Q,Me),e(J,ye),e(J,U),e(U,Ee),e(U,Y),e(Y,se),e(U,me),e(U,K),e(K,$e),e(J,ue),e(J,G),e(G,Fe),e(G,q),e(q,je),g(T,ee,C),g(T,W,C),e(W,xe),e(W,N),e(N,Ce),e(W,ze)},d(T){T&&t(d),T&&t(i),T&&t(h),T&&t(te),T&&t(j),T&&t(ne),T&&t(J),T&&t(ee),T&&t(W)}}}function jI(F){let d,b,u,f,_;return{c(){d=o("p"),b=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(i){d=n(i,"P",{});var h=a(d);b=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var x=a(u);f=l(x,"Module"),x.forEach(t),_=l(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(i,h){g(i,d,h),e(d,b),e(d,u),e(u,f),e(d,_)},d(i){i&&t(d)}}}function xI(F){let d,b,u,f,_;return f=new Ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkVsZWN0cmFGb3JNYXNrZWRMTSUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZWxlY3RyYS1zbWFsbC1nZW5lcmF0b3IlMjIpJTBBbW9kZWwlMjAlM0QlMjBURkVsZWN0cmFGb3JNYXNrZWRMTS5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZWxlY3RyYS1zbWFsbC1nZW5lcmF0b3IlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMlRoZSUyMGNhcGl0YWwlMjBvZiUyMEZyYW5jZSUyMGlzJTIwJTVCTUFTSyU1RC4lMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQWxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjByZXRyaWV2ZSUyMGluZGV4JTIwb2YlMjAlNUJNQVNLJTVEJTBBbWFza190b2tlbl9pbmRleCUyMCUzRCUyMHRmLndoZXJlKChpbnB1dHMuaW5wdXRfaWRzJTIwJTNEJTNEJTIwdG9rZW5pemVyLm1hc2tfdG9rZW5faWQpJTVCMCU1RCklMEFzZWxlY3RlZF9sb2dpdHMlMjAlM0QlMjB0Zi5nYXRoZXJfbmQobG9naXRzJTVCMCU1RCUyQyUyMGluZGljZXMlM0RtYXNrX3Rva2VuX2luZGV4KSUwQSUwQXByZWRpY3RlZF90b2tlbl9pZCUyMCUzRCUyMHRmLm1hdGguYXJnbWF4KHNlbGVjdGVkX2xvZ2l0cyUyQyUyMGF4aXMlM0QtMSklMEF0b2tlbml6ZXIuZGVjb2RlKHByZWRpY3RlZF90b2tlbl9pZCk=",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"),b=r("Example:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Example:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function CI(F){let d,b;return d=new Ne({props:{code:"bGFiZWxzJTIwJTNEJTIwdG9rZW5pemVyKCUyMlRoZSUyMGNhcGl0YWwlMjBvZiUyMEZyYW5jZSUyMGlzJTIwUGFyaXMuJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklNUIlMjJpbnB1dF9pZHMlMjIlNUQlMEElMjMlMjBtYXNrJTIwbGFiZWxzJTIwb2YlMjBub24tJTVCTUFTSyU1RCUyMHRva2VucyUwQWxhYmVscyUyMCUzRCUyMHRmLndoZXJlKGlucHV0cy5pbnB1dF9pZHMlMjAlM0QlM0QlMjB0b2tlbml6ZXIubWFza190b2tlbl9pZCUyQyUyMGxhYmVscyUyQyUyMC0xMDApJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzJTJDJTIwbGFiZWxzJTNEbGFiZWxzKSUwQXJvdW5kKGZsb2F0KG91dHB1dHMubG9zcyklMkMlMjAyKQ==",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(){k(d.$$.fragment)},l(u){v(d.$$.fragment,u)},m(u,f){w(d,u,f),b=!0},p:We,i(u){b||(M(d.$$.fragment,u),b=!0)},o(u){E(d.$$.fragment,u),b=!1},d(u){$(d,u)}}}function zI(F){let d,b,u,f,_,i,h,x,be,fe,R,de,te,j,Te,X,ce,Ze,D,ae,re,L,le,ke,O,ve,ge,B,we,ie,ne,J,I,pe,H,_e,he,Q,Me,ye,U,Ee,Y,se,me,K,$e,ue,G,Fe,q,je,ee,W,xe,N,Ce,ze;return{c(){d=o("p"),b=r("TensorFlow models and layers in "),u=o("code"),f=r("transformers"),_=r(" accept two formats as input:"),i=c(),h=o("ul"),x=o("li"),be=r("having all inputs as keyword arguments (like PyTorch models), or"),fe=c(),R=o("li"),de=r("having all inputs as a list, tuple or dict in the first positional argument."),te=c(),j=o("p"),Te=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 `),X=o("code"),ce=r("model.fit()"),Ze=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=o("code"),ae=r("model.fit()"),re=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),L=o("code"),le=r("fit()"),ke=r(" and "),O=o("code"),ve=r("predict()"),ge=r(`, such as when creating your own layers or models with
the Keras `),B=o("code"),we=r("Functional"),ie=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ne=c(),J=o("ul"),I=o("li"),pe=r("a single Tensor with "),H=o("code"),_e=r("input_ids"),he=r(" only and nothing else: "),Q=o("code"),Me=r("model(input_ids)"),ye=c(),U=o("li"),Ee=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Y=o("code"),se=r("model([input_ids, attention_mask])"),me=r(" or "),K=o("code"),$e=r("model([input_ids, attention_mask, token_type_ids])"),ue=c(),G=o("li"),Fe=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),q=o("code"),je=r('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ee=c(),W=o("p"),xe=r(`Note that when creating models and layers with
`),N=o("a"),Ce=r("subclassing"),ze=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(T){d=n(T,"P",{});var C=a(d);b=l(C,"TensorFlow models and layers in "),u=n(C,"CODE",{});var Xe=a(u);f=l(Xe,"transformers"),Xe.forEach(t),_=l(C," accept two formats as input:"),C.forEach(t),i=p(T),h=n(T,"UL",{});var oe=a(h);x=n(oe,"LI",{});var Je=a(x);be=l(Je,"having all inputs as keyword arguments (like PyTorch models), or"),Je.forEach(t),fe=p(oe),R=n(oe,"LI",{});var Le=a(R);de=l(Le,"having all inputs as a list, tuple or dict in the first positional argument."),Le.forEach(t),oe.forEach(t),te=p(T),j=n(T,"P",{});var z=a(j);Te=l(z,`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 `),X=n(z,"CODE",{});var Oe=a(X);ce=l(Oe,"model.fit()"),Oe.forEach(t),Ze=l(z,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=n(z,"CODE",{});var Qe=a(D);ae=l(Qe,"model.fit()"),Qe.forEach(t),re=l(z,` supports! If, however, you want to use the second
format outside of Keras methods like `),L=n(z,"CODE",{});var Re=a(L);le=l(Re,"fit()"),Re.forEach(t),ke=l(z," and "),O=n(z,"CODE",{});var De=a(O);ve=l(De,"predict()"),De.forEach(t),ge=l(z,`, such as when creating your own layers or models with
the Keras `),B=n(z,"CODE",{});var Ye=a(B);we=l(Ye,"Functional"),Ye.forEach(t),ie=l(z,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),z.forEach(t),ne=p(T),J=n(T,"UL",{});var A=a(J);I=n(A,"LI",{});var P=a(I);pe=l(P,"a single Tensor with "),H=n(P,"CODE",{});var Ge=a(H);_e=l(Ge,"input_ids"),Ge.forEach(t),he=l(P," only and nothing else: "),Q=n(P,"CODE",{});var Pe=a(Q);Me=l(Pe,"model(input_ids)"),Pe.forEach(t),P.forEach(t),ye=p(A),U=n(A,"LI",{});var S=a(U);Ee=l(S,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Y=n(S,"CODE",{});var He=a(Y);se=l(He,"model([input_ids, attention_mask])"),He.forEach(t),me=l(S," or "),K=n(S,"CODE",{});var Ve=a(K);$e=l(Ve,"model([input_ids, attention_mask, token_type_ids])"),Ve.forEach(t),S.forEach(t),ue=p(A),G=n(A,"LI",{});var Ue=a(G);Fe=l(Ue,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),q=n(Ue,"CODE",{});var Se=a(q);je=l(Se,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Se.forEach(t),Ue.forEach(t),A.forEach(t),ee=p(T),W=n(T,"P",{});var V=a(W);xe=l(V,`Note that when creating models and layers with
`),N=n(V,"A",{href:!0,rel:!0});var Be=a(N);Ce=l(Be,"subclassing"),Be.forEach(t),ze=l(V,` 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!`),V.forEach(t),this.h()},h(){m(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(N,"rel","nofollow")},m(T,C){g(T,d,C),e(d,b),e(d,u),e(u,f),e(d,_),g(T,i,C),g(T,h,C),e(h,x),e(x,be),e(h,fe),e(h,R),e(R,de),g(T,te,C),g(T,j,C),e(j,Te),e(j,X),e(X,ce),e(j,Ze),e(j,D),e(D,ae),e(j,re),e(j,L),e(L,le),e(j,ke),e(j,O),e(O,ve),e(j,ge),e(j,B),e(B,we),e(j,ie),g(T,ne,C),g(T,J,C),e(J,I),e(I,pe),e(I,H),e(H,_e),e(I,he),e(I,Q),e(Q,Me),e(J,ye),e(J,U),e(U,Ee),e(U,Y),e(Y,se),e(U,me),e(U,K),e(K,$e),e(J,ue),e(J,G),e(G,Fe),e(G,q),e(q,je),g(T,ee,C),g(T,W,C),e(W,xe),e(W,N),e(N,Ce),e(W,ze)},d(T){T&&t(d),T&&t(i),T&&t(h),T&&t(te),T&&t(j),T&&t(ne),T&&t(J),T&&t(ee),T&&t(W)}}}function JI(F){let d,b,u,f,_;return{c(){d=o("p"),b=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(i){d=n(i,"P",{});var h=a(d);b=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var x=a(u);f=l(x,"Module"),x.forEach(t),_=l(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(i,h){g(i,d,h),e(d,b),e(d,u),e(u,f),e(d,_)},d(i){i&&t(d)}}}function UI(F){let d,b,u,f,_;return f=new Ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkVsZWN0cmFGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBaW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJiaGFkcmVzaC1zYXZhbmklMkZlbGVjdHJhLWJhc2UtZW1vdGlvbiUyMiklMEFtb2RlbCUyMCUzRCUyMFRGRWxlY3RyYUZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmJoYWRyZXNoLXNhdmFuaSUyRmVsZWN0cmEtYmFzZS1lbW90aW9uJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEElMEFsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX2NsYXNzX2lkJTIwJTNEJTIwaW50KHRmLm1hdGguYXJnbWF4KGxvZ2l0cyUyQyUyMGF4aXMlM0QtMSklNUIwJTVEKSUwQW1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9jbGFzc19pZCU1RA==",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"),b=r("Example:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Example:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function II(F){let d,b;return d=new Ne({props:{code:"JTIzJTIwVG8lMjB0cmFpbiUyMGElMjBtb2RlbCUyMG9uJTIwJTYwbnVtX2xhYmVscyU2MCUyMGNsYXNzZXMlMkMlMjB5b3UlMjBjYW4lMjBwYXNzJTIwJTYwbnVtX2xhYmVscyUzRG51bV9sYWJlbHMlNjAlMjB0byUyMCU2MC5mcm9tX3ByZXRyYWluZWQoLi4uKSU2MCUwQW51bV9sYWJlbHMlMjAlM0QlMjBsZW4obW9kZWwuY29uZmlnLmlkMmxhYmVsKSUwQW1vZGVsJTIwJTNEJTIwVEZFbGVjdHJhRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyYmhhZHJlc2gtc2F2YW5pJTJGZWxlY3RyYS1iYXNlLWVtb3Rpb24lMjIlMkMlMjBudW1fbGFiZWxzJTNEbnVtX2xhYmVscyklMEElMEFsYWJlbHMlMjAlM0QlMjB0Zi5jb25zdGFudCgxKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcyUwQXJvdW5kKGZsb2F0KGxvc3MpJTJDJTIwMik=",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(){k(d.$$.fragment)},l(u){v(d.$$.fragment,u)},m(u,f){w(d,u,f),b=!0},p:We,i(u){b||(M(d.$$.fragment,u),b=!0)},o(u){E(d.$$.fragment,u),b=!1},d(u){$(d,u)}}}function WI(F){let d,b,u,f,_,i,h,x,be,fe,R,de,te,j,Te,X,ce,Ze,D,ae,re,L,le,ke,O,ve,ge,B,we,ie,ne,J,I,pe,H,_e,he,Q,Me,ye,U,Ee,Y,se,me,K,$e,ue,G,Fe,q,je,ee,W,xe,N,Ce,ze;return{c(){d=o("p"),b=r("TensorFlow models and layers in "),u=o("code"),f=r("transformers"),_=r(" accept two formats as input:"),i=c(),h=o("ul"),x=o("li"),be=r("having all inputs as keyword arguments (like PyTorch models), or"),fe=c(),R=o("li"),de=r("having all inputs as a list, tuple or dict in the first positional argument."),te=c(),j=o("p"),Te=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 `),X=o("code"),ce=r("model.fit()"),Ze=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=o("code"),ae=r("model.fit()"),re=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),L=o("code"),le=r("fit()"),ke=r(" and "),O=o("code"),ve=r("predict()"),ge=r(`, such as when creating your own layers or models with
the Keras `),B=o("code"),we=r("Functional"),ie=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ne=c(),J=o("ul"),I=o("li"),pe=r("a single Tensor with "),H=o("code"),_e=r("input_ids"),he=r(" only and nothing else: "),Q=o("code"),Me=r("model(input_ids)"),ye=c(),U=o("li"),Ee=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Y=o("code"),se=r("model([input_ids, attention_mask])"),me=r(" or "),K=o("code"),$e=r("model([input_ids, attention_mask, token_type_ids])"),ue=c(),G=o("li"),Fe=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),q=o("code"),je=r('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ee=c(),W=o("p"),xe=r(`Note that when creating models and layers with
`),N=o("a"),Ce=r("subclassing"),ze=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(T){d=n(T,"P",{});var C=a(d);b=l(C,"TensorFlow models and layers in "),u=n(C,"CODE",{});var Xe=a(u);f=l(Xe,"transformers"),Xe.forEach(t),_=l(C," accept two formats as input:"),C.forEach(t),i=p(T),h=n(T,"UL",{});var oe=a(h);x=n(oe,"LI",{});var Je=a(x);be=l(Je,"having all inputs as keyword arguments (like PyTorch models), or"),Je.forEach(t),fe=p(oe),R=n(oe,"LI",{});var Le=a(R);de=l(Le,"having all inputs as a list, tuple or dict in the first positional argument."),Le.forEach(t),oe.forEach(t),te=p(T),j=n(T,"P",{});var z=a(j);Te=l(z,`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 `),X=n(z,"CODE",{});var Oe=a(X);ce=l(Oe,"model.fit()"),Oe.forEach(t),Ze=l(z,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=n(z,"CODE",{});var Qe=a(D);ae=l(Qe,"model.fit()"),Qe.forEach(t),re=l(z,` supports! If, however, you want to use the second
format outside of Keras methods like `),L=n(z,"CODE",{});var Re=a(L);le=l(Re,"fit()"),Re.forEach(t),ke=l(z," and "),O=n(z,"CODE",{});var De=a(O);ve=l(De,"predict()"),De.forEach(t),ge=l(z,`, such as when creating your own layers or models with
the Keras `),B=n(z,"CODE",{});var Ye=a(B);we=l(Ye,"Functional"),Ye.forEach(t),ie=l(z,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),z.forEach(t),ne=p(T),J=n(T,"UL",{});var A=a(J);I=n(A,"LI",{});var P=a(I);pe=l(P,"a single Tensor with "),H=n(P,"CODE",{});var Ge=a(H);_e=l(Ge,"input_ids"),Ge.forEach(t),he=l(P," only and nothing else: "),Q=n(P,"CODE",{});var Pe=a(Q);Me=l(Pe,"model(input_ids)"),Pe.forEach(t),P.forEach(t),ye=p(A),U=n(A,"LI",{});var S=a(U);Ee=l(S,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Y=n(S,"CODE",{});var He=a(Y);se=l(He,"model([input_ids, attention_mask])"),He.forEach(t),me=l(S," or "),K=n(S,"CODE",{});var Ve=a(K);$e=l(Ve,"model([input_ids, attention_mask, token_type_ids])"),Ve.forEach(t),S.forEach(t),ue=p(A),G=n(A,"LI",{});var Ue=a(G);Fe=l(Ue,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),q=n(Ue,"CODE",{});var Se=a(q);je=l(Se,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Se.forEach(t),Ue.forEach(t),A.forEach(t),ee=p(T),W=n(T,"P",{});var V=a(W);xe=l(V,`Note that when creating models and layers with
`),N=n(V,"A",{href:!0,rel:!0});var Be=a(N);Ce=l(Be,"subclassing"),Be.forEach(t),ze=l(V,` 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!`),V.forEach(t),this.h()},h(){m(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(N,"rel","nofollow")},m(T,C){g(T,d,C),e(d,b),e(d,u),e(u,f),e(d,_),g(T,i,C),g(T,h,C),e(h,x),e(x,be),e(h,fe),e(h,R),e(R,de),g(T,te,C),g(T,j,C),e(j,Te),e(j,X),e(X,ce),e(j,Ze),e(j,D),e(D,ae),e(j,re),e(j,L),e(L,le),e(j,ke),e(j,O),e(O,ve),e(j,ge),e(j,B),e(B,we),e(j,ie),g(T,ne,C),g(T,J,C),e(J,I),e(I,pe),e(I,H),e(H,_e),e(I,he),e(I,Q),e(Q,Me),e(J,ye),e(J,U),e(U,Ee),e(U,Y),e(Y,se),e(U,me),e(U,K),e(K,$e),e(J,ue),e(J,G),e(G,Fe),e(G,q),e(q,je),g(T,ee,C),g(T,W,C),e(W,xe),e(W,N),e(N,Ce),e(W,ze)},d(T){T&&t(d),T&&t(i),T&&t(h),T&&t(te),T&&t(j),T&&t(ne),T&&t(J),T&&t(ee),T&&t(W)}}}function NI(F){let d,b,u,f,_;return{c(){d=o("p"),b=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(i){d=n(i,"P",{});var h=a(d);b=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var x=a(u);f=l(x,"Module"),x.forEach(t),_=l(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(i,h){g(i,d,h),e(d,b),e(d,u),e(u,f),e(d,_)},d(i){i&&t(d)}}}function ZI(F){let d,b,u,f,_;return f=new Ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkVsZWN0cmFGb3JNdWx0aXBsZUNob2ljZSUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZWxlY3RyYS1zbWFsbC1kaXNjcmltaW5hdG9yJTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZFbGVjdHJhRm9yTXVsdGlwbGVDaG9pY2UuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmVsZWN0cmEtc21hbGwtZGlzY3JpbWluYXRvciUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJJbiUyMEl0YWx5JTJDJTIwcGl6emElMjBzZXJ2ZWQlMjBpbiUyMGZvcm1hbCUyMHNldHRpbmdzJTJDJTIwc3VjaCUyMGFzJTIwYXQlMjBhJTIwcmVzdGF1cmFudCUyQyUyMGlzJTIwcHJlc2VudGVkJTIwdW5zbGljZWQuJTIyJTBBY2hvaWNlMCUyMCUzRCUyMCUyMkl0JTIwaXMlMjBlYXRlbiUyMHdpdGglMjBhJTIwZm9yayUyMGFuZCUyMGElMjBrbmlmZS4lMjIlMEFjaG9pY2UxJTIwJTNEJTIwJTIySXQlMjBpcyUyMGVhdGVuJTIwd2hpbGUlMjBoZWxkJTIwaW4lMjB0aGUlMjBoYW5kLiUyMiUwQSUwQWVuY29kaW5nJTIwJTNEJTIwdG9rZW5pemVyKCU1QnByb21wdCUyQyUyMHByb21wdCU1RCUyQyUyMCU1QmNob2ljZTAlMkMlMjBjaG9pY2UxJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiUyQyUyMHBhZGRpbmclM0RUcnVlKSUwQWlucHV0cyUyMCUzRCUyMCU3QmslM0ElMjB0Zi5leHBhbmRfZGltcyh2JTJDJTIwMCklMjBmb3IlMjBrJTJDJTIwdiUyMGluJTIwZW5jb2RpbmcuaXRlbXMoKSU3RCUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbChpbnB1dHMpJTIwJTIwJTIzJTIwYmF0Y2glMjBzaXplJTIwaXMlMjAxJTBBJTBBJTIzJTIwdGhlJTIwbGluZWFyJTIwY2xhc3NpZmllciUyMHN0aWxsJTIwbmVlZHMlMjB0byUyMGJlJTIwdHJhaW5lZCUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRz",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"),b=r("Example:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Example:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function qI(F){let d,b,u,f,_,i,h,x,be,fe,R,de,te,j,Te,X,ce,Ze,D,ae,re,L,le,ke,O,ve,ge,B,we,ie,ne,J,I,pe,H,_e,he,Q,Me,ye,U,Ee,Y,se,me,K,$e,ue,G,Fe,q,je,ee,W,xe,N,Ce,ze;return{c(){d=o("p"),b=r("TensorFlow models and layers in "),u=o("code"),f=r("transformers"),_=r(" accept two formats as input:"),i=c(),h=o("ul"),x=o("li"),be=r("having all inputs as keyword arguments (like PyTorch models), or"),fe=c(),R=o("li"),de=r("having all inputs as a list, tuple or dict in the first positional argument."),te=c(),j=o("p"),Te=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 `),X=o("code"),ce=r("model.fit()"),Ze=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=o("code"),ae=r("model.fit()"),re=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),L=o("code"),le=r("fit()"),ke=r(" and "),O=o("code"),ve=r("predict()"),ge=r(`, such as when creating your own layers or models with
the Keras `),B=o("code"),we=r("Functional"),ie=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ne=c(),J=o("ul"),I=o("li"),pe=r("a single Tensor with "),H=o("code"),_e=r("input_ids"),he=r(" only and nothing else: "),Q=o("code"),Me=r("model(input_ids)"),ye=c(),U=o("li"),Ee=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Y=o("code"),se=r("model([input_ids, attention_mask])"),me=r(" or "),K=o("code"),$e=r("model([input_ids, attention_mask, token_type_ids])"),ue=c(),G=o("li"),Fe=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),q=o("code"),je=r('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ee=c(),W=o("p"),xe=r(`Note that when creating models and layers with
`),N=o("a"),Ce=r("subclassing"),ze=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(T){d=n(T,"P",{});var C=a(d);b=l(C,"TensorFlow models and layers in "),u=n(C,"CODE",{});var Xe=a(u);f=l(Xe,"transformers"),Xe.forEach(t),_=l(C," accept two formats as input:"),C.forEach(t),i=p(T),h=n(T,"UL",{});var oe=a(h);x=n(oe,"LI",{});var Je=a(x);be=l(Je,"having all inputs as keyword arguments (like PyTorch models), or"),Je.forEach(t),fe=p(oe),R=n(oe,"LI",{});var Le=a(R);de=l(Le,"having all inputs as a list, tuple or dict in the first positional argument."),Le.forEach(t),oe.forEach(t),te=p(T),j=n(T,"P",{});var z=a(j);Te=l(z,`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 `),X=n(z,"CODE",{});var Oe=a(X);ce=l(Oe,"model.fit()"),Oe.forEach(t),Ze=l(z,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=n(z,"CODE",{});var Qe=a(D);ae=l(Qe,"model.fit()"),Qe.forEach(t),re=l(z,` supports! If, however, you want to use the second
format outside of Keras methods like `),L=n(z,"CODE",{});var Re=a(L);le=l(Re,"fit()"),Re.forEach(t),ke=l(z," and "),O=n(z,"CODE",{});var De=a(O);ve=l(De,"predict()"),De.forEach(t),ge=l(z,`, such as when creating your own layers or models with
the Keras `),B=n(z,"CODE",{});var Ye=a(B);we=l(Ye,"Functional"),Ye.forEach(t),ie=l(z,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),z.forEach(t),ne=p(T),J=n(T,"UL",{});var A=a(J);I=n(A,"LI",{});var P=a(I);pe=l(P,"a single Tensor with "),H=n(P,"CODE",{});var Ge=a(H);_e=l(Ge,"input_ids"),Ge.forEach(t),he=l(P," only and nothing else: "),Q=n(P,"CODE",{});var Pe=a(Q);Me=l(Pe,"model(input_ids)"),Pe.forEach(t),P.forEach(t),ye=p(A),U=n(A,"LI",{});var S=a(U);Ee=l(S,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Y=n(S,"CODE",{});var He=a(Y);se=l(He,"model([input_ids, attention_mask])"),He.forEach(t),me=l(S," or "),K=n(S,"CODE",{});var Ve=a(K);$e=l(Ve,"model([input_ids, attention_mask, token_type_ids])"),Ve.forEach(t),S.forEach(t),ue=p(A),G=n(A,"LI",{});var Ue=a(G);Fe=l(Ue,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),q=n(Ue,"CODE",{});var Se=a(q);je=l(Se,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Se.forEach(t),Ue.forEach(t),A.forEach(t),ee=p(T),W=n(T,"P",{});var V=a(W);xe=l(V,`Note that when creating models and layers with
`),N=n(V,"A",{href:!0,rel:!0});var Be=a(N);Ce=l(Be,"subclassing"),Be.forEach(t),ze=l(V,` 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!`),V.forEach(t),this.h()},h(){m(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(N,"rel","nofollow")},m(T,C){g(T,d,C),e(d,b),e(d,u),e(u,f),e(d,_),g(T,i,C),g(T,h,C),e(h,x),e(x,be),e(h,fe),e(h,R),e(R,de),g(T,te,C),g(T,j,C),e(j,Te),e(j,X),e(X,ce),e(j,Ze),e(j,D),e(D,ae),e(j,re),e(j,L),e(L,le),e(j,ke),e(j,O),e(O,ve),e(j,ge),e(j,B),e(B,we),e(j,ie),g(T,ne,C),g(T,J,C),e(J,I),e(I,pe),e(I,H),e(H,_e),e(I,he),e(I,Q),e(Q,Me),e(J,ye),e(J,U),e(U,Ee),e(U,Y),e(Y,se),e(U,me),e(U,K),e(K,$e),e(J,ue),e(J,G),e(G,Fe),e(G,q),e(q,je),g(T,ee,C),g(T,W,C),e(W,xe),e(W,N),e(N,Ce),e(W,ze)},d(T){T&&t(d),T&&t(i),T&&t(h),T&&t(te),T&&t(j),T&&t(ne),T&&t(J),T&&t(ee),T&&t(W)}}}function AI(F){let d,b,u,f,_;return{c(){d=o("p"),b=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(i){d=n(i,"P",{});var h=a(d);b=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var x=a(u);f=l(x,"Module"),x.forEach(t),_=l(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(i,h){g(i,d,h),e(d,b),e(d,u),e(u,f),e(d,_)},d(i){i&&t(d)}}}function GI(F){let d,b,u,f,_;return f=new Ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkVsZWN0cmFGb3JUb2tlbkNsYXNzaWZpY2F0aW9uJTBBaW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJiaGFkcmVzaC1zYXZhbmklMkZlbGVjdHJhLWJhc2UtZGlzY3JpbWluYXRvci1maW5ldHVuZWQtY29ubGwwMy1lbmdsaXNoJTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZFbGVjdHJhRm9yVG9rZW5DbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyYmhhZHJlc2gtc2F2YW5pJTJGZWxlY3RyYS1iYXNlLWRpc2NyaW1pbmF0b3ItZmluZXR1bmVkLWNvbmxsMDMtZW5nbGlzaCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTBBJTIwJTIwJTIwJTIwJTIySHVnZ2luZ0ZhY2UlMjBpcyUyMGElMjBjb21wYW55JTIwYmFzZWQlMjBpbiUyMFBhcmlzJTIwYW5kJTIwTmV3JTIwWW9yayUyMiUyQyUyMGFkZF9zcGVjaWFsX3Rva2VucyUzREZhbHNlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiUwQSklMEElMEFsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyUyMCUzRCUyMHRmLm1hdGguYXJnbWF4KGxvZ2l0cyUyQyUyMGF4aXMlM0QtMSklMEElMEElMjMlMjBOb3RlJTIwdGhhdCUyMHRva2VucyUyMGFyZSUyMGNsYXNzaWZpZWQlMjByYXRoZXIlMjB0aGVuJTIwaW5wdXQlMjB3b3JkcyUyMHdoaWNoJTIwbWVhbnMlMjB0aGF0JTBBJTIzJTIwdGhlcmUlMjBtaWdodCUyMGJlJTIwbW9yZSUyMHByZWRpY3RlZCUyMHRva2VuJTIwY2xhc3NlcyUyMHRoYW4lMjB3b3Jkcy4lMEElMjMlMjBNdWx0aXBsZSUyMHRva2VuJTIwY2xhc3NlcyUyMG1pZ2h0JTIwYWNjb3VudCUyMGZvciUyMHRoZSUyMHNhbWUlMjB3b3JkJTBBcHJlZGljdGVkX3Rva2Vuc19jbGFzc2VzJTIwJTNEJTIwJTVCbW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCdCU1RCUyMGZvciUyMHQlMjBpbiUyMHByZWRpY3RlZF90b2tlbl9jbGFzc19pZHMlNUIwJTVELm51bXB5KCkudG9saXN0KCklNUQlMEFwcmVkaWN0ZWRfdG9rZW5zX2NsYXNzZXM=",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"),b=r("Example:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Example:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function RI(F){let d,b;return d=new Ne({props:{code:"bGFiZWxzJTIwJTNEJTIwcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyUwQWxvc3MlMjAlM0QlMjB0Zi5tYXRoLnJlZHVjZV9tZWFuKG1vZGVsKCoqaW5wdXRzJTJDJTIwbGFiZWxzJTNEbGFiZWxzKS5sb3NzKSUwQXJvdW5kKGZsb2F0KGxvc3MpJTJDJTIwMik=",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(){k(d.$$.fragment)},l(u){v(d.$$.fragment,u)},m(u,f){w(d,u,f),b=!0},p:We,i(u){b||(M(d.$$.fragment,u),b=!0)},o(u){E(d.$$.fragment,u),b=!1},d(u){$(d,u)}}}function PI(F){let d,b,u,f,_,i,h,x,be,fe,R,de,te,j,Te,X,ce,Ze,D,ae,re,L,le,ke,O,ve,ge,B,we,ie,ne,J,I,pe,H,_e,he,Q,Me,ye,U,Ee,Y,se,me,K,$e,ue,G,Fe,q,je,ee,W,xe,N,Ce,ze;return{c(){d=o("p"),b=r("TensorFlow models and layers in "),u=o("code"),f=r("transformers"),_=r(" accept two formats as input:"),i=c(),h=o("ul"),x=o("li"),be=r("having all inputs as keyword arguments (like PyTorch models), or"),fe=c(),R=o("li"),de=r("having all inputs as a list, tuple or dict in the first positional argument."),te=c(),j=o("p"),Te=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 `),X=o("code"),ce=r("model.fit()"),Ze=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=o("code"),ae=r("model.fit()"),re=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),L=o("code"),le=r("fit()"),ke=r(" and "),O=o("code"),ve=r("predict()"),ge=r(`, such as when creating your own layers or models with
the Keras `),B=o("code"),we=r("Functional"),ie=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ne=c(),J=o("ul"),I=o("li"),pe=r("a single Tensor with "),H=o("code"),_e=r("input_ids"),he=r(" only and nothing else: "),Q=o("code"),Me=r("model(input_ids)"),ye=c(),U=o("li"),Ee=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Y=o("code"),se=r("model([input_ids, attention_mask])"),me=r(" or "),K=o("code"),$e=r("model([input_ids, attention_mask, token_type_ids])"),ue=c(),G=o("li"),Fe=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),q=o("code"),je=r('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ee=c(),W=o("p"),xe=r(`Note that when creating models and layers with
`),N=o("a"),Ce=r("subclassing"),ze=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(T){d=n(T,"P",{});var C=a(d);b=l(C,"TensorFlow models and layers in "),u=n(C,"CODE",{});var Xe=a(u);f=l(Xe,"transformers"),Xe.forEach(t),_=l(C," accept two formats as input:"),C.forEach(t),i=p(T),h=n(T,"UL",{});var oe=a(h);x=n(oe,"LI",{});var Je=a(x);be=l(Je,"having all inputs as keyword arguments (like PyTorch models), or"),Je.forEach(t),fe=p(oe),R=n(oe,"LI",{});var Le=a(R);de=l(Le,"having all inputs as a list, tuple or dict in the first positional argument."),Le.forEach(t),oe.forEach(t),te=p(T),j=n(T,"P",{});var z=a(j);Te=l(z,`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 `),X=n(z,"CODE",{});var Oe=a(X);ce=l(Oe,"model.fit()"),Oe.forEach(t),Ze=l(z,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),D=n(z,"CODE",{});var Qe=a(D);ae=l(Qe,"model.fit()"),Qe.forEach(t),re=l(z,` supports! If, however, you want to use the second
format outside of Keras methods like `),L=n(z,"CODE",{});var Re=a(L);le=l(Re,"fit()"),Re.forEach(t),ke=l(z," and "),O=n(z,"CODE",{});var De=a(O);ve=l(De,"predict()"),De.forEach(t),ge=l(z,`, such as when creating your own layers or models with
the Keras `),B=n(z,"CODE",{});var Ye=a(B);we=l(Ye,"Functional"),Ye.forEach(t),ie=l(z,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),z.forEach(t),ne=p(T),J=n(T,"UL",{});var A=a(J);I=n(A,"LI",{});var P=a(I);pe=l(P,"a single Tensor with "),H=n(P,"CODE",{});var Ge=a(H);_e=l(Ge,"input_ids"),Ge.forEach(t),he=l(P," only and nothing else: "),Q=n(P,"CODE",{});var Pe=a(Q);Me=l(Pe,"model(input_ids)"),Pe.forEach(t),P.forEach(t),ye=p(A),U=n(A,"LI",{});var S=a(U);Ee=l(S,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Y=n(S,"CODE",{});var He=a(Y);se=l(He,"model([input_ids, attention_mask])"),He.forEach(t),me=l(S," or "),K=n(S,"CODE",{});var Ve=a(K);$e=l(Ve,"model([input_ids, attention_mask, token_type_ids])"),Ve.forEach(t),S.forEach(t),ue=p(A),G=n(A,"LI",{});var Ue=a(G);Fe=l(Ue,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),q=n(Ue,"CODE",{});var Se=a(q);je=l(Se,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Se.forEach(t),Ue.forEach(t),A.forEach(t),ee=p(T),W=n(T,"P",{});var V=a(W);xe=l(V,`Note that when creating models and layers with
`),N=n(V,"A",{href:!0,rel:!0});var Be=a(N);Ce=l(Be,"subclassing"),Be.forEach(t),ze=l(V,` 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!`),V.forEach(t),this.h()},h(){m(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(N,"rel","nofollow")},m(T,C){g(T,d,C),e(d,b),e(d,u),e(u,f),e(d,_),g(T,i,C),g(T,h,C),e(h,x),e(x,be),e(h,fe),e(h,R),e(R,de),g(T,te,C),g(T,j,C),e(j,Te),e(j,X),e(X,ce),e(j,Ze),e(j,D),e(D,ae),e(j,re),e(j,L),e(L,le),e(j,ke),e(j,O),e(O,ve),e(j,ge),e(j,B),e(B,we),e(j,ie),g(T,ne,C),g(T,J,C),e(J,I),e(I,pe),e(I,H),e(H,_e),e(I,he),e(I,Q),e(Q,Me),e(J,ye),e(J,U),e(U,Ee),e(U,Y),e(Y,se),e(U,me),e(U,K),e(K,$e),e(J,ue),e(J,G),e(G,Fe),e(G,q),e(q,je),g(T,ee,C),g(T,W,C),e(W,xe),e(W,N),e(N,Ce),e(W,ze)},d(T){T&&t(d),T&&t(i),T&&t(h),T&&t(te),T&&t(j),T&&t(ne),T&&t(J),T&&t(ee),T&&t(W)}}}function VI(F){let d,b,u,f,_;return{c(){d=o("p"),b=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(i){d=n(i,"P",{});var h=a(d);b=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var x=a(u);f=l(x,"Module"),x.forEach(t),_=l(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(i,h){g(i,d,h),e(d,b),e(d,u),e(u,f),e(d,_)},d(i){i&&t(d)}}}function BI(F){let d,b,u,f,_;return f=new Ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkVsZWN0cmFGb3JRdWVzdGlvbkFuc3dlcmluZyUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyYmhhZHJlc2gtc2F2YW5pJTJGZWxlY3RyYS1iYXNlLXNxdWFkMiUyMiklMEFtb2RlbCUyMCUzRCUyMFRGRWxlY3RyYUZvclF1ZXN0aW9uQW5zd2VyaW5nLmZyb21fcHJldHJhaW5lZCglMjJiaGFkcmVzaC1zYXZhbmklMkZlbGVjdHJhLWJhc2Utc3F1YWQyJTIyKSUwQSUwQXF1ZXN0aW9uJTJDJTIwdGV4dCUyMCUzRCUyMCUyMldobyUyMHdhcyUyMEppbSUyMEhlbnNvbiUzRiUyMiUyQyUyMCUyMkppbSUyMEhlbnNvbiUyMHdhcyUyMGElMjBuaWNlJTIwcHVwcGV0JTIyJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHF1ZXN0aW9uJTJDJTIwdGV4dCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWFuc3dlcl9zdGFydF9pbmRleCUyMCUzRCUyMGludCh0Zi5tYXRoLmFyZ21heChvdXRwdXRzLnN0YXJ0X2xvZ2l0cyUyQyUyMGF4aXMlM0QtMSklNUIwJTVEKSUwQWFuc3dlcl9lbmRfaW5kZXglMjAlM0QlMjBpbnQodGYubWF0aC5hcmdtYXgob3V0cHV0cy5lbmRfbG9naXRzJTJDJTIwYXhpcyUzRC0xKSU1QjAlNUQpJTBBJTBBcHJlZGljdF9hbnN3ZXJfdG9rZW5zJTIwJTNEJTIwaW5wdXRzLmlucHV0X2lkcyU1QjAlMkMlMjBhbnN3ZXJfc3RhcnRfaW5kZXglMjAlM0ElMjBhbnN3ZXJfZW5kX2luZGV4JTIwJTJCJTIwMSU1RCUwQXRva2VuaXplci5kZWNvZGUocHJlZGljdF9hbnN3ZXJfdG9rZW5zKQ==",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"),b=r("Example:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Example:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function SI(F){let d,b;return d=new Ne({props:{code:"JTIzJTIwdGFyZ2V0JTIwaXMlMjAlMjJuaWNlJTIwcHVwcGV0JTIyJTBBdGFyZ2V0X3N0YXJ0X2luZGV4JTIwJTNEJTIwdGYuY29uc3RhbnQoJTVCMTElNUQpJTBBdGFyZ2V0X2VuZF9pbmRleCUyMCUzRCUyMHRmLmNvbnN0YW50KCU1QjEyJTVEKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMHN0YXJ0X3Bvc2l0aW9ucyUzRHRhcmdldF9zdGFydF9pbmRleCUyQyUyMGVuZF9wb3NpdGlvbnMlM0R0YXJnZXRfZW5kX2luZGV4KSUwQWxvc3MlMjAlM0QlMjB0Zi5tYXRoLnJlZHVjZV9tZWFuKG91dHB1dHMubG9zcyklMEFyb3VuZChmbG9hdChsb3NzKSUyQyUyMDIp",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(){k(d.$$.fragment)},l(u){v(d.$$.fragment,u)},m(u,f){w(d,u,f),b=!0},p:We,i(u){b||(M(d.$$.fragment,u),b=!0)},o(u){E(d.$$.fragment,u),b=!1},d(u){$(d,u)}}}function XI(F){let d,b,u,f,_;return{c(){d=o("p"),b=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(i){d=n(i,"P",{});var h=a(d);b=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var x=a(u);f=l(x,"Module"),x.forEach(t),_=l(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(i,h){g(i,d,h),e(d,b),e(d,u),e(u,f),e(d,_)},d(i){i&&t(d)}}}function LI(F){let d,b,u,f,_;return f=new Ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4RWxlY3RyYU1vZGVsJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZWxlY3RyYS1zbWFsbC1kaXNjcmltaW5hdG9yJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxheEVsZWN0cmFNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZWxlY3RyYS1zbWFsbC1kaXNjcmltaW5hdG9yJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJqYXglMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",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"),b=r("Example:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Example:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function OI(F){let d,b,u,f,_;return{c(){d=o("p"),b=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(i){d=n(i,"P",{});var h=a(d);b=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var x=a(u);f=l(x,"Module"),x.forEach(t),_=l(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(i,h){g(i,d,h),e(d,b),e(d,u),e(u,f),e(d,_)},d(i){i&&t(d)}}}function QI(F){let d,b,u,f,_;return f=new Ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4RWxlY3RyYUZvclByZVRyYWluaW5nJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZWxlY3RyYS1zbWFsbC1kaXNjcmltaW5hdG9yJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxheEVsZWN0cmFGb3JQcmVUcmFpbmluZy5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZWxlY3RyYS1zbWFsbC1kaXNjcmltaW5hdG9yJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJucCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBcHJlZGljdGlvbl9sb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",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"),b=r("Example:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Example:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function DI(F){let d,b,u,f,_;return{c(){d=o("p"),b=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(i){d=n(i,"P",{});var h=a(d);b=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var x=a(u);f=l(x,"Module"),x.forEach(t),_=l(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(i,h){g(i,d,h),e(d,b),e(d,u),e(u,f),e(d,_)},d(i){i&&t(d)}}}function YI(F){let d,b,u,f,_;return f=new Ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4RWxlY3RyYUZvckNhdXNhbExNJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZWxlY3RyYS1zbWFsbC1kaXNjcmltaW5hdG9yJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxheEVsZWN0cmFGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZWxlY3RyYS1zbWFsbC1kaXNjcmltaW5hdG9yJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJucCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBJTIzJTIwcmV0cmlldmUlMjBsb2d0cyUyMGZvciUyMG5leHQlMjB0b2tlbiUwQW5leHRfdG9rZW5fbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHMlNUIlM0ElMkMlMjAtMSU1RA==",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"),b=r("Example:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Example:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function HI(F){let d,b,u,f,_;return{c(){d=o("p"),b=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(i){d=n(i,"P",{});var h=a(d);b=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var x=a(u);f=l(x,"Module"),x.forEach(t),_=l(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(i,h){g(i,d,h),e(d,b),e(d,u),e(u,f),e(d,_)},d(i){i&&t(d)}}}function KI(F){let d,b,u,f,_;return f=new Ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4RWxlY3RyYUZvck1hc2tlZExNJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZWxlY3RyYS1zbWFsbC1kaXNjcmltaW5hdG9yJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxheEVsZWN0cmFGb3JNYXNrZWRMTS5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZWxlY3RyYS1zbWFsbC1kaXNjcmltaW5hdG9yJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJUaGUlMjBjYXBpdGFsJTIwb2YlMjBGcmFuY2UlMjBpcyUyMCU1Qk1BU0slNUQuJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJqYXglMjIpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRz",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"),b=r("Example:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Example:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function e3(F){let d,b,u,f,_;return{c(){d=o("p"),b=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(i){d=n(i,"P",{});var h=a(d);b=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var x=a(u);f=l(x,"Module"),x.forEach(t),_=l(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(i,h){g(i,d,h),e(d,b),e(d,u),e(u,f),e(d,_)},d(i){i&&t(d)}}}function t3(F){let d,b,u,f,_;return f=new Ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4RWxlY3RyYUZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZlbGVjdHJhLXNtYWxsLWRpc2NyaW1pbmF0b3IlMjIpJTBBbW9kZWwlMjAlM0QlMjBGbGF4RWxlY3RyYUZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmVsZWN0cmEtc21hbGwtZGlzY3JpbWluYXRvciUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIyamF4JTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",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"),b=r("Example:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Example:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function o3(F){let d,b,u,f,_;return{c(){d=o("p"),b=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(i){d=n(i,"P",{});var h=a(d);b=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var x=a(u);f=l(x,"Module"),x.forEach(t),_=l(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(i,h){g(i,d,h),e(d,b),e(d,u),e(u,f),e(d,_)},d(i){i&&t(d)}}}function n3(F){let d,b,u,f,_;return f=new Ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4RWxlY3RyYUZvck11bHRpcGxlQ2hvaWNlJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZWxlY3RyYS1zbWFsbC1kaXNjcmltaW5hdG9yJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxheEVsZWN0cmFGb3JNdWx0aXBsZUNob2ljZS5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZWxlY3RyYS1zbWFsbC1kaXNjcmltaW5hdG9yJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMkluJTIwSXRhbHklMkMlMjBwaXp6YSUyMHNlcnZlZCUyMGluJTIwZm9ybWFsJTIwc2V0dGluZ3MlMkMlMjBzdWNoJTIwYXMlMjBhdCUyMGElMjByZXN0YXVyYW50JTJDJTIwaXMlMjBwcmVzZW50ZWQlMjB1bnNsaWNlZC4lMjIlMEFjaG9pY2UwJTIwJTNEJTIwJTIySXQlMjBpcyUyMGVhdGVuJTIwd2l0aCUyMGElMjBmb3JrJTIwYW5kJTIwYSUyMGtuaWZlLiUyMiUwQWNob2ljZTElMjAlM0QlMjAlMjJJdCUyMGlzJTIwZWF0ZW4lMjB3aGlsZSUyMGhlbGQlMjBpbiUyMHRoZSUyMGhhbmQuJTIyJTBBJTBBZW5jb2RpbmclMjAlM0QlMjB0b2tlbml6ZXIoJTVCcHJvbXB0JTJDJTIwcHJvbXB0JTVEJTJDJTIwJTVCY2hvaWNlMCUyQyUyMGNob2ljZTElNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMmpheCUyMiUyQyUyMHBhZGRpbmclM0RUcnVlKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKiU3QmslM0ElMjB2JTVCTm9uZSUyQyUyMCUzQSU1RCUyMGZvciUyMGslMkMlMjB2JTIwaW4lMjBlbmNvZGluZy5pdGVtcygpJTdEKSUwQSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRz",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"),b=r("Example:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Example:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function s3(F){let d,b,u,f,_;return{c(){d=o("p"),b=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(i){d=n(i,"P",{});var h=a(d);b=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var x=a(u);f=l(x,"Module"),x.forEach(t),_=l(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(i,h){g(i,d,h),e(d,b),e(d,u),e(u,f),e(d,_)},d(i){i&&t(d)}}}function a3(F){let d,b,u,f,_;return f=new Ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4RWxlY3RyYUZvclRva2VuQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZlbGVjdHJhLXNtYWxsLWRpc2NyaW1pbmF0b3IlMjIpJTBBbW9kZWwlMjAlM0QlMjBGbGF4RWxlY3RyYUZvclRva2VuQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmVsZWN0cmEtc21hbGwtZGlzY3JpbWluYXRvciUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIyamF4JTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",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"),b=r("Example:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Example:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function r3(F){let d,b,u,f,_;return{c(){d=o("p"),b=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(i){d=n(i,"P",{});var h=a(d);b=l(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n(h,"CODE",{});var x=a(u);f=l(x,"Module"),x.forEach(t),_=l(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(i,h){g(i,d,h),e(d,b),e(d,u),e(u,f),e(d,_)},d(i){i&&t(d)}}}function l3(F){let d,b,u,f,_;return f=new Ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4RWxlY3RyYUZvclF1ZXN0aW9uQW5zd2VyaW5nJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZWxlY3RyYS1zbWFsbC1kaXNjcmltaW5hdG9yJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxheEVsZWN0cmFGb3JRdWVzdGlvbkFuc3dlcmluZy5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZWxlY3RyYS1zbWFsbC1kaXNjcmltaW5hdG9yJTIyKSUwQSUwQXF1ZXN0aW9uJTJDJTIwdGV4dCUyMCUzRCUyMCUyMldobyUyMHdhcyUyMEppbSUyMEhlbnNvbiUzRiUyMiUyQyUyMCUyMkppbSUyMEhlbnNvbiUyMHdhcyUyMGElMjBuaWNlJTIwcHVwcGV0JTIyJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHF1ZXN0aW9uJTJDJTIwdGV4dCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIyamF4JTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFzdGFydF9zY29yZXMlMjAlM0QlMjBvdXRwdXRzLnN0YXJ0X2xvZ2l0cyUwQWVuZF9zY29yZXMlMjAlM0QlMjBvdXRwdXRzLmVuZF9sb2dpdHM=",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"),b=r("Example:"),u=c(),k(f.$$.fragment)},l(i){d=n(i,"P",{});var h=a(d);b=l(h,"Example:"),h.forEach(t),u=p(i),v(f.$$.fragment,i)},m(i,h){g(i,d,h),e(d,b),g(i,u,h),w(f,i,h),_=!0},p:We,i(i){_||(M(f.$$.fragment,i),_=!0)},o(i){E(f.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(u),$(f,i)}}}function i3(F){let d,b,u,f,_,i,h,x,be,fe,R,de,te,j,Te,X,ce,Ze,D,ae,re,L,le,ke,O,ve,ge,B,we,ie,ne,J,I,pe,H,_e,he,Q,Me,ye,U,Ee,Y,se,me,K,$e,ue,G,Fe,q,je,ee,W,xe,N,Ce,ze,T,C,Xe,oe,Je,Le,z,Oe,Qe,Re,De,Ye,A,P,Ge,Pe,S,He,Ve,Ue,Se,V,Be,Ld,fy,gy,Ep,Od,_y,yy,$p,Qd,by,Ty,Fp,Dd,ky,vy,jp,Yd,wy,My,xp,Hd,Ey,Nf,Po,Dn,Cp,rr,$y,zp,Fy,Zf,Pt,lr,jy,_o,xy,Kd,Cy,zy,ec,Jy,Uy,ir,Iy,Wy,Ny,Vo,Zy,tc,qy,Ay,oc,Gy,Ry,Py,Yn,qf,Bo,Hn,Jp,dr,Vy,Up,By,Af,tt,cr,Sy,Ip,Xy,Ly,pr,Oy,nc,Qy,Dy,Yy,xo,hr,Hy,Wp,Ky,eb,mr,sc,tb,Np,ob,nb,ac,sb,Zp,ab,rb,Kn,ur,lb,qp,ib,db,Vt,fr,cb,Ap,pb,hb,es,mb,So,ub,Gp,fb,gb,Rp,_b,yb,bb,ts,gr,Tb,_r,kb,Pp,vb,wb,Gf,Xo,os,Vp,yr,Mb,Bp,Eb,Rf,kt,br,$b,Tr,Fb,Sp,jb,xb,Cb,kr,zb,rc,Jb,Ub,Ib,Co,vr,Wb,Xp,Nb,Zb,wr,lc,qb,Lp,Ab,Gb,ic,Rb,Op,Pb,Vb,Bt,Mr,Bb,Qp,Sb,Xb,ns,Lb,Lo,Ob,Dp,Qb,Db,Yp,Yb,Hb,Pf,Oo,ss,Hp,Er,Kb,Kp,eT,Vf,Qo,$r,tT,Fr,oT,dc,nT,sT,Bf,Do,jr,aT,xr,rT,cc,lT,iT,Sf,Yo,as,eh,Cr,dT,th,cT,Xf,vt,zr,pT,oh,hT,mT,Jr,uT,pc,fT,gT,_T,Ur,yT,Ir,bT,TT,kT,St,Wr,vT,Ho,wT,hc,MT,ET,nh,$T,FT,jT,rs,xT,ls,Lf,Ko,is,sh,Nr,CT,ah,zT,Of,pt,Zr,JT,rh,UT,IT,lh,WT,NT,qr,ZT,mc,qT,AT,GT,Ar,RT,Gr,PT,VT,BT,Xt,Rr,ST,en,XT,uc,LT,OT,ih,QT,DT,YT,ds,HT,cs,Qf,tn,ps,dh,Pr,KT,ch,ek,Df,wt,Vr,tk,Br,ok,ph,nk,sk,ak,Sr,rk,fc,lk,ik,dk,Xr,ck,Lr,pk,hk,mk,Lt,Or,uk,on,fk,gc,gk,_k,hh,yk,bk,Tk,hs,kk,ms,Yf,nn,us,mh,Qr,vk,uh,wk,Hf,ht,Dr,Mk,fh,Ek,$k,gh,Fk,jk,Yr,xk,_c,Ck,zk,Jk,Hr,Uk,Kr,Ik,Wk,Nk,Ot,el,Zk,sn,qk,yc,Ak,Gk,_h,Rk,Pk,Vk,fs,Bk,gs,Kf,an,_s,yh,tl,Sk,bh,Xk,eg,Mt,ol,Lk,Th,Ok,Qk,nl,Dk,bc,Yk,Hk,Kk,sl,ev,al,tv,ov,nv,jt,rl,sv,rn,av,Tc,rv,lv,kh,iv,dv,cv,ys,pv,bs,hv,Ts,tg,ln,ks,vh,ll,mv,wh,uv,og,Et,il,fv,Mh,gv,_v,dl,yv,kc,bv,Tv,kv,cl,vv,pl,wv,Mv,Ev,Qt,hl,$v,dn,Fv,vc,jv,xv,Eh,Cv,zv,Jv,vs,Uv,ws,ng,cn,Ms,$h,ml,Iv,Fh,Wv,sg,mt,ul,Nv,jh,Zv,qv,xh,Av,Gv,fl,Rv,wc,Pv,Vv,Bv,gl,Sv,_l,Xv,Lv,Ov,Dt,yl,Qv,pn,Dv,Mc,Yv,Hv,Ch,Kv,ew,tw,Es,ow,$s,ag,hn,Fs,zh,bl,nw,Jh,sw,rg,$t,Tl,aw,mn,rw,Uh,lw,iw,Ih,dw,cw,pw,kl,hw,Ec,mw,uw,fw,vl,gw,wl,_w,yw,bw,Yt,Ml,Tw,un,kw,$c,vw,ww,Wh,Mw,Ew,$w,js,Fw,xs,lg,fn,Cs,Nh,El,jw,Zh,xw,ig,ut,$l,Cw,qh,zw,Jw,Fl,Uw,Fc,Iw,Ww,Nw,jl,Zw,xl,qw,Aw,Gw,zs,Rw,Ht,Cl,Pw,gn,Vw,jc,Bw,Sw,Ah,Xw,Lw,Ow,Js,Qw,Us,dg,_n,Is,Gh,zl,Dw,Rh,Yw,cg,ot,Jl,Hw,Ph,Kw,eM,Vh,tM,oM,Ul,nM,xc,sM,aM,rM,Il,lM,Wl,iM,dM,cM,Ws,pM,Kt,Nl,hM,yn,mM,Cc,uM,fM,Bh,gM,_M,yM,Ns,bM,Zs,pg,bn,qs,Sh,Zl,TM,Xh,kM,hg,nt,ql,vM,Lh,wM,MM,Oh,EM,$M,Al,FM,zc,jM,xM,CM,Gl,zM,Rl,JM,UM,IM,As,WM,xt,Pl,NM,Tn,ZM,Jc,qM,AM,Qh,GM,RM,PM,Gs,VM,Rs,BM,Ps,mg,kn,Vs,Dh,Vl,SM,Yh,XM,ug,ft,Bl,LM,Hh,OM,QM,Sl,DM,Uc,YM,HM,KM,Xl,eE,Ll,tE,oE,nE,Bs,sE,Ct,Ol,aE,vn,rE,Ic,lE,iE,Kh,dE,cE,pE,Ss,hE,Xs,mE,Ls,fg,wn,Os,em,Ql,uE,tm,fE,gg,gt,Dl,gE,om,_E,yE,Yl,bE,Wc,TE,kE,vE,Hl,wE,Kl,ME,EE,$E,Qs,FE,eo,ei,jE,Mn,xE,Nc,CE,zE,nm,JE,UE,IE,Ds,WE,Ys,_g,En,Hs,sm,ti,NE,am,ZE,yg,st,oi,qE,rm,AE,GE,lm,RE,PE,ni,VE,Zc,BE,SE,XE,si,LE,ai,OE,QE,DE,Ks,YE,zt,ri,HE,$n,KE,qc,e1,t1,im,o1,n1,s1,ea,a1,ta,r1,oa,bg,Fn,na,dm,li,l1,cm,i1,Tg,_t,ii,d1,jn,c1,pm,p1,h1,hm,m1,u1,f1,di,g1,Ac,_1,y1,b1,ci,T1,pi,k1,v1,w1,sa,M1,Jt,hi,E1,xn,$1,Gc,F1,j1,mm,x1,C1,z1,aa,J1,ra,U1,la,kg,Cn,ia,um,mi,I1,fm,W1,vg,at,ui,N1,gm,Z1,q1,fi,A1,Rc,G1,R1,P1,gi,V1,_i,B1,S1,X1,_m,L1,O1,yo,ym,yi,Q1,D1,bm,bi,Y1,H1,Tm,Ti,K1,e2,km,ki,t2,o2,to,vi,n2,zn,s2,vm,a2,r2,wm,l2,i2,d2,da,c2,ca,wg,Jn,pa,Mm,wi,p2,Em,h2,Mg,Ke,Mi,m2,$m,u2,f2,Fm,g2,_2,Ei,y2,Pc,b2,T2,k2,$i,v2,Fi,w2,M2,E2,jm,$2,F2,bo,xm,ji,j2,x2,Cm,xi,C2,z2,zm,Ci,J2,U2,Jm,zi,I2,W2,oo,Ji,N2,Un,Z2,Um,q2,A2,Im,G2,R2,P2,ha,V2,ma,Eg,In,ua,Wm,Ui,B2,Nm,S2,$g,rt,Ii,X2,Zm,L2,O2,Wi,Q2,Vc,D2,Y2,H2,Ni,K2,Zi,e0,t0,o0,qm,n0,s0,To,Am,qi,a0,r0,Gm,Ai,l0,i0,Rm,Gi,d0,c0,Pm,Ri,p0,h0,no,Pi,m0,Wn,u0,Vm,f0,g0,Bm,_0,y0,b0,fa,T0,ga,Fg,Nn,_a,Sm,Vi,k0,Xm,v0,jg,lt,Bi,w0,Si,M0,Lm,E0,$0,F0,Xi,j0,Bc,x0,C0,z0,Li,J0,Oi,U0,I0,W0,Om,N0,Z0,ko,Qm,Qi,q0,A0,Dm,Di,G0,R0,Ym,Yi,P0,V0,Hm,Hi,B0,S0,so,Ki,X0,Zn,L0,Km,O0,Q0,eu,D0,Y0,H0,ya,K0,ba,xg,qn,Ta,tu,ed,e$,ou,t$,Cg,it,td,o$,nu,n$,s$,od,a$,Sc,r$,l$,i$,nd,d$,sd,c$,p$,h$,su,m$,u$,vo,au,ad,f$,g$,ru,rd,_$,y$,lu,ld,b$,T$,iu,id,k$,v$,ao,dd,w$,An,M$,du,E$,$$,cu,F$,j$,x$,ka,C$,va,zg,Gn,wa,pu,cd,z$,hu,J$,Jg,dt,pd,U$,mu,I$,W$,hd,N$,Xc,Z$,q$,A$,md,G$,ud,R$,P$,V$,uu,B$,S$,wo,fu,fd,X$,L$,gu,gd,O$,Q$,_u,_d,D$,Y$,yu,yd,H$,K$,ro,bd,eF,Rn,tF,bu,oF,nF,Tu,sF,aF,rF,Ma,lF,Ea,Ug,Pn,$a,ku,Td,iF,vu,dF,Ig,et,kd,cF,wu,pF,hF,Mu,mF,uF,vd,fF,Lc,gF,_F,yF,wd,bF,Md,TF,kF,vF,Eu,wF,MF,Mo,$u,Ed,EF,$F,Fu,$d,FF,jF,ju,Fd,xF,CF,xu,jd,zF,JF,lo,xd,UF,Vn,IF,Cu,WF,NF,zu,ZF,qF,AF,Fa,GF,ja,Wg,Bn,xa,Ju,Cd,RF,Uu,PF,Ng,ct,zd,VF,Sn,BF,Iu,SF,XF,Wu,LF,OF,QF,Jd,DF,Oc,YF,HF,KF,Ud,ej,Id,tj,oj,nj,Nu,sj,aj,Eo,Zu,Wd,rj,lj,qu,Nd,ij,dj,Au,Zd,cj,pj,Gu,qd,hj,mj,io,Ad,uj,Xn,fj,Ru,gj,_j,Pu,yj,bj,Tj,Ca,kj,za,Zg;return i=new Ae({}),le=new Ae({}),S=new Ae({}),rr=new Ae({}),lr=new Z({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/main/en/model_doc/electra#transformers.ElectraModel">ElectraModel</a> or <a href="/docs/transformers/main/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/main/en/model_doc/electra#transformers.ElectraModel">ElectraModel</a> or <a href="/docs/transformers/main/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/main/src/transformers/models/electra/configuration_electra.py#L44"}}),Yn=new Ie({props:{anchor:"transformers.ElectraConfig.example",$$slots:{default:[tI]},$$scope:{ctx:F}}}),dr=new Ae({}),cr=new Z({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/main/src/transformers/models/electra/tokenization_electra.py#L93"}}),hr=new Z({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/main/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 Z({props:{name:"convert_tokens_to_string",anchor:"transformers.ElectraTokenizer.convert_tokens_to_string",parameters:[{name:"tokens",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/tokenization_electra.py#L218"}}),fr=new Z({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/main/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 Ie({props:{anchor:"transformers.ElectraTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[oI]},$$scope:{ctx:F}}}),gr=new Z({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/main/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>
`}}),yr=new Ae({}),br=new Z({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/main/src/transformers/models/electra/tokenization_electra_fast.py#L88"}}),vr=new Z({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/main/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>
`}}),Mr=new Z({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/main/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 Ie({props:{anchor:"transformers.ElectraTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[nI]},$$scope:{ctx:F}}}),Er=new Ae({}),$r=new Z({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/main/src/transformers/models/electra/modeling_electra.py#L701"}}),jr=new Z({props:{name:"class transformers.models.electra.modeling_tf_electra.TFElectraForPreTrainingOutput",anchor:"transformers.models.electra.modeling_tf_electra.TFElectraForPreTrainingOutput",parameters:[{name:"logits",val:": tf.Tensor = None"},{name:"hidden_states",val:": Tuple[tf.Tensor] | None = None"},{name:"attentions",val:": Tuple[tf.Tensor] | None = 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/main/src/transformers/models/electra/modeling_tf_electra.py#L786"}}),Cr=new Ae({}),zr=new Z({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_electra.py#L813"}}),Wr=new Z({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_electra.py#L840",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),rs=new qe({props:{$$slots:{default:[sI]},$$scope:{ctx:F}}}),ls=new Ie({props:{anchor:"transformers.ElectraModel.forward.example",$$slots:{default:[aI]},$$scope:{ctx:F}}}),Nr=new Ae({}),Zr=new Z({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_electra.py#L1063"}}),Rr=new Z({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__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/main/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/main/src/transformers/models/electra/modeling_electra.py#L1072",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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 qe({props:{$$slots:{default:[rI]},$$scope:{ctx:F}}}),cs=new Ie({props:{anchor:"transformers.ElectraForPreTraining.forward.example",$$slots:{default:[lI]},$$scope:{ctx:F}}}),Pr=new Ae({}),Vr=new Z({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_electra.py#L1536"}}),Or=new Z({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__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/main/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/main/src/transformers/models/electra/modeling_electra.py#L1557",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),hs=new qe({props:{$$slots:{default:[iI]},$$scope:{ctx:F}}}),ms=new Ie({props:{anchor:"transformers.ElectraForCausalLM.forward.example",$$slots:{default:[dI]},$$scope:{ctx:F}}}),Qr=new Ae({}),Dr=new Z({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_electra.py#L1169"}}),el=new Z({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__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/main/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/main/src/transformers/models/electra/modeling_electra.py#L1188",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),fs=new qe({props:{$$slots:{default:[cI]},$$scope:{ctx:F}}}),gs=new Ie({props:{anchor:"transformers.ElectraForMaskedLM.forward.example",$$slots:{default:[pI]},$$scope:{ctx:F}}}),tl=new Ae({}),ol=new Z({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_electra.py#L965"}}),rl=new Z({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__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/main/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/main/src/transformers/models/electra/modeling_electra.py#L976",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ys=new qe({props:{$$slots:{default:[hI]},$$scope:{ctx:F}}}),bs=new Ie({props:{anchor:"transformers.ElectraForSequenceClassification.forward.example",$$slots:{default:[mI]},$$scope:{ctx:F}}}),Ts=new Ie({props:{anchor:"transformers.ElectraForSequenceClassification.forward.example-2",$$slots:{default:[uI]},$$scope:{ctx:F}}}),ll=new Ae({}),il=new Z({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_electra.py#L1449"}}),hl=new Z({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__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/main/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/main/src/transformers/models/electra/modeling_electra.py#L1460",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),vs=new qe({props:{$$slots:{default:[fI]},$$scope:{ctx:F}}}),ws=new Ie({props:{anchor:"transformers.ElectraForMultipleChoice.forward.example",$$slots:{default:[gI]},$$scope:{ctx:F}}}),ml=new Ae({}),ul=new Z({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_electra.py#L1260"}}),yl=new Z({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__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/main/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/main/src/transformers/models/electra/modeling_electra.py#L1274",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Es=new qe({props:{$$slots:{default:[_I]},$$scope:{ctx:F}}}),$s=new Ie({props:{anchor:"transformers.ElectraForTokenClassification.forward.example",$$slots:{default:[yI]},$$scope:{ctx:F}}}),bl=new Ae({}),Tl=new Z({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_electra.py#L1341"}}),Ml=new Z({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__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/main/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/main/src/transformers/models/electra/modeling_electra.py#L1355",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),js=new qe({props:{$$slots:{default:[bI]},$$scope:{ctx:F}}}),xs=new Ie({props:{anchor:"transformers.ElectraForQuestionAnswering.forward.example",$$slots:{default:[TI]},$$scope:{ctx:F}}}),El=new Ae({}),$l=new Z({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_tf_electra.py#L911"}}),zs=new qe({props:{$$slots:{default:[kI]},$$scope:{ctx:F}}}),Cl=new Z({props:{name:"call",anchor:"transformers.TFElectraModel.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"encoder_hidden_states",val:": np.ndarray | tf.Tensor | None = None"},{name:"encoder_attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"past_key_values",val:": Optional[Tuple[Tuple[Union[np.ndarray, tf.Tensor]]]] = None"},{name:"use_cache",val:": Optional[bool] = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": 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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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/main/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/main/src/transformers/models/electra/modeling_tf_electra.py#L917",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Js=new qe({props:{$$slots:{default:[vI]},$$scope:{ctx:F}}}),Us=new Ie({props:{anchor:"transformers.TFElectraModel.call.example",$$slots:{default:[wI]},$$scope:{ctx:F}}}),zl=new Ae({}),Jl=new Z({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_tf_electra.py#L990"}}),Ws=new qe({props:{$$slots:{default:[MI]},$$scope:{ctx:F}}}),Nl=new Z({props:{name:"call",anchor:"transformers.TFElectraForPreTraining.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": 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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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/main/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/main/src/transformers/models/electra/modeling_tf_electra.py#L997",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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>
`}}),Ns=new qe({props:{$$slots:{default:[EI]},$$scope:{ctx:F}}}),Zs=new Ie({props:{anchor:"transformers.TFElectraForPreTraining.call.example",$$slots:{default:[$I]},$$scope:{ctx:F}}}),Zl=new Ae({}),ql=new Z({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_tf_electra.py#L1099"}}),As=new qe({props:{$$slots:{default:[FI]},$$scope:{ctx:F}}}),Pl=new Z({props:{name:"call",anchor:"transformers.TFElectraForMaskedLM.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": 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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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/main/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/main/src/transformers/models/electra/modeling_tf_electra.py#L1121",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_tf_outputs.TFMaskedLMOutput"
>transformers.modeling_tf_outputs.TFMaskedLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Gs=new qe({props:{$$slots:{default:[jI]},$$scope:{ctx:F}}}),Rs=new Ie({props:{anchor:"transformers.TFElectraForMaskedLM.call.example",$$slots:{default:[xI]},$$scope:{ctx:F}}}),Ps=new Ie({props:{anchor:"transformers.TFElectraForMaskedLM.call.example-2",$$slots:{default:[CI]},$$scope:{ctx:F}}}),Vl=new Ae({}),Bl=new Z({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_tf_electra.py#L1218"}}),Bs=new qe({props:{$$slots:{default:[zI]},$$scope:{ctx:F}}}),Ol=new Z({props:{name:"call",anchor:"transformers.TFElectraForSequenceClassification.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": 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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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/main/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/main/src/transformers/models/electra/modeling_tf_electra.py#L1225",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Ss=new qe({props:{$$slots:{default:[JI]},$$scope:{ctx:F}}}),Xs=new Ie({props:{anchor:"transformers.TFElectraForSequenceClassification.call.example",$$slots:{default:[UI]},$$scope:{ctx:F}}}),Ls=new Ie({props:{anchor:"transformers.TFElectraForSequenceClassification.call.example-2",$$slots:{default:[II]},$$scope:{ctx:F}}}),Ql=new Ae({}),Dl=new Z({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_tf_electra.py#L1289"}}),Qs=new qe({props:{$$slots:{default:[WI]},$$scope:{ctx:F}}}),ei=new Z({props:{name:"call",anchor:"transformers.TFElectraForMultipleChoice.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": 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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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/main/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/main/src/transformers/models/electra/modeling_tf_electra.py#L1301",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput"
>transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Ds=new qe({props:{$$slots:{default:[NI]},$$scope:{ctx:F}}}),Ys=new Ie({props:{anchor:"transformers.TFElectraForMultipleChoice.call.example",$$slots:{default:[ZI]},$$scope:{ctx:F}}}),ti=new Ae({}),oi=new Z({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_tf_electra.py#L1382"}}),Ks=new qe({props:{$$slots:{default:[qI]},$$scope:{ctx:F}}}),ri=new Z({props:{name:"call",anchor:"transformers.TFElectraForTokenClassification.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": 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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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/main/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/main/src/transformers/models/electra/modeling_tf_electra.py#L1395",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_tf_outputs.TFTokenClassifierOutput"
>transformers.modeling_tf_outputs.TFTokenClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ea=new qe({props:{$$slots:{default:[AI]},$$scope:{ctx:F}}}),ta=new Ie({props:{anchor:"transformers.TFElectraForTokenClassification.call.example",$$slots:{default:[GI]},$$scope:{ctx:F}}}),oa=new Ie({props:{anchor:"transformers.TFElectraForTokenClassification.call.example-2",$$slots:{default:[RI]},$$scope:{ctx:F}}}),li=new Ae({}),ii=new Z({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_tf_electra.py#L1459"}}),sa=new qe({props:{$$slots:{default:[PI]},$$scope:{ctx:F}}}),hi=new Z({props:{name:"call",anchor:"transformers.TFElectraForQuestionAnswering.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"start_positions",val:": np.ndarray | tf.Tensor | None = None"},{name:"end_positions",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": 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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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/main/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/main/src/transformers/models/electra/modeling_tf_electra.py#L1469",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput"
>transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),aa=new qe({props:{$$slots:{default:[VI]},$$scope:{ctx:F}}}),ra=new Ie({props:{anchor:"transformers.TFElectraForQuestionAnswering.call.example",$$slots:{default:[BI]},$$scope:{ctx:F}}}),la=new Ie({props:{anchor:"transformers.TFElectraForQuestionAnswering.call.example-2",$$slots:{default:[SI]},$$scope:{ctx:F}}}),mi=new Ae({}),ui=new Z({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_flax_electra.py#L920"}}),vi=new Z({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_flax_electra.py#L770",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),da=new qe({props:{$$slots:{default:[XI]},$$scope:{ctx:F}}}),ca=new Ie({props:{anchor:"transformers.FlaxElectraModel.__call__.example",$$slots:{default:[LI]},$$scope:{ctx:F}}}),wi=new Ae({}),Mi=new Z({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_flax_electra.py#L1071"}}),Ji=new Z({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/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/main/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 qe({props:{$$slots:{default:[OI]},$$scope:{ctx:F}}}),ma=new Ie({props:{anchor:"transformers.FlaxElectraForPreTraining.__call__.example",$$slots:{default:[QI]},$$scope:{ctx:F}}}),Ui=new Ae({}),Ii=new Z({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_flax_electra.py#L1565"}}),Pi=new Z({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_flax_electra.py#L770",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),fa=new qe({props:{$$slots:{default:[DI]},$$scope:{ctx:F}}}),ga=new Ie({props:{anchor:"transformers.FlaxElectraForCausalLM.__call__.example",$$slots:{default:[YI]},$$scope:{ctx:F}}}),Vi=new Ae({}),Bi=new Z({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_flax_electra.py#L1007"}}),Ki=new Z({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_flax_electra.py#L770",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ya=new qe({props:{$$slots:{default:[HI]},$$scope:{ctx:F}}}),ba=new Ie({props:{anchor:"transformers.FlaxElectraForMaskedLM.__call__.example",$$slots:{default:[KI]},$$scope:{ctx:F}}}),ed=new Ae({}),td=new Z({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_flax_electra.py#L1481"}}),dd=new Z({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_flax_electra.py#L770",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ka=new qe({props:{$$slots:{default:[e3]},$$scope:{ctx:F}}}),va=new Ie({props:{anchor:"transformers.FlaxElectraForSequenceClassification.__call__.example",$$slots:{default:[t3]},$$scope:{ctx:F}}}),cd=new Ae({}),pd=new Z({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_flax_electra.py#L1313"}}),bd=new Z({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_flax_electra.py#L770",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput"
>transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ma=new qe({props:{$$slots:{default:[o3]},$$scope:{ctx:F}}}),Ea=new Ie({props:{anchor:"transformers.FlaxElectraForMultipleChoice.__call__.example",$$slots:{default:[n3]},$$scope:{ctx:F}}}),Td=new Ae({}),kd=new Z({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_flax_electra.py#L1166"}}),xd=new Z({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_flax_electra.py#L770",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxTokenClassifierOutput"
>transformers.modeling_flax_outputs.FlaxTokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Fa=new qe({props:{$$slots:{default:[s3]},$$scope:{ctx:F}}}),ja=new Ie({props:{anchor:"transformers.FlaxElectraForTokenClassification.__call__.example",$$slots:{default:[a3]},$$scope:{ctx:F}}}),Cd=new Ae({}),zd=new Z({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_flax_electra.py#L1388"}}),Ad=new Z({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/electra/modeling_flax_electra.py#L770",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput"
>transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ca=new qe({props:{$$slots:{default:[r3]},$$scope:{ctx:F}}}),za=new Ie({props:{anchor:"transformers.FlaxElectraForQuestionAnswering.__call__.example",$$slots:{default:[l3]},$$scope:{ctx:F}}}),{c(){d=o("meta"),b=c(),u=o("h1"),f=o("a"),_=o("span"),k(i.$$.fragment),h=c(),x=o("span"),be=r("ELECTRA"),fe=c(),R=o("div"),de=o("a"),te=o("img"),Te=c(),X=o("a"),ce=o("img"),D=c(),ae=o("h2"),re=o("a"),L=o("span"),k(le.$$.fragment),ke=c(),O=o("span"),ve=r("Overview"),ge=c(),B=o("p"),we=r("The ELECTRA model was proposed in the paper "),ie=o("a"),ne=r(`ELECTRA: Pre-training Text Encoders as Discriminators Rather Than
Generators`),J=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.`),I=c(),pe=o("p"),H=r("The abstract from the paper is the following:"),_e=c(),he=o("p"),Q=o("em"),Me=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.`),ye=c(),U=o("p"),Ee=r("Tips:"),Y=c(),se=o("ul"),me=o("li"),K=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.`),$e=c(),ue=o("li"),G=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."),Fe=c(),q=o("li"),je=r("The ELECTRA checkpoints saved using "),ee=o("a"),W=r("Google Research\u2019s implementation"),xe=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
`),N=o("a"),Ce=r("ElectraForMaskedLM"),ze=r(` model, and the generator may be loaded in the
`),T=o("a"),C=r("ElectraForPreTraining"),Xe=r(` model (the classification head will be randomly initialized as it
doesn\u2019t exist in the generator).`),oe=c(),Je=o("p"),Le=r("This model was contributed by "),z=o("a"),Oe=r("lysandre"),Qe=r(". The original code can be found "),Re=o("a"),De=r("here"),Ye=r("."),A=c(),P=o("h2"),Ge=o("a"),Pe=o("span"),k(S.$$.fragment),He=c(),Ve=o("span"),Ue=r("Documentation resources"),Se=c(),V=o("ul"),Be=o("li"),Ld=o("a"),fy=r("Text classification task guide"),gy=c(),Ep=o("li"),Od=o("a"),_y=r("Token classification task guide"),yy=c(),$p=o("li"),Qd=o("a"),by=r("Question answering task guide"),Ty=c(),Fp=o("li"),Dd=o("a"),ky=r("Causal language modeling task guide"),vy=c(),jp=o("li"),Yd=o("a"),wy=r("Masked language modeling task guide"),My=c(),xp=o("li"),Hd=o("a"),Ey=r("Multiple choice task guide"),Nf=c(),Po=o("h2"),Dn=o("a"),Cp=o("span"),k(rr.$$.fragment),$y=c(),zp=o("span"),Fy=r("ElectraConfig"),Zf=c(),Pt=o("div"),k(lr.$$.fragment),jy=c(),_o=o("p"),xy=r("This is the configuration class to store the configuration of a "),Kd=o("a"),Cy=r("ElectraModel"),zy=r(" or a "),ec=o("a"),Jy=r("TFElectraModel"),Uy=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
`),ir=o("a"),Iy=r("google/electra-small-discriminator"),Wy=r(" architecture."),Ny=c(),Vo=o("p"),Zy=r("Configuration objects inherit from "),tc=o("a"),qy=r("PretrainedConfig"),Ay=r(` and can be used to control the model outputs. Read the
documentation from `),oc=o("a"),Gy=r("PretrainedConfig"),Ry=r(" for more information."),Py=c(),k(Yn.$$.fragment),qf=c(),Bo=o("h2"),Hn=o("a"),Jp=o("span"),k(dr.$$.fragment),Vy=c(),Up=o("span"),By=r("ElectraTokenizer"),Af=c(),tt=o("div"),k(cr.$$.fragment),Sy=c(),Ip=o("p"),Xy=r("Construct a Electra tokenizer. Based on WordPiece."),Ly=c(),pr=o("p"),Oy=r("This tokenizer inherits from "),nc=o("a"),Qy=r("PreTrainedTokenizer"),Dy=r(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Yy=c(),xo=o("div"),k(hr.$$.fragment),Hy=c(),Wp=o("p"),Ky=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:`),eb=c(),mr=o("ul"),sc=o("li"),tb=r("single sequence: "),Np=o("code"),ob=r("[CLS] X [SEP]"),nb=c(),ac=o("li"),sb=r("pair of sequences: "),Zp=o("code"),ab=r("[CLS] A [SEP] B [SEP]"),rb=c(),Kn=o("div"),k(ur.$$.fragment),lb=c(),qp=o("p"),ib=r("Converts a sequence of tokens (string) in a single string."),db=c(),Vt=o("div"),k(fr.$$.fragment),cb=c(),Ap=o("p"),pb=r("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A Electra"),hb=c(),k(es.$$.fragment),mb=c(),So=o("p"),ub=r("If "),Gp=o("code"),fb=r("token_ids_1"),gb=r(" is "),Rp=o("code"),_b=r("None"),yb=r(", this method only returns the first portion of the mask (0s)."),bb=c(),ts=o("div"),k(gr.$$.fragment),Tb=c(),_r=o("p"),kb=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 `),Pp=o("code"),vb=r("prepare_for_model"),wb=r(" method."),Gf=c(),Xo=o("h2"),os=o("a"),Vp=o("span"),k(yr.$$.fragment),Mb=c(),Bp=o("span"),Eb=r("ElectraTokenizerFast"),Rf=c(),kt=o("div"),k(br.$$.fragment),$b=c(),Tr=o("p"),Fb=r("Construct a \u201Cfast\u201D ELECTRA tokenizer (backed by HuggingFace\u2019s "),Sp=o("em"),jb=r("tokenizers"),xb=r(" library). Based on WordPiece."),Cb=c(),kr=o("p"),zb=r("This tokenizer inherits from "),rc=o("a"),Jb=r("PreTrainedTokenizerFast"),Ub=r(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Ib=c(),Co=o("div"),k(vr.$$.fragment),Wb=c(),Xp=o("p"),Nb=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:`),Zb=c(),wr=o("ul"),lc=o("li"),qb=r("single sequence: "),Lp=o("code"),Ab=r("[CLS] X [SEP]"),Gb=c(),ic=o("li"),Rb=r("pair of sequences: "),Op=o("code"),Pb=r("[CLS] A [SEP] B [SEP]"),Vb=c(),Bt=o("div"),k(Mr.$$.fragment),Bb=c(),Qp=o("p"),Sb=r("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A ELECTRA"),Xb=c(),k(ns.$$.fragment),Lb=c(),Lo=o("p"),Ob=r("If "),Dp=o("code"),Qb=r("token_ids_1"),Db=r(" is "),Yp=o("code"),Yb=r("None"),Hb=r(", this method only returns the first portion of the mask (0s)."),Pf=c(),Oo=o("h2"),ss=o("a"),Hp=o("span"),k(Er.$$.fragment),Kb=c(),Kp=o("span"),eT=r("Electra specific outputs"),Vf=c(),Qo=o("div"),k($r.$$.fragment),tT=c(),Fr=o("p"),oT=r("Output type of "),dc=o("a"),nT=r("ElectraForPreTraining"),sT=r("."),Bf=c(),Do=o("div"),k(jr.$$.fragment),aT=c(),xr=o("p"),rT=r("Output type of "),cc=o("a"),lT=r("TFElectraForPreTraining"),iT=r("."),Sf=c(),Yo=o("h2"),as=o("a"),eh=o("span"),k(Cr.$$.fragment),dT=c(),th=o("span"),cT=r("ElectraModel"),Xf=c(),vt=o("div"),k(zr.$$.fragment),pT=c(),oh=o("p"),hT=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."),mT=c(),Jr=o("p"),uT=r("This model inherits from "),pc=o("a"),fT=r("PreTrainedModel"),gT=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.)`),_T=c(),Ur=o("p"),yT=r("This model is also a PyTorch "),Ir=o("a"),bT=r("torch.nn.Module"),TT=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),kT=c(),St=o("div"),k(Wr.$$.fragment),vT=c(),Ho=o("p"),wT=r("The "),hc=o("a"),MT=r("ElectraModel"),ET=r(" forward method, overrides the "),nh=o("code"),$T=r("__call__"),FT=r(" special method."),jT=c(),k(rs.$$.fragment),xT=c(),k(ls.$$.fragment),Lf=c(),Ko=o("h2"),is=o("a"),sh=o("span"),k(Nr.$$.fragment),CT=c(),ah=o("span"),zT=r("ElectraForPreTraining"),Of=c(),pt=o("div"),k(Zr.$$.fragment),JT=c(),rh=o("p"),UT=r("Electra model with a binary classification head on top as used during pretraining for identifying generated tokens."),IT=c(),lh=o("p"),WT=r("It is recommended to load the discriminator checkpoint into that model."),NT=c(),qr=o("p"),ZT=r("This model inherits from "),mc=o("a"),qT=r("PreTrainedModel"),AT=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.)`),GT=c(),Ar=o("p"),RT=r("This model is also a PyTorch "),Gr=o("a"),PT=r("torch.nn.Module"),VT=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),BT=c(),Xt=o("div"),k(Rr.$$.fragment),ST=c(),en=o("p"),XT=r("The "),uc=o("a"),LT=r("ElectraForPreTraining"),OT=r(" forward method, overrides the "),ih=o("code"),QT=r("__call__"),DT=r(" special method."),YT=c(),k(ds.$$.fragment),HT=c(),k(cs.$$.fragment),Qf=c(),tn=o("h2"),ps=o("a"),dh=o("span"),k(Pr.$$.fragment),KT=c(),ch=o("span"),ek=r("ElectraForCausalLM"),Df=c(),wt=o("div"),k(Vr.$$.fragment),tk=c(),Br=o("p"),ok=r("ELECTRA Model with a "),ph=o("code"),nk=r("language modeling"),sk=r(" head on top for CLM fine-tuning."),ak=c(),Sr=o("p"),rk=r("This model inherits from "),fc=o("a"),lk=r("PreTrainedModel"),ik=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.)`),dk=c(),Xr=o("p"),ck=r("This model is also a PyTorch "),Lr=o("a"),pk=r("torch.nn.Module"),hk=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),mk=c(),Lt=o("div"),k(Or.$$.fragment),uk=c(),on=o("p"),fk=r("The "),gc=o("a"),gk=r("ElectraForCausalLM"),_k=r(" forward method, overrides the "),hh=o("code"),yk=r("__call__"),bk=r(" special method."),Tk=c(),k(hs.$$.fragment),kk=c(),k(ms.$$.fragment),Yf=c(),nn=o("h2"),us=o("a"),mh=o("span"),k(Qr.$$.fragment),vk=c(),uh=o("span"),wk=r("ElectraForMaskedLM"),Hf=c(),ht=o("div"),k(Dr.$$.fragment),Mk=c(),fh=o("p"),Ek=r("Electra model with a language modeling head on top."),$k=c(),gh=o("p"),Fk=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.`),jk=c(),Yr=o("p"),xk=r("This model inherits from "),_c=o("a"),Ck=r("PreTrainedModel"),zk=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.)`),Jk=c(),Hr=o("p"),Uk=r("This model is also a PyTorch "),Kr=o("a"),Ik=r("torch.nn.Module"),Wk=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Nk=c(),Ot=o("div"),k(el.$$.fragment),Zk=c(),sn=o("p"),qk=r("The "),yc=o("a"),Ak=r("ElectraForMaskedLM"),Gk=r(" forward method, overrides the "),_h=o("code"),Rk=r("__call__"),Pk=r(" special method."),Vk=c(),k(fs.$$.fragment),Bk=c(),k(gs.$$.fragment),Kf=c(),an=o("h2"),_s=o("a"),yh=o("span"),k(tl.$$.fragment),Sk=c(),bh=o("span"),Xk=r("ElectraForSequenceClassification"),eg=c(),Mt=o("div"),k(ol.$$.fragment),Lk=c(),Th=o("p"),Ok=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.`),Qk=c(),nl=o("p"),Dk=r("This model inherits from "),bc=o("a"),Yk=r("PreTrainedModel"),Hk=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.)`),Kk=c(),sl=o("p"),ev=r("This model is also a PyTorch "),al=o("a"),tv=r("torch.nn.Module"),ov=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),nv=c(),jt=o("div"),k(rl.$$.fragment),sv=c(),rn=o("p"),av=r("The "),Tc=o("a"),rv=r("ElectraForSequenceClassification"),lv=r(" forward method, overrides the "),kh=o("code"),iv=r("__call__"),dv=r(" special method."),cv=c(),k(ys.$$.fragment),pv=c(),k(bs.$$.fragment),hv=c(),k(Ts.$$.fragment),tg=c(),ln=o("h2"),ks=o("a"),vh=o("span"),k(ll.$$.fragment),mv=c(),wh=o("span"),uv=r("ElectraForMultipleChoice"),og=c(),Et=o("div"),k(il.$$.fragment),fv=c(),Mh=o("p"),gv=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.`),_v=c(),dl=o("p"),yv=r("This model inherits from "),kc=o("a"),bv=r("PreTrainedModel"),Tv=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.)`),kv=c(),cl=o("p"),vv=r("This model is also a PyTorch "),pl=o("a"),wv=r("torch.nn.Module"),Mv=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ev=c(),Qt=o("div"),k(hl.$$.fragment),$v=c(),dn=o("p"),Fv=r("The "),vc=o("a"),jv=r("ElectraForMultipleChoice"),xv=r(" forward method, overrides the "),Eh=o("code"),Cv=r("__call__"),zv=r(" special method."),Jv=c(),k(vs.$$.fragment),Uv=c(),k(ws.$$.fragment),ng=c(),cn=o("h2"),Ms=o("a"),$h=o("span"),k(ml.$$.fragment),Iv=c(),Fh=o("span"),Wv=r("ElectraForTokenClassification"),sg=c(),mt=o("div"),k(ul.$$.fragment),Nv=c(),jh=o("p"),Zv=r("Electra model with a token classification head on top."),qv=c(),xh=o("p"),Av=r("Both the discriminator and generator may be loaded into this model."),Gv=c(),fl=o("p"),Rv=r("This model inherits from "),wc=o("a"),Pv=r("PreTrainedModel"),Vv=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.)`),Bv=c(),gl=o("p"),Sv=r("This model is also a PyTorch "),_l=o("a"),Xv=r("torch.nn.Module"),Lv=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ov=c(),Dt=o("div"),k(yl.$$.fragment),Qv=c(),pn=o("p"),Dv=r("The "),Mc=o("a"),Yv=r("ElectraForTokenClassification"),Hv=r(" forward method, overrides the "),Ch=o("code"),Kv=r("__call__"),ew=r(" special method."),tw=c(),k(Es.$$.fragment),ow=c(),k($s.$$.fragment),ag=c(),hn=o("h2"),Fs=o("a"),zh=o("span"),k(bl.$$.fragment),nw=c(),Jh=o("span"),sw=r("ElectraForQuestionAnswering"),rg=c(),$t=o("div"),k(Tl.$$.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 `),Uh=o("code"),lw=r("span start logits"),iw=r(" and "),Ih=o("code"),dw=r("span end logits"),cw=r(")."),pw=c(),kl=o("p"),hw=r("This model inherits from "),Ec=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(),vl=o("p"),gw=r("This model is also a PyTorch "),wl=o("a"),_w=r("torch.nn.Module"),yw=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),bw=c(),Yt=o("div"),k(Ml.$$.fragment),Tw=c(),un=o("p"),kw=r("The "),$c=o("a"),vw=r("ElectraForQuestionAnswering"),ww=r(" forward method, overrides the "),Wh=o("code"),Mw=r("__call__"),Ew=r(" special method."),$w=c(),k(js.$$.fragment),Fw=c(),k(xs.$$.fragment),lg=c(),fn=o("h2"),Cs=o("a"),Nh=o("span"),k(El.$$.fragment),jw=c(),Zh=o("span"),xw=r("TFElectraModel"),ig=c(),ut=o("div"),k($l.$$.fragment),Cw=c(),qh=o("p"),zw=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."),Jw=c(),Fl=o("p"),Uw=r("This model inherits from "),Fc=o("a"),Iw=r("TFPreTrainedModel"),Ww=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.)`),Nw=c(),jl=o("p"),Zw=r("This model is also a "),xl=o("a"),qw=r("tf.keras.Model"),Aw=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.`),Gw=c(),k(zs.$$.fragment),Rw=c(),Ht=o("div"),k(Cl.$$.fragment),Pw=c(),gn=o("p"),Vw=r("The "),jc=o("a"),Bw=r("TFElectraModel"),Sw=r(" forward method, overrides the "),Ah=o("code"),Xw=r("__call__"),Lw=r(" special method."),Ow=c(),k(Js.$$.fragment),Qw=c(),k(Us.$$.fragment),dg=c(),_n=o("h2"),Is=o("a"),Gh=o("span"),k(zl.$$.fragment),Dw=c(),Rh=o("span"),Yw=r("TFElectraForPreTraining"),cg=c(),ot=o("div"),k(Jl.$$.fragment),Hw=c(),Ph=o("p"),Kw=r("Electra model with a binary classification head on top as used during pretraining for identifying generated tokens."),eM=c(),Vh=o("p"),tM=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.`),oM=c(),Ul=o("p"),nM=r("This model inherits from "),xc=o("a"),sM=r("TFPreTrainedModel"),aM=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.)`),rM=c(),Il=o("p"),lM=r("This model is also a "),Wl=o("a"),iM=r("tf.keras.Model"),dM=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.`),cM=c(),k(Ws.$$.fragment),pM=c(),Kt=o("div"),k(Nl.$$.fragment),hM=c(),yn=o("p"),mM=r("The "),Cc=o("a"),uM=r("TFElectraForPreTraining"),fM=r(" forward method, overrides the "),Bh=o("code"),gM=r("__call__"),_M=r(" special method."),yM=c(),k(Ns.$$.fragment),bM=c(),k(Zs.$$.fragment),pg=c(),bn=o("h2"),qs=o("a"),Sh=o("span"),k(Zl.$$.fragment),TM=c(),Xh=o("span"),kM=r("TFElectraForMaskedLM"),hg=c(),nt=o("div"),k(ql.$$.fragment),vM=c(),Lh=o("p"),wM=r("Electra model with a language modeling head on top."),MM=c(),Oh=o("p"),EM=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.`),$M=c(),Al=o("p"),FM=r("This model inherits from "),zc=o("a"),jM=r("TFPreTrainedModel"),xM=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.)`),CM=c(),Gl=o("p"),zM=r("This model is also a "),Rl=o("a"),JM=r("tf.keras.Model"),UM=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.`),IM=c(),k(As.$$.fragment),WM=c(),xt=o("div"),k(Pl.$$.fragment),NM=c(),Tn=o("p"),ZM=r("The "),Jc=o("a"),qM=r("TFElectraForMaskedLM"),AM=r(" forward method, overrides the "),Qh=o("code"),GM=r("__call__"),RM=r(" special method."),PM=c(),k(Gs.$$.fragment),VM=c(),k(Rs.$$.fragment),BM=c(),k(Ps.$$.fragment),mg=c(),kn=o("h2"),Vs=o("a"),Dh=o("span"),k(Vl.$$.fragment),SM=c(),Yh=o("span"),XM=r("TFElectraForSequenceClassification"),ug=c(),ft=o("div"),k(Bl.$$.fragment),LM=c(),Hh=o("p"),OM=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.`),QM=c(),Sl=o("p"),DM=r("This model inherits from "),Uc=o("a"),YM=r("TFPreTrainedModel"),HM=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.)`),KM=c(),Xl=o("p"),eE=r("This model is also a "),Ll=o("a"),tE=r("tf.keras.Model"),oE=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.`),nE=c(),k(Bs.$$.fragment),sE=c(),Ct=o("div"),k(Ol.$$.fragment),aE=c(),vn=o("p"),rE=r("The "),Ic=o("a"),lE=r("TFElectraForSequenceClassification"),iE=r(" forward method, overrides the "),Kh=o("code"),dE=r("__call__"),cE=r(" special method."),pE=c(),k(Ss.$$.fragment),hE=c(),k(Xs.$$.fragment),mE=c(),k(Ls.$$.fragment),fg=c(),wn=o("h2"),Os=o("a"),em=o("span"),k(Ql.$$.fragment),uE=c(),tm=o("span"),fE=r("TFElectraForMultipleChoice"),gg=c(),gt=o("div"),k(Dl.$$.fragment),gE=c(),om=o("p"),_E=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.`),yE=c(),Yl=o("p"),bE=r("This model inherits from "),Wc=o("a"),TE=r("TFPreTrainedModel"),kE=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.)`),vE=c(),Hl=o("p"),wE=r("This model is also a "),Kl=o("a"),ME=r("tf.keras.Model"),EE=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.`),$E=c(),k(Qs.$$.fragment),FE=c(),eo=o("div"),k(ei.$$.fragment),jE=c(),Mn=o("p"),xE=r("The "),Nc=o("a"),CE=r("TFElectraForMultipleChoice"),zE=r(" forward method, overrides the "),nm=o("code"),JE=r("__call__"),UE=r(" special method."),IE=c(),k(Ds.$$.fragment),WE=c(),k(Ys.$$.fragment),_g=c(),En=o("h2"),Hs=o("a"),sm=o("span"),k(ti.$$.fragment),NE=c(),am=o("span"),ZE=r("TFElectraForTokenClassification"),yg=c(),st=o("div"),k(oi.$$.fragment),qE=c(),rm=o("p"),AE=r("Electra model with a token classification head on top."),GE=c(),lm=o("p"),RE=r("Both the discriminator and generator may be loaded into this model."),PE=c(),ni=o("p"),VE=r("This model inherits from "),Zc=o("a"),BE=r("TFPreTrainedModel"),SE=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.)`),XE=c(),si=o("p"),LE=r("This model is also a "),ai=o("a"),OE=r("tf.keras.Model"),QE=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.`),DE=c(),k(Ks.$$.fragment),YE=c(),zt=o("div"),k(ri.$$.fragment),HE=c(),$n=o("p"),KE=r("The "),qc=o("a"),e1=r("TFElectraForTokenClassification"),t1=r(" forward method, overrides the "),im=o("code"),o1=r("__call__"),n1=r(" special method."),s1=c(),k(ea.$$.fragment),a1=c(),k(ta.$$.fragment),r1=c(),k(oa.$$.fragment),bg=c(),Fn=o("h2"),na=o("a"),dm=o("span"),k(li.$$.fragment),l1=c(),cm=o("span"),i1=r("TFElectraForQuestionAnswering"),Tg=c(),_t=o("div"),k(ii.$$.fragment),d1=c(),jn=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(),di=o("p"),g1=r("This model inherits from "),Ac=o("a"),_1=r("TFPreTrainedModel"),y1=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.)`),b1=c(),ci=o("p"),T1=r("This model is also a "),pi=o("a"),k1=r("tf.keras.Model"),v1=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(),k(sa.$$.fragment),M1=c(),Jt=o("div"),k(hi.$$.fragment),E1=c(),xn=o("p"),$1=r("The "),Gc=o("a"),F1=r("TFElectraForQuestionAnswering"),j1=r(" forward method, overrides the "),mm=o("code"),x1=r("__call__"),C1=r(" special method."),z1=c(),k(aa.$$.fragment),J1=c(),k(ra.$$.fragment),U1=c(),k(la.$$.fragment),kg=c(),Cn=o("h2"),ia=o("a"),um=o("span"),k(mi.$$.fragment),I1=c(),fm=o("span"),W1=r("FlaxElectraModel"),vg=c(),at=o("div"),k(ui.$$.fragment),N1=c(),gm=o("p"),Z1=r("The bare Electra Model transformer outputting raw hidden-states without any specific head on top."),q1=c(),fi=o("p"),A1=r("This model inherits from "),Rc=o("a"),G1=r("FlaxPreTrainedModel"),R1=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)`),P1=c(),gi=o("p"),V1=r(`This model is also a Flax Linen
`),_i=o("a"),B1=r("flax.nn.Module"),S1=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),X1=c(),_m=o("p"),L1=r("Finally, this model supports inherent JAX features such as:"),O1=c(),yo=o("ul"),ym=o("li"),yi=o("a"),Q1=r("Just-In-Time (JIT) compilation"),D1=c(),bm=o("li"),bi=o("a"),Y1=r("Automatic Differentiation"),H1=c(),Tm=o("li"),Ti=o("a"),K1=r("Vectorization"),e2=c(),km=o("li"),ki=o("a"),t2=r("Parallelization"),o2=c(),to=o("div"),k(vi.$$.fragment),n2=c(),zn=o("p"),s2=r("The "),vm=o("code"),a2=r("FlaxElectraPreTrainedModel"),r2=r(" forward method, overrides the "),wm=o("code"),l2=r("__call__"),i2=r(" special method."),d2=c(),k(da.$$.fragment),c2=c(),k(ca.$$.fragment),wg=c(),Jn=o("h2"),pa=o("a"),Mm=o("span"),k(wi.$$.fragment),p2=c(),Em=o("span"),h2=r("FlaxElectraForPreTraining"),Mg=c(),Ke=o("div"),k(Mi.$$.fragment),m2=c(),$m=o("p"),u2=r("Electra model with a binary classification head on top as used during pretraining for identifying generated tokens."),f2=c(),Fm=o("p"),g2=r("It is recommended to load the discriminator checkpoint into that model."),_2=c(),Ei=o("p"),y2=r("This model inherits from "),Pc=o("a"),b2=r("FlaxPreTrainedModel"),T2=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)`),k2=c(),$i=o("p"),v2=r(`This model is also a Flax Linen
`),Fi=o("a"),w2=r("flax.nn.Module"),M2=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),E2=c(),jm=o("p"),$2=r("Finally, this model supports inherent JAX features such as:"),F2=c(),bo=o("ul"),xm=o("li"),ji=o("a"),j2=r("Just-In-Time (JIT) compilation"),x2=c(),Cm=o("li"),xi=o("a"),C2=r("Automatic Differentiation"),z2=c(),zm=o("li"),Ci=o("a"),J2=r("Vectorization"),U2=c(),Jm=o("li"),zi=o("a"),I2=r("Parallelization"),W2=c(),oo=o("div"),k(Ji.$$.fragment),N2=c(),Un=o("p"),Z2=r("The "),Um=o("code"),q2=r("FlaxElectraPreTrainedModel"),A2=r(" forward method, overrides the "),Im=o("code"),G2=r("__call__"),R2=r(" special method."),P2=c(),k(ha.$$.fragment),V2=c(),k(ma.$$.fragment),Eg=c(),In=o("h2"),ua=o("a"),Wm=o("span"),k(Ui.$$.fragment),B2=c(),Nm=o("span"),S2=r("FlaxElectraForCausalLM"),$g=c(),rt=o("div"),k(Ii.$$.fragment),X2=c(),Zm=o("p"),L2=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.`),O2=c(),Wi=o("p"),Q2=r("This model inherits from "),Vc=o("a"),D2=r("FlaxPreTrainedModel"),Y2=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)`),H2=c(),Ni=o("p"),K2=r(`This model is also a Flax Linen
`),Zi=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(),qm=o("p"),n0=r("Finally, this model supports inherent JAX features such as:"),s0=c(),To=o("ul"),Am=o("li"),qi=o("a"),a0=r("Just-In-Time (JIT) compilation"),r0=c(),Gm=o("li"),Ai=o("a"),l0=r("Automatic Differentiation"),i0=c(),Rm=o("li"),Gi=o("a"),d0=r("Vectorization"),c0=c(),Pm=o("li"),Ri=o("a"),p0=r("Parallelization"),h0=c(),no=o("div"),k(Pi.$$.fragment),m0=c(),Wn=o("p"),u0=r("The "),Vm=o("code"),f0=r("FlaxElectraPreTrainedModel"),g0=r(" forward method, overrides the "),Bm=o("code"),_0=r("__call__"),y0=r(" special method."),b0=c(),k(fa.$$.fragment),T0=c(),k(ga.$$.fragment),Fg=c(),Nn=o("h2"),_a=o("a"),Sm=o("span"),k(Vi.$$.fragment),k0=c(),Xm=o("span"),v0=r("FlaxElectraForMaskedLM"),jg=c(),lt=o("div"),k(Bi.$$.fragment),w0=c(),Si=o("p"),M0=r("Electra Model with a "),Lm=o("code"),E0=r("language modeling"),$0=r(" head on top."),F0=c(),Xi=o("p"),j0=r("This model inherits from "),Bc=o("a"),x0=r("FlaxPreTrainedModel"),C0=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)`),z0=c(),Li=o("p"),J0=r(`This model is also a Flax Linen
`),Oi=o("a"),U0=r("flax.nn.Module"),I0=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),W0=c(),Om=o("p"),N0=r("Finally, this model supports inherent JAX features such as:"),Z0=c(),ko=o("ul"),Qm=o("li"),Qi=o("a"),q0=r("Just-In-Time (JIT) compilation"),A0=c(),Dm=o("li"),Di=o("a"),G0=r("Automatic Differentiation"),R0=c(),Ym=o("li"),Yi=o("a"),P0=r("Vectorization"),V0=c(),Hm=o("li"),Hi=o("a"),B0=r("Parallelization"),S0=c(),so=o("div"),k(Ki.$$.fragment),X0=c(),Zn=o("p"),L0=r("The "),Km=o("code"),O0=r("FlaxElectraPreTrainedModel"),Q0=r(" forward method, overrides the "),eu=o("code"),D0=r("__call__"),Y0=r(" special method."),H0=c(),k(ya.$$.fragment),K0=c(),k(ba.$$.fragment),xg=c(),qn=o("h2"),Ta=o("a"),tu=o("span"),k(ed.$$.fragment),e$=c(),ou=o("span"),t$=r("FlaxElectraForSequenceClassification"),Cg=c(),it=o("div"),k(td.$$.fragment),o$=c(),nu=o("p"),n$=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.`),s$=c(),od=o("p"),a$=r("This model inherits from "),Sc=o("a"),r$=r("FlaxPreTrainedModel"),l$=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)`),i$=c(),nd=o("p"),d$=r(`This model is also a Flax Linen
`),sd=o("a"),c$=r("flax.nn.Module"),p$=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),h$=c(),su=o("p"),m$=r("Finally, this model supports inherent JAX features such as:"),u$=c(),vo=o("ul"),au=o("li"),ad=o("a"),f$=r("Just-In-Time (JIT) compilation"),g$=c(),ru=o("li"),rd=o("a"),_$=r("Automatic Differentiation"),y$=c(),lu=o("li"),ld=o("a"),b$=r("Vectorization"),T$=c(),iu=o("li"),id=o("a"),k$=r("Parallelization"),v$=c(),ao=o("div"),k(dd.$$.fragment),w$=c(),An=o("p"),M$=r("The "),du=o("code"),E$=r("FlaxElectraPreTrainedModel"),$$=r(" forward method, overrides the "),cu=o("code"),F$=r("__call__"),j$=r(" special method."),x$=c(),k(ka.$$.fragment),C$=c(),k(va.$$.fragment),zg=c(),Gn=o("h2"),wa=o("a"),pu=o("span"),k(cd.$$.fragment),z$=c(),hu=o("span"),J$=r("FlaxElectraForMultipleChoice"),Jg=c(),dt=o("div"),k(pd.$$.fragment),U$=c(),mu=o("p"),I$=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.`),W$=c(),hd=o("p"),N$=r("This model inherits from "),Xc=o("a"),Z$=r("FlaxPreTrainedModel"),q$=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)`),A$=c(),md=o("p"),G$=r(`This model is also a Flax Linen
`),ud=o("a"),R$=r("flax.nn.Module"),P$=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),V$=c(),uu=o("p"),B$=r("Finally, this model supports inherent JAX features such as:"),S$=c(),wo=o("ul"),fu=o("li"),fd=o("a"),X$=r("Just-In-Time (JIT) compilation"),L$=c(),gu=o("li"),gd=o("a"),O$=r("Automatic Differentiation"),Q$=c(),_u=o("li"),_d=o("a"),D$=r("Vectorization"),Y$=c(),yu=o("li"),yd=o("a"),H$=r("Parallelization"),K$=c(),ro=o("div"),k(bd.$$.fragment),eF=c(),Rn=o("p"),tF=r("The "),bu=o("code"),oF=r("FlaxElectraPreTrainedModel"),nF=r(" forward method, overrides the "),Tu=o("code"),sF=r("__call__"),aF=r(" special method."),rF=c(),k(Ma.$$.fragment),lF=c(),k(Ea.$$.fragment),Ug=c(),Pn=o("h2"),$a=o("a"),ku=o("span"),k(Td.$$.fragment),iF=c(),vu=o("span"),dF=r("FlaxElectraForTokenClassification"),Ig=c(),et=o("div"),k(kd.$$.fragment),cF=c(),wu=o("p"),pF=r("Electra model with a token classification head on top."),hF=c(),Mu=o("p"),mF=r("Both the discriminator and generator may be loaded into this model."),uF=c(),vd=o("p"),fF=r("This model inherits from "),Lc=o("a"),gF=r("FlaxPreTrainedModel"),_F=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)`),yF=c(),wd=o("p"),bF=r(`This model is also a Flax Linen
`),Md=o("a"),TF=r("flax.nn.Module"),kF=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),vF=c(),Eu=o("p"),wF=r("Finally, this model supports inherent JAX features such as:"),MF=c(),Mo=o("ul"),$u=o("li"),Ed=o("a"),EF=r("Just-In-Time (JIT) compilation"),$F=c(),Fu=o("li"),$d=o("a"),FF=r("Automatic Differentiation"),jF=c(),ju=o("li"),Fd=o("a"),xF=r("Vectorization"),CF=c(),xu=o("li"),jd=o("a"),zF=r("Parallelization"),JF=c(),lo=o("div"),k(xd.$$.fragment),UF=c(),Vn=o("p"),IF=r("The "),Cu=o("code"),WF=r("FlaxElectraPreTrainedModel"),NF=r(" forward method, overrides the "),zu=o("code"),ZF=r("__call__"),qF=r(" special method."),AF=c(),k(Fa.$$.fragment),GF=c(),k(ja.$$.fragment),Wg=c(),Bn=o("h2"),xa=o("a"),Ju=o("span"),k(Cd.$$.fragment),RF=c(),Uu=o("span"),PF=r("FlaxElectraForQuestionAnswering"),Ng=c(),ct=o("div"),k(zd.$$.fragment),VF=c(),Sn=o("p"),BF=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 `),Iu=o("code"),SF=r("span start logits"),XF=r(" and "),Wu=o("code"),LF=r("span end logits"),OF=r(")."),QF=c(),Jd=o("p"),DF=r("This model inherits from "),Oc=o("a"),YF=r("FlaxPreTrainedModel"),HF=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)`),KF=c(),Ud=o("p"),ej=r(`This model is also a Flax Linen
`),Id=o("a"),tj=r("flax.nn.Module"),oj=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),nj=c(),Nu=o("p"),sj=r("Finally, this model supports inherent JAX features such as:"),aj=c(),Eo=o("ul"),Zu=o("li"),Wd=o("a"),rj=r("Just-In-Time (JIT) compilation"),lj=c(),qu=o("li"),Nd=o("a"),ij=r("Automatic Differentiation"),dj=c(),Au=o("li"),Zd=o("a"),cj=r("Vectorization"),pj=c(),Gu=o("li"),qd=o("a"),hj=r("Parallelization"),mj=c(),io=o("div"),k(Ad.$$.fragment),uj=c(),Xn=o("p"),fj=r("The "),Ru=o("code"),gj=r("FlaxElectraPreTrainedModel"),_j=r(" forward method, overrides the "),Pu=o("code"),yj=r("__call__"),bj=r(" special method."),Tj=c(),k(Ca.$$.fragment),kj=c(),k(za.$$.fragment),this.h()},l(s){const y=KU('[data-svelte="svelte-1phssyn"]',document.head);d=n(y,"META",{name:!0,content:!0}),y.forEach(t),b=p(s),u=n(s,"H1",{class:!0});var Gd=a(u);f=n(Gd,"A",{id:!0,class:!0,href:!0});var Vu=a(f);_=n(Vu,"SPAN",{});var Bu=a(_);v(i.$$.fragment,Bu),Bu.forEach(t),Vu.forEach(t),h=p(Gd),x=n(Gd,"SPAN",{});var Su=a(x);be=l(Su,"ELECTRA"),Su.forEach(t),Gd.forEach(t),fe=p(s),R=n(s,"DIV",{class:!0});var Rd=a(R);de=n(Rd,"A",{href:!0});var Xu=a(de);te=n(Xu,"IMG",{alt:!0,src:!0}),Xu.forEach(t),Te=p(Rd),X=n(Rd,"A",{href:!0});var Lu=a(X);ce=n(Lu,"IMG",{alt:!0,src:!0}),Lu.forEach(t),Rd.forEach(t),D=p(s),ae=n(s,"H2",{class:!0});var Pd=a(ae);re=n(Pd,"A",{id:!0,class:!0,href:!0});var Ou=a(re);L=n(Ou,"SPAN",{});var Qu=a(L);v(le.$$.fragment,Qu),Qu.forEach(t),Ou.forEach(t),ke=p(Pd),O=n(Pd,"SPAN",{});var Du=a(O);ve=l(Du,"Overview"),Du.forEach(t),Pd.forEach(t),ge=p(s),B=n(s,"P",{});var Vd=a(B);we=l(Vd,"The ELECTRA model was proposed in the paper "),ie=n(Vd,"A",{href:!0,rel:!0});var Yu=a(ie);ne=l(Yu,`ELECTRA: Pre-training Text Encoders as Discriminators Rather Than
Generators`),Yu.forEach(t),J=l(Vd,`. 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.`),Vd.forEach(t),I=p(s),pe=n(s,"P",{});var Hu=a(pe);H=l(Hu,"The abstract from the paper is the following:"),Hu.forEach(t),_e=p(s),he=n(s,"P",{});var Ku=a(he);Q=n(Ku,"EM",{});var ef=a(Q);Me=l(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),Ku.forEach(t),ye=p(s),U=n(s,"P",{});var tf=a(U);Ee=l(tf,"Tips:"),tf.forEach(t),Y=p(s),se=n(s,"UL",{});var Ln=a(se);me=n(Ln,"LI",{});var of=a(me);K=l(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),$e=p(Ln),ue=n(Ln,"LI",{});var nf=a(ue);G=l(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),Fe=p(Ln),q=n(Ln,"LI",{});var $o=a(q);je=l($o,"The ELECTRA checkpoints saved using "),ee=n($o,"A",{href:!0,rel:!0});var sf=a(ee);W=l(sf,"Google Research\u2019s implementation"),sf.forEach(t),xe=l($o,`
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
`),N=n($o,"A",{href:!0});var af=a(N);Ce=l(af,"ElectraForMaskedLM"),af.forEach(t),ze=l($o,` model, and the generator may be loaded in the
`),T=n($o,"A",{href:!0});var rf=a(T);C=l(rf,"ElectraForPreTraining"),rf.forEach(t),Xe=l($o,` model (the classification head will be randomly initialized as it
doesn\u2019t exist in the generator).`),$o.forEach(t),Ln.forEach(t),oe=p(s),Je=n(s,"P",{});var On=a(Je);Le=l(On,"This model was contributed by "),z=n(On,"A",{href:!0,rel:!0});var lf=a(z);Oe=l(lf,"lysandre"),lf.forEach(t),Qe=l(On,". The original code can be found "),Re=n(On,"A",{href:!0,rel:!0});var df=a(Re);De=l(df,"here"),df.forEach(t),Ye=l(On,"."),On.forEach(t),A=p(s),P=n(s,"H2",{class:!0});var Bd=a(P);Ge=n(Bd,"A",{id:!0,class:!0,href:!0});var cf=a(Ge);Pe=n(cf,"SPAN",{});var pf=a(Pe);v(S.$$.fragment,pf),pf.forEach(t),cf.forEach(t),He=p(Bd),Ve=n(Bd,"SPAN",{});var hf=a(Ve);Ue=l(hf,"Documentation resources"),hf.forEach(t),Bd.forEach(t),Se=p(s),V=n(s,"UL",{});var Ft=a(V);Be=n(Ft,"LI",{});var mf=a(Be);Ld=n(mf,"A",{href:!0});var uf=a(Ld);fy=l(uf,"Text classification task guide"),uf.forEach(t),mf.forEach(t),gy=p(Ft),Ep=n(Ft,"LI",{});var ff=a(Ep);Od=n(ff,"A",{href:!0});var gf=a(Od);_y=l(gf,"Token classification task guide"),gf.forEach(t),ff.forEach(t),yy=p(Ft),$p=n(Ft,"LI",{});var _f=a($p);Qd=n(_f,"A",{href:!0});var yf=a(Qd);by=l(yf,"Question answering task guide"),yf.forEach(t),_f.forEach(t),Ty=p(Ft),Fp=n(Ft,"LI",{});var bf=a(Fp);Dd=n(bf,"A",{href:!0});var Tf=a(Dd);ky=l(Tf,"Causal language modeling task guide"),Tf.forEach(t),bf.forEach(t),vy=p(Ft),jp=n(Ft,"LI",{});var kf=a(jp);Yd=n(kf,"A",{href:!0});var vf=a(Yd);wy=l(vf,"Masked language modeling task guide"),vf.forEach(t),kf.forEach(t),My=p(Ft),xp=n(Ft,"LI",{});var wf=a(xp);Hd=n(wf,"A",{href:!0});var Mf=a(Hd);Ey=l(Mf,"Multiple choice task guide"),Mf.forEach(t),wf.forEach(t),Ft.forEach(t),Nf=p(s),Po=n(s,"H2",{class:!0});var Sd=a(Po);Dn=n(Sd,"A",{id:!0,class:!0,href:!0});var Ef=a(Dn);Cp=n(Ef,"SPAN",{});var $f=a(Cp);v(rr.$$.fragment,$f),$f.forEach(t),Ef.forEach(t),$y=p(Sd),zp=n(Sd,"SPAN",{});var Ff=a(zp);Fy=l(Ff,"ElectraConfig"),Ff.forEach(t),Sd.forEach(t),Zf=p(s),Pt=n(s,"DIV",{class:!0});var Fo=a(Pt);v(lr.$$.fragment,Fo),jy=p(Fo),_o=n(Fo,"P",{});var jo=a(_o);xy=l(jo,"This is the configuration class to store the configuration of a "),Kd=n(jo,"A",{href:!0});var jf=a(Kd);Cy=l(jf,"ElectraModel"),jf.forEach(t),zy=l(jo," or a "),ec=n(jo,"A",{href:!0});var xf=a(ec);Jy=l(xf,"TFElectraModel"),xf.forEach(t),Uy=l(jo,`. 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
`),ir=n(jo,"A",{href:!0,rel:!0});var Cf=a(ir);Iy=l(Cf,"google/electra-small-discriminator"),Cf.forEach(t),Wy=l(jo," architecture."),jo.forEach(t),Ny=p(Fo),Vo=n(Fo,"P",{});var Qn=a(Vo);Zy=l(Qn,"Configuration objects inherit from "),tc=n(Qn,"A",{href:!0});var zf=a(tc);qy=l(zf,"PretrainedConfig"),zf.forEach(t),Ay=l(Qn,` and can be used to control the model outputs. Read the
documentation from `),oc=n(Qn,"A",{href:!0});var Jf=a(oc);Gy=l(Jf,"PretrainedConfig"),Jf.forEach(t),Ry=l(Qn," for more information."),Qn.forEach(t),Py=p(Fo),v(Yn.$$.fragment,Fo),Fo.forEach(t),qf=p(s),Bo=n(s,"H2",{class:!0});var Xd=a(Bo);Hn=n(Xd,"A",{id:!0,class:!0,href:!0});var Uf=a(Hn);Jp=n(Uf,"SPAN",{});var If=a(Jp);v(dr.$$.fragment,If),If.forEach(t),Uf.forEach(t),Vy=p(Xd),Up=n(Xd,"SPAN",{});var Wf=a(Up);By=l(Wf,"ElectraTokenizer"),Wf.forEach(t),Xd.forEach(t),Af=p(s),tt=n(s,"DIV",{class:!0});var yt=a(tt);v(cr.$$.fragment,yt),Sy=p(yt),Ip=n(yt,"P",{});var $j=a(Ip);Xy=l($j,"Construct a Electra tokenizer. Based on WordPiece."),$j.forEach(t),Ly=p(yt),pr=n(yt,"P",{});var qg=a(pr);Oy=l(qg,"This tokenizer inherits from "),nc=n(qg,"A",{href:!0});var Fj=a(nc);Qy=l(Fj,"PreTrainedTokenizer"),Fj.forEach(t),Dy=l(qg,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),qg.forEach(t),Yy=p(yt),xo=n(yt,"DIV",{class:!0});var Qc=a(xo);v(hr.$$.fragment,Qc),Hy=p(Qc),Wp=n(Qc,"P",{});var jj=a(Wp);Ky=l(jj,`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:`),jj.forEach(t),eb=p(Qc),mr=n(Qc,"UL",{});var Ag=a(mr);sc=n(Ag,"LI",{});var vj=a(sc);tb=l(vj,"single sequence: "),Np=n(vj,"CODE",{});var xj=a(Np);ob=l(xj,"[CLS] X [SEP]"),xj.forEach(t),vj.forEach(t),nb=p(Ag),ac=n(Ag,"LI",{});var wj=a(ac);sb=l(wj,"pair of sequences: "),Zp=n(wj,"CODE",{});var Cj=a(Zp);ab=l(Cj,"[CLS] A [SEP] B [SEP]"),Cj.forEach(t),wj.forEach(t),Ag.forEach(t),Qc.forEach(t),rb=p(yt),Kn=n(yt,"DIV",{class:!0});var Gg=a(Kn);v(ur.$$.fragment,Gg),lb=p(Gg),qp=n(Gg,"P",{});var zj=a(qp);ib=l(zj,"Converts a sequence of tokens (string) in a single string."),zj.forEach(t),Gg.forEach(t),db=p(yt),Vt=n(yt,"DIV",{class:!0});var Ja=a(Vt);v(fr.$$.fragment,Ja),cb=p(Ja),Ap=n(Ja,"P",{});var Jj=a(Ap);pb=l(Jj,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A Electra"),Jj.forEach(t),hb=p(Ja),v(es.$$.fragment,Ja),mb=p(Ja),So=n(Ja,"P",{});var Dc=a(So);ub=l(Dc,"If "),Gp=n(Dc,"CODE",{});var Uj=a(Gp);fb=l(Uj,"token_ids_1"),Uj.forEach(t),gb=l(Dc," is "),Rp=n(Dc,"CODE",{});var Ij=a(Rp);_b=l(Ij,"None"),Ij.forEach(t),yb=l(Dc,", this method only returns the first portion of the mask (0s)."),Dc.forEach(t),Ja.forEach(t),bb=p(yt),ts=n(yt,"DIV",{class:!0});var Rg=a(ts);v(gr.$$.fragment,Rg),Tb=p(Rg),_r=n(Rg,"P",{});var Pg=a(_r);kb=l(Pg,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Pp=n(Pg,"CODE",{});var Wj=a(Pp);vb=l(Wj,"prepare_for_model"),Wj.forEach(t),wb=l(Pg," method."),Pg.forEach(t),Rg.forEach(t),yt.forEach(t),Gf=p(s),Xo=n(s,"H2",{class:!0});var Vg=a(Xo);os=n(Vg,"A",{id:!0,class:!0,href:!0});var Nj=a(os);Vp=n(Nj,"SPAN",{});var Zj=a(Vp);v(yr.$$.fragment,Zj),Zj.forEach(t),Nj.forEach(t),Mb=p(Vg),Bp=n(Vg,"SPAN",{});var qj=a(Bp);Eb=l(qj,"ElectraTokenizerFast"),qj.forEach(t),Vg.forEach(t),Rf=p(s),kt=n(s,"DIV",{class:!0});var zo=a(kt);v(br.$$.fragment,zo),$b=p(zo),Tr=n(zo,"P",{});var Bg=a(Tr);Fb=l(Bg,"Construct a \u201Cfast\u201D ELECTRA tokenizer (backed by HuggingFace\u2019s "),Sp=n(Bg,"EM",{});var Aj=a(Sp);jb=l(Aj,"tokenizers"),Aj.forEach(t),xb=l(Bg," library). Based on WordPiece."),Bg.forEach(t),Cb=p(zo),kr=n(zo,"P",{});var Sg=a(kr);zb=l(Sg,"This tokenizer inherits from "),rc=n(Sg,"A",{href:!0});var Gj=a(rc);Jb=l(Gj,"PreTrainedTokenizerFast"),Gj.forEach(t),Ub=l(Sg,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Sg.forEach(t),Ib=p(zo),Co=n(zo,"DIV",{class:!0});var Yc=a(Co);v(vr.$$.fragment,Yc),Wb=p(Yc),Xp=n(Yc,"P",{});var Rj=a(Xp);Nb=l(Rj,`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:`),Rj.forEach(t),Zb=p(Yc),wr=n(Yc,"UL",{});var Xg=a(wr);lc=n(Xg,"LI",{});var Mj=a(lc);qb=l(Mj,"single sequence: "),Lp=n(Mj,"CODE",{});var Pj=a(Lp);Ab=l(Pj,"[CLS] X [SEP]"),Pj.forEach(t),Mj.forEach(t),Gb=p(Xg),ic=n(Xg,"LI",{});var Ej=a(ic);Rb=l(Ej,"pair of sequences: "),Op=n(Ej,"CODE",{});var Vj=a(Op);Pb=l(Vj,"[CLS] A [SEP] B [SEP]"),Vj.forEach(t),Ej.forEach(t),Xg.forEach(t),Yc.forEach(t),Vb=p(zo),Bt=n(zo,"DIV",{class:!0});var Ua=a(Bt);v(Mr.$$.fragment,Ua),Bb=p(Ua),Qp=n(Ua,"P",{});var Bj=a(Qp);Sb=l(Bj,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A ELECTRA"),Bj.forEach(t),Xb=p(Ua),v(ns.$$.fragment,Ua),Lb=p(Ua),Lo=n(Ua,"P",{});var Hc=a(Lo);Ob=l(Hc,"If "),Dp=n(Hc,"CODE",{});var Sj=a(Dp);Qb=l(Sj,"token_ids_1"),Sj.forEach(t),Db=l(Hc," is "),Yp=n(Hc,"CODE",{});var Xj=a(Yp);Yb=l(Xj,"None"),Xj.forEach(t),Hb=l(Hc,", this method only returns the first portion of the mask (0s)."),Hc.forEach(t),Ua.forEach(t),zo.forEach(t),Pf=p(s),Oo=n(s,"H2",{class:!0});var Lg=a(Oo);ss=n(Lg,"A",{id:!0,class:!0,href:!0});var Lj=a(ss);Hp=n(Lj,"SPAN",{});var Oj=a(Hp);v(Er.$$.fragment,Oj),Oj.forEach(t),Lj.forEach(t),Kb=p(Lg),Kp=n(Lg,"SPAN",{});var Qj=a(Kp);eT=l(Qj,"Electra specific outputs"),Qj.forEach(t),Lg.forEach(t),Vf=p(s),Qo=n(s,"DIV",{class:!0});var Og=a(Qo);v($r.$$.fragment,Og),tT=p(Og),Fr=n(Og,"P",{});var Qg=a(Fr);oT=l(Qg,"Output type of "),dc=n(Qg,"A",{href:!0});var Dj=a(dc);nT=l(Dj,"ElectraForPreTraining"),Dj.forEach(t),sT=l(Qg,"."),Qg.forEach(t),Og.forEach(t),Bf=p(s),Do=n(s,"DIV",{class:!0});var Dg=a(Do);v(jr.$$.fragment,Dg),aT=p(Dg),xr=n(Dg,"P",{});var Yg=a(xr);rT=l(Yg,"Output type of "),cc=n(Yg,"A",{href:!0});var Yj=a(cc);lT=l(Yj,"TFElectraForPreTraining"),Yj.forEach(t),iT=l(Yg,"."),Yg.forEach(t),Dg.forEach(t),Sf=p(s),Yo=n(s,"H2",{class:!0});var Hg=a(Yo);as=n(Hg,"A",{id:!0,class:!0,href:!0});var Hj=a(as);eh=n(Hj,"SPAN",{});var Kj=a(eh);v(Cr.$$.fragment,Kj),Kj.forEach(t),Hj.forEach(t),dT=p(Hg),th=n(Hg,"SPAN",{});var ex=a(th);cT=l(ex,"ElectraModel"),ex.forEach(t),Hg.forEach(t),Xf=p(s),vt=n(s,"DIV",{class:!0});var Jo=a(vt);v(zr.$$.fragment,Jo),pT=p(Jo),oh=n(Jo,"P",{});var tx=a(oh);hT=l(tx,"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."),tx.forEach(t),mT=p(Jo),Jr=n(Jo,"P",{});var Kg=a(Jr);uT=l(Kg,"This model inherits from "),pc=n(Kg,"A",{href:!0});var ox=a(pc);fT=l(ox,"PreTrainedModel"),ox.forEach(t),gT=l(Kg,`. 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.)`),Kg.forEach(t),_T=p(Jo),Ur=n(Jo,"P",{});var e_=a(Ur);yT=l(e_,"This model is also a PyTorch "),Ir=n(e_,"A",{href:!0,rel:!0});var nx=a(Ir);bT=l(nx,"torch.nn.Module"),nx.forEach(t),TT=l(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),kT=p(Jo),St=n(Jo,"DIV",{class:!0});var Ia=a(St);v(Wr.$$.fragment,Ia),vT=p(Ia),Ho=n(Ia,"P",{});var Kc=a(Ho);wT=l(Kc,"The "),hc=n(Kc,"A",{href:!0});var sx=a(hc);MT=l(sx,"ElectraModel"),sx.forEach(t),ET=l(Kc," forward method, overrides the "),nh=n(Kc,"CODE",{});var ax=a(nh);$T=l(ax,"__call__"),ax.forEach(t),FT=l(Kc," special method."),Kc.forEach(t),jT=p(Ia),v(rs.$$.fragment,Ia),xT=p(Ia),v(ls.$$.fragment,Ia),Ia.forEach(t),Jo.forEach(t),Lf=p(s),Ko=n(s,"H2",{class:!0});var t_=a(Ko);is=n(t_,"A",{id:!0,class:!0,href:!0});var rx=a(is);sh=n(rx,"SPAN",{});var lx=a(sh);v(Nr.$$.fragment,lx),lx.forEach(t),rx.forEach(t),CT=p(t_),ah=n(t_,"SPAN",{});var ix=a(ah);zT=l(ix,"ElectraForPreTraining"),ix.forEach(t),t_.forEach(t),Of=p(s),pt=n(s,"DIV",{class:!0});var co=a(pt);v(Zr.$$.fragment,co),JT=p(co),rh=n(co,"P",{});var dx=a(rh);UT=l(dx,"Electra model with a binary classification head on top as used during pretraining for identifying generated tokens."),dx.forEach(t),IT=p(co),lh=n(co,"P",{});var cx=a(lh);WT=l(cx,"It is recommended to load the discriminator checkpoint into that model."),cx.forEach(t),NT=p(co),qr=n(co,"P",{});var o_=a(qr);ZT=l(o_,"This model inherits from "),mc=n(o_,"A",{href:!0});var px=a(mc);qT=l(px,"PreTrainedModel"),px.forEach(t),AT=l(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),GT=p(co),Ar=n(co,"P",{});var n_=a(Ar);RT=l(n_,"This model is also a PyTorch "),Gr=n(n_,"A",{href:!0,rel:!0});var hx=a(Gr);PT=l(hx,"torch.nn.Module"),hx.forEach(t),VT=l(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),BT=p(co),Xt=n(co,"DIV",{class:!0});var Wa=a(Xt);v(Rr.$$.fragment,Wa),ST=p(Wa),en=n(Wa,"P",{});var ep=a(en);XT=l(ep,"The "),uc=n(ep,"A",{href:!0});var mx=a(uc);LT=l(mx,"ElectraForPreTraining"),mx.forEach(t),OT=l(ep," forward method, overrides the "),ih=n(ep,"CODE",{});var ux=a(ih);QT=l(ux,"__call__"),ux.forEach(t),DT=l(ep," special method."),ep.forEach(t),YT=p(Wa),v(ds.$$.fragment,Wa),HT=p(Wa),v(cs.$$.fragment,Wa),Wa.forEach(t),co.forEach(t),Qf=p(s),tn=n(s,"H2",{class:!0});var s_=a(tn);ps=n(s_,"A",{id:!0,class:!0,href:!0});var fx=a(ps);dh=n(fx,"SPAN",{});var gx=a(dh);v(Pr.$$.fragment,gx),gx.forEach(t),fx.forEach(t),KT=p(s_),ch=n(s_,"SPAN",{});var _x=a(ch);ek=l(_x,"ElectraForCausalLM"),_x.forEach(t),s_.forEach(t),Df=p(s),wt=n(s,"DIV",{class:!0});var Uo=a(wt);v(Vr.$$.fragment,Uo),tk=p(Uo),Br=n(Uo,"P",{});var a_=a(Br);ok=l(a_,"ELECTRA Model with a "),ph=n(a_,"CODE",{});var yx=a(ph);nk=l(yx,"language modeling"),yx.forEach(t),sk=l(a_," head on top for CLM fine-tuning."),a_.forEach(t),ak=p(Uo),Sr=n(Uo,"P",{});var r_=a(Sr);rk=l(r_,"This model inherits from "),fc=n(r_,"A",{href:!0});var bx=a(fc);lk=l(bx,"PreTrainedModel"),bx.forEach(t),ik=l(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),dk=p(Uo),Xr=n(Uo,"P",{});var l_=a(Xr);ck=l(l_,"This model is also a PyTorch "),Lr=n(l_,"A",{href:!0,rel:!0});var Tx=a(Lr);pk=l(Tx,"torch.nn.Module"),Tx.forEach(t),hk=l(l_,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),l_.forEach(t),mk=p(Uo),Lt=n(Uo,"DIV",{class:!0});var Na=a(Lt);v(Or.$$.fragment,Na),uk=p(Na),on=n(Na,"P",{});var tp=a(on);fk=l(tp,"The "),gc=n(tp,"A",{href:!0});var kx=a(gc);gk=l(kx,"ElectraForCausalLM"),kx.forEach(t),_k=l(tp," forward method, overrides the "),hh=n(tp,"CODE",{});var vx=a(hh);yk=l(vx,"__call__"),vx.forEach(t),bk=l(tp," special method."),tp.forEach(t),Tk=p(Na),v(hs.$$.fragment,Na),kk=p(Na),v(ms.$$.fragment,Na),Na.forEach(t),Uo.forEach(t),Yf=p(s),nn=n(s,"H2",{class:!0});var i_=a(nn);us=n(i_,"A",{id:!0,class:!0,href:!0});var wx=a(us);mh=n(wx,"SPAN",{});var Mx=a(mh);v(Qr.$$.fragment,Mx),Mx.forEach(t),wx.forEach(t),vk=p(i_),uh=n(i_,"SPAN",{});var Ex=a(uh);wk=l(Ex,"ElectraForMaskedLM"),Ex.forEach(t),i_.forEach(t),Hf=p(s),ht=n(s,"DIV",{class:!0});var po=a(ht);v(Dr.$$.fragment,po),Mk=p(po),fh=n(po,"P",{});var $x=a(fh);Ek=l($x,"Electra model with a language modeling head on top."),$x.forEach(t),$k=p(po),gh=n(po,"P",{});var Fx=a(gh);Fk=l(Fx,`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.`),Fx.forEach(t),jk=p(po),Yr=n(po,"P",{});var d_=a(Yr);xk=l(d_,"This model inherits from "),_c=n(d_,"A",{href:!0});var jx=a(_c);Ck=l(jx,"PreTrainedModel"),jx.forEach(t),zk=l(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),Jk=p(po),Hr=n(po,"P",{});var c_=a(Hr);Uk=l(c_,"This model is also a PyTorch "),Kr=n(c_,"A",{href:!0,rel:!0});var xx=a(Kr);Ik=l(xx,"torch.nn.Module"),xx.forEach(t),Wk=l(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),Nk=p(po),Ot=n(po,"DIV",{class:!0});var Za=a(Ot);v(el.$$.fragment,Za),Zk=p(Za),sn=n(Za,"P",{});var op=a(sn);qk=l(op,"The "),yc=n(op,"A",{href:!0});var Cx=a(yc);Ak=l(Cx,"ElectraForMaskedLM"),Cx.forEach(t),Gk=l(op," forward method, overrides the "),_h=n(op,"CODE",{});var zx=a(_h);Rk=l(zx,"__call__"),zx.forEach(t),Pk=l(op," special method."),op.forEach(t),Vk=p(Za),v(fs.$$.fragment,Za),Bk=p(Za),v(gs.$$.fragment,Za),Za.forEach(t),po.forEach(t),Kf=p(s),an=n(s,"H2",{class:!0});var p_=a(an);_s=n(p_,"A",{id:!0,class:!0,href:!0});var Jx=a(_s);yh=n(Jx,"SPAN",{});var Ux=a(yh);v(tl.$$.fragment,Ux),Ux.forEach(t),Jx.forEach(t),Sk=p(p_),bh=n(p_,"SPAN",{});var Ix=a(bh);Xk=l(Ix,"ElectraForSequenceClassification"),Ix.forEach(t),p_.forEach(t),eg=p(s),Mt=n(s,"DIV",{class:!0});var Io=a(Mt);v(ol.$$.fragment,Io),Lk=p(Io),Th=n(Io,"P",{});var Wx=a(Th);Ok=l(Wx,`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.`),Wx.forEach(t),Qk=p(Io),nl=n(Io,"P",{});var h_=a(nl);Dk=l(h_,"This model inherits from "),bc=n(h_,"A",{href:!0});var Nx=a(bc);Yk=l(Nx,"PreTrainedModel"),Nx.forEach(t),Hk=l(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),Kk=p(Io),sl=n(Io,"P",{});var m_=a(sl);ev=l(m_,"This model is also a PyTorch "),al=n(m_,"A",{href:!0,rel:!0});var Zx=a(al);tv=l(Zx,"torch.nn.Module"),Zx.forEach(t),ov=l(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),nv=p(Io),jt=n(Io,"DIV",{class:!0});var Wo=a(jt);v(rl.$$.fragment,Wo),sv=p(Wo),rn=n(Wo,"P",{});var np=a(rn);av=l(np,"The "),Tc=n(np,"A",{href:!0});var qx=a(Tc);rv=l(qx,"ElectraForSequenceClassification"),qx.forEach(t),lv=l(np," forward method, overrides the "),kh=n(np,"CODE",{});var Ax=a(kh);iv=l(Ax,"__call__"),Ax.forEach(t),dv=l(np," special method."),np.forEach(t),cv=p(Wo),v(ys.$$.fragment,Wo),pv=p(Wo),v(bs.$$.fragment,Wo),hv=p(Wo),v(Ts.$$.fragment,Wo),Wo.forEach(t),Io.forEach(t),tg=p(s),ln=n(s,"H2",{class:!0});var u_=a(ln);ks=n(u_,"A",{id:!0,class:!0,href:!0});var Gx=a(ks);vh=n(Gx,"SPAN",{});var Rx=a(vh);v(ll.$$.fragment,Rx),Rx.forEach(t),Gx.forEach(t),mv=p(u_),wh=n(u_,"SPAN",{});var Px=a(wh);uv=l(Px,"ElectraForMultipleChoice"),Px.forEach(t),u_.forEach(t),og=p(s),Et=n(s,"DIV",{class:!0});var No=a(Et);v(il.$$.fragment,No),fv=p(No),Mh=n(No,"P",{});var Vx=a(Mh);gv=l(Vx,`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.`),Vx.forEach(t),_v=p(No),dl=n(No,"P",{});var f_=a(dl);yv=l(f_,"This model inherits from "),kc=n(f_,"A",{href:!0});var Bx=a(kc);bv=l(Bx,"PreTrainedModel"),Bx.forEach(t),Tv=l(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),kv=p(No),cl=n(No,"P",{});var g_=a(cl);vv=l(g_,"This model is also a PyTorch "),pl=n(g_,"A",{href:!0,rel:!0});var Sx=a(pl);wv=l(Sx,"torch.nn.Module"),Sx.forEach(t),Mv=l(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),Ev=p(No),Qt=n(No,"DIV",{class:!0});var qa=a(Qt);v(hl.$$.fragment,qa),$v=p(qa),dn=n(qa,"P",{});var sp=a(dn);Fv=l(sp,"The "),vc=n(sp,"A",{href:!0});var Xx=a(vc);jv=l(Xx,"ElectraForMultipleChoice"),Xx.forEach(t),xv=l(sp," forward method, overrides the "),Eh=n(sp,"CODE",{});var Lx=a(Eh);Cv=l(Lx,"__call__"),Lx.forEach(t),zv=l(sp," special method."),sp.forEach(t),Jv=p(qa),v(vs.$$.fragment,qa),Uv=p(qa),v(ws.$$.fragment,qa),qa.forEach(t),No.forEach(t),ng=p(s),cn=n(s,"H2",{class:!0});var __=a(cn);Ms=n(__,"A",{id:!0,class:!0,href:!0});var Ox=a(Ms);$h=n(Ox,"SPAN",{});var Qx=a($h);v(ml.$$.fragment,Qx),Qx.forEach(t),Ox.forEach(t),Iv=p(__),Fh=n(__,"SPAN",{});var Dx=a(Fh);Wv=l(Dx,"ElectraForTokenClassification"),Dx.forEach(t),__.forEach(t),sg=p(s),mt=n(s,"DIV",{class:!0});var ho=a(mt);v(ul.$$.fragment,ho),Nv=p(ho),jh=n(ho,"P",{});var Yx=a(jh);Zv=l(Yx,"Electra model with a token classification head on top."),Yx.forEach(t),qv=p(ho),xh=n(ho,"P",{});var Hx=a(xh);Av=l(Hx,"Both the discriminator and generator may be loaded into this model."),Hx.forEach(t),Gv=p(ho),fl=n(ho,"P",{});var y_=a(fl);Rv=l(y_,"This model inherits from "),wc=n(y_,"A",{href:!0});var Kx=a(wc);Pv=l(Kx,"PreTrainedModel"),Kx.forEach(t),Vv=l(y_,`. 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_.forEach(t),Bv=p(ho),gl=n(ho,"P",{});var b_=a(gl);Sv=l(b_,"This model is also a PyTorch "),_l=n(b_,"A",{href:!0,rel:!0});var eC=a(_l);Xv=l(eC,"torch.nn.Module"),eC.forEach(t),Lv=l(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),Ov=p(ho),Dt=n(ho,"DIV",{class:!0});var Aa=a(Dt);v(yl.$$.fragment,Aa),Qv=p(Aa),pn=n(Aa,"P",{});var ap=a(pn);Dv=l(ap,"The "),Mc=n(ap,"A",{href:!0});var tC=a(Mc);Yv=l(tC,"ElectraForTokenClassification"),tC.forEach(t),Hv=l(ap," forward method, overrides the "),Ch=n(ap,"CODE",{});var oC=a(Ch);Kv=l(oC,"__call__"),oC.forEach(t),ew=l(ap," special method."),ap.forEach(t),tw=p(Aa),v(Es.$$.fragment,Aa),ow=p(Aa),v($s.$$.fragment,Aa),Aa.forEach(t),ho.forEach(t),ag=p(s),hn=n(s,"H2",{class:!0});var T_=a(hn);Fs=n(T_,"A",{id:!0,class:!0,href:!0});var nC=a(Fs);zh=n(nC,"SPAN",{});var sC=a(zh);v(bl.$$.fragment,sC),sC.forEach(t),nC.forEach(t),nw=p(T_),Jh=n(T_,"SPAN",{});var aC=a(Jh);sw=l(aC,"ElectraForQuestionAnswering"),aC.forEach(t),T_.forEach(t),rg=p(s),$t=n(s,"DIV",{class:!0});var Zo=a($t);v(Tl.$$.fragment,Zo),aw=p(Zo),mn=n(Zo,"P",{});var rp=a(mn);rw=l(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 `),Uh=n(rp,"CODE",{});var rC=a(Uh);lw=l(rC,"span start logits"),rC.forEach(t),iw=l(rp," and "),Ih=n(rp,"CODE",{});var lC=a(Ih);dw=l(lC,"span end logits"),lC.forEach(t),cw=l(rp,")."),rp.forEach(t),pw=p(Zo),kl=n(Zo,"P",{});var k_=a(kl);hw=l(k_,"This model inherits from "),Ec=n(k_,"A",{href:!0});var iC=a(Ec);mw=l(iC,"PreTrainedModel"),iC.forEach(t),uw=l(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),fw=p(Zo),vl=n(Zo,"P",{});var v_=a(vl);gw=l(v_,"This model is also a PyTorch "),wl=n(v_,"A",{href:!0,rel:!0});var dC=a(wl);_w=l(dC,"torch.nn.Module"),dC.forEach(t),yw=l(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),bw=p(Zo),Yt=n(Zo,"DIV",{class:!0});var Ga=a(Yt);v(Ml.$$.fragment,Ga),Tw=p(Ga),un=n(Ga,"P",{});var lp=a(un);kw=l(lp,"The "),$c=n(lp,"A",{href:!0});var cC=a($c);vw=l(cC,"ElectraForQuestionAnswering"),cC.forEach(t),ww=l(lp," forward method, overrides the "),Wh=n(lp,"CODE",{});var pC=a(Wh);Mw=l(pC,"__call__"),pC.forEach(t),Ew=l(lp," special method."),lp.forEach(t),$w=p(Ga),v(js.$$.fragment,Ga),Fw=p(Ga),v(xs.$$.fragment,Ga),Ga.forEach(t),Zo.forEach(t),lg=p(s),fn=n(s,"H2",{class:!0});var w_=a(fn);Cs=n(w_,"A",{id:!0,class:!0,href:!0});var hC=a(Cs);Nh=n(hC,"SPAN",{});var mC=a(Nh);v(El.$$.fragment,mC),mC.forEach(t),hC.forEach(t),jw=p(w_),Zh=n(w_,"SPAN",{});var uC=a(Zh);xw=l(uC,"TFElectraModel"),uC.forEach(t),w_.forEach(t),ig=p(s),ut=n(s,"DIV",{class:!0});var mo=a(ut);v($l.$$.fragment,mo),Cw=p(mo),qh=n(mo,"P",{});var fC=a(qh);zw=l(fC,"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."),fC.forEach(t),Jw=p(mo),Fl=n(mo,"P",{});var M_=a(Fl);Uw=l(M_,"This model inherits from "),Fc=n(M_,"A",{href:!0});var gC=a(Fc);Iw=l(gC,"TFPreTrainedModel"),gC.forEach(t),Ww=l(M_,`. 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.)`),M_.forEach(t),Nw=p(mo),jl=n(mo,"P",{});var E_=a(jl);Zw=l(E_,"This model is also a "),xl=n(E_,"A",{href:!0,rel:!0});var _C=a(xl);qw=l(_C,"tf.keras.Model"),_C.forEach(t),Aw=l(E_,` 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.`),E_.forEach(t),Gw=p(mo),v(zs.$$.fragment,mo),Rw=p(mo),Ht=n(mo,"DIV",{class:!0});var Ra=a(Ht);v(Cl.$$.fragment,Ra),Pw=p(Ra),gn=n(Ra,"P",{});var ip=a(gn);Vw=l(ip,"The "),jc=n(ip,"A",{href:!0});var yC=a(jc);Bw=l(yC,"TFElectraModel"),yC.forEach(t),Sw=l(ip," forward method, overrides the "),Ah=n(ip,"CODE",{});var bC=a(Ah);Xw=l(bC,"__call__"),bC.forEach(t),Lw=l(ip," special method."),ip.forEach(t),Ow=p(Ra),v(Js.$$.fragment,Ra),Qw=p(Ra),v(Us.$$.fragment,Ra),Ra.forEach(t),mo.forEach(t),dg=p(s),_n=n(s,"H2",{class:!0});var $_=a(_n);Is=n($_,"A",{id:!0,class:!0,href:!0});var TC=a(Is);Gh=n(TC,"SPAN",{});var kC=a(Gh);v(zl.$$.fragment,kC),kC.forEach(t),TC.forEach(t),Dw=p($_),Rh=n($_,"SPAN",{});var vC=a(Rh);Yw=l(vC,"TFElectraForPreTraining"),vC.forEach(t),$_.forEach(t),cg=p(s),ot=n(s,"DIV",{class:!0});var Ut=a(ot);v(Jl.$$.fragment,Ut),Hw=p(Ut),Ph=n(Ut,"P",{});var wC=a(Ph);Kw=l(wC,"Electra model with a binary classification head on top as used during pretraining for identifying generated tokens."),wC.forEach(t),eM=p(Ut),Vh=n(Ut,"P",{});var MC=a(Vh);tM=l(MC,`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.`),MC.forEach(t),oM=p(Ut),Ul=n(Ut,"P",{});var F_=a(Ul);nM=l(F_,"This model inherits from "),xc=n(F_,"A",{href:!0});var EC=a(xc);sM=l(EC,"TFPreTrainedModel"),EC.forEach(t),aM=l(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),rM=p(Ut),Il=n(Ut,"P",{});var j_=a(Il);lM=l(j_,"This model is also a "),Wl=n(j_,"A",{href:!0,rel:!0});var $C=a(Wl);iM=l($C,"tf.keras.Model"),$C.forEach(t),dM=l(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),cM=p(Ut),v(Ws.$$.fragment,Ut),pM=p(Ut),Kt=n(Ut,"DIV",{class:!0});var Pa=a(Kt);v(Nl.$$.fragment,Pa),hM=p(Pa),yn=n(Pa,"P",{});var dp=a(yn);mM=l(dp,"The "),Cc=n(dp,"A",{href:!0});var FC=a(Cc);uM=l(FC,"TFElectraForPreTraining"),FC.forEach(t),fM=l(dp," forward method, overrides the "),Bh=n(dp,"CODE",{});var jC=a(Bh);gM=l(jC,"__call__"),jC.forEach(t),_M=l(dp," special method."),dp.forEach(t),yM=p(Pa),v(Ns.$$.fragment,Pa),bM=p(Pa),v(Zs.$$.fragment,Pa),Pa.forEach(t),Ut.forEach(t),pg=p(s),bn=n(s,"H2",{class:!0});var x_=a(bn);qs=n(x_,"A",{id:!0,class:!0,href:!0});var xC=a(qs);Sh=n(xC,"SPAN",{});var CC=a(Sh);v(Zl.$$.fragment,CC),CC.forEach(t),xC.forEach(t),TM=p(x_),Xh=n(x_,"SPAN",{});var zC=a(Xh);kM=l(zC,"TFElectraForMaskedLM"),zC.forEach(t),x_.forEach(t),hg=p(s),nt=n(s,"DIV",{class:!0});var It=a(nt);v(ql.$$.fragment,It),vM=p(It),Lh=n(It,"P",{});var JC=a(Lh);wM=l(JC,"Electra model with a language modeling head on top."),JC.forEach(t),MM=p(It),Oh=n(It,"P",{});var UC=a(Oh);EM=l(UC,`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.`),UC.forEach(t),$M=p(It),Al=n(It,"P",{});var C_=a(Al);FM=l(C_,"This model inherits from "),zc=n(C_,"A",{href:!0});var IC=a(zc);jM=l(IC,"TFPreTrainedModel"),IC.forEach(t),xM=l(C_,`. 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.)`),C_.forEach(t),CM=p(It),Gl=n(It,"P",{});var z_=a(Gl);zM=l(z_,"This model is also a "),Rl=n(z_,"A",{href:!0,rel:!0});var WC=a(Rl);JM=l(WC,"tf.keras.Model"),WC.forEach(t),UM=l(z_,` 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.`),z_.forEach(t),IM=p(It),v(As.$$.fragment,It),WM=p(It),xt=n(It,"DIV",{class:!0});var qo=a(xt);v(Pl.$$.fragment,qo),NM=p(qo),Tn=n(qo,"P",{});var cp=a(Tn);ZM=l(cp,"The "),Jc=n(cp,"A",{href:!0});var NC=a(Jc);qM=l(NC,"TFElectraForMaskedLM"),NC.forEach(t),AM=l(cp," forward method, overrides the "),Qh=n(cp,"CODE",{});var ZC=a(Qh);GM=l(ZC,"__call__"),ZC.forEach(t),RM=l(cp," special method."),cp.forEach(t),PM=p(qo),v(Gs.$$.fragment,qo),VM=p(qo),v(Rs.$$.fragment,qo),BM=p(qo),v(Ps.$$.fragment,qo),qo.forEach(t),It.forEach(t),mg=p(s),kn=n(s,"H2",{class:!0});var J_=a(kn);Vs=n(J_,"A",{id:!0,class:!0,href:!0});var qC=a(Vs);Dh=n(qC,"SPAN",{});var AC=a(Dh);v(Vl.$$.fragment,AC),AC.forEach(t),qC.forEach(t),SM=p(J_),Yh=n(J_,"SPAN",{});var GC=a(Yh);XM=l(GC,"TFElectraForSequenceClassification"),GC.forEach(t),J_.forEach(t),ug=p(s),ft=n(s,"DIV",{class:!0});var uo=a(ft);v(Bl.$$.fragment,uo),LM=p(uo),Hh=n(uo,"P",{});var RC=a(Hh);OM=l(RC,`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.`),RC.forEach(t),QM=p(uo),Sl=n(uo,"P",{});var U_=a(Sl);DM=l(U_,"This model inherits from "),Uc=n(U_,"A",{href:!0});var PC=a(Uc);YM=l(PC,"TFPreTrainedModel"),PC.forEach(t),HM=l(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),KM=p(uo),Xl=n(uo,"P",{});var I_=a(Xl);eE=l(I_,"This model is also a "),Ll=n(I_,"A",{href:!0,rel:!0});var VC=a(Ll);tE=l(VC,"tf.keras.Model"),VC.forEach(t),oE=l(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.`),I_.forEach(t),nE=p(uo),v(Bs.$$.fragment,uo),sE=p(uo),Ct=n(uo,"DIV",{class:!0});var Ao=a(Ct);v(Ol.$$.fragment,Ao),aE=p(Ao),vn=n(Ao,"P",{});var pp=a(vn);rE=l(pp,"The "),Ic=n(pp,"A",{href:!0});var BC=a(Ic);lE=l(BC,"TFElectraForSequenceClassification"),BC.forEach(t),iE=l(pp," forward method, overrides the "),Kh=n(pp,"CODE",{});var SC=a(Kh);dE=l(SC,"__call__"),SC.forEach(t),cE=l(pp," special method."),pp.forEach(t),pE=p(Ao),v(Ss.$$.fragment,Ao),hE=p(Ao),v(Xs.$$.fragment,Ao),mE=p(Ao),v(Ls.$$.fragment,Ao),Ao.forEach(t),uo.forEach(t),fg=p(s),wn=n(s,"H2",{class:!0});var W_=a(wn);Os=n(W_,"A",{id:!0,class:!0,href:!0});var XC=a(Os);em=n(XC,"SPAN",{});var LC=a(em);v(Ql.$$.fragment,LC),LC.forEach(t),XC.forEach(t),uE=p(W_),tm=n(W_,"SPAN",{});var OC=a(tm);fE=l(OC,"TFElectraForMultipleChoice"),OC.forEach(t),W_.forEach(t),gg=p(s),gt=n(s,"DIV",{class:!0});var fo=a(gt);v(Dl.$$.fragment,fo),gE=p(fo),om=n(fo,"P",{});var QC=a(om);_E=l(QC,`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.`),QC.forEach(t),yE=p(fo),Yl=n(fo,"P",{});var N_=a(Yl);bE=l(N_,"This model inherits from "),Wc=n(N_,"A",{href:!0});var DC=a(Wc);TE=l(DC,"TFPreTrainedModel"),DC.forEach(t),kE=l(N_,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),N_.forEach(t),vE=p(fo),Hl=n(fo,"P",{});var Z_=a(Hl);wE=l(Z_,"This model is also a "),Kl=n(Z_,"A",{href:!0,rel:!0});var YC=a(Kl);ME=l(YC,"tf.keras.Model"),YC.forEach(t),EE=l(Z_,` 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.`),Z_.forEach(t),$E=p(fo),v(Qs.$$.fragment,fo),FE=p(fo),eo=n(fo,"DIV",{class:!0});var Va=a(eo);v(ei.$$.fragment,Va),jE=p(Va),Mn=n(Va,"P",{});var hp=a(Mn);xE=l(hp,"The "),Nc=n(hp,"A",{href:!0});var HC=a(Nc);CE=l(HC,"TFElectraForMultipleChoice"),HC.forEach(t),zE=l(hp," forward method, overrides the "),nm=n(hp,"CODE",{});var KC=a(nm);JE=l(KC,"__call__"),KC.forEach(t),UE=l(hp," special method."),hp.forEach(t),IE=p(Va),v(Ds.$$.fragment,Va),WE=p(Va),v(Ys.$$.fragment,Va),Va.forEach(t),fo.forEach(t),_g=p(s),En=n(s,"H2",{class:!0});var q_=a(En);Hs=n(q_,"A",{id:!0,class:!0,href:!0});var ez=a(Hs);sm=n(ez,"SPAN",{});var tz=a(sm);v(ti.$$.fragment,tz),tz.forEach(t),ez.forEach(t),NE=p(q_),am=n(q_,"SPAN",{});var oz=a(am);ZE=l(oz,"TFElectraForTokenClassification"),oz.forEach(t),q_.forEach(t),yg=p(s),st=n(s,"DIV",{class:!0});var Wt=a(st);v(oi.$$.fragment,Wt),qE=p(Wt),rm=n(Wt,"P",{});var nz=a(rm);AE=l(nz,"Electra model with a token classification head on top."),nz.forEach(t),GE=p(Wt),lm=n(Wt,"P",{});var sz=a(lm);RE=l(sz,"Both the discriminator and generator may be loaded into this model."),sz.forEach(t),PE=p(Wt),ni=n(Wt,"P",{});var A_=a(ni);VE=l(A_,"This model inherits from "),Zc=n(A_,"A",{href:!0});var az=a(Zc);BE=l(az,"TFPreTrainedModel"),az.forEach(t),SE=l(A_,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),A_.forEach(t),XE=p(Wt),si=n(Wt,"P",{});var G_=a(si);LE=l(G_,"This model is also a "),ai=n(G_,"A",{href:!0,rel:!0});var rz=a(ai);OE=l(rz,"tf.keras.Model"),rz.forEach(t),QE=l(G_,` 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.`),G_.forEach(t),DE=p(Wt),v(Ks.$$.fragment,Wt),YE=p(Wt),zt=n(Wt,"DIV",{class:!0});var Go=a(zt);v(ri.$$.fragment,Go),HE=p(Go),$n=n(Go,"P",{});var mp=a($n);KE=l(mp,"The "),qc=n(mp,"A",{href:!0});var lz=a(qc);e1=l(lz,"TFElectraForTokenClassification"),lz.forEach(t),t1=l(mp," forward method, overrides the "),im=n(mp,"CODE",{});var iz=a(im);o1=l(iz,"__call__"),iz.forEach(t),n1=l(mp," special method."),mp.forEach(t),s1=p(Go),v(ea.$$.fragment,Go),a1=p(Go),v(ta.$$.fragment,Go),r1=p(Go),v(oa.$$.fragment,Go),Go.forEach(t),Wt.forEach(t),bg=p(s),Fn=n(s,"H2",{class:!0});var R_=a(Fn);na=n(R_,"A",{id:!0,class:!0,href:!0});var dz=a(na);dm=n(dz,"SPAN",{});var cz=a(dm);v(li.$$.fragment,cz),cz.forEach(t),dz.forEach(t),l1=p(R_),cm=n(R_,"SPAN",{});var pz=a(cm);i1=l(pz,"TFElectraForQuestionAnswering"),pz.forEach(t),R_.forEach(t),Tg=p(s),_t=n(s,"DIV",{class:!0});var go=a(_t);v(ii.$$.fragment,go),d1=p(go),jn=n(go,"P",{});var up=a(jn);c1=l(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 hz=a(pm);p1=l(hz,"span start logits"),hz.forEach(t),h1=l(up," and "),hm=n(up,"CODE",{});var mz=a(hm);m1=l(mz,"span end logits"),mz.forEach(t),u1=l(up,")."),up.forEach(t),f1=p(go),di=n(go,"P",{});var P_=a(di);g1=l(P_,"This model inherits from "),Ac=n(P_,"A",{href:!0});var uz=a(Ac);_1=l(uz,"TFPreTrainedModel"),uz.forEach(t),y1=l(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),b1=p(go),ci=n(go,"P",{});var V_=a(ci);T1=l(V_,"This model is also a "),pi=n(V_,"A",{href:!0,rel:!0});var fz=a(pi);k1=l(fz,"tf.keras.Model"),fz.forEach(t),v1=l(V_,` 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.`),V_.forEach(t),w1=p(go),v(sa.$$.fragment,go),M1=p(go),Jt=n(go,"DIV",{class:!0});var Ro=a(Jt);v(hi.$$.fragment,Ro),E1=p(Ro),xn=n(Ro,"P",{});var fp=a(xn);$1=l(fp,"The "),Gc=n(fp,"A",{href:!0});var gz=a(Gc);F1=l(gz,"TFElectraForQuestionAnswering"),gz.forEach(t),j1=l(fp," forward method, overrides the "),mm=n(fp,"CODE",{});var _z=a(mm);x1=l(_z,"__call__"),_z.forEach(t),C1=l(fp," special method."),fp.forEach(t),z1=p(Ro),v(aa.$$.fragment,Ro),J1=p(Ro),v(ra.$$.fragment,Ro),U1=p(Ro),v(la.$$.fragment,Ro),Ro.forEach(t),go.forEach(t),kg=p(s),Cn=n(s,"H2",{class:!0});var B_=a(Cn);ia=n(B_,"A",{id:!0,class:!0,href:!0});var yz=a(ia);um=n(yz,"SPAN",{});var bz=a(um);v(mi.$$.fragment,bz),bz.forEach(t),yz.forEach(t),I1=p(B_),fm=n(B_,"SPAN",{});var Tz=a(fm);W1=l(Tz,"FlaxElectraModel"),Tz.forEach(t),B_.forEach(t),vg=p(s),at=n(s,"DIV",{class:!0});var Nt=a(at);v(ui.$$.fragment,Nt),N1=p(Nt),gm=n(Nt,"P",{});var kz=a(gm);Z1=l(kz,"The bare Electra Model transformer outputting raw hidden-states without any specific head on top."),kz.forEach(t),q1=p(Nt),fi=n(Nt,"P",{});var S_=a(fi);A1=l(S_,"This model inherits from "),Rc=n(S_,"A",{href:!0});var vz=a(Rc);G1=l(vz,"FlaxPreTrainedModel"),vz.forEach(t),R1=l(S_,`. 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)`),S_.forEach(t),P1=p(Nt),gi=n(Nt,"P",{});var X_=a(gi);V1=l(X_,`This model is also a Flax Linen
`),_i=n(X_,"A",{href:!0,rel:!0});var wz=a(_i);B1=l(wz,"flax.nn.Module"),wz.forEach(t),S1=l(X_,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),X_.forEach(t),X1=p(Nt),_m=n(Nt,"P",{});var Mz=a(_m);L1=l(Mz,"Finally, this model supports inherent JAX features such as:"),Mz.forEach(t),O1=p(Nt),yo=n(Nt,"UL",{});var Ba=a(yo);ym=n(Ba,"LI",{});var Ez=a(ym);yi=n(Ez,"A",{href:!0,rel:!0});var $z=a(yi);Q1=l($z,"Just-In-Time (JIT) compilation"),$z.forEach(t),Ez.forEach(t),D1=p(Ba),bm=n(Ba,"LI",{});var Fz=a(bm);bi=n(Fz,"A",{href:!0,rel:!0});var jz=a(bi);Y1=l(jz,"Automatic Differentiation"),jz.forEach(t),Fz.forEach(t),H1=p(Ba),Tm=n(Ba,"LI",{});var xz=a(Tm);Ti=n(xz,"A",{href:!0,rel:!0});var Cz=a(Ti);K1=l(Cz,"Vectorization"),Cz.forEach(t),xz.forEach(t),e2=p(Ba),km=n(Ba,"LI",{});var zz=a(km);ki=n(zz,"A",{href:!0,rel:!0});var Jz=a(ki);t2=l(Jz,"Parallelization"),Jz.forEach(t),zz.forEach(t),Ba.forEach(t),o2=p(Nt),to=n(Nt,"DIV",{class:!0});var Sa=a(to);v(vi.$$.fragment,Sa),n2=p(Sa),zn=n(Sa,"P",{});var gp=a(zn);s2=l(gp,"The "),vm=n(gp,"CODE",{});var Uz=a(vm);a2=l(Uz,"FlaxElectraPreTrainedModel"),Uz.forEach(t),r2=l(gp," forward method, overrides the "),wm=n(gp,"CODE",{});var Iz=a(wm);l2=l(Iz,"__call__"),Iz.forEach(t),i2=l(gp," special method."),gp.forEach(t),d2=p(Sa),v(da.$$.fragment,Sa),c2=p(Sa),v(ca.$$.fragment,Sa),Sa.forEach(t),Nt.forEach(t),wg=p(s),Jn=n(s,"H2",{class:!0});var L_=a(Jn);pa=n(L_,"A",{id:!0,class:!0,href:!0});var Wz=a(pa);Mm=n(Wz,"SPAN",{});var Nz=a(Mm);v(wi.$$.fragment,Nz),Nz.forEach(t),Wz.forEach(t),p2=p(L_),Em=n(L_,"SPAN",{});var Zz=a(Em);h2=l(Zz,"FlaxElectraForPreTraining"),Zz.forEach(t),L_.forEach(t),Mg=p(s),Ke=n(s,"DIV",{class:!0});var bt=a(Ke);v(Mi.$$.fragment,bt),m2=p(bt),$m=n(bt,"P",{});var qz=a($m);u2=l(qz,"Electra model with a binary classification head on top as used during pretraining for identifying generated tokens."),qz.forEach(t),f2=p(bt),Fm=n(bt,"P",{});var Az=a(Fm);g2=l(Az,"It is recommended to load the discriminator checkpoint into that model."),Az.forEach(t),_2=p(bt),Ei=n(bt,"P",{});var O_=a(Ei);y2=l(O_,"This model inherits from "),Pc=n(O_,"A",{href:!0});var Gz=a(Pc);b2=l(Gz,"FlaxPreTrainedModel"),Gz.forEach(t),T2=l(O_,`. 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)`),O_.forEach(t),k2=p(bt),$i=n(bt,"P",{});var Q_=a($i);v2=l(Q_,`This model is also a Flax Linen
`),Fi=n(Q_,"A",{href:!0,rel:!0});var Rz=a(Fi);w2=l(Rz,"flax.nn.Module"),Rz.forEach(t),M2=l(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),E2=p(bt),jm=n(bt,"P",{});var Pz=a(jm);$2=l(Pz,"Finally, this model supports inherent JAX features such as:"),Pz.forEach(t),F2=p(bt),bo=n(bt,"UL",{});var Xa=a(bo);xm=n(Xa,"LI",{});var Vz=a(xm);ji=n(Vz,"A",{href:!0,rel:!0});var Bz=a(ji);j2=l(Bz,"Just-In-Time (JIT) compilation"),Bz.forEach(t),Vz.forEach(t),x2=p(Xa),Cm=n(Xa,"LI",{});var Sz=a(Cm);xi=n(Sz,"A",{href:!0,rel:!0});var Xz=a(xi);C2=l(Xz,"Automatic Differentiation"),Xz.forEach(t),Sz.forEach(t),z2=p(Xa),zm=n(Xa,"LI",{});var Lz=a(zm);Ci=n(Lz,"A",{href:!0,rel:!0});var Oz=a(Ci);J2=l(Oz,"Vectorization"),Oz.forEach(t),Lz.forEach(t),U2=p(Xa),Jm=n(Xa,"LI",{});var Qz=a(Jm);zi=n(Qz,"A",{href:!0,rel:!0});var Dz=a(zi);I2=l(Dz,"Parallelization"),Dz.forEach(t),Qz.forEach(t),Xa.forEach(t),W2=p(bt),oo=n(bt,"DIV",{class:!0});var La=a(oo);v(Ji.$$.fragment,La),N2=p(La),Un=n(La,"P",{});var _p=a(Un);Z2=l(_p,"The "),Um=n(_p,"CODE",{});var Yz=a(Um);q2=l(Yz,"FlaxElectraPreTrainedModel"),Yz.forEach(t),A2=l(_p," forward method, overrides the "),Im=n(_p,"CODE",{});var Hz=a(Im);G2=l(Hz,"__call__"),Hz.forEach(t),R2=l(_p," special method."),_p.forEach(t),P2=p(La),v(ha.$$.fragment,La),V2=p(La),v(ma.$$.fragment,La),La.forEach(t),bt.forEach(t),Eg=p(s),In=n(s,"H2",{class:!0});var D_=a(In);ua=n(D_,"A",{id:!0,class:!0,href:!0});var Kz=a(ua);Wm=n(Kz,"SPAN",{});var eJ=a(Wm);v(Ui.$$.fragment,eJ),eJ.forEach(t),Kz.forEach(t),B2=p(D_),Nm=n(D_,"SPAN",{});var tJ=a(Nm);S2=l(tJ,"FlaxElectraForCausalLM"),tJ.forEach(t),D_.forEach(t),$g=p(s),rt=n(s,"DIV",{class:!0});var Zt=a(rt);v(Ii.$$.fragment,Zt),X2=p(Zt),Zm=n(Zt,"P",{});var oJ=a(Zm);L2=l(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),O2=p(Zt),Wi=n(Zt,"P",{});var Y_=a(Wi);Q2=l(Y_,"This model inherits from "),Vc=n(Y_,"A",{href:!0});var nJ=a(Vc);D2=l(nJ,"FlaxPreTrainedModel"),nJ.forEach(t),Y2=l(Y_,`. 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_.forEach(t),H2=p(Zt),Ni=n(Zt,"P",{});var H_=a(Ni);K2=l(H_,`This model is also a Flax Linen
`),Zi=n(H_,"A",{href:!0,rel:!0});var sJ=a(Zi);e0=l(sJ,"flax.nn.Module"),sJ.forEach(t),t0=l(H_,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),H_.forEach(t),o0=p(Zt),qm=n(Zt,"P",{});var aJ=a(qm);n0=l(aJ,"Finally, this model supports inherent JAX features such as:"),aJ.forEach(t),s0=p(Zt),To=n(Zt,"UL",{});var Oa=a(To);Am=n(Oa,"LI",{});var rJ=a(Am);qi=n(rJ,"A",{href:!0,rel:!0});var lJ=a(qi);a0=l(lJ,"Just-In-Time (JIT) compilation"),lJ.forEach(t),rJ.forEach(t),r0=p(Oa),Gm=n(Oa,"LI",{});var iJ=a(Gm);Ai=n(iJ,"A",{href:!0,rel:!0});var dJ=a(Ai);l0=l(dJ,"Automatic Differentiation"),dJ.forEach(t),iJ.forEach(t),i0=p(Oa),Rm=n(Oa,"LI",{});var cJ=a(Rm);Gi=n(cJ,"A",{href:!0,rel:!0});var pJ=a(Gi);d0=l(pJ,"Vectorization"),pJ.forEach(t),cJ.forEach(t),c0=p(Oa),Pm=n(Oa,"LI",{});var hJ=a(Pm);Ri=n(hJ,"A",{href:!0,rel:!0});var mJ=a(Ri);p0=l(mJ,"Parallelization"),mJ.forEach(t),hJ.forEach(t),Oa.forEach(t),h0=p(Zt),no=n(Zt,"DIV",{class:!0});var Qa=a(no);v(Pi.$$.fragment,Qa),m0=p(Qa),Wn=n(Qa,"P",{});var yp=a(Wn);u0=l(yp,"The "),Vm=n(yp,"CODE",{});var uJ=a(Vm);f0=l(uJ,"FlaxElectraPreTrainedModel"),uJ.forEach(t),g0=l(yp," forward method, overrides the "),Bm=n(yp,"CODE",{});var fJ=a(Bm);_0=l(fJ,"__call__"),fJ.forEach(t),y0=l(yp," special method."),yp.forEach(t),b0=p(Qa),v(fa.$$.fragment,Qa),T0=p(Qa),v(ga.$$.fragment,Qa),Qa.forEach(t),Zt.forEach(t),Fg=p(s),Nn=n(s,"H2",{class:!0});var K_=a(Nn);_a=n(K_,"A",{id:!0,class:!0,href:!0});var gJ=a(_a);Sm=n(gJ,"SPAN",{});var _J=a(Sm);v(Vi.$$.fragment,_J),_J.forEach(t),gJ.forEach(t),k0=p(K_),Xm=n(K_,"SPAN",{});var yJ=a(Xm);v0=l(yJ,"FlaxElectraForMaskedLM"),yJ.forEach(t),K_.forEach(t),jg=p(s),lt=n(s,"DIV",{class:!0});var qt=a(lt);v(Bi.$$.fragment,qt),w0=p(qt),Si=n(qt,"P",{});var ey=a(Si);M0=l(ey,"Electra Model with a "),Lm=n(ey,"CODE",{});var bJ=a(Lm);E0=l(bJ,"language modeling"),bJ.forEach(t),$0=l(ey," head on top."),ey.forEach(t),F0=p(qt),Xi=n(qt,"P",{});var ty=a(Xi);j0=l(ty,"This model inherits from "),Bc=n(ty,"A",{href:!0});var TJ=a(Bc);x0=l(TJ,"FlaxPreTrainedModel"),TJ.forEach(t),C0=l(ty,`. 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)`),ty.forEach(t),z0=p(qt),Li=n(qt,"P",{});var oy=a(Li);J0=l(oy,`This model is also a Flax Linen
`),Oi=n(oy,"A",{href:!0,rel:!0});var kJ=a(Oi);U0=l(kJ,"flax.nn.Module"),kJ.forEach(t),I0=l(oy,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),oy.forEach(t),W0=p(qt),Om=n(qt,"P",{});var vJ=a(Om);N0=l(vJ,"Finally, this model supports inherent JAX features such as:"),vJ.forEach(t),Z0=p(qt),ko=n(qt,"UL",{});var Da=a(ko);Qm=n(Da,"LI",{});var wJ=a(Qm);Qi=n(wJ,"A",{href:!0,rel:!0});var MJ=a(Qi);q0=l(MJ,"Just-In-Time (JIT) compilation"),MJ.forEach(t),wJ.forEach(t),A0=p(Da),Dm=n(Da,"LI",{});var EJ=a(Dm);Di=n(EJ,"A",{href:!0,rel:!0});var $J=a(Di);G0=l($J,"Automatic Differentiation"),$J.forEach(t),EJ.forEach(t),R0=p(Da),Ym=n(Da,"LI",{});var FJ=a(Ym);Yi=n(FJ,"A",{href:!0,rel:!0});var jJ=a(Yi);P0=l(jJ,"Vectorization"),jJ.forEach(t),FJ.forEach(t),V0=p(Da),Hm=n(Da,"LI",{});var xJ=a(Hm);Hi=n(xJ,"A",{href:!0,rel:!0});var CJ=a(Hi);B0=l(CJ,"Parallelization"),CJ.forEach(t),xJ.forEach(t),Da.forEach(t),S0=p(qt),so=n(qt,"DIV",{class:!0});var Ya=a(so);v(Ki.$$.fragment,Ya),X0=p(Ya),Zn=n(Ya,"P",{});var bp=a(Zn);L0=l(bp,"The "),Km=n(bp,"CODE",{});var zJ=a(Km);O0=l(zJ,"FlaxElectraPreTrainedModel"),zJ.forEach(t),Q0=l(bp," forward method, overrides the "),eu=n(bp,"CODE",{});var JJ=a(eu);D0=l(JJ,"__call__"),JJ.forEach(t),Y0=l(bp," special method."),bp.forEach(t),H0=p(Ya),v(ya.$$.fragment,Ya),K0=p(Ya),v(ba.$$.fragment,Ya),Ya.forEach(t),qt.forEach(t),xg=p(s),qn=n(s,"H2",{class:!0});var ny=a(qn);Ta=n(ny,"A",{id:!0,class:!0,href:!0});var UJ=a(Ta);tu=n(UJ,"SPAN",{});var IJ=a(tu);v(ed.$$.fragment,IJ),IJ.forEach(t),UJ.forEach(t),e$=p(ny),ou=n(ny,"SPAN",{});var WJ=a(ou);t$=l(WJ,"FlaxElectraForSequenceClassification"),WJ.forEach(t),ny.forEach(t),Cg=p(s),it=n(s,"DIV",{class:!0});var At=a(it);v(td.$$.fragment,At),o$=p(At),nu=n(At,"P",{});var NJ=a(nu);n$=l(NJ,`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.`),NJ.forEach(t),s$=p(At),od=n(At,"P",{});var sy=a(od);a$=l(sy,"This model inherits from "),Sc=n(sy,"A",{href:!0});var ZJ=a(Sc);r$=l(ZJ,"FlaxPreTrainedModel"),ZJ.forEach(t),l$=l(sy,`. 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)`),sy.forEach(t),i$=p(At),nd=n(At,"P",{});var ay=a(nd);d$=l(ay,`This model is also a Flax Linen
`),sd=n(ay,"A",{href:!0,rel:!0});var qJ=a(sd);c$=l(qJ,"flax.nn.Module"),qJ.forEach(t),p$=l(ay,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),ay.forEach(t),h$=p(At),su=n(At,"P",{});var AJ=a(su);m$=l(AJ,"Finally, this model supports inherent JAX features such as:"),AJ.forEach(t),u$=p(At),vo=n(At,"UL",{});var Ha=a(vo);au=n(Ha,"LI",{});var GJ=a(au);ad=n(GJ,"A",{href:!0,rel:!0});var RJ=a(ad);f$=l(RJ,"Just-In-Time (JIT) compilation"),RJ.forEach(t),GJ.forEach(t),g$=p(Ha),ru=n(Ha,"LI",{});var PJ=a(ru);rd=n(PJ,"A",{href:!0,rel:!0});var VJ=a(rd);_$=l(VJ,"Automatic Differentiation"),VJ.forEach(t),PJ.forEach(t),y$=p(Ha),lu=n(Ha,"LI",{});var BJ=a(lu);ld=n(BJ,"A",{href:!0,rel:!0});var SJ=a(ld);b$=l(SJ,"Vectorization"),SJ.forEach(t),BJ.forEach(t),T$=p(Ha),iu=n(Ha,"LI",{});var XJ=a(iu);id=n(XJ,"A",{href:!0,rel:!0});var LJ=a(id);k$=l(LJ,"Parallelization"),LJ.forEach(t),XJ.forEach(t),Ha.forEach(t),v$=p(At),ao=n(At,"DIV",{class:!0});var Ka=a(ao);v(dd.$$.fragment,Ka),w$=p(Ka),An=n(Ka,"P",{});var Tp=a(An);M$=l(Tp,"The "),du=n(Tp,"CODE",{});var OJ=a(du);E$=l(OJ,"FlaxElectraPreTrainedModel"),OJ.forEach(t),$$=l(Tp," forward method, overrides the "),cu=n(Tp,"CODE",{});var QJ=a(cu);F$=l(QJ,"__call__"),QJ.forEach(t),j$=l(Tp," special method."),Tp.forEach(t),x$=p(Ka),v(ka.$$.fragment,Ka),C$=p(Ka),v(va.$$.fragment,Ka),Ka.forEach(t),At.forEach(t),zg=p(s),Gn=n(s,"H2",{class:!0});var ry=a(Gn);wa=n(ry,"A",{id:!0,class:!0,href:!0});var DJ=a(wa);pu=n(DJ,"SPAN",{});var YJ=a(pu);v(cd.$$.fragment,YJ),YJ.forEach(t),DJ.forEach(t),z$=p(ry),hu=n(ry,"SPAN",{});var HJ=a(hu);J$=l(HJ,"FlaxElectraForMultipleChoice"),HJ.forEach(t),ry.forEach(t),Jg=p(s),dt=n(s,"DIV",{class:!0});var Gt=a(dt);v(pd.$$.fragment,Gt),U$=p(Gt),mu=n(Gt,"P",{});var KJ=a(mu);I$=l(KJ,`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.`),KJ.forEach(t),W$=p(Gt),hd=n(Gt,"P",{});var ly=a(hd);N$=l(ly,"This model inherits from "),Xc=n(ly,"A",{href:!0});var eU=a(Xc);Z$=l(eU,"FlaxPreTrainedModel"),eU.forEach(t),q$=l(ly,`. 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)`),ly.forEach(t),A$=p(Gt),md=n(Gt,"P",{});var iy=a(md);G$=l(iy,`This model is also a Flax Linen
`),ud=n(iy,"A",{href:!0,rel:!0});var tU=a(ud);R$=l(tU,"flax.nn.Module"),tU.forEach(t),P$=l(iy,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),iy.forEach(t),V$=p(Gt),uu=n(Gt,"P",{});var oU=a(uu);B$=l(oU,"Finally, this model supports inherent JAX features such as:"),oU.forEach(t),S$=p(Gt),wo=n(Gt,"UL",{});var er=a(wo);fu=n(er,"LI",{});var nU=a(fu);fd=n(nU,"A",{href:!0,rel:!0});var sU=a(fd);X$=l(sU,"Just-In-Time (JIT) compilation"),sU.forEach(t),nU.forEach(t),L$=p(er),gu=n(er,"LI",{});var aU=a(gu);gd=n(aU,"A",{href:!0,rel:!0});var rU=a(gd);O$=l(rU,"Automatic Differentiation"),rU.forEach(t),aU.forEach(t),Q$=p(er),_u=n(er,"LI",{});var lU=a(_u);_d=n(lU,"A",{href:!0,rel:!0});var iU=a(_d);D$=l(iU,"Vectorization"),iU.forEach(t),lU.forEach(t),Y$=p(er),yu=n(er,"LI",{});var dU=a(yu);yd=n(dU,"A",{href:!0,rel:!0});var cU=a(yd);H$=l(cU,"Parallelization"),cU.forEach(t),dU.forEach(t),er.forEach(t),K$=p(Gt),ro=n(Gt,"DIV",{class:!0});var tr=a(ro);v(bd.$$.fragment,tr),eF=p(tr),Rn=n(tr,"P",{});var kp=a(Rn);tF=l(kp,"The "),bu=n(kp,"CODE",{});var pU=a(bu);oF=l(pU,"FlaxElectraPreTrainedModel"),pU.forEach(t),nF=l(kp," forward method, overrides the "),Tu=n(kp,"CODE",{});var hU=a(Tu);sF=l(hU,"__call__"),hU.forEach(t),aF=l(kp," special method."),kp.forEach(t),rF=p(tr),v(Ma.$$.fragment,tr),lF=p(tr),v(Ea.$$.fragment,tr),tr.forEach(t),Gt.forEach(t),Ug=p(s),Pn=n(s,"H2",{class:!0});var dy=a(Pn);$a=n(dy,"A",{id:!0,class:!0,href:!0});var mU=a($a);ku=n(mU,"SPAN",{});var uU=a(ku);v(Td.$$.fragment,uU),uU.forEach(t),mU.forEach(t),iF=p(dy),vu=n(dy,"SPAN",{});var fU=a(vu);dF=l(fU,"FlaxElectraForTokenClassification"),fU.forEach(t),dy.forEach(t),Ig=p(s),et=n(s,"DIV",{class:!0});var Tt=a(et);v(kd.$$.fragment,Tt),cF=p(Tt),wu=n(Tt,"P",{});var gU=a(wu);pF=l(gU,"Electra model with a token classification head on top."),gU.forEach(t),hF=p(Tt),Mu=n(Tt,"P",{});var _U=a(Mu);mF=l(_U,"Both the discriminator and generator may be loaded into this model."),_U.forEach(t),uF=p(Tt),vd=n(Tt,"P",{});var cy=a(vd);fF=l(cy,"This model inherits from "),Lc=n(cy,"A",{href:!0});var yU=a(Lc);gF=l(yU,"FlaxPreTrainedModel"),yU.forEach(t),_F=l(cy,`. 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)`),cy.forEach(t),yF=p(Tt),wd=n(Tt,"P",{});var py=a(wd);bF=l(py,`This model is also a Flax Linen
`),Md=n(py,"A",{href:!0,rel:!0});var bU=a(Md);TF=l(bU,"flax.nn.Module"),bU.forEach(t),kF=l(py,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),py.forEach(t),vF=p(Tt),Eu=n(Tt,"P",{});var TU=a(Eu);wF=l(TU,"Finally, this model supports inherent JAX features such as:"),TU.forEach(t),MF=p(Tt),Mo=n(Tt,"UL",{});var or=a(Mo);$u=n(or,"LI",{});var kU=a($u);Ed=n(kU,"A",{href:!0,rel:!0});var vU=a(Ed);EF=l(vU,"Just-In-Time (JIT) compilation"),vU.forEach(t),kU.forEach(t),$F=p(or),Fu=n(or,"LI",{});var wU=a(Fu);$d=n(wU,"A",{href:!0,rel:!0});var MU=a($d);FF=l(MU,"Automatic Differentiation"),MU.forEach(t),wU.forEach(t),jF=p(or),ju=n(or,"LI",{});var EU=a(ju);Fd=n(EU,"A",{href:!0,rel:!0});var $U=a(Fd);xF=l($U,"Vectorization"),$U.forEach(t),EU.forEach(t),CF=p(or),xu=n(or,"LI",{});var FU=a(xu);jd=n(FU,"A",{href:!0,rel:!0});var jU=a(jd);zF=l(jU,"Parallelization"),jU.forEach(t),FU.forEach(t),or.forEach(t),JF=p(Tt),lo=n(Tt,"DIV",{class:!0});var nr=a(lo);v(xd.$$.fragment,nr),UF=p(nr),Vn=n(nr,"P",{});var vp=a(Vn);IF=l(vp,"The "),Cu=n(vp,"CODE",{});var xU=a(Cu);WF=l(xU,"FlaxElectraPreTrainedModel"),xU.forEach(t),NF=l(vp," forward method, overrides the "),zu=n(vp,"CODE",{});var CU=a(zu);ZF=l(CU,"__call__"),CU.forEach(t),qF=l(vp," special method."),vp.forEach(t),AF=p(nr),v(Fa.$$.fragment,nr),GF=p(nr),v(ja.$$.fragment,nr),nr.forEach(t),Tt.forEach(t),Wg=p(s),Bn=n(s,"H2",{class:!0});var hy=a(Bn);xa=n(hy,"A",{id:!0,class:!0,href:!0});var zU=a(xa);Ju=n(zU,"SPAN",{});var JU=a(Ju);v(Cd.$$.fragment,JU),JU.forEach(t),zU.forEach(t),RF=p(hy),Uu=n(hy,"SPAN",{});var UU=a(Uu);PF=l(UU,"FlaxElectraForQuestionAnswering"),UU.forEach(t),hy.forEach(t),Ng=p(s),ct=n(s,"DIV",{class:!0});var Rt=a(ct);v(zd.$$.fragment,Rt),VF=p(Rt),Sn=n(Rt,"P",{});var wp=a(Sn);BF=l(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 `),Iu=n(wp,"CODE",{});var IU=a(Iu);SF=l(IU,"span start logits"),IU.forEach(t),XF=l(wp," and "),Wu=n(wp,"CODE",{});var WU=a(Wu);LF=l(WU,"span end logits"),WU.forEach(t),OF=l(wp,")."),wp.forEach(t),QF=p(Rt),Jd=n(Rt,"P",{});var my=a(Jd);DF=l(my,"This model inherits from "),Oc=n(my,"A",{href:!0});var NU=a(Oc);YF=l(NU,"FlaxPreTrainedModel"),NU.forEach(t),HF=l(my,`. 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)`),my.forEach(t),KF=p(Rt),Ud=n(Rt,"P",{});var uy=a(Ud);ej=l(uy,`This model is also a Flax Linen
`),Id=n(uy,"A",{href:!0,rel:!0});var ZU=a(Id);tj=l(ZU,"flax.nn.Module"),ZU.forEach(t),oj=l(uy,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),uy.forEach(t),nj=p(Rt),Nu=n(Rt,"P",{});var qU=a(Nu);sj=l(qU,"Finally, this model supports inherent JAX features such as:"),qU.forEach(t),aj=p(Rt),Eo=n(Rt,"UL",{});var sr=a(Eo);Zu=n(sr,"LI",{});var AU=a(Zu);Wd=n(AU,"A",{href:!0,rel:!0});var GU=a(Wd);rj=l(GU,"Just-In-Time (JIT) compilation"),GU.forEach(t),AU.forEach(t),lj=p(sr),qu=n(sr,"LI",{});var RU=a(qu);Nd=n(RU,"A",{href:!0,rel:!0});var PU=a(Nd);ij=l(PU,"Automatic Differentiation"),PU.forEach(t),RU.forEach(t),dj=p(sr),Au=n(sr,"LI",{});var VU=a(Au);Zd=n(VU,"A",{href:!0,rel:!0});var BU=a(Zd);cj=l(BU,"Vectorization"),BU.forEach(t),VU.forEach(t),pj=p(sr),Gu=n(sr,"LI",{});var SU=a(Gu);qd=n(SU,"A",{href:!0,rel:!0});var XU=a(qd);hj=l(XU,"Parallelization"),XU.forEach(t),SU.forEach(t),sr.forEach(t),mj=p(Rt),io=n(Rt,"DIV",{class:!0});var ar=a(io);v(Ad.$$.fragment,ar),uj=p(ar),Xn=n(ar,"P",{});var Mp=a(Xn);fj=l(Mp,"The "),Ru=n(Mp,"CODE",{});var LU=a(Ru);gj=l(LU,"FlaxElectraPreTrainedModel"),LU.forEach(t),_j=l(Mp," forward method, overrides the "),Pu=n(Mp,"CODE",{});var OU=a(Pu);yj=l(OU,"__call__"),OU.forEach(t),bj=l(Mp," special method."),Mp.forEach(t),Tj=p(ar),v(Ca.$$.fragment,ar),kj=p(ar),v(za.$$.fragment,ar),ar.forEach(t),Rt.forEach(t),this.h()},h(){m(d,"name","hf:doc:metadata"),m(d,"content",JSON.stringify(d3)),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"),QU(te.src,j="https://img.shields.io/badge/All_model_pages-electra-blueviolet")||m(te,"src",j),m(de,"href","https://huggingface.co/models?filter=electra"),m(ce,"alt","Spaces"),QU(ce.src,Ze="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||m(ce,"src",Ze),m(X,"href","https://huggingface.co/spaces/docs-demos/electra_large_discriminator_squad2_512"),m(R,"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(ie,"href","https://openreview.net/pdf?id=r1xMH1BtvB"),m(ie,"rel","nofollow"),m(ee,"href","https://github.com/google-research/electra"),m(ee,"rel","nofollow"),m(N,"href","/docs/transformers/main/en/model_doc/electra#transformers.ElectraForMaskedLM"),m(T,"href","/docs/transformers/main/en/model_doc/electra#transformers.ElectraForPreTraining"),m(z,"href","https://huggingface.co/lysandre"),m(z,"rel","nofollow"),m(Re,"href","https://github.com/google-research/electra"),m(Re,"rel","nofollow"),m(Ge,"id","documentation-resources"),m(Ge,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Ge,"href","#documentation-resources"),m(P,"class","relative group"),m(Ld,"href","../tasks/sequence_classification"),m(Od,"href","../tasks/token_classification"),m(Qd,"href","../tasks/question_answering"),m(Dd,"href","../tasks/language_modeling"),m(Yd,"href","../tasks/masked_language_modeling"),m(Hd,"href","../tasks/multiple_choice"),m(Dn,"id","transformers.ElectraConfig"),m(Dn,"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(Dn,"href","#transformers.ElectraConfig"),m(Po,"class","relative group"),m(Kd,"href","/docs/transformers/main/en/model_doc/electra#transformers.ElectraModel"),m(ec,"href","/docs/transformers/main/en/model_doc/electra#transformers.TFElectraModel"),m(ir,"href","https://huggingface.co/google/electra-small-discriminator"),m(ir,"rel","nofollow"),m(tc,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),m(oc,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),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(Hn,"id","transformers.ElectraTokenizer"),m(Hn,"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(Hn,"href","#transformers.ElectraTokenizer"),m(Bo,"class","relative group"),m(nc,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),m(xo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Kn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(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(Xo,"class","relative group"),m(rc,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),m(Co,"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(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(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(Oo,"class","relative group"),m(dc,"href","/docs/transformers/main/en/model_doc/electra#transformers.ElectraForPreTraining"),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(cc,"href","/docs/transformers/main/en/model_doc/electra#transformers.TFElectraForPreTraining"),m(Do,"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(Yo,"class","relative group"),m(pc,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(Ir,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Ir,"rel","nofollow"),m(hc,"href","/docs/transformers/main/en/model_doc/electra#transformers.ElectraModel"),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(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(is,"id","transformers.ElectraForPreTraining"),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.ElectraForPreTraining"),m(Ko,"class","relative group"),m(mc,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(Gr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Gr,"rel","nofollow"),m(uc,"href","/docs/transformers/main/en/model_doc/electra#transformers.ElectraForPreTraining"),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(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/main/en/main_classes/model#transformers.PreTrainedModel"),m(Lr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Lr,"rel","nofollow"),m(gc,"href","/docs/transformers/main/en/model_doc/electra#transformers.ElectraForCausalLM"),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(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/main/en/main_classes/model#transformers.PreTrainedModel"),m(Kr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Kr,"rel","nofollow"),m(yc,"href","/docs/transformers/main/en/model_doc/electra#transformers.ElectraForMaskedLM"),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(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(bc,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(al,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(al,"rel","nofollow"),m(Tc,"href","/docs/transformers/main/en/model_doc/electra#transformers.ElectraForSequenceClassification"),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(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(ks,"id","transformers.ElectraForMultipleChoice"),m(ks,"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(ks,"href","#transformers.ElectraForMultipleChoice"),m(ln,"class","relative group"),m(kc,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(pl,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(pl,"rel","nofollow"),m(vc,"href","/docs/transformers/main/en/model_doc/electra#transformers.ElectraForMultipleChoice"),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(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(Ms,"id","transformers.ElectraForTokenClassification"),m(Ms,"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(Ms,"href","#transformers.ElectraForTokenClassification"),m(cn,"class","relative group"),m(wc,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(_l,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(_l,"rel","nofollow"),m(Mc,"href","/docs/transformers/main/en/model_doc/electra#transformers.ElectraForTokenClassification"),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(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(Fs,"id","transformers.ElectraForQuestionAnswering"),m(Fs,"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(Fs,"href","#transformers.ElectraForQuestionAnswering"),m(hn,"class","relative group"),m(Ec,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(wl,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(wl,"rel","nofollow"),m($c,"href","/docs/transformers/main/en/model_doc/electra#transformers.ElectraForQuestionAnswering"),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($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(Cs,"id","transformers.TFElectraModel"),m(Cs,"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(Cs,"href","#transformers.TFElectraModel"),m(fn,"class","relative group"),m(Fc,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),m(xl,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(xl,"rel","nofollow"),m(jc,"href","/docs/transformers/main/en/model_doc/electra#transformers.TFElectraModel"),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(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(Is,"id","transformers.TFElectraForPreTraining"),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.TFElectraForPreTraining"),m(_n,"class","relative group"),m(xc,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),m(Wl,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(Wl,"rel","nofollow"),m(Cc,"href","/docs/transformers/main/en/model_doc/electra#transformers.TFElectraForPreTraining"),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(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(qs,"id","transformers.TFElectraForMaskedLM"),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.TFElectraForMaskedLM"),m(bn,"class","relative group"),m(zc,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),m(Rl,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(Rl,"rel","nofollow"),m(Jc,"href","/docs/transformers/main/en/model_doc/electra#transformers.TFElectraForMaskedLM"),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(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(Vs,"id","transformers.TFElectraForSequenceClassification"),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.TFElectraForSequenceClassification"),m(kn,"class","relative group"),m(Uc,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),m(Ll,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(Ll,"rel","nofollow"),m(Ic,"href","/docs/transformers/main/en/model_doc/electra#transformers.TFElectraForSequenceClassification"),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(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(Os,"id","transformers.TFElectraForMultipleChoice"),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.TFElectraForMultipleChoice"),m(wn,"class","relative group"),m(Wc,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),m(Kl,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(Kl,"rel","nofollow"),m(Nc,"href","/docs/transformers/main/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(Hs,"id","transformers.TFElectraForTokenClassification"),m(Hs,"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(Hs,"href","#transformers.TFElectraForTokenClassification"),m(En,"class","relative group"),m(Zc,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),m(ai,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(ai,"rel","nofollow"),m(qc,"href","/docs/transformers/main/en/model_doc/electra#transformers.TFElectraForTokenClassification"),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(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(Fn,"class","relative group"),m(Ac,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),m(pi,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(pi,"rel","nofollow"),m(Gc,"href","/docs/transformers/main/en/model_doc/electra#transformers.TFElectraForQuestionAnswering"),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(ia,"id","transformers.FlaxElectraModel"),m(ia,"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(ia,"href","#transformers.FlaxElectraModel"),m(Cn,"class","relative group"),m(Rc,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),m(_i,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),m(_i,"rel","nofollow"),m(yi,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),m(yi,"rel","nofollow"),m(bi,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),m(bi,"rel","nofollow"),m(Ti,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),m(Ti,"rel","nofollow"),m(ki,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),m(ki,"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(Jn,"class","relative group"),m(Pc,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),m(Fi,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),m(Fi,"rel","nofollow"),m(ji,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),m(ji,"rel","nofollow"),m(xi,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),m(xi,"rel","nofollow"),m(Ci,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),m(Ci,"rel","nofollow"),m(zi,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),m(zi,"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(Ke,"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(In,"class","relative group"),m(Vc,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),m(Zi,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),m(Zi,"rel","nofollow"),m(qi,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),m(qi,"rel","nofollow"),m(Ai,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),m(Ai,"rel","nofollow"),m(Gi,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),m(Gi,"rel","nofollow"),m(Ri,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),m(Ri,"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(Nn,"class","relative group"),m(Bc,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),m(Oi,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),m(Oi,"rel","nofollow"),m(Qi,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),m(Qi,"rel","nofollow"),m(Di,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),m(Di,"rel","nofollow"),m(Yi,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),m(Yi,"rel","nofollow"),m(Hi,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),m(Hi,"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(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(Ta,"id","transformers.FlaxElectraForSequenceClassification"),m(Ta,"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(Ta,"href","#transformers.FlaxElectraForSequenceClassification"),m(qn,"class","relative group"),m(Sc,"href","/docs/transformers/main/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(ld,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),m(ld,"rel","nofollow"),m(id,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),m(id,"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(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(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(Gn,"class","relative group"),m(Xc,"href","/docs/transformers/main/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(yd,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),m(yd,"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($a,"id","transformers.FlaxElectraForTokenClassification"),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.FlaxElectraForTokenClassification"),m(Pn,"class","relative group"),m(Lc,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),m(Md,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),m(Md,"rel","nofollow"),m(Ed,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),m(Ed,"rel","nofollow"),m($d,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),m($d,"rel","nofollow"),m(Fd,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),m(Fd,"rel","nofollow"),m(jd,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),m(jd,"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(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(xa,"id","transformers.FlaxElectraForQuestionAnswering"),m(xa,"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(xa,"href","#transformers.FlaxElectraForQuestionAnswering"),m(Bn,"class","relative group"),m(Oc,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),m(Id,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),m(Id,"rel","nofollow"),m(Wd,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),m(Wd,"rel","nofollow"),m(Nd,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),m(Nd,"rel","nofollow"),m(Zd,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),m(Zd,"rel","nofollow"),m(qd,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),m(qd,"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(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,y){e(document.head,d),g(s,b,y),g(s,u,y),e(u,f),e(f,_),w(i,_,null),e(u,h),e(u,x),e(x,be),g(s,fe,y),g(s,R,y),e(R,de),e(de,te),e(R,Te),e(R,X),e(X,ce),g(s,D,y),g(s,ae,y),e(ae,re),e(re,L),w(le,L,null),e(ae,ke),e(ae,O),e(O,ve),g(s,ge,y),g(s,B,y),e(B,we),e(B,ie),e(ie,ne),e(B,J),g(s,I,y),g(s,pe,y),e(pe,H),g(s,_e,y),g(s,he,y),e(he,Q),e(Q,Me),g(s,ye,y),g(s,U,y),e(U,Ee),g(s,Y,y),g(s,se,y),e(se,me),e(me,K),e(se,$e),e(se,ue),e(ue,G),e(se,Fe),e(se,q),e(q,je),e(q,ee),e(ee,W),e(q,xe),e(q,N),e(N,Ce),e(q,ze),e(q,T),e(T,C),e(q,Xe),g(s,oe,y),g(s,Je,y),e(Je,Le),e(Je,z),e(z,Oe),e(Je,Qe),e(Je,Re),e(Re,De),e(Je,Ye),g(s,A,y),g(s,P,y),e(P,Ge),e(Ge,Pe),w(S,Pe,null),e(P,He),e(P,Ve),e(Ve,Ue),g(s,Se,y),g(s,V,y),e(V,Be),e(Be,Ld),e(Ld,fy),e(V,gy),e(V,Ep),e(Ep,Od),e(Od,_y),e(V,yy),e(V,$p),e($p,Qd),e(Qd,by),e(V,Ty),e(V,Fp),e(Fp,Dd),e(Dd,ky),e(V,vy),e(V,jp),e(jp,Yd),e(Yd,wy),e(V,My),e(V,xp),e(xp,Hd),e(Hd,Ey),g(s,Nf,y),g(s,Po,y),e(Po,Dn),e(Dn,Cp),w(rr,Cp,null),e(Po,$y),e(Po,zp),e(zp,Fy),g(s,Zf,y),g(s,Pt,y),w(lr,Pt,null),e(Pt,jy),e(Pt,_o),e(_o,xy),e(_o,Kd),e(Kd,Cy),e(_o,zy),e(_o,ec),e(ec,Jy),e(_o,Uy),e(_o,ir),e(ir,Iy),e(_o,Wy),e(Pt,Ny),e(Pt,Vo),e(Vo,Zy),e(Vo,tc),e(tc,qy),e(Vo,Ay),e(Vo,oc),e(oc,Gy),e(Vo,Ry),e(Pt,Py),w(Yn,Pt,null),g(s,qf,y),g(s,Bo,y),e(Bo,Hn),e(Hn,Jp),w(dr,Jp,null),e(Bo,Vy),e(Bo,Up),e(Up,By),g(s,Af,y),g(s,tt,y),w(cr,tt,null),e(tt,Sy),e(tt,Ip),e(Ip,Xy),e(tt,Ly),e(tt,pr),e(pr,Oy),e(pr,nc),e(nc,Qy),e(pr,Dy),e(tt,Yy),e(tt,xo),w(hr,xo,null),e(xo,Hy),e(xo,Wp),e(Wp,Ky),e(xo,eb),e(xo,mr),e(mr,sc),e(sc,tb),e(sc,Np),e(Np,ob),e(mr,nb),e(mr,ac),e(ac,sb),e(ac,Zp),e(Zp,ab),e(tt,rb),e(tt,Kn),w(ur,Kn,null),e(Kn,lb),e(Kn,qp),e(qp,ib),e(tt,db),e(tt,Vt),w(fr,Vt,null),e(Vt,cb),e(Vt,Ap),e(Ap,pb),e(Vt,hb),w(es,Vt,null),e(Vt,mb),e(Vt,So),e(So,ub),e(So,Gp),e(Gp,fb),e(So,gb),e(So,Rp),e(Rp,_b),e(So,yb),e(tt,bb),e(tt,ts),w(gr,ts,null),e(ts,Tb),e(ts,_r),e(_r,kb),e(_r,Pp),e(Pp,vb),e(_r,wb),g(s,Gf,y),g(s,Xo,y),e(Xo,os),e(os,Vp),w(yr,Vp,null),e(Xo,Mb),e(Xo,Bp),e(Bp,Eb),g(s,Rf,y),g(s,kt,y),w(br,kt,null),e(kt,$b),e(kt,Tr),e(Tr,Fb),e(Tr,Sp),e(Sp,jb),e(Tr,xb),e(kt,Cb),e(kt,kr),e(kr,zb),e(kr,rc),e(rc,Jb),e(kr,Ub),e(kt,Ib),e(kt,Co),w(vr,Co,null),e(Co,Wb),e(Co,Xp),e(Xp,Nb),e(Co,Zb),e(Co,wr),e(wr,lc),e(lc,qb),e(lc,Lp),e(Lp,Ab),e(wr,Gb),e(wr,ic),e(ic,Rb),e(ic,Op),e(Op,Pb),e(kt,Vb),e(kt,Bt),w(Mr,Bt,null),e(Bt,Bb),e(Bt,Qp),e(Qp,Sb),e(Bt,Xb),w(ns,Bt,null),e(Bt,Lb),e(Bt,Lo),e(Lo,Ob),e(Lo,Dp),e(Dp,Qb),e(Lo,Db),e(Lo,Yp),e(Yp,Yb),e(Lo,Hb),g(s,Pf,y),g(s,Oo,y),e(Oo,ss),e(ss,Hp),w(Er,Hp,null),e(Oo,Kb),e(Oo,Kp),e(Kp,eT),g(s,Vf,y),g(s,Qo,y),w($r,Qo,null),e(Qo,tT),e(Qo,Fr),e(Fr,oT),e(Fr,dc),e(dc,nT),e(Fr,sT),g(s,Bf,y),g(s,Do,y),w(jr,Do,null),e(Do,aT),e(Do,xr),e(xr,rT),e(xr,cc),e(cc,lT),e(xr,iT),g(s,Sf,y),g(s,Yo,y),e(Yo,as),e(as,eh),w(Cr,eh,null),e(Yo,dT),e(Yo,th),e(th,cT),g(s,Xf,y),g(s,vt,y),w(zr,vt,null),e(vt,pT),e(vt,oh),e(oh,hT),e(vt,mT),e(vt,Jr),e(Jr,uT),e(Jr,pc),e(pc,fT),e(Jr,gT),e(vt,_T),e(vt,Ur),e(Ur,yT),e(Ur,Ir),e(Ir,bT),e(Ur,TT),e(vt,kT),e(vt,St),w(Wr,St,null),e(St,vT),e(St,Ho),e(Ho,wT),e(Ho,hc),e(hc,MT),e(Ho,ET),e(Ho,nh),e(nh,$T),e(Ho,FT),e(St,jT),w(rs,St,null),e(St,xT),w(ls,St,null),g(s,Lf,y),g(s,Ko,y),e(Ko,is),e(is,sh),w(Nr,sh,null),e(Ko,CT),e(Ko,ah),e(ah,zT),g(s,Of,y),g(s,pt,y),w(Zr,pt,null),e(pt,JT),e(pt,rh),e(rh,UT),e(pt,IT),e(pt,lh),e(lh,WT),e(pt,NT),e(pt,qr),e(qr,ZT),e(qr,mc),e(mc,qT),e(qr,AT),e(pt,GT),e(pt,Ar),e(Ar,RT),e(Ar,Gr),e(Gr,PT),e(Ar,VT),e(pt,BT),e(pt,Xt),w(Rr,Xt,null),e(Xt,ST),e(Xt,en),e(en,XT),e(en,uc),e(uc,LT),e(en,OT),e(en,ih),e(ih,QT),e(en,DT),e(Xt,YT),w(ds,Xt,null),e(Xt,HT),w(cs,Xt,null),g(s,Qf,y),g(s,tn,y),e(tn,ps),e(ps,dh),w(Pr,dh,null),e(tn,KT),e(tn,ch),e(ch,ek),g(s,Df,y),g(s,wt,y),w(Vr,wt,null),e(wt,tk),e(wt,Br),e(Br,ok),e(Br,ph),e(ph,nk),e(Br,sk),e(wt,ak),e(wt,Sr),e(Sr,rk),e(Sr,fc),e(fc,lk),e(Sr,ik),e(wt,dk),e(wt,Xr),e(Xr,ck),e(Xr,Lr),e(Lr,pk),e(Xr,hk),e(wt,mk),e(wt,Lt),w(Or,Lt,null),e(Lt,uk),e(Lt,on),e(on,fk),e(on,gc),e(gc,gk),e(on,_k),e(on,hh),e(hh,yk),e(on,bk),e(Lt,Tk),w(hs,Lt,null),e(Lt,kk),w(ms,Lt,null),g(s,Yf,y),g(s,nn,y),e(nn,us),e(us,mh),w(Qr,mh,null),e(nn,vk),e(nn,uh),e(uh,wk),g(s,Hf,y),g(s,ht,y),w(Dr,ht,null),e(ht,Mk),e(ht,fh),e(fh,Ek),e(ht,$k),e(ht,gh),e(gh,Fk),e(ht,jk),e(ht,Yr),e(Yr,xk),e(Yr,_c),e(_c,Ck),e(Yr,zk),e(ht,Jk),e(ht,Hr),e(Hr,Uk),e(Hr,Kr),e(Kr,Ik),e(Hr,Wk),e(ht,Nk),e(ht,Ot),w(el,Ot,null),e(Ot,Zk),e(Ot,sn),e(sn,qk),e(sn,yc),e(yc,Ak),e(sn,Gk),e(sn,_h),e(_h,Rk),e(sn,Pk),e(Ot,Vk),w(fs,Ot,null),e(Ot,Bk),w(gs,Ot,null),g(s,Kf,y),g(s,an,y),e(an,_s),e(_s,yh),w(tl,yh,null),e(an,Sk),e(an,bh),e(bh,Xk),g(s,eg,y),g(s,Mt,y),w(ol,Mt,null),e(Mt,Lk),e(Mt,Th),e(Th,Ok),e(Mt,Qk),e(Mt,nl),e(nl,Dk),e(nl,bc),e(bc,Yk),e(nl,Hk),e(Mt,Kk),e(Mt,sl),e(sl,ev),e(sl,al),e(al,tv),e(sl,ov),e(Mt,nv),e(Mt,jt),w(rl,jt,null),e(jt,sv),e(jt,rn),e(rn,av),e(rn,Tc),e(Tc,rv),e(rn,lv),e(rn,kh),e(kh,iv),e(rn,dv),e(jt,cv),w(ys,jt,null),e(jt,pv),w(bs,jt,null),e(jt,hv),w(Ts,jt,null),g(s,tg,y),g(s,ln,y),e(ln,ks),e(ks,vh),w(ll,vh,null),e(ln,mv),e(ln,wh),e(wh,uv),g(s,og,y),g(s,Et,y),w(il,Et,null),e(Et,fv),e(Et,Mh),e(Mh,gv),e(Et,_v),e(Et,dl),e(dl,yv),e(dl,kc),e(kc,bv),e(dl,Tv),e(Et,kv),e(Et,cl),e(cl,vv),e(cl,pl),e(pl,wv),e(cl,Mv),e(Et,Ev),e(Et,Qt),w(hl,Qt,null),e(Qt,$v),e(Qt,dn),e(dn,Fv),e(dn,vc),e(vc,jv),e(dn,xv),e(dn,Eh),e(Eh,Cv),e(dn,zv),e(Qt,Jv),w(vs,Qt,null),e(Qt,Uv),w(ws,Qt,null),g(s,ng,y),g(s,cn,y),e(cn,Ms),e(Ms,$h),w(ml,$h,null),e(cn,Iv),e(cn,Fh),e(Fh,Wv),g(s,sg,y),g(s,mt,y),w(ul,mt,null),e(mt,Nv),e(mt,jh),e(jh,Zv),e(mt,qv),e(mt,xh),e(xh,Av),e(mt,Gv),e(mt,fl),e(fl,Rv),e(fl,wc),e(wc,Pv),e(fl,Vv),e(mt,Bv),e(mt,gl),e(gl,Sv),e(gl,_l),e(_l,Xv),e(gl,Lv),e(mt,Ov),e(mt,Dt),w(yl,Dt,null),e(Dt,Qv),e(Dt,pn),e(pn,Dv),e(pn,Mc),e(Mc,Yv),e(pn,Hv),e(pn,Ch),e(Ch,Kv),e(pn,ew),e(Dt,tw),w(Es,Dt,null),e(Dt,ow),w($s,Dt,null),g(s,ag,y),g(s,hn,y),e(hn,Fs),e(Fs,zh),w(bl,zh,null),e(hn,nw),e(hn,Jh),e(Jh,sw),g(s,rg,y),g(s,$t,y),w(Tl,$t,null),e($t,aw),e($t,mn),e(mn,rw),e(mn,Uh),e(Uh,lw),e(mn,iw),e(mn,Ih),e(Ih,dw),e(mn,cw),e($t,pw),e($t,kl),e(kl,hw),e(kl,Ec),e(Ec,mw),e(kl,uw),e($t,fw),e($t,vl),e(vl,gw),e(vl,wl),e(wl,_w),e(vl,yw),e($t,bw),e($t,Yt),w(Ml,Yt,null),e(Yt,Tw),e(Yt,un),e(un,kw),e(un,$c),e($c,vw),e(un,ww),e(un,Wh),e(Wh,Mw),e(un,Ew),e(Yt,$w),w(js,Yt,null),e(Yt,Fw),w(xs,Yt,null),g(s,lg,y),g(s,fn,y),e(fn,Cs),e(Cs,Nh),w(El,Nh,null),e(fn,jw),e(fn,Zh),e(Zh,xw),g(s,ig,y),g(s,ut,y),w($l,ut,null),e(ut,Cw),e(ut,qh),e(qh,zw),e(ut,Jw),e(ut,Fl),e(Fl,Uw),e(Fl,Fc),e(Fc,Iw),e(Fl,Ww),e(ut,Nw),e(ut,jl),e(jl,Zw),e(jl,xl),e(xl,qw),e(jl,Aw),e(ut,Gw),w(zs,ut,null),e(ut,Rw),e(ut,Ht),w(Cl,Ht,null),e(Ht,Pw),e(Ht,gn),e(gn,Vw),e(gn,jc),e(jc,Bw),e(gn,Sw),e(gn,Ah),e(Ah,Xw),e(gn,Lw),e(Ht,Ow),w(Js,Ht,null),e(Ht,Qw),w(Us,Ht,null),g(s,dg,y),g(s,_n,y),e(_n,Is),e(Is,Gh),w(zl,Gh,null),e(_n,Dw),e(_n,Rh),e(Rh,Yw),g(s,cg,y),g(s,ot,y),w(Jl,ot,null),e(ot,Hw),e(ot,Ph),e(Ph,Kw),e(ot,eM),e(ot,Vh),e(Vh,tM),e(ot,oM),e(ot,Ul),e(Ul,nM),e(Ul,xc),e(xc,sM),e(Ul,aM),e(ot,rM),e(ot,Il),e(Il,lM),e(Il,Wl),e(Wl,iM),e(Il,dM),e(ot,cM),w(Ws,ot,null),e(ot,pM),e(ot,Kt),w(Nl,Kt,null),e(Kt,hM),e(Kt,yn),e(yn,mM),e(yn,Cc),e(Cc,uM),e(yn,fM),e(yn,Bh),e(Bh,gM),e(yn,_M),e(Kt,yM),w(Ns,Kt,null),e(Kt,bM),w(Zs,Kt,null),g(s,pg,y),g(s,bn,y),e(bn,qs),e(qs,Sh),w(Zl,Sh,null),e(bn,TM),e(bn,Xh),e(Xh,kM),g(s,hg,y),g(s,nt,y),w(ql,nt,null),e(nt,vM),e(nt,Lh),e(Lh,wM),e(nt,MM),e(nt,Oh),e(Oh,EM),e(nt,$M),e(nt,Al),e(Al,FM),e(Al,zc),e(zc,jM),e(Al,xM),e(nt,CM),e(nt,Gl),e(Gl,zM),e(Gl,Rl),e(Rl,JM),e(Gl,UM),e(nt,IM),w(As,nt,null),e(nt,WM),e(nt,xt),w(Pl,xt,null),e(xt,NM),e(xt,Tn),e(Tn,ZM),e(Tn,Jc),e(Jc,qM),e(Tn,AM),e(Tn,Qh),e(Qh,GM),e(Tn,RM),e(xt,PM),w(Gs,xt,null),e(xt,VM),w(Rs,xt,null),e(xt,BM),w(Ps,xt,null),g(s,mg,y),g(s,kn,y),e(kn,Vs),e(Vs,Dh),w(Vl,Dh,null),e(kn,SM),e(kn,Yh),e(Yh,XM),g(s,ug,y),g(s,ft,y),w(Bl,ft,null),e(ft,LM),e(ft,Hh),e(Hh,OM),e(ft,QM),e(ft,Sl),e(Sl,DM),e(Sl,Uc),e(Uc,YM),e(Sl,HM),e(ft,KM),e(ft,Xl),e(Xl,eE),e(Xl,Ll),e(Ll,tE),e(Xl,oE),e(ft,nE),w(Bs,ft,null),e(ft,sE),e(ft,Ct),w(Ol,Ct,null),e(Ct,aE),e(Ct,vn),e(vn,rE),e(vn,Ic),e(Ic,lE),e(vn,iE),e(vn,Kh),e(Kh,dE),e(vn,cE),e(Ct,pE),w(Ss,Ct,null),e(Ct,hE),w(Xs,Ct,null),e(Ct,mE),w(Ls,Ct,null),g(s,fg,y),g(s,wn,y),e(wn,Os),e(Os,em),w(Ql,em,null),e(wn,uE),e(wn,tm),e(tm,fE),g(s,gg,y),g(s,gt,y),w(Dl,gt,null),e(gt,gE),e(gt,om),e(om,_E),e(gt,yE),e(gt,Yl),e(Yl,bE),e(Yl,Wc),e(Wc,TE),e(Yl,kE),e(gt,vE),e(gt,Hl),e(Hl,wE),e(Hl,Kl),e(Kl,ME),e(Hl,EE),e(gt,$E),w(Qs,gt,null),e(gt,FE),e(gt,eo),w(ei,eo,null),e(eo,jE),e(eo,Mn),e(Mn,xE),e(Mn,Nc),e(Nc,CE),e(Mn,zE),e(Mn,nm),e(nm,JE),e(Mn,UE),e(eo,IE),w(Ds,eo,null),e(eo,WE),w(Ys,eo,null),g(s,_g,y),g(s,En,y),e(En,Hs),e(Hs,sm),w(ti,sm,null),e(En,NE),e(En,am),e(am,ZE),g(s,yg,y),g(s,st,y),w(oi,st,null),e(st,qE),e(st,rm),e(rm,AE),e(st,GE),e(st,lm),e(lm,RE),e(st,PE),e(st,ni),e(ni,VE),e(ni,Zc),e(Zc,BE),e(ni,SE),e(st,XE),e(st,si),e(si,LE),e(si,ai),e(ai,OE),e(si,QE),e(st,DE),w(Ks,st,null),e(st,YE),e(st,zt),w(ri,zt,null),e(zt,HE),e(zt,$n),e($n,KE),e($n,qc),e(qc,e1),e($n,t1),e($n,im),e(im,o1),e($n,n1),e(zt,s1),w(ea,zt,null),e(zt,a1),w(ta,zt,null),e(zt,r1),w(oa,zt,null),g(s,bg,y),g(s,Fn,y),e(Fn,na),e(na,dm),w(li,dm,null),e(Fn,l1),e(Fn,cm),e(cm,i1),g(s,Tg,y),g(s,_t,y),w(ii,_t,null),e(_t,d1),e(_t,jn),e(jn,c1),e(jn,pm),e(pm,p1),e(jn,h1),e(jn,hm),e(hm,m1),e(jn,u1),e(_t,f1),e(_t,di),e(di,g1),e(di,Ac),e(Ac,_1),e(di,y1),e(_t,b1),e(_t,ci),e(ci,T1),e(ci,pi),e(pi,k1),e(ci,v1),e(_t,w1),w(sa,_t,null),e(_t,M1),e(_t,Jt),w(hi,Jt,null),e(Jt,E1),e(Jt,xn),e(xn,$1),e(xn,Gc),e(Gc,F1),e(xn,j1),e(xn,mm),e(mm,x1),e(xn,C1),e(Jt,z1),w(aa,Jt,null),e(Jt,J1),w(ra,Jt,null),e(Jt,U1),w(la,Jt,null),g(s,kg,y),g(s,Cn,y),e(Cn,ia),e(ia,um),w(mi,um,null),e(Cn,I1),e(Cn,fm),e(fm,W1),g(s,vg,y),g(s,at,y),w(ui,at,null),e(at,N1),e(at,gm),e(gm,Z1),e(at,q1),e(at,fi),e(fi,A1),e(fi,Rc),e(Rc,G1),e(fi,R1),e(at,P1),e(at,gi),e(gi,V1),e(gi,_i),e(_i,B1),e(gi,S1),e(at,X1),e(at,_m),e(_m,L1),e(at,O1),e(at,yo),e(yo,ym),e(ym,yi),e(yi,Q1),e(yo,D1),e(yo,bm),e(bm,bi),e(bi,Y1),e(yo,H1),e(yo,Tm),e(Tm,Ti),e(Ti,K1),e(yo,e2),e(yo,km),e(km,ki),e(ki,t2),e(at,o2),e(at,to),w(vi,to,null),e(to,n2),e(to,zn),e(zn,s2),e(zn,vm),e(vm,a2),e(zn,r2),e(zn,wm),e(wm,l2),e(zn,i2),e(to,d2),w(da,to,null),e(to,c2),w(ca,to,null),g(s,wg,y),g(s,Jn,y),e(Jn,pa),e(pa,Mm),w(wi,Mm,null),e(Jn,p2),e(Jn,Em),e(Em,h2),g(s,Mg,y),g(s,Ke,y),w(Mi,Ke,null),e(Ke,m2),e(Ke,$m),e($m,u2),e(Ke,f2),e(Ke,Fm),e(Fm,g2),e(Ke,_2),e(Ke,Ei),e(Ei,y2),e(Ei,Pc),e(Pc,b2),e(Ei,T2),e(Ke,k2),e(Ke,$i),e($i,v2),e($i,Fi),e(Fi,w2),e($i,M2),e(Ke,E2),e(Ke,jm),e(jm,$2),e(Ke,F2),e(Ke,bo),e(bo,xm),e(xm,ji),e(ji,j2),e(bo,x2),e(bo,Cm),e(Cm,xi),e(xi,C2),e(bo,z2),e(bo,zm),e(zm,Ci),e(Ci,J2),e(bo,U2),e(bo,Jm),e(Jm,zi),e(zi,I2),e(Ke,W2),e(Ke,oo),w(Ji,oo,null),e(oo,N2),e(oo,Un),e(Un,Z2),e(Un,Um),e(Um,q2),e(Un,A2),e(Un,Im),e(Im,G2),e(Un,R2),e(oo,P2),w(ha,oo,null),e(oo,V2),w(ma,oo,null),g(s,Eg,y),g(s,In,y),e(In,ua),e(ua,Wm),w(Ui,Wm,null),e(In,B2),e(In,Nm),e(Nm,S2),g(s,$g,y),g(s,rt,y),w(Ii,rt,null),e(rt,X2),e(rt,Zm),e(Zm,L2),e(rt,O2),e(rt,Wi),e(Wi,Q2),e(Wi,Vc),e(Vc,D2),e(Wi,Y2),e(rt,H2),e(rt,Ni),e(Ni,K2),e(Ni,Zi),e(Zi,e0),e(Ni,t0),e(rt,o0),e(rt,qm),e(qm,n0),e(rt,s0),e(rt,To),e(To,Am),e(Am,qi),e(qi,a0),e(To,r0),e(To,Gm),e(Gm,Ai),e(Ai,l0),e(To,i0),e(To,Rm),e(Rm,Gi),e(Gi,d0),e(To,c0),e(To,Pm),e(Pm,Ri),e(Ri,p0),e(rt,h0),e(rt,no),w(Pi,no,null),e(no,m0),e(no,Wn),e(Wn,u0),e(Wn,Vm),e(Vm,f0),e(Wn,g0),e(Wn,Bm),e(Bm,_0),e(Wn,y0),e(no,b0),w(fa,no,null),e(no,T0),w(ga,no,null),g(s,Fg,y),g(s,Nn,y),e(Nn,_a),e(_a,Sm),w(Vi,Sm,null),e(Nn,k0),e(Nn,Xm),e(Xm,v0),g(s,jg,y),g(s,lt,y),w(Bi,lt,null),e(lt,w0),e(lt,Si),e(Si,M0),e(Si,Lm),e(Lm,E0),e(Si,$0),e(lt,F0),e(lt,Xi),e(Xi,j0),e(Xi,Bc),e(Bc,x0),e(Xi,C0),e(lt,z0),e(lt,Li),e(Li,J0),e(Li,Oi),e(Oi,U0),e(Li,I0),e(lt,W0),e(lt,Om),e(Om,N0),e(lt,Z0),e(lt,ko),e(ko,Qm),e(Qm,Qi),e(Qi,q0),e(ko,A0),e(ko,Dm),e(Dm,Di),e(Di,G0),e(ko,R0),e(ko,Ym),e(Ym,Yi),e(Yi,P0),e(ko,V0),e(ko,Hm),e(Hm,Hi),e(Hi,B0),e(lt,S0),e(lt,so),w(Ki,so,null),e(so,X0),e(so,Zn),e(Zn,L0),e(Zn,Km),e(Km,O0),e(Zn,Q0),e(Zn,eu),e(eu,D0),e(Zn,Y0),e(so,H0),w(ya,so,null),e(so,K0),w(ba,so,null),g(s,xg,y),g(s,qn,y),e(qn,Ta),e(Ta,tu),w(ed,tu,null),e(qn,e$),e(qn,ou),e(ou,t$),g(s,Cg,y),g(s,it,y),w(td,it,null),e(it,o$),e(it,nu),e(nu,n$),e(it,s$),e(it,od),e(od,a$),e(od,Sc),e(Sc,r$),e(od,l$),e(it,i$),e(it,nd),e(nd,d$),e(nd,sd),e(sd,c$),e(nd,p$),e(it,h$),e(it,su),e(su,m$),e(it,u$),e(it,vo),e(vo,au),e(au,ad),e(ad,f$),e(vo,g$),e(vo,ru),e(ru,rd),e(rd,_$),e(vo,y$),e(vo,lu),e(lu,ld),e(ld,b$),e(vo,T$),e(vo,iu),e(iu,id),e(id,k$),e(it,v$),e(it,ao),w(dd,ao,null),e(ao,w$),e(ao,An),e(An,M$),e(An,du),e(du,E$),e(An,$$),e(An,cu),e(cu,F$),e(An,j$),e(ao,x$),w(ka,ao,null),e(ao,C$),w(va,ao,null),g(s,zg,y),g(s,Gn,y),e(Gn,wa),e(wa,pu),w(cd,pu,null),e(Gn,z$),e(Gn,hu),e(hu,J$),g(s,Jg,y),g(s,dt,y),w(pd,dt,null),e(dt,U$),e(dt,mu),e(mu,I$),e(dt,W$),e(dt,hd),e(hd,N$),e(hd,Xc),e(Xc,Z$),e(hd,q$),e(dt,A$),e(dt,md),e(md,G$),e(md,ud),e(ud,R$),e(md,P$),e(dt,V$),e(dt,uu),e(uu,B$),e(dt,S$),e(dt,wo),e(wo,fu),e(fu,fd),e(fd,X$),e(wo,L$),e(wo,gu),e(gu,gd),e(gd,O$),e(wo,Q$),e(wo,_u),e(_u,_d),e(_d,D$),e(wo,Y$),e(wo,yu),e(yu,yd),e(yd,H$),e(dt,K$),e(dt,ro),w(bd,ro,null),e(ro,eF),e(ro,Rn),e(Rn,tF),e(Rn,bu),e(bu,oF),e(Rn,nF),e(Rn,Tu),e(Tu,sF),e(Rn,aF),e(ro,rF),w(Ma,ro,null),e(ro,lF),w(Ea,ro,null),g(s,Ug,y),g(s,Pn,y),e(Pn,$a),e($a,ku),w(Td,ku,null),e(Pn,iF),e(Pn,vu),e(vu,dF),g(s,Ig,y),g(s,et,y),w(kd,et,null),e(et,cF),e(et,wu),e(wu,pF),e(et,hF),e(et,Mu),e(Mu,mF),e(et,uF),e(et,vd),e(vd,fF),e(vd,Lc),e(Lc,gF),e(vd,_F),e(et,yF),e(et,wd),e(wd,bF),e(wd,Md),e(Md,TF),e(wd,kF),e(et,vF),e(et,Eu),e(Eu,wF),e(et,MF),e(et,Mo),e(Mo,$u),e($u,Ed),e(Ed,EF),e(Mo,$F),e(Mo,Fu),e(Fu,$d),e($d,FF),e(Mo,jF),e(Mo,ju),e(ju,Fd),e(Fd,xF),e(Mo,CF),e(Mo,xu),e(xu,jd),e(jd,zF),e(et,JF),e(et,lo),w(xd,lo,null),e(lo,UF),e(lo,Vn),e(Vn,IF),e(Vn,Cu),e(Cu,WF),e(Vn,NF),e(Vn,zu),e(zu,ZF),e(Vn,qF),e(lo,AF),w(Fa,lo,null),e(lo,GF),w(ja,lo,null),g(s,Wg,y),g(s,Bn,y),e(Bn,xa),e(xa,Ju),w(Cd,Ju,null),e(Bn,RF),e(Bn,Uu),e(Uu,PF),g(s,Ng,y),g(s,ct,y),w(zd,ct,null),e(ct,VF),e(ct,Sn),e(Sn,BF),e(Sn,Iu),e(Iu,SF),e(Sn,XF),e(Sn,Wu),e(Wu,LF),e(Sn,OF),e(ct,QF),e(ct,Jd),e(Jd,DF),e(Jd,Oc),e(Oc,YF),e(Jd,HF),e(ct,KF),e(ct,Ud),e(Ud,ej),e(Ud,Id),e(Id,tj),e(Ud,oj),e(ct,nj),e(ct,Nu),e(Nu,sj),e(ct,aj),e(ct,Eo),e(Eo,Zu),e(Zu,Wd),e(Wd,rj),e(Eo,lj),e(Eo,qu),e(qu,Nd),e(Nd,ij),e(Eo,dj),e(Eo,Au),e(Au,Zd),e(Zd,cj),e(Eo,pj),e(Eo,Gu),e(Gu,qd),e(qd,hj),e(ct,mj),e(ct,io),w(Ad,io,null),e(io,uj),e(io,Xn),e(Xn,fj),e(Xn,Ru),e(Ru,gj),e(Xn,_j),e(Xn,Pu),e(Pu,yj),e(Xn,bj),e(io,Tj),w(Ca,io,null),e(io,kj),w(za,io,null),Zg=!0},p(s,[y]){const Gd={};y&2&&(Gd.$$scope={dirty:y,ctx:s}),Yn.$set(Gd);const Vu={};y&2&&(Vu.$$scope={dirty:y,ctx:s}),es.$set(Vu);const Bu={};y&2&&(Bu.$$scope={dirty:y,ctx:s}),ns.$set(Bu);const Su={};y&2&&(Su.$$scope={dirty:y,ctx:s}),rs.$set(Su);const Rd={};y&2&&(Rd.$$scope={dirty:y,ctx:s}),ls.$set(Rd);const Xu={};y&2&&(Xu.$$scope={dirty:y,ctx:s}),ds.$set(Xu);const Lu={};y&2&&(Lu.$$scope={dirty:y,ctx:s}),cs.$set(Lu);const Pd={};y&2&&(Pd.$$scope={dirty:y,ctx:s}),hs.$set(Pd);const Ou={};y&2&&(Ou.$$scope={dirty:y,ctx:s}),ms.$set(Ou);const Qu={};y&2&&(Qu.$$scope={dirty:y,ctx:s}),fs.$set(Qu);const Du={};y&2&&(Du.$$scope={dirty:y,ctx:s}),gs.$set(Du);const Vd={};y&2&&(Vd.$$scope={dirty:y,ctx:s}),ys.$set(Vd);const Yu={};y&2&&(Yu.$$scope={dirty:y,ctx:s}),bs.$set(Yu);const Hu={};y&2&&(Hu.$$scope={dirty:y,ctx:s}),Ts.$set(Hu);const Ku={};y&2&&(Ku.$$scope={dirty:y,ctx:s}),vs.$set(Ku);const ef={};y&2&&(ef.$$scope={dirty:y,ctx:s}),ws.$set(ef);const tf={};y&2&&(tf.$$scope={dirty:y,ctx:s}),Es.$set(tf);const Ln={};y&2&&(Ln.$$scope={dirty:y,ctx:s}),$s.$set(Ln);const of={};y&2&&(of.$$scope={dirty:y,ctx:s}),js.$set(of);const nf={};y&2&&(nf.$$scope={dirty:y,ctx:s}),xs.$set(nf);const $o={};y&2&&($o.$$scope={dirty:y,ctx:s}),zs.$set($o);const sf={};y&2&&(sf.$$scope={dirty:y,ctx:s}),Js.$set(sf);const af={};y&2&&(af.$$scope={dirty:y,ctx:s}),Us.$set(af);const rf={};y&2&&(rf.$$scope={dirty:y,ctx:s}),Ws.$set(rf);const On={};y&2&&(On.$$scope={dirty:y,ctx:s}),Ns.$set(On);const lf={};y&2&&(lf.$$scope={dirty:y,ctx:s}),Zs.$set(lf);const df={};y&2&&(df.$$scope={dirty:y,ctx:s}),As.$set(df);const Bd={};y&2&&(Bd.$$scope={dirty:y,ctx:s}),Gs.$set(Bd);const cf={};y&2&&(cf.$$scope={dirty:y,ctx:s}),Rs.$set(cf);const pf={};y&2&&(pf.$$scope={dirty:y,ctx:s}),Ps.$set(pf);const hf={};y&2&&(hf.$$scope={dirty:y,ctx:s}),Bs.$set(hf);const Ft={};y&2&&(Ft.$$scope={dirty:y,ctx:s}),Ss.$set(Ft);const mf={};y&2&&(mf.$$scope={dirty:y,ctx:s}),Xs.$set(mf);const uf={};y&2&&(uf.$$scope={dirty:y,ctx:s}),Ls.$set(uf);const ff={};y&2&&(ff.$$scope={dirty:y,ctx:s}),Qs.$set(ff);const gf={};y&2&&(gf.$$scope={dirty:y,ctx:s}),Ds.$set(gf);const _f={};y&2&&(_f.$$scope={dirty:y,ctx:s}),Ys.$set(_f);const yf={};y&2&&(yf.$$scope={dirty:y,ctx:s}),Ks.$set(yf);const bf={};y&2&&(bf.$$scope={dirty:y,ctx:s}),ea.$set(bf);const Tf={};y&2&&(Tf.$$scope={dirty:y,ctx:s}),ta.$set(Tf);const kf={};y&2&&(kf.$$scope={dirty:y,ctx:s}),oa.$set(kf);const vf={};y&2&&(vf.$$scope={dirty:y,ctx:s}),sa.$set(vf);const wf={};y&2&&(wf.$$scope={dirty:y,ctx:s}),aa.$set(wf);const Mf={};y&2&&(Mf.$$scope={dirty:y,ctx:s}),ra.$set(Mf);const Sd={};y&2&&(Sd.$$scope={dirty:y,ctx:s}),la.$set(Sd);const Ef={};y&2&&(Ef.$$scope={dirty:y,ctx:s}),da.$set(Ef);const $f={};y&2&&($f.$$scope={dirty:y,ctx:s}),ca.$set($f);const Ff={};y&2&&(Ff.$$scope={dirty:y,ctx:s}),ha.$set(Ff);const Fo={};y&2&&(Fo.$$scope={dirty:y,ctx:s}),ma.$set(Fo);const jo={};y&2&&(jo.$$scope={dirty:y,ctx:s}),fa.$set(jo);const jf={};y&2&&(jf.$$scope={dirty:y,ctx:s}),ga.$set(jf);const xf={};y&2&&(xf.$$scope={dirty:y,ctx:s}),ya.$set(xf);const Cf={};y&2&&(Cf.$$scope={dirty:y,ctx:s}),ba.$set(Cf);const Qn={};y&2&&(Qn.$$scope={dirty:y,ctx:s}),ka.$set(Qn);const zf={};y&2&&(zf.$$scope={dirty:y,ctx:s}),va.$set(zf);const Jf={};y&2&&(Jf.$$scope={dirty:y,ctx:s}),Ma.$set(Jf);const Xd={};y&2&&(Xd.$$scope={dirty:y,ctx:s}),Ea.$set(Xd);const Uf={};y&2&&(Uf.$$scope={dirty:y,ctx:s}),Fa.$set(Uf);const If={};y&2&&(If.$$scope={dirty:y,ctx:s}),ja.$set(If);const Wf={};y&2&&(Wf.$$scope={dirty:y,ctx:s}),Ca.$set(Wf);const yt={};y&2&&(yt.$$scope={dirty:y,ctx:s}),za.$set(yt)},i(s){Zg||(M(i.$$.fragment,s),M(le.$$.fragment,s),M(S.$$.fragment,s),M(rr.$$.fragment,s),M(lr.$$.fragment,s),M(Yn.$$.fragment,s),M(dr.$$.fragment,s),M(cr.$$.fragment,s),M(hr.$$.fragment,s),M(ur.$$.fragment,s),M(fr.$$.fragment,s),M(es.$$.fragment,s),M(gr.$$.fragment,s),M(yr.$$.fragment,s),M(br.$$.fragment,s),M(vr.$$.fragment,s),M(Mr.$$.fragment,s),M(ns.$$.fragment,s),M(Er.$$.fragment,s),M($r.$$.fragment,s),M(jr.$$.fragment,s),M(Cr.$$.fragment,s),M(zr.$$.fragment,s),M(Wr.$$.fragment,s),M(rs.$$.fragment,s),M(ls.$$.fragment,s),M(Nr.$$.fragment,s),M(Zr.$$.fragment,s),M(Rr.$$.fragment,s),M(ds.$$.fragment,s),M(cs.$$.fragment,s),M(Pr.$$.fragment,s),M(Vr.$$.fragment,s),M(Or.$$.fragment,s),M(hs.$$.fragment,s),M(ms.$$.fragment,s),M(Qr.$$.fragment,s),M(Dr.$$.fragment,s),M(el.$$.fragment,s),M(fs.$$.fragment,s),M(gs.$$.fragment,s),M(tl.$$.fragment,s),M(ol.$$.fragment,s),M(rl.$$.fragment,s),M(ys.$$.fragment,s),M(bs.$$.fragment,s),M(Ts.$$.fragment,s),M(ll.$$.fragment,s),M(il.$$.fragment,s),M(hl.$$.fragment,s),M(vs.$$.fragment,s),M(ws.$$.fragment,s),M(ml.$$.fragment,s),M(ul.$$.fragment,s),M(yl.$$.fragment,s),M(Es.$$.fragment,s),M($s.$$.fragment,s),M(bl.$$.fragment,s),M(Tl.$$.fragment,s),M(Ml.$$.fragment,s),M(js.$$.fragment,s),M(xs.$$.fragment,s),M(El.$$.fragment,s),M($l.$$.fragment,s),M(zs.$$.fragment,s),M(Cl.$$.fragment,s),M(Js.$$.fragment,s),M(Us.$$.fragment,s),M(zl.$$.fragment,s),M(Jl.$$.fragment,s),M(Ws.$$.fragment,s),M(Nl.$$.fragment,s),M(Ns.$$.fragment,s),M(Zs.$$.fragment,s),M(Zl.$$.fragment,s),M(ql.$$.fragment,s),M(As.$$.fragment,s),M(Pl.$$.fragment,s),M(Gs.$$.fragment,s),M(Rs.$$.fragment,s),M(Ps.$$.fragment,s),M(Vl.$$.fragment,s),M(Bl.$$.fragment,s),M(Bs.$$.fragment,s),M(Ol.$$.fragment,s),M(Ss.$$.fragment,s),M(Xs.$$.fragment,s),M(Ls.$$.fragment,s),M(Ql.$$.fragment,s),M(Dl.$$.fragment,s),M(Qs.$$.fragment,s),M(ei.$$.fragment,s),M(Ds.$$.fragment,s),M(Ys.$$.fragment,s),M(ti.$$.fragment,s),M(oi.$$.fragment,s),M(Ks.$$.fragment,s),M(ri.$$.fragment,s),M(ea.$$.fragment,s),M(ta.$$.fragment,s),M(oa.$$.fragment,s),M(li.$$.fragment,s),M(ii.$$.fragment,s),M(sa.$$.fragment,s),M(hi.$$.fragment,s),M(aa.$$.fragment,s),M(ra.$$.fragment,s),M(la.$$.fragment,s),M(mi.$$.fragment,s),M(ui.$$.fragment,s),M(vi.$$.fragment,s),M(da.$$.fragment,s),M(ca.$$.fragment,s),M(wi.$$.fragment,s),M(Mi.$$.fragment,s),M(Ji.$$.fragment,s),M(ha.$$.fragment,s),M(ma.$$.fragment,s),M(Ui.$$.fragment,s),M(Ii.$$.fragment,s),M(Pi.$$.fragment,s),M(fa.$$.fragment,s),M(ga.$$.fragment,s),M(Vi.$$.fragment,s),M(Bi.$$.fragment,s),M(Ki.$$.fragment,s),M(ya.$$.fragment,s),M(ba.$$.fragment,s),M(ed.$$.fragment,s),M(td.$$.fragment,s),M(dd.$$.fragment,s),M(ka.$$.fragment,s),M(va.$$.fragment,s),M(cd.$$.fragment,s),M(pd.$$.fragment,s),M(bd.$$.fragment,s),M(Ma.$$.fragment,s),M(Ea.$$.fragment,s),M(Td.$$.fragment,s),M(kd.$$.fragment,s),M(xd.$$.fragment,s),M(Fa.$$.fragment,s),M(ja.$$.fragment,s),M(Cd.$$.fragment,s),M(zd.$$.fragment,s),M(Ad.$$.fragment,s),M(Ca.$$.fragment,s),M(za.$$.fragment,s),Zg=!0)},o(s){E(i.$$.fragment,s),E(le.$$.fragment,s),E(S.$$.fragment,s),E(rr.$$.fragment,s),E(lr.$$.fragment,s),E(Yn.$$.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(yr.$$.fragment,s),E(br.$$.fragment,s),E(vr.$$.fragment,s),E(Mr.$$.fragment,s),E(ns.$$.fragment,s),E(Er.$$.fragment,s),E($r.$$.fragment,s),E(jr.$$.fragment,s),E(Cr.$$.fragment,s),E(zr.$$.fragment,s),E(Wr.$$.fragment,s),E(rs.$$.fragment,s),E(ls.$$.fragment,s),E(Nr.$$.fragment,s),E(Zr.$$.fragment,s),E(Rr.$$.fragment,s),E(ds.$$.fragment,s),E(cs.$$.fragment,s),E(Pr.$$.fragment,s),E(Vr.$$.fragment,s),E(Or.$$.fragment,s),E(hs.$$.fragment,s),E(ms.$$.fragment,s),E(Qr.$$.fragment,s),E(Dr.$$.fragment,s),E(el.$$.fragment,s),E(fs.$$.fragment,s),E(gs.$$.fragment,s),E(tl.$$.fragment,s),E(ol.$$.fragment,s),E(rl.$$.fragment,s),E(ys.$$.fragment,s),E(bs.$$.fragment,s),E(Ts.$$.fragment,s),E(ll.$$.fragment,s),E(il.$$.fragment,s),E(hl.$$.fragment,s),E(vs.$$.fragment,s),E(ws.$$.fragment,s),E(ml.$$.fragment,s),E(ul.$$.fragment,s),E(yl.$$.fragment,s),E(Es.$$.fragment,s),E($s.$$.fragment,s),E(bl.$$.fragment,s),E(Tl.$$.fragment,s),E(Ml.$$.fragment,s),E(js.$$.fragment,s),E(xs.$$.fragment,s),E(El.$$.fragment,s),E($l.$$.fragment,s),E(zs.$$.fragment,s),E(Cl.$$.fragment,s),E(Js.$$.fragment,s),E(Us.$$.fragment,s),E(zl.$$.fragment,s),E(Jl.$$.fragment,s),E(Ws.$$.fragment,s),E(Nl.$$.fragment,s),E(Ns.$$.fragment,s),E(Zs.$$.fragment,s),E(Zl.$$.fragment,s),E(ql.$$.fragment,s),E(As.$$.fragment,s),E(Pl.$$.fragment,s),E(Gs.$$.fragment,s),E(Rs.$$.fragment,s),E(Ps.$$.fragment,s),E(Vl.$$.fragment,s),E(Bl.$$.fragment,s),E(Bs.$$.fragment,s),E(Ol.$$.fragment,s),E(Ss.$$.fragment,s),E(Xs.$$.fragment,s),E(Ls.$$.fragment,s),E(Ql.$$.fragment,s),E(Dl.$$.fragment,s),E(Qs.$$.fragment,s),E(ei.$$.fragment,s),E(Ds.$$.fragment,s),E(Ys.$$.fragment,s),E(ti.$$.fragment,s),E(oi.$$.fragment,s),E(Ks.$$.fragment,s),E(ri.$$.fragment,s),E(ea.$$.fragment,s),E(ta.$$.fragment,s),E(oa.$$.fragment,s),E(li.$$.fragment,s),E(ii.$$.fragment,s),E(sa.$$.fragment,s),E(hi.$$.fragment,s),E(aa.$$.fragment,s),E(ra.$$.fragment,s),E(la.$$.fragment,s),E(mi.$$.fragment,s),E(ui.$$.fragment,s),E(vi.$$.fragment,s),E(da.$$.fragment,s),E(ca.$$.fragment,s),E(wi.$$.fragment,s),E(Mi.$$.fragment,s),E(Ji.$$.fragment,s),E(ha.$$.fragment,s),E(ma.$$.fragment,s),E(Ui.$$.fragment,s),E(Ii.$$.fragment,s),E(Pi.$$.fragment,s),E(fa.$$.fragment,s),E(ga.$$.fragment,s),E(Vi.$$.fragment,s),E(Bi.$$.fragment,s),E(Ki.$$.fragment,s),E(ya.$$.fragment,s),E(ba.$$.fragment,s),E(ed.$$.fragment,s),E(td.$$.fragment,s),E(dd.$$.fragment,s),E(ka.$$.fragment,s),E(va.$$.fragment,s),E(cd.$$.fragment,s),E(pd.$$.fragment,s),E(bd.$$.fragment,s),E(Ma.$$.fragment,s),E(Ea.$$.fragment,s),E(Td.$$.fragment,s),E(kd.$$.fragment,s),E(xd.$$.fragment,s),E(Fa.$$.fragment,s),E(ja.$$.fragment,s),E(Cd.$$.fragment,s),E(zd.$$.fragment,s),E(Ad.$$.fragment,s),E(Ca.$$.fragment,s),E(za.$$.fragment,s),Zg=!1},d(s){t(d),s&&t(b),s&&t(u),$(i),s&&t(fe),s&&t(R),s&&t(D),s&&t(ae),$(le),s&&t(ge),s&&t(B),s&&t(I),s&&t(pe),s&&t(_e),s&&t(he),s&&t(ye),s&&t(U),s&&t(Y),s&&t(se),s&&t(oe),s&&t(Je),s&&t(A),s&&t(P),$(S),s&&t(Se),s&&t(V),s&&t(Nf),s&&t(Po),$(rr),s&&t(Zf),s&&t(Pt),$(lr),$(Yn),s&&t(qf),s&&t(Bo),$(dr),s&&t(Af),s&&t(tt),$(cr),$(hr),$(ur),$(fr),$(es),$(gr),s&&t(Gf),s&&t(Xo),$(yr),s&&t(Rf),s&&t(kt),$(br),$(vr),$(Mr),$(ns),s&&t(Pf),s&&t(Oo),$(Er),s&&t(Vf),s&&t(Qo),$($r),s&&t(Bf),s&&t(Do),$(jr),s&&t(Sf),s&&t(Yo),$(Cr),s&&t(Xf),s&&t(vt),$(zr),$(Wr),$(rs),$(ls),s&&t(Lf),s&&t(Ko),$(Nr),s&&t(Of),s&&t(pt),$(Zr),$(Rr),$(ds),$(cs),s&&t(Qf),s&&t(tn),$(Pr),s&&t(Df),s&&t(wt),$(Vr),$(Or),$(hs),$(ms),s&&t(Yf),s&&t(nn),$(Qr),s&&t(Hf),s&&t(ht),$(Dr),$(el),$(fs),$(gs),s&&t(Kf),s&&t(an),$(tl),s&&t(eg),s&&t(Mt),$(ol),$(rl),$(ys),$(bs),$(Ts),s&&t(tg),s&&t(ln),$(ll),s&&t(og),s&&t(Et),$(il),$(hl),$(vs),$(ws),s&&t(ng),s&&t(cn),$(ml),s&&t(sg),s&&t(mt),$(ul),$(yl),$(Es),$($s),s&&t(ag),s&&t(hn),$(bl),s&&t(rg),s&&t($t),$(Tl),$(Ml),$(js),$(xs),s&&t(lg),s&&t(fn),$(El),s&&t(ig),s&&t(ut),$($l),$(zs),$(Cl),$(Js),$(Us),s&&t(dg),s&&t(_n),$(zl),s&&t(cg),s&&t(ot),$(Jl),$(Ws),$(Nl),$(Ns),$(Zs),s&&t(pg),s&&t(bn),$(Zl),s&&t(hg),s&&t(nt),$(ql),$(As),$(Pl),$(Gs),$(Rs),$(Ps),s&&t(mg),s&&t(kn),$(Vl),s&&t(ug),s&&t(ft),$(Bl),$(Bs),$(Ol),$(Ss),$(Xs),$(Ls),s&&t(fg),s&&t(wn),$(Ql),s&&t(gg),s&&t(gt),$(Dl),$(Qs),$(ei),$(Ds),$(Ys),s&&t(_g),s&&t(En),$(ti),s&&t(yg),s&&t(st),$(oi),$(Ks),$(ri),$(ea),$(ta),$(oa),s&&t(bg),s&&t(Fn),$(li),s&&t(Tg),s&&t(_t),$(ii),$(sa),$(hi),$(aa),$(ra),$(la),s&&t(kg),s&&t(Cn),$(mi),s&&t(vg),s&&t(at),$(ui),$(vi),$(da),$(ca),s&&t(wg),s&&t(Jn),$(wi),s&&t(Mg),s&&t(Ke),$(Mi),$(Ji),$(ha),$(ma),s&&t(Eg),s&&t(In),$(Ui),s&&t($g),s&&t(rt),$(Ii),$(Pi),$(fa),$(ga),s&&t(Fg),s&&t(Nn),$(Vi),s&&t(jg),s&&t(lt),$(Bi),$(Ki),$(ya),$(ba),s&&t(xg),s&&t(qn),$(ed),s&&t(Cg),s&&t(it),$(td),$(dd),$(ka),$(va),s&&t(zg),s&&t(Gn),$(cd),s&&t(Jg),s&&t(dt),$(pd),$(bd),$(Ma),$(Ea),s&&t(Ug),s&&t(Pn),$(Td),s&&t(Ig),s&&t(et),$(kd),$(xd),$(Fa),$(ja),s&&t(Wg),s&&t(Bn),$(Cd),s&&t(Ng),s&&t(ct),$(zd),$(Ad),$(Ca),$(za)}}}const d3={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 c3(F){return eI(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class _3 extends DU{constructor(d){super();YU(this,d,c3,i3,HU,{})}}export{_3 as default,d3 as metadata};
