import{S as Lh,i as Dh,s as Hh,e as s,k as m,w,t as i,M as Yh,c as r,d as o,m as f,a,x as T,h as l,b as h,G as e,g as b,y as v,q as k,o as M,B as F,v as Oh,L as K}from"../../chunks/vendor-hf-doc-builder.js";import{T as St}from"../../chunks/Tip-hf-doc-builder.js";import{D as J}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ee}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as E}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as O}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Kh($){let c,y,u,p,_;return p=new ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZOZXRDb25maWclMkMlMjBGTmV0TW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwRk5ldCUyMGZuZXQtYmFzZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBGTmV0Q29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMGZuZXQtYmFzZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwRk5ldE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> FNetConfig, FNetModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a FNet fnet-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = FNetConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the fnet-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FNetModel(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(){c=s("p"),y=i("Example:"),u=m(),w(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);y=l(d,"Example:"),d.forEach(o),u=f(n),T(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,y),b(n,u,d),v(p,n,d),_=!0},p:K,i(n){_||(k(p.$$.fragment,n),_=!0)},o(n){M(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),F(p,n)}}}function em($){let c,y,u,p,_;return p=new ee({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAlN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",highlighted:'<span class="hljs-attribute">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">1</span> <span class="hljs-number">1</span> <span class="hljs-number">1</span> <span class="hljs-number">1</span> <span class="hljs-number">1</span> <span class="hljs-number">1</span> <span class="hljs-number">1</span> <span class="hljs-number">1</span> <span class="hljs-number">1</span> | first sequence | second sequence |'}}),{c(){c=s("p"),y=i("pair mask has the following format: :"),u=m(),w(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);y=l(d,"pair mask has the following format: :"),d.forEach(o),u=f(n),T(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,y),b(n,u,d),v(p,n,d),_=!0},p:K,i(n){_||(k(p.$$.fragment,n),_=!0)},o(n){M(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),F(p,n)}}}function tm($){let c,y,u,p,_;return p=new ee({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(){c=s("p"),y=i("sequence pair mask has the following format:"),u=m(),w(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);y=l(d,"sequence pair mask has the following format:"),d.forEach(o),u=f(n),T(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,y),b(n,u,d),v(p,n,d),_=!0},p:K,i(n){_||(k(p.$$.fragment,n),_=!0)},o(n){M(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),F(p,n)}}}function om($){let c,y,u,p,_;return{c(){c=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){c=r(n,"P",{});var d=a(c);y=l(d,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(d,"CODE",{});var N=a(u);p=l(N,"Module"),N.forEach(o),_=l(d,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),d.forEach(o)},m(n,d){b(n,c,d),e(c,y),e(c,u),e(u,p),e(c,_)},d(n){n&&o(c)}}}function nm($){let c,y,u,p,_;return p=new ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGTmV0TW9kZWwlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmZuZXQtYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyMEZOZXRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZm5ldC1iYXNlJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FNetModel
<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/fnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FNetModel.from_pretrained(<span class="hljs-string">&quot;google/fnet-base&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){c=s("p"),y=i("Example:"),u=m(),w(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);y=l(d,"Example:"),d.forEach(o),u=f(n),T(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,y),b(n,u,d),v(p,n,d),_=!0},p:K,i(n){_||(k(p.$$.fragment,n),_=!0)},o(n){M(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),F(p,n)}}}function sm($){let c,y,u,p,_;return{c(){c=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){c=r(n,"P",{});var d=a(c);y=l(d,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(d,"CODE",{});var N=a(u);p=l(N,"Module"),N.forEach(o),_=l(d,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),d.forEach(o)},m(n,d){b(n,c,d),e(c,y),e(c,u),e(u,p),e(c,_)},d(n){n&&o(c)}}}function rm($){let c,y,u,p,_;return p=new ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGTmV0Rm9yUHJlVHJhaW5pbmclMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmZuZXQtYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyMEZOZXRGb3JQcmVUcmFpbmluZy5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZm5ldC1iYXNlJTIyKSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBcHJlZGljdGlvbl9sb2dpdHMlMjAlM0QlMjBvdXRwdXRzLnByZWRpY3Rpb25fbG9naXRzJTBBc2VxX3JlbGF0aW9uc2hpcF9sb2dpdHMlMjAlM0QlMjBvdXRwdXRzLnNlcV9yZWxhdGlvbnNoaXBfbG9naXRz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FNetForPreTraining
<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/fnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FNetForPreTraining.from_pretrained(<span class="hljs-string">&quot;google/fnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>prediction_logits = outputs.prediction_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>seq_relationship_logits = outputs.seq_relationship_logits`}}),{c(){c=s("p"),y=i("Example:"),u=m(),w(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);y=l(d,"Example:"),d.forEach(o),u=f(n),T(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,y),b(n,u,d),v(p,n,d),_=!0},p:K,i(n){_||(k(p.$$.fragment,n),_=!0)},o(n){M(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),F(p,n)}}}function am($){let c,y,u,p,_;return{c(){c=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){c=r(n,"P",{});var d=a(c);y=l(d,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(d,"CODE",{});var N=a(u);p=l(N,"Module"),N.forEach(o),_=l(d,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),d.forEach(o)},m(n,d){b(n,c,d),e(c,y),e(c,u),e(u,p),e(c,_)},d(n){n&&o(c)}}}function im($){let c,y,u,p,_;return p=new ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGTmV0Rm9yTWFza2VkTE0lMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmZuZXQtYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyMEZOZXRGb3JNYXNrZWRMTS5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZm5ldC1iYXNlJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJUaGUlMjBjYXBpdGFsJTIwb2YlMjBGcmFuY2UlMjBpcyUyMCU1Qk1BU0slNUQuJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQSUyMyUyMHJldHJpZXZlJTIwaW5kZXglMjBvZiUyMCU1Qk1BU0slNUQlMEFtYXNrX3Rva2VuX2luZGV4JTIwJTNEJTIwKGlucHV0cy5pbnB1dF9pZHMlMjAlM0QlM0QlMjB0b2tlbml6ZXIubWFza190b2tlbl9pZCklNUIwJTVELm5vbnplcm8oYXNfdHVwbGUlM0RUcnVlKSU1QjAlNUQlMEElMEFwcmVkaWN0ZWRfdG9rZW5faWQlMjAlM0QlMjBsb2dpdHMlNUIwJTJDJTIwbWFza190b2tlbl9pbmRleCU1RC5hcmdtYXgoYXhpcyUzRC0xKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRva2VuaXplciglMjJUaGUlMjBjYXBpdGFsJTIwb2YlMjBGcmFuY2UlMjBpcyUyMFBhcmlzLiUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTVCJTIyaW5wdXRfaWRzJTIyJTVEJTBBJTIzJTIwbWFzayUyMGxhYmVscyUyMG9mJTIwbm9uLSU1Qk1BU0slNUQlMjB0b2tlbnMlMEFsYWJlbHMlMjAlM0QlMjB0b3JjaC53aGVyZShpbnB1dHMuaW5wdXRfaWRzJTIwJTNEJTNEJTIwdG9rZW5pemVyLm1hc2tfdG9rZW5faWQlMkMlMjBsYWJlbHMlMkMlMjAtMTAwKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FNetForMaskedLM
<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/fnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FNetForMaskedLM.from_pretrained(<span class="hljs-string">&quot;google/fnet-base&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># retrieve index of [MASK]</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_token_index = (inputs.input_ids == tokenizer.mask_token_id)[<span class="hljs-number">0</span>].nonzero(as_tuple=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_id = logits[<span class="hljs-number">0</span>, mask_token_index].argmax(axis=-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tokenizer(<span class="hljs-string">&quot;The capital of France is Paris.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># mask labels of non-[MASK] tokens</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.where(inputs.input_ids == tokenizer.mask_token_id, labels, -<span class="hljs-number">100</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)`}}),{c(){c=s("p"),y=i("Example:"),u=m(),w(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);y=l(d,"Example:"),d.forEach(o),u=f(n),T(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,y),b(n,u,d),v(p,n,d),_=!0},p:K,i(n){_||(k(p.$$.fragment,n),_=!0)},o(n){M(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),F(p,n)}}}function lm($){let c,y,u,p,_;return{c(){c=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){c=r(n,"P",{});var d=a(c);y=l(d,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(d,"CODE",{});var N=a(u);p=l(N,"Module"),N.forEach(o),_=l(d,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),d.forEach(o)},m(n,d){b(n,c,d),e(c,y),e(c,u),e(u,p),e(c,_)},d(n){n&&o(c)}}}function cm($){let c,y,u,p,_;return p=new ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGTmV0Rm9yTmV4dFNlbnRlbmNlUHJlZGljdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZm5ldC1iYXNlJTIyKSUwQW1vZGVsJTIwJTNEJTIwRk5ldEZvck5leHRTZW50ZW5jZVByZWRpY3Rpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmZuZXQtYmFzZSUyMiklMEFwcm9tcHQlMjAlM0QlMjAlMjJJbiUyMEl0YWx5JTJDJTIwcGl6emElMjBzZXJ2ZWQlMjBpbiUyMGZvcm1hbCUyMHNldHRpbmdzJTJDJTIwc3VjaCUyMGFzJTIwYXQlMjBhJTIwcmVzdGF1cmFudCUyQyUyMGlzJTIwcHJlc2VudGVkJTIwdW5zbGljZWQuJTIyJTBBbmV4dF9zZW50ZW5jZSUyMCUzRCUyMCUyMlRoZSUyMHNreSUyMGlzJTIwYmx1ZSUyMGR1ZSUyMHRvJTIwdGhlJTIwc2hvcnRlciUyMHdhdmVsZW5ndGglMjBvZiUyMGJsdWUlMjBsaWdodC4lMjIlMEFlbmNvZGluZyUyMCUzRCUyMHRva2VuaXplcihwcm9tcHQlMkMlMjBuZXh0X3NlbnRlbmNlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKiplbmNvZGluZyUyQyUyMGxhYmVscyUzRHRvcmNoLkxvbmdUZW5zb3IoJTVCMSU1RCkpJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHMlMEFhc3NlcnQlMjBsb2dpdHMlNUIwJTJDJTIwMCU1RCUyMCUzQyUyMGxvZ2l0cyU1QjAlMkMlMjAxJTVEJTIwJTIwJTIzJTIwbmV4dCUyMHNlbnRlbmNlJTIwd2FzJTIwcmFuZG9t",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FNetForNextSentencePrediction
<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/fnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FNetForNextSentencePrediction.from_pretrained(<span class="hljs-string">&quot;google/fnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>next_sentence = <span class="hljs-string">&quot;The sky is blue due to the shorter wavelength of blue light.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer(prompt, next_sentence, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoding, labels=torch.LongTensor([<span class="hljs-number">1</span>]))
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> logits[<span class="hljs-number">0</span>, <span class="hljs-number">0</span>] &lt; logits[<span class="hljs-number">0</span>, <span class="hljs-number">1</span>]  <span class="hljs-comment"># next sentence was random</span>`}}),{c(){c=s("p"),y=i("Example:"),u=m(),w(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);y=l(d,"Example:"),d.forEach(o),u=f(n),T(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,y),b(n,u,d),v(p,n,d),_=!0},p:K,i(n){_||(k(p.$$.fragment,n),_=!0)},o(n){M(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),F(p,n)}}}function dm($){let c,y,u,p,_;return{c(){c=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){c=r(n,"P",{});var d=a(c);y=l(d,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(d,"CODE",{});var N=a(u);p=l(N,"Module"),N.forEach(o),_=l(d,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),d.forEach(o)},m(n,d){b(n,c,d),e(c,y),e(c,u),e(u,p),e(c,_)},d(n){n&&o(c)}}}function pm($){let c,y,u,p,_;return p=new ee({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEZOZXRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZm5ldC1iYXNlJTIyKSUwQW1vZGVsJTIwJTNEJTIwRk5ldEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmZuZXQtYmFzZSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWQlMjAlM0QlMjBsb2dpdHMuYXJnbWF4KCkuaXRlbSgpJTBBJTBBJTIzJTIwVG8lMjB0cmFpbiUyMGElMjBtb2RlbCUyMG9uJTIwJTYwbnVtX2xhYmVscyU2MCUyMGNsYXNzZXMlMkMlMjB5b3UlMjBjYW4lMjBwYXNzJTIwJTYwbnVtX2xhYmVscyUzRG51bV9sYWJlbHMlNjAlMjB0byUyMCU2MC5mcm9tX3ByZXRyYWluZWQoLi4uKSU2MCUwQW51bV9sYWJlbHMlMjAlM0QlMjBsZW4obW9kZWwuY29uZmlnLmlkMmxhYmVsKSUwQW1vZGVsJTIwJTNEJTIwRk5ldEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmZuZXQtYmFzZSUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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, FNetForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/fnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FNetForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;google/fnet-base&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = logits.argmax().item()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FNetForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;google/fnet-base&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){c=s("p"),y=i("Example of single-label classification:"),u=m(),w(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);y=l(d,"Example of single-label classification:"),d.forEach(o),u=f(n),T(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,y),b(n,u,d),v(p,n,d),_=!0},p:K,i(n){_||(k(p.$$.fragment,n),_=!0)},o(n){M(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),F(p,n)}}}function hm($){let c,y,u,p,_;return p=new ee({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEZOZXRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZm5ldC1iYXNlJTIyKSUwQW1vZGVsJTIwJTNEJTIwRk5ldEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmZuZXQtYmFzZSUyMiUyQyUyMHByb2JsZW1fdHlwZSUzRCUyMm11bHRpX2xhYmVsX2NsYXNzaWZpY2F0aW9uJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQXByZWRpY3RlZF9jbGFzc19pZHMlMjAlM0QlMjB0b3JjaC5hcmFuZ2UoMCUyQyUyMGxvZ2l0cy5zaGFwZSU1Qi0xJTVEKSU1QnRvcmNoLnNpZ21vaWQobG9naXRzKS5zcXVlZXplKGRpbSUzRDApJTIwJTNFJTIwMC41JTVEJTBBJTBBJTIzJTIwVG8lMjB0cmFpbiUyMGElMjBtb2RlbCUyMG9uJTIwJTYwbnVtX2xhYmVscyU2MCUyMGNsYXNzZXMlMkMlMjB5b3UlMjBjYW4lMjBwYXNzJTIwJTYwbnVtX2xhYmVscyUzRG51bV9sYWJlbHMlNjAlMjB0byUyMCU2MC5mcm9tX3ByZXRyYWluZWQoLi4uKSU2MCUwQW51bV9sYWJlbHMlMjAlM0QlMjBsZW4obW9kZWwuY29uZmlnLmlkMmxhYmVsKSUwQW1vZGVsJTIwJTNEJTIwRk5ldEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmdvb2dsZSUyRmZuZXQtYmFzZSUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIlMEEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2guc3VtKCUwQSUyMCUyMCUyMCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwub25lX2hvdChwcmVkaWN0ZWRfY2xhc3NfaWRzJTVCTm9uZSUyQyUyMCUzQSU1RC5jbG9uZSgpJTJDJTIwbnVtX2NsYXNzZXMlM0RudW1fbGFiZWxzKSUyQyUyMGRpbSUzRDElMEEpLnRvKHRvcmNoLmZsb2F0KSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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, FNetForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/fnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FNetForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;google/fnet-base&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_ids = torch.arange(<span class="hljs-number">0</span>, logits.shape[-<span class="hljs-number">1</span>])[torch.sigmoid(logits).squeeze(dim=<span class="hljs-number">0</span>) &gt; <span class="hljs-number">0.5</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FNetForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;google/fnet-base&quot;</span>, num_labels=num_labels, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.<span class="hljs-built_in">sum</span>(
<span class="hljs-meta">... </span>    torch.nn.functional.one_hot(predicted_class_ids[<span class="hljs-literal">None</span>, :].clone(), num_classes=num_labels), dim=<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>).to(torch.<span class="hljs-built_in">float</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){c=s("p"),y=i("Example of multi-label classification:"),u=m(),w(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);y=l(d,"Example of multi-label classification:"),d.forEach(o),u=f(n),T(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,y),b(n,u,d),v(p,n,d),_=!0},p:K,i(n){_||(k(p.$$.fragment,n),_=!0)},o(n){M(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),F(p,n)}}}function mm($){let c,y,u,p,_;return{c(){c=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){c=r(n,"P",{});var d=a(c);y=l(d,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(d,"CODE",{});var N=a(u);p=l(N,"Module"),N.forEach(o),_=l(d,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),d.forEach(o)},m(n,d){b(n,c,d),e(c,y),e(c,u),e(u,p),e(c,_)},d(n){n&&o(c)}}}function fm($){let c,y,u,p,_;return p=new ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGTmV0Rm9yTXVsdGlwbGVDaG9pY2UlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmZuZXQtYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyMEZOZXRGb3JNdWx0aXBsZUNob2ljZS5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZm5ldC1iYXNlJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMkluJTIwSXRhbHklMkMlMjBwaXp6YSUyMHNlcnZlZCUyMGluJTIwZm9ybWFsJTIwc2V0dGluZ3MlMkMlMjBzdWNoJTIwYXMlMjBhdCUyMGElMjByZXN0YXVyYW50JTJDJTIwaXMlMjBwcmVzZW50ZWQlMjB1bnNsaWNlZC4lMjIlMEFjaG9pY2UwJTIwJTNEJTIwJTIySXQlMjBpcyUyMGVhdGVuJTIwd2l0aCUyMGElMjBmb3JrJTIwYW5kJTIwYSUyMGtuaWZlLiUyMiUwQWNob2ljZTElMjAlM0QlMjAlMjJJdCUyMGlzJTIwZWF0ZW4lMjB3aGlsZSUyMGhlbGQlMjBpbiUyMHRoZSUyMGhhbmQuJTIyJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2gudGVuc29yKDApLnVuc3F1ZWV6ZSgwKSUyMCUyMCUyMyUyMGNob2ljZTAlMjBpcyUyMGNvcnJlY3QlMjAoYWNjb3JkaW5nJTIwdG8lMjBXaWtpcGVkaWElMjAlM0IpKSUyQyUyMGJhdGNoJTIwc2l6ZSUyMDElMEElMEFlbmNvZGluZyUyMCUzRCUyMHRva2VuaXplciglNUJwcm9tcHQlMkMlMjBwcm9tcHQlNUQlMkMlMjAlNUJjaG9pY2UwJTJDJTIwY2hvaWNlMSU1RCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMkMlMjBwYWRkaW5nJTNEVHJ1ZSklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKiolN0JrJTNBJTIwdi51bnNxdWVlemUoMCklMjBmb3IlMjBrJTJDJTIwdiUyMGluJTIwZW5jb2RpbmcuaXRlbXMoKSU3RCUyQyUyMGxhYmVscyUzRGxhYmVscyklMjAlMjAlMjMlMjBiYXRjaCUyMHNpemUlMjBpcyUyMDElMEElMEElMjMlMjB0aGUlMjBsaW5lYXIlMjBjbGFzc2lmaWVyJTIwc3RpbGwlMjBuZWVkcyUyMHRvJTIwYmUlMjB0cmFpbmVkJTBBbG9zcyUyMCUzRCUyMG91dHB1dHMubG9zcyUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FNetForMultipleChoice
<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/fnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FNetForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;google/fnet-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice0 = <span class="hljs-string">&quot;It is eaten with a fork and a knife.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice1 = <span class="hljs-string">&quot;It is eaten while held in the hand.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor(<span class="hljs-number">0</span>).unsqueeze(<span class="hljs-number">0</span>)  <span class="hljs-comment"># choice0 is correct (according to Wikipedia ;)), batch size 1</span>

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the linear classifier still needs to be trained</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){c=s("p"),y=i("Example:"),u=m(),w(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);y=l(d,"Example:"),d.forEach(o),u=f(n),T(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,y),b(n,u,d),v(p,n,d),_=!0},p:K,i(n){_||(k(p.$$.fragment,n),_=!0)},o(n){M(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),F(p,n)}}}function um($){let c,y,u,p,_;return{c(){c=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){c=r(n,"P",{});var d=a(c);y=l(d,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(d,"CODE",{});var N=a(u);p=l(N,"Module"),N.forEach(o),_=l(d,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),d.forEach(o)},m(n,d){b(n,c,d),e(c,y),e(c,u),e(u,p),e(c,_)},d(n){n&&o(c)}}}function gm($){let c,y,u,p,_;return p=new ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGTmV0Rm9yVG9rZW5DbGFzc2lmaWNhdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZm5ldC1iYXNlJTIyKSUwQW1vZGVsJTIwJTNEJTIwRk5ldEZvclRva2VuQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmZuZXQtYmFzZSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTBBJTIwJTIwJTIwJTIwJTIySHVnZ2luZ0ZhY2UlMjBpcyUyMGElMjBjb21wYW55JTIwYmFzZWQlMjBpbiUyMFBhcmlzJTIwYW5kJTIwTmV3JTIwWW9yayUyMiUyQyUyMGFkZF9zcGVjaWFsX3Rva2VucyUzREZhbHNlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUwQSklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQXByZWRpY3RlZF90b2tlbl9jbGFzc19pZHMlMjAlM0QlMjBsb2dpdHMuYXJnbWF4KC0xKSUwQSUwQSUyMyUyME5vdGUlMjB0aGF0JTIwdG9rZW5zJTIwYXJlJTIwY2xhc3NpZmllZCUyMHJhdGhlciUyMHRoZW4lMjBpbnB1dCUyMHdvcmRzJTIwd2hpY2glMjBtZWFucyUyMHRoYXQlMEElMjMlMjB0aGVyZSUyMG1pZ2h0JTIwYmUlMjBtb3JlJTIwcHJlZGljdGVkJTIwdG9rZW4lMjBjbGFzc2VzJTIwdGhhbiUyMHdvcmRzLiUwQSUyMyUyME11bHRpcGxlJTIwdG9rZW4lMjBjbGFzc2VzJTIwbWlnaHQlMjBhY2NvdW50JTIwZm9yJTIwdGhlJTIwc2FtZSUyMHdvcmQlMEFwcmVkaWN0ZWRfdG9rZW5zX2NsYXNzZXMlMjAlM0QlMjAlNUJtb2RlbC5jb25maWcuaWQybGFiZWwlNUJ0Lml0ZW0oKSU1RCUyMGZvciUyMHQlMjBpbiUyMHByZWRpY3RlZF90b2tlbl9jbGFzc19pZHMlNUIwJTVEJTVEJTBBJTBBbGFiZWxzJTIwJTNEJTIwcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FNetForTokenClassification
<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/fnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FNetForTokenClassification.from_pretrained(<span class="hljs-string">&quot;google/fnet-base&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_class_ids = logits.argmax(-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Note that tokens are classified rather then input words which means that</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># there might be more predicted token classes than words.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Multiple token classes might account for the same word</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_tokens_classes = [model.config.id2label[t.item()] <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> predicted_token_class_ids[<span class="hljs-number">0</span>]]

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){c=s("p"),y=i("Example:"),u=m(),w(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);y=l(d,"Example:"),d.forEach(o),u=f(n),T(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,y),b(n,u,d),v(p,n,d),_=!0},p:K,i(n){_||(k(p.$$.fragment,n),_=!0)},o(n){M(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),F(p,n)}}}function _m($){let c,y,u,p,_;return{c(){c=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){c=r(n,"P",{});var d=a(c);y=l(d,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(d,"CODE",{});var N=a(u);p=l(N,"Module"),N.forEach(o),_=l(d,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),d.forEach(o)},m(n,d){b(n,c,d),e(c,y),e(c,u),e(u,p),e(c,_)},d(n){n&&o(c)}}}function bm($){let c,y,u,p,_;return p=new ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGTmV0Rm9yUXVlc3Rpb25BbnN3ZXJpbmclMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmZuZXQtYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyMEZOZXRGb3JRdWVzdGlvbkFuc3dlcmluZy5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZm5ldC1iYXNlJTIyKSUwQSUwQXF1ZXN0aW9uJTJDJTIwdGV4dCUyMCUzRCUyMCUyMldobyUyMHdhcyUyMEppbSUyMEhlbnNvbiUzRiUyMiUyQyUyMCUyMkppbSUyMEhlbnNvbiUyMHdhcyUyMGElMjBuaWNlJTIwcHVwcGV0JTIyJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHF1ZXN0aW9uJTJDJTIwdGV4dCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFhbnN3ZXJfc3RhcnRfaW5kZXglMjAlM0QlMjBvdXRwdXRzLnN0YXJ0X2xvZ2l0cy5hcmdtYXgoKSUwQWFuc3dlcl9lbmRfaW5kZXglMjAlM0QlMjBvdXRwdXRzLmVuZF9sb2dpdHMuYXJnbWF4KCklMEElMEFwcmVkaWN0X2Fuc3dlcl90b2tlbnMlMjAlM0QlMjBpbnB1dHMuaW5wdXRfaWRzJTVCMCUyQyUyMGFuc3dlcl9zdGFydF9pbmRleCUyMCUzQSUyMGFuc3dlcl9lbmRfaW5kZXglMjAlMkIlMjAxJTVEJTBBJTBBJTIzJTIwdGFyZ2V0JTIwaXMlMjAlMjJuaWNlJTIwcHVwcGV0JTIyJTBBdGFyZ2V0X3N0YXJ0X2luZGV4JTIwJTNEJTIwdG9yY2gudGVuc29yKCU1QjE0JTVEKSUwQXRhcmdldF9lbmRfaW5kZXglMjAlM0QlMjB0b3JjaC50ZW5zb3IoJTVCMTUlNUQpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzJTJDJTIwc3RhcnRfcG9zaXRpb25zJTNEdGFyZ2V0X3N0YXJ0X2luZGV4JTJDJTIwZW5kX3Bvc2l0aW9ucyUzRHRhcmdldF9lbmRfaW5kZXgpJTBBbG9zcyUyMCUzRCUyMG91dHB1dHMubG9zcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FNetForQuestionAnswering
<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/fnet-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FNetForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;google/fnet-base&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(question, text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>answer_start_index = outputs.start_logits.argmax()
<span class="hljs-meta">&gt;&gt;&gt; </span>answer_end_index = outputs.end_logits.argmax()

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># target is &quot;nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_start_index = torch.tensor([<span class="hljs-number">14</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = torch.tensor([<span class="hljs-number">15</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss`}}),{c(){c=s("p"),y=i("Example:"),u=m(),w(p.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);y=l(d,"Example:"),d.forEach(o),u=f(n),T(p.$$.fragment,n)},m(n,d){b(n,c,d),e(c,y),b(n,u,d),v(p,n,d),_=!0},p:K,i(n){_||(k(p.$$.fragment,n),_=!0)},o(n){M(p.$$.fragment,n),_=!1},d(n){n&&o(c),n&&o(u),F(p,n)}}}function ym($){let c,y,u,p,_,n,d,N,ga,_r,de,We,Qn,Wt,_a,Ln,ba,br,Be,ya,Bt,wa,Ta,yr,Ko,Dn,va,wr,en,ka,Tr,tn,Hn,Ma,vr,se,Fa,At,$a,Na,Rt,Ja,ja,kr,pe,Ae,Yn,Pt,Ua,On,za,Mr,U,Kn,on,Ea,Ia,es,nn,xa,Ca,ts,sn,Za,qa,os,rn,Sa,Wa,ns,an,Ba,Fr,he,Re,ss,Gt,Aa,rs,Ra,$r,I,Xt,Pa,me,Ga,ln,Xa,Va,Vt,Qa,La,Da,fe,Ha,cn,Ya,Oa,dn,Ka,ei,ti,Pe,Nr,ue,Ge,as,Qt,oi,is,ni,Jr,j,Lt,si,te,ri,pn,ai,ii,Dt,li,ci,hn,di,pi,hi,re,Ht,mi,ls,fi,ui,Yt,mn,gi,cs,_i,bi,fn,yi,ds,wi,Ti,Xe,Ot,vi,Kt,ki,ps,Mi,Fi,$i,R,eo,Ni,hs,Ji,ji,Ve,Ui,ge,zi,ms,Ei,Ii,fs,xi,Ci,Zi,un,to,jr,_e,Qe,us,oo,qi,gs,Si,Ur,x,no,Wi,C,Bi,_s,Ai,Ri,gn,Pi,Gi,so,Xi,Vi,_n,Qi,Li,Di,ae,ro,Hi,bs,Yi,Oi,ao,bn,Ki,ys,el,tl,yn,ol,ws,nl,sl,P,io,rl,Ts,al,il,Le,ll,vs,cl,zr,be,De,ks,lo,dl,Ms,pl,Er,Z,co,hl,po,ml,ho,fl,ul,gl,mo,_l,fo,bl,yl,wl,G,uo,Tl,ye,vl,wn,kl,Ml,Fs,Fl,$l,Nl,He,Jl,Ye,Ir,we,Oe,$s,go,jl,Ns,Ul,xr,q,_o,zl,Te,El,Js,Il,xl,js,Cl,Zl,ql,bo,Sl,yo,Wl,Bl,Al,X,wo,Rl,ve,Pl,Tn,Gl,Xl,Us,Vl,Ql,Ll,Ke,Dl,et,Cr,ke,tt,zs,To,Hl,Es,Yl,Zr,oe,vo,Ol,Me,Kl,Is,ec,tc,ko,oc,nc,sc,V,Mo,rc,Fe,ac,vn,ic,lc,xs,cc,dc,pc,ot,hc,nt,qr,$e,st,Cs,Fo,mc,Zs,fc,Sr,ne,$o,uc,Ne,gc,qs,_c,bc,No,yc,wc,Tc,Q,Jo,vc,Je,kc,kn,Mc,Fc,Ss,$c,Nc,Jc,rt,jc,at,Wr,je,it,Ws,jo,Uc,Bs,zc,Br,S,Uo,Ec,As,Ic,xc,zo,Cc,Eo,Zc,qc,Sc,z,Io,Wc,Ue,Bc,Mn,Ac,Rc,Rs,Pc,Gc,Xc,lt,Vc,ct,Qc,dt,Ar,ze,pt,Ps,xo,Lc,Gs,Dc,Rr,W,Co,Hc,Xs,Yc,Oc,Zo,Kc,qo,ed,td,od,L,So,nd,Ee,sd,Fn,rd,ad,Vs,id,ld,cd,ht,dd,mt,Pr,Ie,ft,Qs,Wo,pd,Ls,hd,Gr,B,Bo,md,Ds,fd,ud,Ao,gd,Ro,_d,bd,yd,D,Po,wd,xe,Td,$n,vd,kd,Hs,Md,Fd,$d,ut,Nd,gt,Xr,Ce,_t,Ys,Go,Jd,Os,jd,Vr,A,Xo,Ud,Ze,zd,Ks,Ed,Id,er,xd,Cd,Zd,Vo,qd,Qo,Sd,Wd,Bd,H,Lo,Ad,qe,Rd,Nn,Pd,Gd,tr,Xd,Vd,Qd,bt,Ld,yt,Qr;return n=new E({}),Wt=new E({}),Pt=new E({}),Gt=new E({}),Xt=new J({props:{name:"class transformers.FNetConfig",anchor:"transformers.FNetConfig",parameters:[{name:"vocab_size",val:" = 32000"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu_new'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 4"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"use_tpu_fourier_optimizations",val:" = False"},{name:"tpu_short_seq_length",val:" = 512"},{name:"pad_token_id",val:" = 3"},{name:"bos_token_id",val:" = 1"},{name:"eos_token_id",val:" = 2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FNetConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32000) &#x2014;
Vocabulary size of the FNet model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetModel">FNetModel</a> or <code>TFFNetModel</code>.`,name:"vocab_size"},{anchor:"transformers.FNetConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimension of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.FNetConfig.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.FNetConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimension of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.FNetConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu_new&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;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.FNetConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probabilitiy for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.FNetConfig.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.FNetConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetModel">FNetModel</a> or <code>TFFNetModel</code>.`,name:"type_vocab_size"},{anchor:"transformers.FNetConfig.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.FNetConfig.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.FNetConfig.use_tpu_fourier_optimizations",description:`<strong>use_tpu_fourier_optimizations</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Determines whether to use TPU optimized FFTs. If <code>True</code>, the model will favor axis-wise FFTs transforms.
Set to <code>False</code> for GPU/CPU hardware, in which case n-dimensional FFTs are used.`,name:"use_tpu_fourier_optimizations"},{anchor:"transformers.FNetConfig.tpu_short_seq_length",description:`<strong>tpu_short_seq_length</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The sequence length that is expected by the model when using TPUs. This will be used to initialize the DFT
matrix only when <em>use_tpu_fourier_optimizations</em> is set to <code>True</code> and the input sequence is shorter than or
equal to 4096 tokens.`,name:"tpu_short_seq_length"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/configuration_fnet.py#L30"}}),Pe=new O({props:{anchor:"transformers.FNetConfig.example",$$slots:{default:[Kh]},$$scope:{ctx:$}}}),Qt=new E({}),Lt=new J({props:{name:"class transformers.FNetTokenizer",anchor:"transformers.FNetTokenizer",parameters:[{name:"vocab_file",val:""},{name:"do_lower_case",val:" = False"},{name:"remove_space",val:" = True"},{name:"keep_accents",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:"sp_model_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FNetTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a <em>.spm</em> extension) that
contains the vocabulary necessary to instantiate a tokenizer.`,name:"vocab_file"},{anchor:"transformers.FNetTokenizer.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.FNetTokenizer.remove_space",description:`<strong>remove_space</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to strip the text when tokenizing (removing excess spaces before and after the string).`,name:"remove_space"},{anchor:"transformers.FNetTokenizer.keep_accents",description:`<strong>keep_accents</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to keep accents when tokenizing.`,name:"keep_accents"},{anchor:"transformers.FNetTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&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.FNetTokenizer.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.FNetTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.FNetTokenizer.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.FNetTokenizer.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.FNetTokenizer.sp_model_kwargs",description:`<strong>sp_model_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Will be passed to the <code>SentencePieceProcessor.__init__()</code> method. The <a href="https://github.com/google/sentencepiece/tree/master/python" rel="nofollow">Python wrapper for
SentencePiece</a> can be used, among other things,
to set:</p>
<ul>
<li>
<p><code>enable_sampling</code>: Enable subword regularization.</p>
</li>
<li>
<p><code>nbest_size</code>: Sampling parameters for unigram. Invalid for BPE-Dropout.</p>
<ul>
<li><code>nbest_size = {0,1}</code>: No sampling is performed.</li>
<li><code>nbest_size &gt; 1</code>: samples from the nbest_size results.</li>
<li><code>nbest_size &lt; 0</code>: assuming that nbest_size is infinite and samples from the all hypothesis (lattice)
using forward-filtering-and-backward-sampling algorithm.</li>
</ul>
</li>
<li>
<p><code>alpha</code>: Smoothing parameter for unigram sampling, and dropout probability of merge operations for
BPE-dropout.</p>
</li>
</ul>`,name:"sp_model_kwargs"},{anchor:"transformers.FNetTokenizer.sp_model",description:`<strong>sp_model</strong> (<code>SentencePieceProcessor</code>) &#x2014;
The <em>SentencePiece</em> processor that is used for every conversion (string, tokens and IDs).`,name:"sp_model"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/tokenization_fnet.py#L47"}}),Ht=new J({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.FNetTokenizer.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.FNetTokenizer.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.FNetTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/tokenization_fnet.py#L283",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>
`}}),Ot=new J({props:{name:"get_special_tokens_mask",anchor:"transformers.FNetTokenizer.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.FNetTokenizer.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.FNetTokenizer.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.FNetTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/tokenization_fnet.py#L308",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>
`}}),eo=new J({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.FNetTokenizer.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.FNetTokenizer.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.FNetTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/tokenization_fnet.py#L336",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>
`}}),Ve=new O({props:{anchor:"transformers.FNetTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[em]},$$scope:{ctx:$}}}),to=new J({props:{name:"save_vocabulary",anchor:"transformers.FNetTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/tokenization_fnet.py#L365"}}),oo=new E({}),no=new J({props:{name:"class transformers.FNetTokenizerFast",anchor:"transformers.FNetTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"do_lower_case",val:" = False"},{name:"remove_space",val:" = True"},{name:"keep_accents",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:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FNetTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a <em>.spm</em> extension) that
contains the vocabulary necessary to instantiate a tokenizer.`,name:"vocab_file"},{anchor:"transformers.FNetTokenizerFast.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.FNetTokenizerFast.remove_space",description:`<strong>remove_space</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to strip the text when tokenizing (removing excess spaces before and after the string).`,name:"remove_space"},{anchor:"transformers.FNetTokenizerFast.keep_accents",description:`<strong>keep_accents</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to keep accents when tokenizing.`,name:"keep_accents"},{anchor:"transformers.FNetTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&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.FNetTokenizerFast.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.FNetTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.FNetTokenizerFast.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.FNetTokenizerFast.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"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/tokenization_fnet_fast.py#L54"}}),ro=new J({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.FNetTokenizerFast.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.FNetTokenizerFast.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.FNetTokenizerFast.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/tokenization_fnet_fast.py#L137",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>
`}}),io=new J({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.FNetTokenizerFast.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.FNetTokenizerFast.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.FNetTokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/tokenization_fnet_fast.py#L162",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>
`}}),Le=new O({props:{anchor:"transformers.FNetTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[tm]},$$scope:{ctx:$}}}),lo=new E({}),co=new J({props:{name:"class transformers.FNetModel",anchor:"transformers.FNetModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.FNetModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetConfig">FNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/modeling_fnet.py#L514"}}),uo=new J({props:{name:"forward",anchor:"transformers.FNetModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FNetModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FNetModel.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.FNetModel.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.FNetModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.FNetModel.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.FNetModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/modeling_fnet.py#L540",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetConfig"
>FNetConfig</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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),He=new St({props:{$$slots:{default:[om]},$$scope:{ctx:$}}}),Ye=new O({props:{anchor:"transformers.FNetModel.forward.example",$$slots:{default:[nm]},$$scope:{ctx:$}}}),go=new E({}),_o=new J({props:{name:"class transformers.FNetForPreTraining",anchor:"transformers.FNetForPreTraining",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.FNetForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetConfig">FNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/modeling_fnet.py#L623"}}),wo=new J({props:{name:"forward",anchor:"transformers.FNetForPreTraining.forward",parameters:[{name:"input_ids",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:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"next_sentence_label",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FNetForPreTraining.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FNetForPreTraining.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.FNetForPreTraining.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.FNetForPreTraining.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.FNetForPreTraining.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.FNetForPreTraining.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.FNetForPreTraining.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"},{anchor:"transformers.FNetForPreTraining.forward.next_sentence_label",description:`<strong>next_sentence_label</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the next sequence prediction (classification) loss. Input should be a sequence pair
(see <code>input_ids</code> docstring) Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates sequence B is a continuation of sequence A,</li>
<li>1 indicates sequence B is a random sequence.</li>
</ul>`,name:"next_sentence_label"},{anchor:"transformers.FNetForPreTraining.forward.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, any]</code>, optional, defaults to <em>{}</em>) &#x2014;
Used to hide legacy arguments that have been deprecated.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/modeling_fnet.py#L641",returnDescription:`
<p>A <code>transformers.models.fnet.modeling_fnet.FNetForPreTrainingOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetConfig"
>FNetConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) \u2014 Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.</li>
<li><strong>prediction_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</li>
<li><strong>seq_relationship_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).</li>
<li><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>. Hidden-states of the model at the output of each layer
plus the initial embedding outputs.</li>
</ul>
`,returnType:`
<p><code>transformers.models.fnet.modeling_fnet.FNetForPreTrainingOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ke=new St({props:{$$slots:{default:[sm]},$$scope:{ctx:$}}}),et=new O({props:{anchor:"transformers.FNetForPreTraining.forward.example",$$slots:{default:[rm]},$$scope:{ctx:$}}}),To=new E({}),vo=new J({props:{name:"class transformers.FNetForMaskedLM",anchor:"transformers.FNetForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.FNetForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetConfig">FNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/modeling_fnet.py#L717"}}),Mo=new J({props:{name:"forward",anchor:"transformers.FNetForMaskedLM.forward",parameters:[{name:"input_ids",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:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FNetForMaskedLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FNetForMaskedLM.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.FNetForMaskedLM.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.FNetForMaskedLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.FNetForMaskedLM.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.FNetForMaskedLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.FNetForMaskedLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/modeling_fnet.py#L735",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetConfig"
>FNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ot=new St({props:{$$slots:{default:[am]},$$scope:{ctx:$}}}),nt=new O({props:{anchor:"transformers.FNetForMaskedLM.forward.example",$$slots:{default:[im]},$$scope:{ctx:$}}}),Fo=new E({}),$o=new J({props:{name:"class transformers.FNetForNextSentencePrediction",anchor:"transformers.FNetForNextSentencePrediction",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.FNetForNextSentencePrediction.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetConfig">FNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/modeling_fnet.py#L787"}}),Jo=new J({props:{name:"forward",anchor:"transformers.FNetForNextSentencePrediction.forward",parameters:[{name:"input_ids",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:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FNetForNextSentencePrediction.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FNetForNextSentencePrediction.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.FNetForNextSentencePrediction.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.FNetForNextSentencePrediction.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.FNetForNextSentencePrediction.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.FNetForNextSentencePrediction.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.FNetForNextSentencePrediction.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the next sequence prediction (classification) loss. Input should be a sequence pair
(see <code>input_ids</code> docstring). Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates sequence B is a continuation of sequence A,</li>
<li>1 indicates sequence B is a random sequence.</li>
</ul>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/modeling_fnet.py#L797",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.NextSentencePredictorOutput"
>transformers.modeling_outputs.NextSentencePredictorOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetConfig"
>FNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>next_sentence_label</code> is provided) \u2014 Next sequence prediction (classification) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.NextSentencePredictorOutput"
>transformers.modeling_outputs.NextSentencePredictorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),rt=new St({props:{$$slots:{default:[lm]},$$scope:{ctx:$}}}),at=new O({props:{anchor:"transformers.FNetForNextSentencePrediction.forward.example",$$slots:{default:[cm]},$$scope:{ctx:$}}}),jo=new E({}),Uo=new J({props:{name:"class transformers.FNetForSequenceClassification",anchor:"transformers.FNetForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.FNetForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetConfig">FNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/modeling_fnet.py#L882"}}),Io=new J({props:{name:"forward",anchor:"transformers.FNetForSequenceClassification.forward",parameters:[{name:"input_ids",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:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FNetForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FNetForSequenceClassification.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.FNetForSequenceClassification.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.FNetForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.FNetForSequenceClassification.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.FNetForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.FNetForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/modeling_fnet.py#L894",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetConfig"
>FNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),lt=new St({props:{$$slots:{default:[dm]},$$scope:{ctx:$}}}),ct=new O({props:{anchor:"transformers.FNetForSequenceClassification.forward.example",$$slots:{default:[pm]},$$scope:{ctx:$}}}),dt=new O({props:{anchor:"transformers.FNetForSequenceClassification.forward.example-2",$$slots:{default:[hm]},$$scope:{ctx:$}}}),xo=new E({}),Co=new J({props:{name:"class transformers.FNetForMultipleChoice",anchor:"transformers.FNetForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.FNetForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetConfig">FNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/modeling_fnet.py#L967"}}),So=new J({props:{name:"forward",anchor:"transformers.FNetForMultipleChoice.forward",parameters:[{name:"input_ids",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:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FNetForMultipleChoice.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FNetForMultipleChoice.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.FNetForMultipleChoice.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.FNetForMultipleChoice.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.FNetForMultipleChoice.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.FNetForMultipleChoice.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.FNetForMultipleChoice.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the multiple choice classification loss. Indices should be in <code>[0, ..., num_choices-1]</code> where <code>num_choices</code> is the size of the second dimension of the input tensors. (See
<code>input_ids</code> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/modeling_fnet.py#L978",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetConfig"
>FNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <em>(1,)</em>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices)</code>) \u2014 <em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ht=new St({props:{$$slots:{default:[mm]},$$scope:{ctx:$}}}),mt=new O({props:{anchor:"transformers.FNetForMultipleChoice.forward.example",$$slots:{default:[fm]},$$scope:{ctx:$}}}),Wo=new E({}),Bo=new J({props:{name:"class transformers.FNetForTokenClassification",anchor:"transformers.FNetForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.FNetForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetConfig">FNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/modeling_fnet.py#L1046"}}),Po=new J({props:{name:"forward",anchor:"transformers.FNetForTokenClassification.forward",parameters:[{name:"input_ids",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:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FNetForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FNetForTokenClassification.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.FNetForTokenClassification.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.FNetForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.FNetForTokenClassification.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.FNetForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.FNetForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/modeling_fnet.py#L1059",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetConfig"
>FNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ut=new St({props:{$$slots:{default:[um]},$$scope:{ctx:$}}}),gt=new O({props:{anchor:"transformers.FNetForTokenClassification.forward.example",$$slots:{default:[gm]},$$scope:{ctx:$}}}),Go=new E({}),Xo=new J({props:{name:"class transformers.FNetForQuestionAnswering",anchor:"transformers.FNetForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.FNetForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetConfig">FNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/modeling_fnet.py#L1115"}}),Lo=new J({props:{name:"forward",anchor:"transformers.FNetForQuestionAnswering.forward",parameters:[{name:"input_ids",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:"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_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FNetForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FNetForQuestionAnswering.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.FNetForQuestionAnswering.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.FNetForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.FNetForQuestionAnswering.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.FNetForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.FNetForQuestionAnswering.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.FNetForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fnet/modeling_fnet.py#L1127",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetConfig"
>FNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),bt=new St({props:{$$slots:{default:[_m]},$$scope:{ctx:$}}}),yt=new O({props:{anchor:"transformers.FNetForQuestionAnswering.forward.example",$$slots:{default:[bm]},$$scope:{ctx:$}}}),{c(){c=s("meta"),y=m(),u=s("h1"),p=s("a"),_=s("span"),w(n.$$.fragment),d=m(),N=s("span"),ga=i("FNet"),_r=m(),de=s("h2"),We=s("a"),Qn=s("span"),w(Wt.$$.fragment),_a=m(),Ln=s("span"),ba=i("Overview"),br=m(),Be=s("p"),ya=i("The FNet model was proposed in "),Bt=s("a"),wa=i("FNet: Mixing Tokens with Fourier Transforms"),Ta=i(` by
James Lee-Thorp, Joshua Ainslie, Ilya Eckstein, Santiago Ontanon. The model replaces the self-attention layer in a BERT
model with a fourier transform which returns only the real parts of the transform. The model is significantly faster
than the BERT model because it has fewer parameters and is more memory efficient. The model achieves about 92-97%
accuracy of BERT counterparts on GLUE benchmark, and trains much faster than the BERT model. The abstract from the
paper is the following:`),yr=m(),Ko=s("p"),Dn=s("em"),va=i(`We show that Transformer encoder architectures can be sped up, with limited accuracy costs, by replacing the
self-attention sublayers with simple linear transformations that \u201Cmix\u201D input tokens. These linear mixers, along with
standard nonlinearities in feed-forward layers, prove competent at modeling semantic relationships in several text
classification tasks. Most surprisingly, we find that replacing the self-attention sublayer in a Transformer encoder
with a standard, unparameterized Fourier Transform achieves 92-97% of the accuracy of BERT counterparts on the GLUE
benchmark, but trains 80% faster on GPUs and 70% faster on TPUs at standard 512 input lengths. At longer input lengths,
our FNet model is significantly faster: when compared to the \u201Cefficient\u201D Transformers on the Long Range Arena
benchmark, FNet matches the accuracy of the most accurate models, while outpacing the fastest models across all
sequence lengths on GPUs (and across relatively shorter lengths on TPUs). Finally, FNet has a light memory footprint
and is particularly efficient at smaller model sizes; for a fixed speed and accuracy budget, small FNet models
outperform Transformer counterparts.`),wr=m(),en=s("p"),ka=i("Tips on usage:"),Tr=m(),tn=s("ul"),Hn=s("li"),Ma=i(`The model was trained without an attention mask as it is based on Fourier Transform. The model was trained with
maximum sequence length 512 which includes pad tokens. Hence, it is highly recommended to use the same maximum
sequence length for fine-tuning and inference.`),vr=m(),se=s("p"),Fa=i("This model was contributed by "),At=s("a"),$a=i("gchhablani"),Na=i(". The original code can be found "),Rt=s("a"),Ja=i("here"),ja=i("."),kr=m(),pe=s("h2"),Ae=s("a"),Yn=s("span"),w(Pt.$$.fragment),Ua=m(),On=s("span"),za=i("Documentation resources"),Mr=m(),U=s("ul"),Kn=s("li"),on=s("a"),Ea=i("Text classification task guide"),Ia=m(),es=s("li"),nn=s("a"),xa=i("Token classification task guide"),Ca=m(),ts=s("li"),sn=s("a"),Za=i("Question answering task guide"),qa=m(),os=s("li"),rn=s("a"),Sa=i("Masked language modeling task guide"),Wa=m(),ns=s("li"),an=s("a"),Ba=i("Multiple choice task guide"),Fr=m(),he=s("h2"),Re=s("a"),ss=s("span"),w(Gt.$$.fragment),Aa=m(),rs=s("span"),Ra=i("FNetConfig"),$r=m(),I=s("div"),w(Xt.$$.fragment),Pa=m(),me=s("p"),Ga=i("This is the configuration class to store the configuration of a "),ln=s("a"),Xa=i("FNetModel"),Va=i(`. It is used to instantiate an FNet
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 FNet
`),Vt=s("a"),Qa=i("google/fnet-base"),La=i(" architecture."),Da=m(),fe=s("p"),Ha=i("Configuration objects inherit from "),cn=s("a"),Ya=i("PretrainedConfig"),Oa=i(` and can be used to control the model outputs. Read the
documentation from `),dn=s("a"),Ka=i("PretrainedConfig"),ei=i(" for more information."),ti=m(),w(Pe.$$.fragment),Nr=m(),ue=s("h2"),Ge=s("a"),as=s("span"),w(Qt.$$.fragment),oi=m(),is=s("span"),ni=i("FNetTokenizer"),Jr=m(),j=s("div"),w(Lt.$$.fragment),si=m(),te=s("p"),ri=i("Construct an FNet tokenizer. Adapted from "),pn=s("a"),ai=i("AlbertTokenizer"),ii=i(`. Based on
`),Dt=s("a"),li=i("SentencePiece"),ci=i(". This tokenizer inherits from "),hn=s("a"),di=i("PreTrainedTokenizer"),pi=i(`
which contains most of the main methods. Users should refer to this superclass for more information regarding those
methods.`),hi=m(),re=s("div"),w(Ht.$$.fragment),mi=m(),ls=s("p"),fi=i(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An FNet sequence has the following format:`),ui=m(),Yt=s("ul"),mn=s("li"),gi=i("single sequence: "),cs=s("code"),_i=i("[CLS] X [SEP]"),bi=m(),fn=s("li"),yi=i("pair of sequences: "),ds=s("code"),wi=i("[CLS] A [SEP] B [SEP]"),Ti=m(),Xe=s("div"),w(Ot.$$.fragment),vi=m(),Kt=s("p"),ki=i(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),ps=s("code"),Mi=i("prepare_for_model"),Fi=i(" method."),$i=m(),R=s("div"),w(eo.$$.fragment),Ni=m(),hs=s("p"),Ji=i("Create a mask from the two sequences passed to be used in a sequence-pair classification task. An FNet sequence"),ji=m(),w(Ve.$$.fragment),Ui=m(),ge=s("p"),zi=i("If "),ms=s("code"),Ei=i("token_ids_1"),Ii=i(" is "),fs=s("code"),xi=i("None"),Ci=i(", this method only returns the first portion of the mask (0s)."),Zi=m(),un=s("div"),w(to.$$.fragment),jr=m(),_e=s("h2"),Qe=s("a"),us=s("span"),w(oo.$$.fragment),qi=m(),gs=s("span"),Si=i("FNetTokenizerFast"),Ur=m(),x=s("div"),w(no.$$.fragment),Wi=m(),C=s("p"),Bi=i("Construct a \u201Cfast\u201D FNetTokenizer (backed by HuggingFace\u2019s "),_s=s("em"),Ai=i("tokenizers"),Ri=i(` library). Adapted from
`),gn=s("a"),Pi=i("AlbertTokenizerFast"),Gi=i(`. Based on
`),so=s("a"),Xi=i("Unigram"),Vi=i(`. This
tokenizer inherits from `),_n=s("a"),Qi=i("PreTrainedTokenizerFast"),Li=i(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods`),Di=m(),ae=s("div"),w(ro.$$.fragment),Hi=m(),bs=s("p"),Yi=i(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An FNet sequence has the following format:`),Oi=m(),ao=s("ul"),bn=s("li"),Ki=i("single sequence: "),ys=s("code"),el=i("[CLS] X [SEP]"),tl=m(),yn=s("li"),ol=i("pair of sequences: "),ws=s("code"),nl=i("[CLS] A [SEP] B [SEP]"),sl=m(),P=s("div"),w(io.$$.fragment),rl=m(),Ts=s("p"),al=i("Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An FNet"),il=m(),w(Le.$$.fragment),ll=m(),vs=s("p"),cl=i("if token_ids_1 is None, only returns the first portion of the mask (0s)."),zr=m(),be=s("h2"),De=s("a"),ks=s("span"),w(lo.$$.fragment),dl=m(),Ms=s("span"),pl=i("FNetModel"),Er=m(),Z=s("div"),w(co.$$.fragment),hl=m(),po=s("p"),ml=i(`The bare FNet Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ho=s("a"),fl=i("torch.nn.Module"),ul=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),gl=m(),mo=s("p"),_l=i("The model can behave as an encoder, following the architecture described in "),fo=s("a"),bl=i(`FNet: Mixing Tokens with Fourier
Transforms`),yl=i(" by James Lee-Thorp, Joshua Ainslie, Ilya Eckstein, Santiago Ontanon."),wl=m(),G=s("div"),w(uo.$$.fragment),Tl=m(),ye=s("p"),vl=i("The "),wn=s("a"),kl=i("FNetModel"),Ml=i(" forward method, overrides the "),Fs=s("code"),Fl=i("__call__"),$l=i(" special method."),Nl=m(),w(He.$$.fragment),Jl=m(),w(Ye.$$.fragment),Ir=m(),we=s("h2"),Oe=s("a"),$s=s("span"),w(go.$$.fragment),jl=m(),Ns=s("span"),Ul=i("FNetForPreTraining"),xr=m(),q=s("div"),w(_o.$$.fragment),zl=m(),Te=s("p"),El=i("FNet Model with two heads on top as done during the pretraining: a "),Js=s("code"),Il=i("masked language modeling"),xl=i(" head and a "),js=s("code"),Cl=i("next sentence prediction (classification)"),Zl=i(" head."),ql=m(),bo=s("p"),Sl=i("This model is a PyTorch "),yo=s("a"),Wl=i("torch.nn.Module"),Bl=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Al=m(),X=s("div"),w(wo.$$.fragment),Rl=m(),ve=s("p"),Pl=i("The "),Tn=s("a"),Gl=i("FNetForPreTraining"),Xl=i(" forward method, overrides the "),Us=s("code"),Vl=i("__call__"),Ql=i(" special method."),Ll=m(),w(Ke.$$.fragment),Dl=m(),w(et.$$.fragment),Cr=m(),ke=s("h2"),tt=s("a"),zs=s("span"),w(To.$$.fragment),Hl=m(),Es=s("span"),Yl=i("FNetForMaskedLM"),Zr=m(),oe=s("div"),w(vo.$$.fragment),Ol=m(),Me=s("p"),Kl=i("FNet Model with a "),Is=s("code"),ec=i("language modeling"),tc=i(` head on top.
This model is a PyTorch `),ko=s("a"),oc=i("torch.nn.Module"),nc=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),sc=m(),V=s("div"),w(Mo.$$.fragment),rc=m(),Fe=s("p"),ac=i("The "),vn=s("a"),ic=i("FNetForMaskedLM"),lc=i(" forward method, overrides the "),xs=s("code"),cc=i("__call__"),dc=i(" special method."),pc=m(),w(ot.$$.fragment),hc=m(),w(nt.$$.fragment),qr=m(),$e=s("h2"),st=s("a"),Cs=s("span"),w(Fo.$$.fragment),mc=m(),Zs=s("span"),fc=i("FNetForNextSentencePrediction"),Sr=m(),ne=s("div"),w($o.$$.fragment),uc=m(),Ne=s("p"),gc=i("FNet Model with a "),qs=s("code"),_c=i("next sentence prediction (classification)"),bc=i(` head on top.
This model is a PyTorch `),No=s("a"),yc=i("torch.nn.Module"),wc=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Tc=m(),Q=s("div"),w(Jo.$$.fragment),vc=m(),Je=s("p"),kc=i("The "),kn=s("a"),Mc=i("FNetForNextSentencePrediction"),Fc=i(" forward method, overrides the "),Ss=s("code"),$c=i("__call__"),Nc=i(" special method."),Jc=m(),w(rt.$$.fragment),jc=m(),w(at.$$.fragment),Wr=m(),je=s("h2"),it=s("a"),Ws=s("span"),w(jo.$$.fragment),Uc=m(),Bs=s("span"),zc=i("FNetForSequenceClassification"),Br=m(),S=s("div"),w(Uo.$$.fragment),Ec=m(),As=s("p"),Ic=i(`FNet Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),xc=m(),zo=s("p"),Cc=i("This model is a PyTorch "),Eo=s("a"),Zc=i("torch.nn.Module"),qc=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Sc=m(),z=s("div"),w(Io.$$.fragment),Wc=m(),Ue=s("p"),Bc=i("The "),Mn=s("a"),Ac=i("FNetForSequenceClassification"),Rc=i(" forward method, overrides the "),Rs=s("code"),Pc=i("__call__"),Gc=i(" special method."),Xc=m(),w(lt.$$.fragment),Vc=m(),w(ct.$$.fragment),Qc=m(),w(dt.$$.fragment),Ar=m(),ze=s("h2"),pt=s("a"),Ps=s("span"),w(xo.$$.fragment),Lc=m(),Gs=s("span"),Dc=i("FNetForMultipleChoice"),Rr=m(),W=s("div"),w(Co.$$.fragment),Hc=m(),Xs=s("p"),Yc=i(`FNet 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.`),Oc=m(),Zo=s("p"),Kc=i("This model is a PyTorch "),qo=s("a"),ed=i("torch.nn.Module"),td=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),od=m(),L=s("div"),w(So.$$.fragment),nd=m(),Ee=s("p"),sd=i("The "),Fn=s("a"),rd=i("FNetForMultipleChoice"),ad=i(" forward method, overrides the "),Vs=s("code"),id=i("__call__"),ld=i(" special method."),cd=m(),w(ht.$$.fragment),dd=m(),w(mt.$$.fragment),Pr=m(),Ie=s("h2"),ft=s("a"),Qs=s("span"),w(Wo.$$.fragment),pd=m(),Ls=s("span"),hd=i("FNetForTokenClassification"),Gr=m(),B=s("div"),w(Bo.$$.fragment),md=m(),Ds=s("p"),fd=i(`FNet Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),ud=m(),Ao=s("p"),gd=i("This model is a PyTorch "),Ro=s("a"),_d=i("torch.nn.Module"),bd=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),yd=m(),D=s("div"),w(Po.$$.fragment),wd=m(),xe=s("p"),Td=i("The "),$n=s("a"),vd=i("FNetForTokenClassification"),kd=i(" forward method, overrides the "),Hs=s("code"),Md=i("__call__"),Fd=i(" special method."),$d=m(),w(ut.$$.fragment),Nd=m(),w(gt.$$.fragment),Xr=m(),Ce=s("h2"),_t=s("a"),Ys=s("span"),w(Go.$$.fragment),Jd=m(),Os=s("span"),jd=i("FNetForQuestionAnswering"),Vr=m(),A=s("div"),w(Xo.$$.fragment),Ud=m(),Ze=s("p"),zd=i(`FNet 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 `),Ks=s("code"),Ed=i("span start logits"),Id=i(" and "),er=s("code"),xd=i("span end logits"),Cd=i(")."),Zd=m(),Vo=s("p"),qd=i("This model is a PyTorch "),Qo=s("a"),Sd=i("torch.nn.Module"),Wd=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Bd=m(),H=s("div"),w(Lo.$$.fragment),Ad=m(),qe=s("p"),Rd=i("The "),Nn=s("a"),Pd=i("FNetForQuestionAnswering"),Gd=i(" forward method, overrides the "),tr=s("code"),Xd=i("__call__"),Vd=i(" special method."),Qd=m(),w(bt.$$.fragment),Ld=m(),w(yt.$$.fragment),this.h()},l(t){const g=Yh('[data-svelte="svelte-1phssyn"]',document.head);c=r(g,"META",{name:!0,content:!0}),g.forEach(o),y=f(t),u=r(t,"H1",{class:!0});var Do=a(u);p=r(Do,"A",{id:!0,class:!0,href:!0});var or=a(p);_=r(or,"SPAN",{});var nr=a(_);T(n.$$.fragment,nr),nr.forEach(o),or.forEach(o),d=f(Do),N=r(Do,"SPAN",{});var sr=a(N);ga=l(sr,"FNet"),sr.forEach(o),Do.forEach(o),_r=f(t),de=r(t,"H2",{class:!0});var Ho=a(de);We=r(Ho,"A",{id:!0,class:!0,href:!0});var rr=a(We);Qn=r(rr,"SPAN",{});var ar=a(Qn);T(Wt.$$.fragment,ar),ar.forEach(o),rr.forEach(o),_a=f(Ho),Ln=r(Ho,"SPAN",{});var ir=a(Ln);ba=l(ir,"Overview"),ir.forEach(o),Ho.forEach(o),br=f(t),Be=r(t,"P",{});var Yo=a(Be);ya=l(Yo,"The FNet model was proposed in "),Bt=r(Yo,"A",{href:!0,rel:!0});var lr=a(Bt);wa=l(lr,"FNet: Mixing Tokens with Fourier Transforms"),lr.forEach(o),Ta=l(Yo,` by
James Lee-Thorp, Joshua Ainslie, Ilya Eckstein, Santiago Ontanon. The model replaces the self-attention layer in a BERT
model with a fourier transform which returns only the real parts of the transform. The model is significantly faster
than the BERT model because it has fewer parameters and is more memory efficient. The model achieves about 92-97%
accuracy of BERT counterparts on GLUE benchmark, and trains much faster than the BERT model. The abstract from the
paper is the following:`),Yo.forEach(o),yr=f(t),Ko=r(t,"P",{});var cr=a(Ko);Dn=r(cr,"EM",{});var dr=a(Dn);va=l(dr,`We show that Transformer encoder architectures can be sped up, with limited accuracy costs, by replacing the
self-attention sublayers with simple linear transformations that \u201Cmix\u201D input tokens. These linear mixers, along with
standard nonlinearities in feed-forward layers, prove competent at modeling semantic relationships in several text
classification tasks. Most surprisingly, we find that replacing the self-attention sublayer in a Transformer encoder
with a standard, unparameterized Fourier Transform achieves 92-97% of the accuracy of BERT counterparts on the GLUE
benchmark, but trains 80% faster on GPUs and 70% faster on TPUs at standard 512 input lengths. At longer input lengths,
our FNet model is significantly faster: when compared to the \u201Cefficient\u201D Transformers on the Long Range Arena
benchmark, FNet matches the accuracy of the most accurate models, while outpacing the fastest models across all
sequence lengths on GPUs (and across relatively shorter lengths on TPUs). Finally, FNet has a light memory footprint
and is particularly efficient at smaller model sizes; for a fixed speed and accuracy budget, small FNet models
outperform Transformer counterparts.`),dr.forEach(o),cr.forEach(o),wr=f(t),en=r(t,"P",{});var pr=a(en);ka=l(pr,"Tips on usage:"),pr.forEach(o),Tr=f(t),tn=r(t,"UL",{});var hr=a(tn);Hn=r(hr,"LI",{});var mr=a(Hn);Ma=l(mr,`The model was trained without an attention mask as it is based on Fourier Transform. The model was trained with
maximum sequence length 512 which includes pad tokens. Hence, it is highly recommended to use the same maximum
sequence length for fine-tuning and inference.`),mr.forEach(o),hr.forEach(o),vr=f(t),se=r(t,"P",{});var Se=a(se);Fa=l(Se,"This model was contributed by "),At=r(Se,"A",{href:!0,rel:!0});var fr=a(At);$a=l(fr,"gchhablani"),fr.forEach(o),Na=l(Se,". The original code can be found "),Rt=r(Se,"A",{href:!0,rel:!0});var ur=a(Rt);Ja=l(ur,"here"),ur.forEach(o),ja=l(Se,"."),Se.forEach(o),kr=f(t),pe=r(t,"H2",{class:!0});var Oo=a(pe);Ae=r(Oo,"A",{id:!0,class:!0,href:!0});var gr=a(Ae);Yn=r(gr,"SPAN",{});var Kd=a(Yn);T(Pt.$$.fragment,Kd),Kd.forEach(o),gr.forEach(o),Ua=f(Oo),On=r(Oo,"SPAN",{});var ep=a(On);za=l(ep,"Documentation resources"),ep.forEach(o),Oo.forEach(o),Mr=f(t),U=r(t,"UL",{});var ie=a(U);Kn=r(ie,"LI",{});var tp=a(Kn);on=r(tp,"A",{href:!0});var op=a(on);Ea=l(op,"Text classification task guide"),op.forEach(o),tp.forEach(o),Ia=f(ie),es=r(ie,"LI",{});var np=a(es);nn=r(np,"A",{href:!0});var sp=a(nn);xa=l(sp,"Token classification task guide"),sp.forEach(o),np.forEach(o),Ca=f(ie),ts=r(ie,"LI",{});var rp=a(ts);sn=r(rp,"A",{href:!0});var ap=a(sn);Za=l(ap,"Question answering task guide"),ap.forEach(o),rp.forEach(o),qa=f(ie),os=r(ie,"LI",{});var ip=a(os);rn=r(ip,"A",{href:!0});var lp=a(rn);Sa=l(lp,"Masked language modeling task guide"),lp.forEach(o),ip.forEach(o),Wa=f(ie),ns=r(ie,"LI",{});var cp=a(ns);an=r(cp,"A",{href:!0});var dp=a(an);Ba=l(dp,"Multiple choice task guide"),dp.forEach(o),cp.forEach(o),ie.forEach(o),Fr=f(t),he=r(t,"H2",{class:!0});var Lr=a(he);Re=r(Lr,"A",{id:!0,class:!0,href:!0});var pp=a(Re);ss=r(pp,"SPAN",{});var hp=a(ss);T(Gt.$$.fragment,hp),hp.forEach(o),pp.forEach(o),Aa=f(Lr),rs=r(Lr,"SPAN",{});var mp=a(rs);Ra=l(mp,"FNetConfig"),mp.forEach(o),Lr.forEach(o),$r=f(t),I=r(t,"DIV",{class:!0});var wt=a(I);T(Xt.$$.fragment,wt),Pa=f(wt),me=r(wt,"P",{});var Jn=a(me);Ga=l(Jn,"This is the configuration class to store the configuration of a "),ln=r(Jn,"A",{href:!0});var fp=a(ln);Xa=l(fp,"FNetModel"),fp.forEach(o),Va=l(Jn,`. It is used to instantiate an FNet
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 FNet
`),Vt=r(Jn,"A",{href:!0,rel:!0});var up=a(Vt);Qa=l(up,"google/fnet-base"),up.forEach(o),La=l(Jn," architecture."),Jn.forEach(o),Da=f(wt),fe=r(wt,"P",{});var jn=a(fe);Ha=l(jn,"Configuration objects inherit from "),cn=r(jn,"A",{href:!0});var gp=a(cn);Ya=l(gp,"PretrainedConfig"),gp.forEach(o),Oa=l(jn,` and can be used to control the model outputs. Read the
documentation from `),dn=r(jn,"A",{href:!0});var _p=a(dn);Ka=l(_p,"PretrainedConfig"),_p.forEach(o),ei=l(jn," for more information."),jn.forEach(o),ti=f(wt),T(Pe.$$.fragment,wt),wt.forEach(o),Nr=f(t),ue=r(t,"H2",{class:!0});var Dr=a(ue);Ge=r(Dr,"A",{id:!0,class:!0,href:!0});var bp=a(Ge);as=r(bp,"SPAN",{});var yp=a(as);T(Qt.$$.fragment,yp),yp.forEach(o),bp.forEach(o),oi=f(Dr),is=r(Dr,"SPAN",{});var wp=a(is);ni=l(wp,"FNetTokenizer"),wp.forEach(o),Dr.forEach(o),Jr=f(t),j=r(t,"DIV",{class:!0});var Y=a(j);T(Lt.$$.fragment,Y),si=f(Y),te=r(Y,"P",{});var Tt=a(te);ri=l(Tt,"Construct an FNet tokenizer. Adapted from "),pn=r(Tt,"A",{href:!0});var Tp=a(pn);ai=l(Tp,"AlbertTokenizer"),Tp.forEach(o),ii=l(Tt,`. Based on
`),Dt=r(Tt,"A",{href:!0,rel:!0});var vp=a(Dt);li=l(vp,"SentencePiece"),vp.forEach(o),ci=l(Tt,". This tokenizer inherits from "),hn=r(Tt,"A",{href:!0});var kp=a(hn);di=l(kp,"PreTrainedTokenizer"),kp.forEach(o),pi=l(Tt,`
which contains most of the main methods. Users should refer to this superclass for more information regarding those
methods.`),Tt.forEach(o),hi=f(Y),re=r(Y,"DIV",{class:!0});var Un=a(re);T(Ht.$$.fragment,Un),mi=f(Un),ls=r(Un,"P",{});var Mp=a(ls);fi=l(Mp,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An FNet sequence has the following format:`),Mp.forEach(o),ui=f(Un),Yt=r(Un,"UL",{});var Hr=a(Yt);mn=r(Hr,"LI",{});var Dd=a(mn);gi=l(Dd,"single sequence: "),cs=r(Dd,"CODE",{});var Fp=a(cs);_i=l(Fp,"[CLS] X [SEP]"),Fp.forEach(o),Dd.forEach(o),bi=f(Hr),fn=r(Hr,"LI",{});var Hd=a(fn);yi=l(Hd,"pair of sequences: "),ds=r(Hd,"CODE",{});var $p=a(ds);wi=l($p,"[CLS] A [SEP] B [SEP]"),$p.forEach(o),Hd.forEach(o),Hr.forEach(o),Un.forEach(o),Ti=f(Y),Xe=r(Y,"DIV",{class:!0});var Yr=a(Xe);T(Ot.$$.fragment,Yr),vi=f(Yr),Kt=r(Yr,"P",{});var Or=a(Kt);ki=l(Or,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),ps=r(Or,"CODE",{});var Np=a(ps);Mi=l(Np,"prepare_for_model"),Np.forEach(o),Fi=l(Or," method."),Or.forEach(o),Yr.forEach(o),$i=f(Y),R=r(Y,"DIV",{class:!0});var vt=a(R);T(eo.$$.fragment,vt),Ni=f(vt),hs=r(vt,"P",{});var Jp=a(hs);Ji=l(Jp,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. An FNet sequence"),Jp.forEach(o),ji=f(vt),T(Ve.$$.fragment,vt),Ui=f(vt),ge=r(vt,"P",{});var zn=a(ge);zi=l(zn,"If "),ms=r(zn,"CODE",{});var jp=a(ms);Ei=l(jp,"token_ids_1"),jp.forEach(o),Ii=l(zn," is "),fs=r(zn,"CODE",{});var Up=a(fs);xi=l(Up,"None"),Up.forEach(o),Ci=l(zn,", this method only returns the first portion of the mask (0s)."),zn.forEach(o),vt.forEach(o),Zi=f(Y),un=r(Y,"DIV",{class:!0});var zp=a(un);T(to.$$.fragment,zp),zp.forEach(o),Y.forEach(o),jr=f(t),_e=r(t,"H2",{class:!0});var Kr=a(_e);Qe=r(Kr,"A",{id:!0,class:!0,href:!0});var Ep=a(Qe);us=r(Ep,"SPAN",{});var Ip=a(us);T(oo.$$.fragment,Ip),Ip.forEach(o),Ep.forEach(o),qi=f(Kr),gs=r(Kr,"SPAN",{});var xp=a(gs);Si=l(xp,"FNetTokenizerFast"),xp.forEach(o),Kr.forEach(o),Ur=f(t),x=r(t,"DIV",{class:!0});var kt=a(x);T(no.$$.fragment,kt),Wi=f(kt),C=r(kt,"P",{});var le=a(C);Bi=l(le,"Construct a \u201Cfast\u201D FNetTokenizer (backed by HuggingFace\u2019s "),_s=r(le,"EM",{});var Cp=a(_s);Ai=l(Cp,"tokenizers"),Cp.forEach(o),Ri=l(le,` library). Adapted from
`),gn=r(le,"A",{href:!0});var Zp=a(gn);Pi=l(Zp,"AlbertTokenizerFast"),Zp.forEach(o),Gi=l(le,`. Based on
`),so=r(le,"A",{href:!0,rel:!0});var qp=a(so);Xi=l(qp,"Unigram"),qp.forEach(o),Vi=l(le,`. This
tokenizer inherits from `),_n=r(le,"A",{href:!0});var Sp=a(_n);Qi=l(Sp,"PreTrainedTokenizerFast"),Sp.forEach(o),Li=l(le,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods`),le.forEach(o),Di=f(kt),ae=r(kt,"DIV",{class:!0});var En=a(ae);T(ro.$$.fragment,En),Hi=f(En),bs=r(En,"P",{});var Wp=a(bs);Yi=l(Wp,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An FNet sequence has the following format:`),Wp.forEach(o),Oi=f(En),ao=r(En,"UL",{});var ea=a(ao);bn=r(ea,"LI",{});var Yd=a(bn);Ki=l(Yd,"single sequence: "),ys=r(Yd,"CODE",{});var Bp=a(ys);el=l(Bp,"[CLS] X [SEP]"),Bp.forEach(o),Yd.forEach(o),tl=f(ea),yn=r(ea,"LI",{});var Od=a(yn);ol=l(Od,"pair of sequences: "),ws=r(Od,"CODE",{});var Ap=a(ws);nl=l(Ap,"[CLS] A [SEP] B [SEP]"),Ap.forEach(o),Od.forEach(o),ea.forEach(o),En.forEach(o),sl=f(kt),P=r(kt,"DIV",{class:!0});var Mt=a(P);T(io.$$.fragment,Mt),rl=f(Mt),Ts=r(Mt,"P",{});var Rp=a(Ts);al=l(Rp,"Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An FNet"),Rp.forEach(o),il=f(Mt),T(Le.$$.fragment,Mt),ll=f(Mt),vs=r(Mt,"P",{});var Pp=a(vs);cl=l(Pp,"if token_ids_1 is None, only returns the first portion of the mask (0s)."),Pp.forEach(o),Mt.forEach(o),kt.forEach(o),zr=f(t),be=r(t,"H2",{class:!0});var ta=a(be);De=r(ta,"A",{id:!0,class:!0,href:!0});var Gp=a(De);ks=r(Gp,"SPAN",{});var Xp=a(ks);T(lo.$$.fragment,Xp),Xp.forEach(o),Gp.forEach(o),dl=f(ta),Ms=r(ta,"SPAN",{});var Vp=a(Ms);pl=l(Vp,"FNetModel"),Vp.forEach(o),ta.forEach(o),Er=f(t),Z=r(t,"DIV",{class:!0});var Ft=a(Z);T(co.$$.fragment,Ft),hl=f(Ft),po=r(Ft,"P",{});var oa=a(po);ml=l(oa,`The bare FNet Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ho=r(oa,"A",{href:!0,rel:!0});var Qp=a(ho);fl=l(Qp,"torch.nn.Module"),Qp.forEach(o),ul=l(oa,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),oa.forEach(o),gl=f(Ft),mo=r(Ft,"P",{});var na=a(mo);_l=l(na,"The model can behave as an encoder, following the architecture described in "),fo=r(na,"A",{href:!0,rel:!0});var Lp=a(fo);bl=l(Lp,`FNet: Mixing Tokens with Fourier
Transforms`),Lp.forEach(o),yl=l(na," by James Lee-Thorp, Joshua Ainslie, Ilya Eckstein, Santiago Ontanon."),na.forEach(o),wl=f(Ft),G=r(Ft,"DIV",{class:!0});var $t=a(G);T(uo.$$.fragment,$t),Tl=f($t),ye=r($t,"P",{});var In=a(ye);vl=l(In,"The "),wn=r(In,"A",{href:!0});var Dp=a(wn);kl=l(Dp,"FNetModel"),Dp.forEach(o),Ml=l(In," forward method, overrides the "),Fs=r(In,"CODE",{});var Hp=a(Fs);Fl=l(Hp,"__call__"),Hp.forEach(o),$l=l(In," special method."),In.forEach(o),Nl=f($t),T(He.$$.fragment,$t),Jl=f($t),T(Ye.$$.fragment,$t),$t.forEach(o),Ft.forEach(o),Ir=f(t),we=r(t,"H2",{class:!0});var sa=a(we);Oe=r(sa,"A",{id:!0,class:!0,href:!0});var Yp=a(Oe);$s=r(Yp,"SPAN",{});var Op=a($s);T(go.$$.fragment,Op),Op.forEach(o),Yp.forEach(o),jl=f(sa),Ns=r(sa,"SPAN",{});var Kp=a(Ns);Ul=l(Kp,"FNetForPreTraining"),Kp.forEach(o),sa.forEach(o),xr=f(t),q=r(t,"DIV",{class:!0});var Nt=a(q);T(_o.$$.fragment,Nt),zl=f(Nt),Te=r(Nt,"P",{});var xn=a(Te);El=l(xn,"FNet Model with two heads on top as done during the pretraining: a "),Js=r(xn,"CODE",{});var eh=a(Js);Il=l(eh,"masked language modeling"),eh.forEach(o),xl=l(xn," head and a "),js=r(xn,"CODE",{});var th=a(js);Cl=l(th,"next sentence prediction (classification)"),th.forEach(o),Zl=l(xn," head."),xn.forEach(o),ql=f(Nt),bo=r(Nt,"P",{});var ra=a(bo);Sl=l(ra,"This model is a PyTorch "),yo=r(ra,"A",{href:!0,rel:!0});var oh=a(yo);Wl=l(oh,"torch.nn.Module"),oh.forEach(o),Bl=l(ra,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ra.forEach(o),Al=f(Nt),X=r(Nt,"DIV",{class:!0});var Jt=a(X);T(wo.$$.fragment,Jt),Rl=f(Jt),ve=r(Jt,"P",{});var Cn=a(ve);Pl=l(Cn,"The "),Tn=r(Cn,"A",{href:!0});var nh=a(Tn);Gl=l(nh,"FNetForPreTraining"),nh.forEach(o),Xl=l(Cn," forward method, overrides the "),Us=r(Cn,"CODE",{});var sh=a(Us);Vl=l(sh,"__call__"),sh.forEach(o),Ql=l(Cn," special method."),Cn.forEach(o),Ll=f(Jt),T(Ke.$$.fragment,Jt),Dl=f(Jt),T(et.$$.fragment,Jt),Jt.forEach(o),Nt.forEach(o),Cr=f(t),ke=r(t,"H2",{class:!0});var aa=a(ke);tt=r(aa,"A",{id:!0,class:!0,href:!0});var rh=a(tt);zs=r(rh,"SPAN",{});var ah=a(zs);T(To.$$.fragment,ah),ah.forEach(o),rh.forEach(o),Hl=f(aa),Es=r(aa,"SPAN",{});var ih=a(Es);Yl=l(ih,"FNetForMaskedLM"),ih.forEach(o),aa.forEach(o),Zr=f(t),oe=r(t,"DIV",{class:!0});var Zn=a(oe);T(vo.$$.fragment,Zn),Ol=f(Zn),Me=r(Zn,"P",{});var qn=a(Me);Kl=l(qn,"FNet Model with a "),Is=r(qn,"CODE",{});var lh=a(Is);ec=l(lh,"language modeling"),lh.forEach(o),tc=l(qn,` head on top.
This model is a PyTorch `),ko=r(qn,"A",{href:!0,rel:!0});var ch=a(ko);oc=l(ch,"torch.nn.Module"),ch.forEach(o),nc=l(qn,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),qn.forEach(o),sc=f(Zn),V=r(Zn,"DIV",{class:!0});var jt=a(V);T(Mo.$$.fragment,jt),rc=f(jt),Fe=r(jt,"P",{});var Sn=a(Fe);ac=l(Sn,"The "),vn=r(Sn,"A",{href:!0});var dh=a(vn);ic=l(dh,"FNetForMaskedLM"),dh.forEach(o),lc=l(Sn," forward method, overrides the "),xs=r(Sn,"CODE",{});var ph=a(xs);cc=l(ph,"__call__"),ph.forEach(o),dc=l(Sn," special method."),Sn.forEach(o),pc=f(jt),T(ot.$$.fragment,jt),hc=f(jt),T(nt.$$.fragment,jt),jt.forEach(o),Zn.forEach(o),qr=f(t),$e=r(t,"H2",{class:!0});var ia=a($e);st=r(ia,"A",{id:!0,class:!0,href:!0});var hh=a(st);Cs=r(hh,"SPAN",{});var mh=a(Cs);T(Fo.$$.fragment,mh),mh.forEach(o),hh.forEach(o),mc=f(ia),Zs=r(ia,"SPAN",{});var fh=a(Zs);fc=l(fh,"FNetForNextSentencePrediction"),fh.forEach(o),ia.forEach(o),Sr=f(t),ne=r(t,"DIV",{class:!0});var Wn=a(ne);T($o.$$.fragment,Wn),uc=f(Wn),Ne=r(Wn,"P",{});var Bn=a(Ne);gc=l(Bn,"FNet Model with a "),qs=r(Bn,"CODE",{});var uh=a(qs);_c=l(uh,"next sentence prediction (classification)"),uh.forEach(o),bc=l(Bn,` head on top.
This model is a PyTorch `),No=r(Bn,"A",{href:!0,rel:!0});var gh=a(No);yc=l(gh,"torch.nn.Module"),gh.forEach(o),wc=l(Bn,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Bn.forEach(o),Tc=f(Wn),Q=r(Wn,"DIV",{class:!0});var Ut=a(Q);T(Jo.$$.fragment,Ut),vc=f(Ut),Je=r(Ut,"P",{});var An=a(Je);kc=l(An,"The "),kn=r(An,"A",{href:!0});var _h=a(kn);Mc=l(_h,"FNetForNextSentencePrediction"),_h.forEach(o),Fc=l(An," forward method, overrides the "),Ss=r(An,"CODE",{});var bh=a(Ss);$c=l(bh,"__call__"),bh.forEach(o),Nc=l(An," special method."),An.forEach(o),Jc=f(Ut),T(rt.$$.fragment,Ut),jc=f(Ut),T(at.$$.fragment,Ut),Ut.forEach(o),Wn.forEach(o),Wr=f(t),je=r(t,"H2",{class:!0});var la=a(je);it=r(la,"A",{id:!0,class:!0,href:!0});var yh=a(it);Ws=r(yh,"SPAN",{});var wh=a(Ws);T(jo.$$.fragment,wh),wh.forEach(o),yh.forEach(o),Uc=f(la),Bs=r(la,"SPAN",{});var Th=a(Bs);zc=l(Th,"FNetForSequenceClassification"),Th.forEach(o),la.forEach(o),Br=f(t),S=r(t,"DIV",{class:!0});var zt=a(S);T(Uo.$$.fragment,zt),Ec=f(zt),As=r(zt,"P",{});var vh=a(As);Ic=l(vh,`FNet Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),vh.forEach(o),xc=f(zt),zo=r(zt,"P",{});var ca=a(zo);Cc=l(ca,"This model is a PyTorch "),Eo=r(ca,"A",{href:!0,rel:!0});var kh=a(Eo);Zc=l(kh,"torch.nn.Module"),kh.forEach(o),qc=l(ca,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ca.forEach(o),Sc=f(zt),z=r(zt,"DIV",{class:!0});var ce=a(z);T(Io.$$.fragment,ce),Wc=f(ce),Ue=r(ce,"P",{});var Rn=a(Ue);Bc=l(Rn,"The "),Mn=r(Rn,"A",{href:!0});var Mh=a(Mn);Ac=l(Mh,"FNetForSequenceClassification"),Mh.forEach(o),Rc=l(Rn," forward method, overrides the "),Rs=r(Rn,"CODE",{});var Fh=a(Rs);Pc=l(Fh,"__call__"),Fh.forEach(o),Gc=l(Rn," special method."),Rn.forEach(o),Xc=f(ce),T(lt.$$.fragment,ce),Vc=f(ce),T(ct.$$.fragment,ce),Qc=f(ce),T(dt.$$.fragment,ce),ce.forEach(o),zt.forEach(o),Ar=f(t),ze=r(t,"H2",{class:!0});var da=a(ze);pt=r(da,"A",{id:!0,class:!0,href:!0});var $h=a(pt);Ps=r($h,"SPAN",{});var Nh=a(Ps);T(xo.$$.fragment,Nh),Nh.forEach(o),$h.forEach(o),Lc=f(da),Gs=r(da,"SPAN",{});var Jh=a(Gs);Dc=l(Jh,"FNetForMultipleChoice"),Jh.forEach(o),da.forEach(o),Rr=f(t),W=r(t,"DIV",{class:!0});var Et=a(W);T(Co.$$.fragment,Et),Hc=f(Et),Xs=r(Et,"P",{});var jh=a(Xs);Yc=l(jh,`FNet 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.`),jh.forEach(o),Oc=f(Et),Zo=r(Et,"P",{});var pa=a(Zo);Kc=l(pa,"This model is a PyTorch "),qo=r(pa,"A",{href:!0,rel:!0});var Uh=a(qo);ed=l(Uh,"torch.nn.Module"),Uh.forEach(o),td=l(pa,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),pa.forEach(o),od=f(Et),L=r(Et,"DIV",{class:!0});var It=a(L);T(So.$$.fragment,It),nd=f(It),Ee=r(It,"P",{});var Pn=a(Ee);sd=l(Pn,"The "),Fn=r(Pn,"A",{href:!0});var zh=a(Fn);rd=l(zh,"FNetForMultipleChoice"),zh.forEach(o),ad=l(Pn," forward method, overrides the "),Vs=r(Pn,"CODE",{});var Eh=a(Vs);id=l(Eh,"__call__"),Eh.forEach(o),ld=l(Pn," special method."),Pn.forEach(o),cd=f(It),T(ht.$$.fragment,It),dd=f(It),T(mt.$$.fragment,It),It.forEach(o),Et.forEach(o),Pr=f(t),Ie=r(t,"H2",{class:!0});var ha=a(Ie);ft=r(ha,"A",{id:!0,class:!0,href:!0});var Ih=a(ft);Qs=r(Ih,"SPAN",{});var xh=a(Qs);T(Wo.$$.fragment,xh),xh.forEach(o),Ih.forEach(o),pd=f(ha),Ls=r(ha,"SPAN",{});var Ch=a(Ls);hd=l(Ch,"FNetForTokenClassification"),Ch.forEach(o),ha.forEach(o),Gr=f(t),B=r(t,"DIV",{class:!0});var xt=a(B);T(Bo.$$.fragment,xt),md=f(xt),Ds=r(xt,"P",{});var Zh=a(Ds);fd=l(Zh,`FNet Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),Zh.forEach(o),ud=f(xt),Ao=r(xt,"P",{});var ma=a(Ao);gd=l(ma,"This model is a PyTorch "),Ro=r(ma,"A",{href:!0,rel:!0});var qh=a(Ro);_d=l(qh,"torch.nn.Module"),qh.forEach(o),bd=l(ma,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ma.forEach(o),yd=f(xt),D=r(xt,"DIV",{class:!0});var Ct=a(D);T(Po.$$.fragment,Ct),wd=f(Ct),xe=r(Ct,"P",{});var Gn=a(xe);Td=l(Gn,"The "),$n=r(Gn,"A",{href:!0});var Sh=a($n);vd=l(Sh,"FNetForTokenClassification"),Sh.forEach(o),kd=l(Gn," forward method, overrides the "),Hs=r(Gn,"CODE",{});var Wh=a(Hs);Md=l(Wh,"__call__"),Wh.forEach(o),Fd=l(Gn," special method."),Gn.forEach(o),$d=f(Ct),T(ut.$$.fragment,Ct),Nd=f(Ct),T(gt.$$.fragment,Ct),Ct.forEach(o),xt.forEach(o),Xr=f(t),Ce=r(t,"H2",{class:!0});var fa=a(Ce);_t=r(fa,"A",{id:!0,class:!0,href:!0});var Bh=a(_t);Ys=r(Bh,"SPAN",{});var Ah=a(Ys);T(Go.$$.fragment,Ah),Ah.forEach(o),Bh.forEach(o),Jd=f(fa),Os=r(fa,"SPAN",{});var Rh=a(Os);jd=l(Rh,"FNetForQuestionAnswering"),Rh.forEach(o),fa.forEach(o),Vr=f(t),A=r(t,"DIV",{class:!0});var Zt=a(A);T(Xo.$$.fragment,Zt),Ud=f(Zt),Ze=r(Zt,"P",{});var Xn=a(Ze);zd=l(Xn,`FNet 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 `),Ks=r(Xn,"CODE",{});var Ph=a(Ks);Ed=l(Ph,"span start logits"),Ph.forEach(o),Id=l(Xn," and "),er=r(Xn,"CODE",{});var Gh=a(er);xd=l(Gh,"span end logits"),Gh.forEach(o),Cd=l(Xn,")."),Xn.forEach(o),Zd=f(Zt),Vo=r(Zt,"P",{});var ua=a(Vo);qd=l(ua,"This model is a PyTorch "),Qo=r(ua,"A",{href:!0,rel:!0});var Xh=a(Qo);Sd=l(Xh,"torch.nn.Module"),Xh.forEach(o),Wd=l(ua,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ua.forEach(o),Bd=f(Zt),H=r(Zt,"DIV",{class:!0});var qt=a(H);T(Lo.$$.fragment,qt),Ad=f(qt),qe=r(qt,"P",{});var Vn=a(qe);Rd=l(Vn,"The "),Nn=r(Vn,"A",{href:!0});var Vh=a(Nn);Pd=l(Vh,"FNetForQuestionAnswering"),Vh.forEach(o),Gd=l(Vn," forward method, overrides the "),tr=r(Vn,"CODE",{});var Qh=a(tr);Xd=l(Qh,"__call__"),Qh.forEach(o),Vd=l(Vn," special method."),Vn.forEach(o),Qd=f(qt),T(bt.$$.fragment,qt),Ld=f(qt),T(yt.$$.fragment,qt),qt.forEach(o),Zt.forEach(o),this.h()},h(){h(c,"name","hf:doc:metadata"),h(c,"content",JSON.stringify(wm)),h(p,"id","fnet"),h(p,"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"),h(p,"href","#fnet"),h(u,"class","relative group"),h(We,"id","overview"),h(We,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(We,"href","#overview"),h(de,"class","relative group"),h(Bt,"href","https://arxiv.org/abs/2105.03824"),h(Bt,"rel","nofollow"),h(At,"href","https://huggingface.co/gchhablani"),h(At,"rel","nofollow"),h(Rt,"href","https://github.com/google-research/google-research/tree/master/f_net"),h(Rt,"rel","nofollow"),h(Ae,"id","documentation-resources"),h(Ae,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Ae,"href","#documentation-resources"),h(pe,"class","relative group"),h(on,"href","../tasks/sequence_classification"),h(nn,"href","../tasks/token_classification"),h(sn,"href","../tasks/question_answering"),h(rn,"href","../tasks/masked_language_modeling"),h(an,"href","../tasks/multiple_choice"),h(Re,"id","transformers.FNetConfig"),h(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"),h(Re,"href","#transformers.FNetConfig"),h(he,"class","relative group"),h(ln,"href","/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetModel"),h(Vt,"href","https://huggingface.co/google/fnet-base"),h(Vt,"rel","nofollow"),h(cn,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),h(dn,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),h(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ge,"id","transformers.FNetTokenizer"),h(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"),h(Ge,"href","#transformers.FNetTokenizer"),h(ue,"class","relative group"),h(pn,"href","/docs/transformers/v4.30.0/en/model_doc/albert#transformers.AlbertTokenizer"),h(Dt,"href","https://github.com/google/sentencepiece"),h(Dt,"rel","nofollow"),h(hn,"href","/docs/transformers/v4.30.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),h(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(un,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Qe,"id","transformers.FNetTokenizerFast"),h(Qe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Qe,"href","#transformers.FNetTokenizerFast"),h(_e,"class","relative group"),h(gn,"href","/docs/transformers/v4.30.0/en/model_doc/albert#transformers.AlbertTokenizerFast"),h(so,"href","https://huggingface.co/docs/tokenizers/python/latest/components.html?highlight=unigram#models"),h(so,"rel","nofollow"),h(_n,"href","/docs/transformers/v4.30.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),h(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(De,"id","transformers.FNetModel"),h(De,"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"),h(De,"href","#transformers.FNetModel"),h(be,"class","relative group"),h(ho,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(ho,"rel","nofollow"),h(fo,"href","https://arxiv.org/abs/2105.03824"),h(fo,"rel","nofollow"),h(wn,"href","/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetModel"),h(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Oe,"id","transformers.FNetForPreTraining"),h(Oe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Oe,"href","#transformers.FNetForPreTraining"),h(we,"class","relative group"),h(yo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(yo,"rel","nofollow"),h(Tn,"href","/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetForPreTraining"),h(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(tt,"id","transformers.FNetForMaskedLM"),h(tt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(tt,"href","#transformers.FNetForMaskedLM"),h(ke,"class","relative group"),h(ko,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(ko,"rel","nofollow"),h(vn,"href","/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetForMaskedLM"),h(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(st,"id","transformers.FNetForNextSentencePrediction"),h(st,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(st,"href","#transformers.FNetForNextSentencePrediction"),h($e,"class","relative group"),h(No,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(No,"rel","nofollow"),h(kn,"href","/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetForNextSentencePrediction"),h(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(it,"id","transformers.FNetForSequenceClassification"),h(it,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(it,"href","#transformers.FNetForSequenceClassification"),h(je,"class","relative group"),h(Eo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Eo,"rel","nofollow"),h(Mn,"href","/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetForSequenceClassification"),h(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(pt,"id","transformers.FNetForMultipleChoice"),h(pt,"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"),h(pt,"href","#transformers.FNetForMultipleChoice"),h(ze,"class","relative group"),h(qo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(qo,"rel","nofollow"),h(Fn,"href","/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetForMultipleChoice"),h(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ft,"id","transformers.FNetForTokenClassification"),h(ft,"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"),h(ft,"href","#transformers.FNetForTokenClassification"),h(Ie,"class","relative group"),h(Ro,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Ro,"rel","nofollow"),h($n,"href","/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetForTokenClassification"),h(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(_t,"id","transformers.FNetForQuestionAnswering"),h(_t,"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"),h(_t,"href","#transformers.FNetForQuestionAnswering"),h(Ce,"class","relative group"),h(Qo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Qo,"rel","nofollow"),h(Nn,"href","/docs/transformers/v4.30.0/en/model_doc/fnet#transformers.FNetForQuestionAnswering"),h(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,g){e(document.head,c),b(t,y,g),b(t,u,g),e(u,p),e(p,_),v(n,_,null),e(u,d),e(u,N),e(N,ga),b(t,_r,g),b(t,de,g),e(de,We),e(We,Qn),v(Wt,Qn,null),e(de,_a),e(de,Ln),e(Ln,ba),b(t,br,g),b(t,Be,g),e(Be,ya),e(Be,Bt),e(Bt,wa),e(Be,Ta),b(t,yr,g),b(t,Ko,g),e(Ko,Dn),e(Dn,va),b(t,wr,g),b(t,en,g),e(en,ka),b(t,Tr,g),b(t,tn,g),e(tn,Hn),e(Hn,Ma),b(t,vr,g),b(t,se,g),e(se,Fa),e(se,At),e(At,$a),e(se,Na),e(se,Rt),e(Rt,Ja),e(se,ja),b(t,kr,g),b(t,pe,g),e(pe,Ae),e(Ae,Yn),v(Pt,Yn,null),e(pe,Ua),e(pe,On),e(On,za),b(t,Mr,g),b(t,U,g),e(U,Kn),e(Kn,on),e(on,Ea),e(U,Ia),e(U,es),e(es,nn),e(nn,xa),e(U,Ca),e(U,ts),e(ts,sn),e(sn,Za),e(U,qa),e(U,os),e(os,rn),e(rn,Sa),e(U,Wa),e(U,ns),e(ns,an),e(an,Ba),b(t,Fr,g),b(t,he,g),e(he,Re),e(Re,ss),v(Gt,ss,null),e(he,Aa),e(he,rs),e(rs,Ra),b(t,$r,g),b(t,I,g),v(Xt,I,null),e(I,Pa),e(I,me),e(me,Ga),e(me,ln),e(ln,Xa),e(me,Va),e(me,Vt),e(Vt,Qa),e(me,La),e(I,Da),e(I,fe),e(fe,Ha),e(fe,cn),e(cn,Ya),e(fe,Oa),e(fe,dn),e(dn,Ka),e(fe,ei),e(I,ti),v(Pe,I,null),b(t,Nr,g),b(t,ue,g),e(ue,Ge),e(Ge,as),v(Qt,as,null),e(ue,oi),e(ue,is),e(is,ni),b(t,Jr,g),b(t,j,g),v(Lt,j,null),e(j,si),e(j,te),e(te,ri),e(te,pn),e(pn,ai),e(te,ii),e(te,Dt),e(Dt,li),e(te,ci),e(te,hn),e(hn,di),e(te,pi),e(j,hi),e(j,re),v(Ht,re,null),e(re,mi),e(re,ls),e(ls,fi),e(re,ui),e(re,Yt),e(Yt,mn),e(mn,gi),e(mn,cs),e(cs,_i),e(Yt,bi),e(Yt,fn),e(fn,yi),e(fn,ds),e(ds,wi),e(j,Ti),e(j,Xe),v(Ot,Xe,null),e(Xe,vi),e(Xe,Kt),e(Kt,ki),e(Kt,ps),e(ps,Mi),e(Kt,Fi),e(j,$i),e(j,R),v(eo,R,null),e(R,Ni),e(R,hs),e(hs,Ji),e(R,ji),v(Ve,R,null),e(R,Ui),e(R,ge),e(ge,zi),e(ge,ms),e(ms,Ei),e(ge,Ii),e(ge,fs),e(fs,xi),e(ge,Ci),e(j,Zi),e(j,un),v(to,un,null),b(t,jr,g),b(t,_e,g),e(_e,Qe),e(Qe,us),v(oo,us,null),e(_e,qi),e(_e,gs),e(gs,Si),b(t,Ur,g),b(t,x,g),v(no,x,null),e(x,Wi),e(x,C),e(C,Bi),e(C,_s),e(_s,Ai),e(C,Ri),e(C,gn),e(gn,Pi),e(C,Gi),e(C,so),e(so,Xi),e(C,Vi),e(C,_n),e(_n,Qi),e(C,Li),e(x,Di),e(x,ae),v(ro,ae,null),e(ae,Hi),e(ae,bs),e(bs,Yi),e(ae,Oi),e(ae,ao),e(ao,bn),e(bn,Ki),e(bn,ys),e(ys,el),e(ao,tl),e(ao,yn),e(yn,ol),e(yn,ws),e(ws,nl),e(x,sl),e(x,P),v(io,P,null),e(P,rl),e(P,Ts),e(Ts,al),e(P,il),v(Le,P,null),e(P,ll),e(P,vs),e(vs,cl),b(t,zr,g),b(t,be,g),e(be,De),e(De,ks),v(lo,ks,null),e(be,dl),e(be,Ms),e(Ms,pl),b(t,Er,g),b(t,Z,g),v(co,Z,null),e(Z,hl),e(Z,po),e(po,ml),e(po,ho),e(ho,fl),e(po,ul),e(Z,gl),e(Z,mo),e(mo,_l),e(mo,fo),e(fo,bl),e(mo,yl),e(Z,wl),e(Z,G),v(uo,G,null),e(G,Tl),e(G,ye),e(ye,vl),e(ye,wn),e(wn,kl),e(ye,Ml),e(ye,Fs),e(Fs,Fl),e(ye,$l),e(G,Nl),v(He,G,null),e(G,Jl),v(Ye,G,null),b(t,Ir,g),b(t,we,g),e(we,Oe),e(Oe,$s),v(go,$s,null),e(we,jl),e(we,Ns),e(Ns,Ul),b(t,xr,g),b(t,q,g),v(_o,q,null),e(q,zl),e(q,Te),e(Te,El),e(Te,Js),e(Js,Il),e(Te,xl),e(Te,js),e(js,Cl),e(Te,Zl),e(q,ql),e(q,bo),e(bo,Sl),e(bo,yo),e(yo,Wl),e(bo,Bl),e(q,Al),e(q,X),v(wo,X,null),e(X,Rl),e(X,ve),e(ve,Pl),e(ve,Tn),e(Tn,Gl),e(ve,Xl),e(ve,Us),e(Us,Vl),e(ve,Ql),e(X,Ll),v(Ke,X,null),e(X,Dl),v(et,X,null),b(t,Cr,g),b(t,ke,g),e(ke,tt),e(tt,zs),v(To,zs,null),e(ke,Hl),e(ke,Es),e(Es,Yl),b(t,Zr,g),b(t,oe,g),v(vo,oe,null),e(oe,Ol),e(oe,Me),e(Me,Kl),e(Me,Is),e(Is,ec),e(Me,tc),e(Me,ko),e(ko,oc),e(Me,nc),e(oe,sc),e(oe,V),v(Mo,V,null),e(V,rc),e(V,Fe),e(Fe,ac),e(Fe,vn),e(vn,ic),e(Fe,lc),e(Fe,xs),e(xs,cc),e(Fe,dc),e(V,pc),v(ot,V,null),e(V,hc),v(nt,V,null),b(t,qr,g),b(t,$e,g),e($e,st),e(st,Cs),v(Fo,Cs,null),e($e,mc),e($e,Zs),e(Zs,fc),b(t,Sr,g),b(t,ne,g),v($o,ne,null),e(ne,uc),e(ne,Ne),e(Ne,gc),e(Ne,qs),e(qs,_c),e(Ne,bc),e(Ne,No),e(No,yc),e(Ne,wc),e(ne,Tc),e(ne,Q),v(Jo,Q,null),e(Q,vc),e(Q,Je),e(Je,kc),e(Je,kn),e(kn,Mc),e(Je,Fc),e(Je,Ss),e(Ss,$c),e(Je,Nc),e(Q,Jc),v(rt,Q,null),e(Q,jc),v(at,Q,null),b(t,Wr,g),b(t,je,g),e(je,it),e(it,Ws),v(jo,Ws,null),e(je,Uc),e(je,Bs),e(Bs,zc),b(t,Br,g),b(t,S,g),v(Uo,S,null),e(S,Ec),e(S,As),e(As,Ic),e(S,xc),e(S,zo),e(zo,Cc),e(zo,Eo),e(Eo,Zc),e(zo,qc),e(S,Sc),e(S,z),v(Io,z,null),e(z,Wc),e(z,Ue),e(Ue,Bc),e(Ue,Mn),e(Mn,Ac),e(Ue,Rc),e(Ue,Rs),e(Rs,Pc),e(Ue,Gc),e(z,Xc),v(lt,z,null),e(z,Vc),v(ct,z,null),e(z,Qc),v(dt,z,null),b(t,Ar,g),b(t,ze,g),e(ze,pt),e(pt,Ps),v(xo,Ps,null),e(ze,Lc),e(ze,Gs),e(Gs,Dc),b(t,Rr,g),b(t,W,g),v(Co,W,null),e(W,Hc),e(W,Xs),e(Xs,Yc),e(W,Oc),e(W,Zo),e(Zo,Kc),e(Zo,qo),e(qo,ed),e(Zo,td),e(W,od),e(W,L),v(So,L,null),e(L,nd),e(L,Ee),e(Ee,sd),e(Ee,Fn),e(Fn,rd),e(Ee,ad),e(Ee,Vs),e(Vs,id),e(Ee,ld),e(L,cd),v(ht,L,null),e(L,dd),v(mt,L,null),b(t,Pr,g),b(t,Ie,g),e(Ie,ft),e(ft,Qs),v(Wo,Qs,null),e(Ie,pd),e(Ie,Ls),e(Ls,hd),b(t,Gr,g),b(t,B,g),v(Bo,B,null),e(B,md),e(B,Ds),e(Ds,fd),e(B,ud),e(B,Ao),e(Ao,gd),e(Ao,Ro),e(Ro,_d),e(Ao,bd),e(B,yd),e(B,D),v(Po,D,null),e(D,wd),e(D,xe),e(xe,Td),e(xe,$n),e($n,vd),e(xe,kd),e(xe,Hs),e(Hs,Md),e(xe,Fd),e(D,$d),v(ut,D,null),e(D,Nd),v(gt,D,null),b(t,Xr,g),b(t,Ce,g),e(Ce,_t),e(_t,Ys),v(Go,Ys,null),e(Ce,Jd),e(Ce,Os),e(Os,jd),b(t,Vr,g),b(t,A,g),v(Xo,A,null),e(A,Ud),e(A,Ze),e(Ze,zd),e(Ze,Ks),e(Ks,Ed),e(Ze,Id),e(Ze,er),e(er,xd),e(Ze,Cd),e(A,Zd),e(A,Vo),e(Vo,qd),e(Vo,Qo),e(Qo,Sd),e(Vo,Wd),e(A,Bd),e(A,H),v(Lo,H,null),e(H,Ad),e(H,qe),e(qe,Rd),e(qe,Nn),e(Nn,Pd),e(qe,Gd),e(qe,tr),e(tr,Xd),e(qe,Vd),e(H,Qd),v(bt,H,null),e(H,Ld),v(yt,H,null),Qr=!0},p(t,[g]){const Do={};g&2&&(Do.$$scope={dirty:g,ctx:t}),Pe.$set(Do);const or={};g&2&&(or.$$scope={dirty:g,ctx:t}),Ve.$set(or);const nr={};g&2&&(nr.$$scope={dirty:g,ctx:t}),Le.$set(nr);const sr={};g&2&&(sr.$$scope={dirty:g,ctx:t}),He.$set(sr);const Ho={};g&2&&(Ho.$$scope={dirty:g,ctx:t}),Ye.$set(Ho);const rr={};g&2&&(rr.$$scope={dirty:g,ctx:t}),Ke.$set(rr);const ar={};g&2&&(ar.$$scope={dirty:g,ctx:t}),et.$set(ar);const ir={};g&2&&(ir.$$scope={dirty:g,ctx:t}),ot.$set(ir);const Yo={};g&2&&(Yo.$$scope={dirty:g,ctx:t}),nt.$set(Yo);const lr={};g&2&&(lr.$$scope={dirty:g,ctx:t}),rt.$set(lr);const cr={};g&2&&(cr.$$scope={dirty:g,ctx:t}),at.$set(cr);const dr={};g&2&&(dr.$$scope={dirty:g,ctx:t}),lt.$set(dr);const pr={};g&2&&(pr.$$scope={dirty:g,ctx:t}),ct.$set(pr);const hr={};g&2&&(hr.$$scope={dirty:g,ctx:t}),dt.$set(hr);const mr={};g&2&&(mr.$$scope={dirty:g,ctx:t}),ht.$set(mr);const Se={};g&2&&(Se.$$scope={dirty:g,ctx:t}),mt.$set(Se);const fr={};g&2&&(fr.$$scope={dirty:g,ctx:t}),ut.$set(fr);const ur={};g&2&&(ur.$$scope={dirty:g,ctx:t}),gt.$set(ur);const Oo={};g&2&&(Oo.$$scope={dirty:g,ctx:t}),bt.$set(Oo);const gr={};g&2&&(gr.$$scope={dirty:g,ctx:t}),yt.$set(gr)},i(t){Qr||(k(n.$$.fragment,t),k(Wt.$$.fragment,t),k(Pt.$$.fragment,t),k(Gt.$$.fragment,t),k(Xt.$$.fragment,t),k(Pe.$$.fragment,t),k(Qt.$$.fragment,t),k(Lt.$$.fragment,t),k(Ht.$$.fragment,t),k(Ot.$$.fragment,t),k(eo.$$.fragment,t),k(Ve.$$.fragment,t),k(to.$$.fragment,t),k(oo.$$.fragment,t),k(no.$$.fragment,t),k(ro.$$.fragment,t),k(io.$$.fragment,t),k(Le.$$.fragment,t),k(lo.$$.fragment,t),k(co.$$.fragment,t),k(uo.$$.fragment,t),k(He.$$.fragment,t),k(Ye.$$.fragment,t),k(go.$$.fragment,t),k(_o.$$.fragment,t),k(wo.$$.fragment,t),k(Ke.$$.fragment,t),k(et.$$.fragment,t),k(To.$$.fragment,t),k(vo.$$.fragment,t),k(Mo.$$.fragment,t),k(ot.$$.fragment,t),k(nt.$$.fragment,t),k(Fo.$$.fragment,t),k($o.$$.fragment,t),k(Jo.$$.fragment,t),k(rt.$$.fragment,t),k(at.$$.fragment,t),k(jo.$$.fragment,t),k(Uo.$$.fragment,t),k(Io.$$.fragment,t),k(lt.$$.fragment,t),k(ct.$$.fragment,t),k(dt.$$.fragment,t),k(xo.$$.fragment,t),k(Co.$$.fragment,t),k(So.$$.fragment,t),k(ht.$$.fragment,t),k(mt.$$.fragment,t),k(Wo.$$.fragment,t),k(Bo.$$.fragment,t),k(Po.$$.fragment,t),k(ut.$$.fragment,t),k(gt.$$.fragment,t),k(Go.$$.fragment,t),k(Xo.$$.fragment,t),k(Lo.$$.fragment,t),k(bt.$$.fragment,t),k(yt.$$.fragment,t),Qr=!0)},o(t){M(n.$$.fragment,t),M(Wt.$$.fragment,t),M(Pt.$$.fragment,t),M(Gt.$$.fragment,t),M(Xt.$$.fragment,t),M(Pe.$$.fragment,t),M(Qt.$$.fragment,t),M(Lt.$$.fragment,t),M(Ht.$$.fragment,t),M(Ot.$$.fragment,t),M(eo.$$.fragment,t),M(Ve.$$.fragment,t),M(to.$$.fragment,t),M(oo.$$.fragment,t),M(no.$$.fragment,t),M(ro.$$.fragment,t),M(io.$$.fragment,t),M(Le.$$.fragment,t),M(lo.$$.fragment,t),M(co.$$.fragment,t),M(uo.$$.fragment,t),M(He.$$.fragment,t),M(Ye.$$.fragment,t),M(go.$$.fragment,t),M(_o.$$.fragment,t),M(wo.$$.fragment,t),M(Ke.$$.fragment,t),M(et.$$.fragment,t),M(To.$$.fragment,t),M(vo.$$.fragment,t),M(Mo.$$.fragment,t),M(ot.$$.fragment,t),M(nt.$$.fragment,t),M(Fo.$$.fragment,t),M($o.$$.fragment,t),M(Jo.$$.fragment,t),M(rt.$$.fragment,t),M(at.$$.fragment,t),M(jo.$$.fragment,t),M(Uo.$$.fragment,t),M(Io.$$.fragment,t),M(lt.$$.fragment,t),M(ct.$$.fragment,t),M(dt.$$.fragment,t),M(xo.$$.fragment,t),M(Co.$$.fragment,t),M(So.$$.fragment,t),M(ht.$$.fragment,t),M(mt.$$.fragment,t),M(Wo.$$.fragment,t),M(Bo.$$.fragment,t),M(Po.$$.fragment,t),M(ut.$$.fragment,t),M(gt.$$.fragment,t),M(Go.$$.fragment,t),M(Xo.$$.fragment,t),M(Lo.$$.fragment,t),M(bt.$$.fragment,t),M(yt.$$.fragment,t),Qr=!1},d(t){o(c),t&&o(y),t&&o(u),F(n),t&&o(_r),t&&o(de),F(Wt),t&&o(br),t&&o(Be),t&&o(yr),t&&o(Ko),t&&o(wr),t&&o(en),t&&o(Tr),t&&o(tn),t&&o(vr),t&&o(se),t&&o(kr),t&&o(pe),F(Pt),t&&o(Mr),t&&o(U),t&&o(Fr),t&&o(he),F(Gt),t&&o($r),t&&o(I),F(Xt),F(Pe),t&&o(Nr),t&&o(ue),F(Qt),t&&o(Jr),t&&o(j),F(Lt),F(Ht),F(Ot),F(eo),F(Ve),F(to),t&&o(jr),t&&o(_e),F(oo),t&&o(Ur),t&&o(x),F(no),F(ro),F(io),F(Le),t&&o(zr),t&&o(be),F(lo),t&&o(Er),t&&o(Z),F(co),F(uo),F(He),F(Ye),t&&o(Ir),t&&o(we),F(go),t&&o(xr),t&&o(q),F(_o),F(wo),F(Ke),F(et),t&&o(Cr),t&&o(ke),F(To),t&&o(Zr),t&&o(oe),F(vo),F(Mo),F(ot),F(nt),t&&o(qr),t&&o($e),F(Fo),t&&o(Sr),t&&o(ne),F($o),F(Jo),F(rt),F(at),t&&o(Wr),t&&o(je),F(jo),t&&o(Br),t&&o(S),F(Uo),F(Io),F(lt),F(ct),F(dt),t&&o(Ar),t&&o(ze),F(xo),t&&o(Rr),t&&o(W),F(Co),F(So),F(ht),F(mt),t&&o(Pr),t&&o(Ie),F(Wo),t&&o(Gr),t&&o(B),F(Bo),F(Po),F(ut),F(gt),t&&o(Xr),t&&o(Ce),F(Go),t&&o(Vr),t&&o(A),F(Xo),F(Lo),F(bt),F(yt)}}}const wm={local:"fnet",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.FNetConfig",title:"FNetConfig"},{local:"transformers.FNetTokenizer",title:"FNetTokenizer"},{local:"transformers.FNetTokenizerFast",title:"FNetTokenizerFast"},{local:"transformers.FNetModel",title:"FNetModel"},{local:"transformers.FNetForPreTraining",title:"FNetForPreTraining"},{local:"transformers.FNetForMaskedLM",title:"FNetForMaskedLM"},{local:"transformers.FNetForNextSentencePrediction",title:"FNetForNextSentencePrediction"},{local:"transformers.FNetForSequenceClassification",title:"FNetForSequenceClassification"},{local:"transformers.FNetForMultipleChoice",title:"FNetForMultipleChoice"},{local:"transformers.FNetForTokenClassification",title:"FNetForTokenClassification"},{local:"transformers.FNetForQuestionAnswering",title:"FNetForQuestionAnswering"}],title:"FNet"};function Tm($){return Oh(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Jm extends Lh{constructor(c){super();Dh(this,c,Tm,ym,Hh,{})}}export{Jm as default,wm as metadata};
