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,Vt,Ua,On,za,Mr,U,Kn,on,Ea,Ca,es,nn,Ia,xa,ts,sn,Za,qa,os,rn,Sa,Wa,ns,an,Ba,Fr,he,Re,ss,Pt,Aa,rs,Ra,$r,C,Gt,Va,me,Pa,ln,Ga,Xa,Xt,Qa,La,Da,fe,Ha,cn,Ya,Oa,dn,Ka,ei,ti,Ve,Nr,ue,Pe,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,Ge,Ot,vi,Kt,ki,ps,Mi,Fi,$i,R,eo,Ni,hs,Ji,ji,Xe,Ui,ge,zi,ms,Ei,Ci,fs,Ii,xi,Zi,un,to,jr,_e,Qe,us,oo,qi,gs,Si,Ur,I,no,Wi,x,Bi,_s,Ai,Ri,gn,Vi,Pi,so,Gi,Xi,_n,Qi,Li,Di,ae,ro,Hi,bs,Yi,Oi,ao,bn,Ki,ys,el,tl,yn,ol,ws,nl,sl,V,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,P,uo,Tl,ye,vl,wn,kl,Ml,Fs,Fl,$l,Nl,He,Jl,Ye,Cr,we,Oe,$s,go,jl,Ns,Ul,Ir,q,_o,zl,Te,El,Js,Cl,Il,js,xl,Zl,ql,bo,Sl,yo,Wl,Bl,Al,G,wo,Rl,ve,Vl,Tn,Pl,Gl,Us,Xl,Ql,Ll,Ke,Dl,et,xr,ke,tt,zs,To,Hl,Es,Yl,Zr,oe,vo,Ol,Me,Kl,Cs,ec,tc,ko,oc,nc,sc,X,Mo,rc,Fe,ac,vn,ic,lc,Is,cc,dc,pc,ot,hc,nt,qr,$e,st,xs,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,Cc,Ic,zo,xc,Eo,Zc,qc,Sc,z,Co,Wc,Ue,Bc,Mn,Ac,Rc,Rs,Vc,Pc,Gc,lt,Xc,ct,Qc,dt,Ar,ze,pt,Vs,Io,Lc,Ps,Dc,Rr,W,xo,Hc,Gs,Yc,Oc,Zo,Kc,qo,ed,td,od,L,So,nd,Ee,sd,Fn,rd,ad,Xs,id,ld,cd,ht,dd,mt,Vr,Ce,ft,Qs,Wo,pd,Ls,hd,Pr,B,Bo,md,Ds,fd,ud,Ao,gd,Ro,_d,bd,yd,D,Vo,wd,Ie,Td,$n,vd,kd,Hs,Md,Fd,$d,ut,Nd,gt,Gr,xe,_t,Ys,Po,Jd,Os,jd,Xr,A,Go,Ud,Ze,zd,Ks,Ed,Cd,er,Id,xd,Zd,Xo,qd,Qo,Sd,Wd,Bd,H,Lo,Ad,qe,Rd,Nn,Vd,Pd,tr,Gd,Xd,Qd,bt,Ld,yt,Qr;return n=new E({}),Wt=new E({}),Vt=new E({}),Pt=new E({}),Gt=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.31.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.31.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.31.0/src/transformers/models/fnet/configuration_fnet.py#L30"}}),Ve=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.31.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.31.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.31.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.31.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>
`}}),Xe=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.31.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.31.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.31.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.31.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.31.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.31.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.31.0/src/transformers/models/fnet/modeling_fnet.py#L515"}}),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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.31.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.31.0/src/transformers/models/fnet/modeling_fnet.py#L541",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.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.31.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.31.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.31.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.31.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.31.0/src/transformers/models/fnet/modeling_fnet.py#L624"}}),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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.31.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.31.0/src/transformers/models/fnet/modeling_fnet.py#L642",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.31.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.31.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.31.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.31.0/src/transformers/models/fnet/modeling_fnet.py#L718"}}),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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.31.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.31.0/src/transformers/models/fnet/modeling_fnet.py#L736",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.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.31.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.31.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.31.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.31.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.31.0/src/transformers/models/fnet/modeling_fnet.py#L788"}}),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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.31.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.31.0/src/transformers/models/fnet/modeling_fnet.py#L798",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.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.31.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.31.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.31.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.31.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.31.0/src/transformers/models/fnet/modeling_fnet.py#L883"}}),Co=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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.31.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.31.0/src/transformers/models/fnet/modeling_fnet.py#L895",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.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.31.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.31.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:$}}}),Io=new E({}),xo=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.31.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.31.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.31.0/src/transformers/models/fnet/modeling_fnet.py#L968"}}),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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.31.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.31.0/src/transformers/models/fnet/modeling_fnet.py#L979",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.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.31.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.31.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.31.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.31.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.31.0/src/transformers/models/fnet/modeling_fnet.py#L1047"}}),Vo=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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.31.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.31.0/src/transformers/models/fnet/modeling_fnet.py#L1060",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.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.31.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.31.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:$}}}),Po=new E({}),Go=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.31.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.31.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.31.0/src/transformers/models/fnet/modeling_fnet.py#L1116"}}),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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.31.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.31.0/src/transformers/models/fnet/modeling_fnet.py#L1128",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.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.31.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.31.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(Vt.$$.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"),Ca=m(),es=s("li"),nn=s("a"),Ia=i("Token classification task guide"),xa=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(Pt.$$.fragment),Aa=m(),rs=s("span"),Ra=i("FNetConfig"),$r=m(),C=s("div"),w(Gt.$$.fragment),Va=m(),me=s("p"),Pa=i("This is the configuration class to store the configuration of a "),ln=s("a"),Ga=i("FNetModel"),Xa=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
`),Xt=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(Ve.$$.fragment),Nr=m(),ue=s("h2"),Pe=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(),Ge=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(Xe.$$.fragment),Ui=m(),ge=s("p"),zi=i("If "),ms=s("code"),Ei=i("token_ids_1"),Ci=i(" is "),fs=s("code"),Ii=i("None"),xi=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(),I=s("div"),w(no.$$.fragment),Wi=m(),x=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"),Vi=i("AlbertTokenizerFast"),Pi=i(`. Based on
`),so=s("a"),Gi=i("Unigram"),Xi=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(),V=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(),P=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),Cr=m(),we=s("h2"),Oe=s("a"),$s=s("span"),w(go.$$.fragment),jl=m(),Ns=s("span"),Ul=i("FNetForPreTraining"),Ir=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"),Cl=i("masked language modeling"),Il=i(" head and a "),js=s("code"),xl=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(),G=s("div"),w(wo.$$.fragment),Rl=m(),ve=s("p"),Vl=i("The "),Tn=s("a"),Pl=i("FNetForPreTraining"),Gl=i(" forward method, overrides the "),Us=s("code"),Xl=i("__call__"),Ql=i(" special method."),Ll=m(),w(Ke.$$.fragment),Dl=m(),w(et.$$.fragment),xr=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 "),Cs=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(),X=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 "),Is=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"),xs=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"),Cc=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.`),Ic=m(),zo=s("p"),xc=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(Co.$$.fragment),Wc=m(),Ue=s("p"),Bc=i("The "),Mn=s("a"),Ac=i("FNetForSequenceClassification"),Rc=i(" forward method, overrides the "),Rs=s("code"),Vc=i("__call__"),Pc=i(" special method."),Gc=m(),w(lt.$$.fragment),Xc=m(),w(ct.$$.fragment),Qc=m(),w(dt.$$.fragment),Ar=m(),ze=s("h2"),pt=s("a"),Vs=s("span"),w(Io.$$.fragment),Lc=m(),Ps=s("span"),Dc=i("FNetForMultipleChoice"),Rr=m(),W=s("div"),w(xo.$$.fragment),Hc=m(),Gs=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 "),Xs=s("code"),id=i("__call__"),ld=i(" special method."),cd=m(),w(ht.$$.fragment),dd=m(),w(mt.$$.fragment),Vr=m(),Ce=s("h2"),ft=s("a"),Qs=s("span"),w(Wo.$$.fragment),pd=m(),Ls=s("span"),hd=i("FNetForTokenClassification"),Pr=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(Vo.$$.fragment),wd=m(),Ie=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),Gr=m(),xe=s("h2"),_t=s("a"),Ys=s("span"),w(Po.$$.fragment),Jd=m(),Os=s("span"),jd=i("FNetForQuestionAnswering"),Xr=m(),A=s("div"),w(Go.$$.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"),Cd=i(" and "),er=s("code"),Id=i("span end logits"),xd=i(")."),Zd=m(),Xo=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"),Vd=i("FNetForQuestionAnswering"),Pd=i(" forward method, overrides the "),tr=s("code"),Gd=i("__call__"),Xd=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(Vt.$$.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),Ca=f(ie),es=r(ie,"LI",{});var np=a(es);nn=r(np,"A",{href:!0});var sp=a(nn);Ia=l(sp,"Token classification task guide"),sp.forEach(o),np.forEach(o),xa=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(Pt.$$.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),C=r(t,"DIV",{class:!0});var wt=a(C);T(Gt.$$.fragment,wt),Va=f(wt),me=r(wt,"P",{});var Jn=a(me);Pa=l(Jn,"This is the configuration class to store the configuration of a "),ln=r(Jn,"A",{href:!0});var fp=a(ln);Ga=l(fp,"FNetModel"),fp.forEach(o),Xa=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
`),Xt=r(Jn,"A",{href:!0,rel:!0});var up=a(Xt);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(Ve.$$.fragment,wt),wt.forEach(o),Nr=f(t),ue=r(t,"H2",{class:!0});var Dr=a(ue);Pe=r(Dr,"A",{id:!0,class:!0,href:!0});var bp=a(Pe);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),Ge=r(Y,"DIV",{class:!0});var Yr=a(Ge);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(Xe.$$.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),Ci=l(zn," is "),fs=r(zn,"CODE",{});var Up=a(fs);Ii=l(Up,"None"),Up.forEach(o),xi=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 Cp=a(us);T(oo.$$.fragment,Cp),Cp.forEach(o),Ep.forEach(o),qi=f(Kr),gs=r(Kr,"SPAN",{});var Ip=a(gs);Si=l(Ip,"FNetTokenizerFast"),Ip.forEach(o),Kr.forEach(o),Ur=f(t),I=r(t,"DIV",{class:!0});var kt=a(I);T(no.$$.fragment,kt),Wi=f(kt),x=r(kt,"P",{});var le=a(x);Bi=l(le,"Construct a \u201Cfast\u201D FNetTokenizer (backed by HuggingFace\u2019s "),_s=r(le,"EM",{});var xp=a(_s);Ai=l(xp,"tokenizers"),xp.forEach(o),Ri=l(le,` library). Adapted from
`),gn=r(le,"A",{href:!0});var Zp=a(gn);Vi=l(Zp,"AlbertTokenizerFast"),Zp.forEach(o),Pi=l(le,`. Based on
`),so=r(le,"A",{href:!0,rel:!0});var qp=a(so);Gi=l(qp,"Unigram"),qp.forEach(o),Xi=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),V=r(kt,"DIV",{class:!0});var Mt=a(V);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 Vp=a(vs);cl=l(Vp,"if token_ids_1 is None, only returns the first portion of the mask (0s)."),Vp.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 Pp=a(De);ks=r(Pp,"SPAN",{});var Gp=a(ks);T(lo.$$.fragment,Gp),Gp.forEach(o),Pp.forEach(o),dl=f(ta),Ms=r(ta,"SPAN",{});var Xp=a(Ms);pl=l(Xp,"FNetModel"),Xp.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),P=r(Ft,"DIV",{class:!0});var $t=a(P);T(uo.$$.fragment,$t),Tl=f($t),ye=r($t,"P",{});var Cn=a(ye);vl=l(Cn,"The "),wn=r(Cn,"A",{href:!0});var Dp=a(wn);kl=l(Dp,"FNetModel"),Dp.forEach(o),Ml=l(Cn," forward method, overrides the "),Fs=r(Cn,"CODE",{});var Hp=a(Fs);Fl=l(Hp,"__call__"),Hp.forEach(o),$l=l(Cn," special method."),Cn.forEach(o),Nl=f($t),T(He.$$.fragment,$t),Jl=f($t),T(Ye.$$.fragment,$t),$t.forEach(o),Ft.forEach(o),Cr=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),Ir=f(t),q=r(t,"DIV",{class:!0});var Nt=a(q);T(_o.$$.fragment,Nt),zl=f(Nt),Te=r(Nt,"P",{});var In=a(Te);El=l(In,"FNet Model with two heads on top as done during the pretraining: a "),Js=r(In,"CODE",{});var eh=a(Js);Cl=l(eh,"masked language modeling"),eh.forEach(o),Il=l(In," head and a "),js=r(In,"CODE",{});var th=a(js);xl=l(th,"next sentence prediction (classification)"),th.forEach(o),Zl=l(In," head."),In.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),G=r(Nt,"DIV",{class:!0});var Jt=a(G);T(wo.$$.fragment,Jt),Rl=f(Jt),ve=r(Jt,"P",{});var xn=a(ve);Vl=l(xn,"The "),Tn=r(xn,"A",{href:!0});var nh=a(Tn);Pl=l(nh,"FNetForPreTraining"),nh.forEach(o),Gl=l(xn," forward method, overrides the "),Us=r(xn,"CODE",{});var sh=a(Us);Xl=l(sh,"__call__"),sh.forEach(o),Ql=l(xn," special method."),xn.forEach(o),Ll=f(Jt),T(Ke.$$.fragment,Jt),Dl=f(Jt),T(et.$$.fragment,Jt),Jt.forEach(o),Nt.forEach(o),xr=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 "),Cs=r(qn,"CODE",{});var lh=a(Cs);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),X=r(Zn,"DIV",{class:!0});var jt=a(X);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 "),Is=r(Sn,"CODE",{});var ph=a(Is);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);xs=r(hh,"SPAN",{});var mh=a(xs);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);Cc=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),Ic=f(zt),zo=r(zt,"P",{});var ca=a(zo);xc=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(Co.$$.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);Vc=l(Fh,"__call__"),Fh.forEach(o),Pc=l(Rn," special method."),Rn.forEach(o),Gc=f(ce),T(lt.$$.fragment,ce),Xc=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);Vs=r($h,"SPAN",{});var Nh=a(Vs);T(Io.$$.fragment,Nh),Nh.forEach(o),$h.forEach(o),Lc=f(da),Ps=r(da,"SPAN",{});var Jh=a(Ps);Dc=l(Jh,"FNetForMultipleChoice"),Jh.forEach(o),da.forEach(o),Rr=f(t),W=r(t,"DIV",{class:!0});var Et=a(W);T(xo.$$.fragment,Et),Hc=f(Et),Gs=r(Et,"P",{});var jh=a(Gs);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 Ct=a(L);T(So.$$.fragment,Ct),nd=f(Ct),Ee=r(Ct,"P",{});var Vn=a(Ee);sd=l(Vn,"The "),Fn=r(Vn,"A",{href:!0});var zh=a(Fn);rd=l(zh,"FNetForMultipleChoice"),zh.forEach(o),ad=l(Vn," forward method, overrides the "),Xs=r(Vn,"CODE",{});var Eh=a(Xs);id=l(Eh,"__call__"),Eh.forEach(o),ld=l(Vn," special method."),Vn.forEach(o),cd=f(Ct),T(ht.$$.fragment,Ct),dd=f(Ct),T(mt.$$.fragment,Ct),Ct.forEach(o),Et.forEach(o),Vr=f(t),Ce=r(t,"H2",{class:!0});var ha=a(Ce);ft=r(ha,"A",{id:!0,class:!0,href:!0});var Ch=a(ft);Qs=r(Ch,"SPAN",{});var Ih=a(Qs);T(Wo.$$.fragment,Ih),Ih.forEach(o),Ch.forEach(o),pd=f(ha),Ls=r(ha,"SPAN",{});var xh=a(Ls);hd=l(xh,"FNetForTokenClassification"),xh.forEach(o),ha.forEach(o),Pr=f(t),B=r(t,"DIV",{class:!0});var It=a(B);T(Bo.$$.fragment,It),md=f(It),Ds=r(It,"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(It),Ao=r(It,"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(It),D=r(It,"DIV",{class:!0});var xt=a(D);T(Vo.$$.fragment,xt),wd=f(xt),Ie=r(xt,"P",{});var Pn=a(Ie);Td=l(Pn,"The "),$n=r(Pn,"A",{href:!0});var Sh=a($n);vd=l(Sh,"FNetForTokenClassification"),Sh.forEach(o),kd=l(Pn," forward method, overrides the "),Hs=r(Pn,"CODE",{});var Wh=a(Hs);Md=l(Wh,"__call__"),Wh.forEach(o),Fd=l(Pn," special method."),Pn.forEach(o),$d=f(xt),T(ut.$$.fragment,xt),Nd=f(xt),T(gt.$$.fragment,xt),xt.forEach(o),It.forEach(o),Gr=f(t),xe=r(t,"H2",{class:!0});var fa=a(xe);_t=r(fa,"A",{id:!0,class:!0,href:!0});var Bh=a(_t);Ys=r(Bh,"SPAN",{});var Ah=a(Ys);T(Po.$$.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),Xr=f(t),A=r(t,"DIV",{class:!0});var Zt=a(A);T(Go.$$.fragment,Zt),Ud=f(Zt),Ze=r(Zt,"P",{});var Gn=a(Ze);zd=l(Gn,`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(Gn,"CODE",{});var Vh=a(Ks);Ed=l(Vh,"span start logits"),Vh.forEach(o),Cd=l(Gn," and "),er=r(Gn,"CODE",{});var Ph=a(er);Id=l(Ph,"span end logits"),Ph.forEach(o),xd=l(Gn,")."),Gn.forEach(o),Zd=f(Zt),Xo=r(Zt,"P",{});var ua=a(Xo);qd=l(ua,"This model is a PyTorch "),Qo=r(ua,"A",{href:!0,rel:!0});var Gh=a(Qo);Sd=l(Gh,"torch.nn.Module"),Gh.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 Xn=a(qe);Rd=l(Xn,"The "),Nn=r(Xn,"A",{href:!0});var Xh=a(Nn);Vd=l(Xh,"FNetForQuestionAnswering"),Xh.forEach(o),Pd=l(Xn," forward method, overrides the "),tr=r(Xn,"CODE",{});var Qh=a(tr);Gd=l(Qh,"__call__"),Qh.forEach(o),Xd=l(Xn," special method."),Xn.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.31.0/en/model_doc/fnet#transformers.FNetModel"),h(Xt,"href","https://huggingface.co/google/fnet-base"),h(Xt,"rel","nofollow"),h(cn,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),h(dn,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),h(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Pe,"id","transformers.FNetTokenizer"),h(Pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Pe,"href","#transformers.FNetTokenizer"),h(ue,"class","relative group"),h(pn,"href","/docs/transformers/v4.31.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.31.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(Ge,"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.31.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.31.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(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(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(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.31.0/en/model_doc/fnet#transformers.FNetModel"),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(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.31.0/en/model_doc/fnet#transformers.FNetForPreTraining"),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(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.31.0/en/model_doc/fnet#transformers.FNetForMaskedLM"),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(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.31.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.31.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.31.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(Ce,"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.31.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(xe,"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.31.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(Vt,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,Ca),e(U,es),e(es,nn),e(nn,Ia),e(U,xa),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(Pt,ss,null),e(he,Aa),e(he,rs),e(rs,Ra),b(t,$r,g),b(t,C,g),v(Gt,C,null),e(C,Va),e(C,me),e(me,Pa),e(me,ln),e(ln,Ga),e(me,Xa),e(me,Xt),e(Xt,Qa),e(me,La),e(C,Da),e(C,fe),e(fe,Ha),e(fe,cn),e(cn,Ya),e(fe,Oa),e(fe,dn),e(dn,Ka),e(fe,ei),e(C,ti),v(Ve,C,null),b(t,Nr,g),b(t,ue,g),e(ue,Pe),e(Pe,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,Ge),v(Ot,Ge,null),e(Ge,vi),e(Ge,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(Xe,R,null),e(R,Ui),e(R,ge),e(ge,zi),e(ge,ms),e(ms,Ei),e(ge,Ci),e(ge,fs),e(fs,Ii),e(ge,xi),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,I,g),v(no,I,null),e(I,Wi),e(I,x),e(x,Bi),e(x,_s),e(_s,Ai),e(x,Ri),e(x,gn),e(gn,Vi),e(x,Pi),e(x,so),e(so,Gi),e(x,Xi),e(x,_n),e(_n,Qi),e(x,Li),e(I,Di),e(I,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(I,sl),e(I,V),v(io,V,null),e(V,rl),e(V,Ts),e(Ts,al),e(V,il),v(Le,V,null),e(V,ll),e(V,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,P),v(uo,P,null),e(P,Tl),e(P,ye),e(ye,vl),e(ye,wn),e(wn,kl),e(ye,Ml),e(ye,Fs),e(Fs,Fl),e(ye,$l),e(P,Nl),v(He,P,null),e(P,Jl),v(Ye,P,null),b(t,Cr,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,Ir,g),b(t,q,g),v(_o,q,null),e(q,zl),e(q,Te),e(Te,El),e(Te,Js),e(Js,Cl),e(Te,Il),e(Te,js),e(js,xl),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,G),v(wo,G,null),e(G,Rl),e(G,ve),e(ve,Vl),e(ve,Tn),e(Tn,Pl),e(ve,Gl),e(ve,Us),e(Us,Xl),e(ve,Ql),e(G,Ll),v(Ke,G,null),e(G,Dl),v(et,G,null),b(t,xr,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,Cs),e(Cs,ec),e(Me,tc),e(Me,ko),e(ko,oc),e(Me,nc),e(oe,sc),e(oe,X),v(Mo,X,null),e(X,rc),e(X,Fe),e(Fe,ac),e(Fe,vn),e(vn,ic),e(Fe,lc),e(Fe,Is),e(Is,cc),e(Fe,dc),e(X,pc),v(ot,X,null),e(X,hc),v(nt,X,null),b(t,qr,g),b(t,$e,g),e($e,st),e(st,xs),v(Fo,xs,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,Cc),e(S,Ic),e(S,zo),e(zo,xc),e(zo,Eo),e(Eo,Zc),e(zo,qc),e(S,Sc),e(S,z),v(Co,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,Vc),e(Ue,Pc),e(z,Gc),v(lt,z,null),e(z,Xc),v(ct,z,null),e(z,Qc),v(dt,z,null),b(t,Ar,g),b(t,ze,g),e(ze,pt),e(pt,Vs),v(Io,Vs,null),e(ze,Lc),e(ze,Ps),e(Ps,Dc),b(t,Rr,g),b(t,W,g),v(xo,W,null),e(W,Hc),e(W,Gs),e(Gs,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,Xs),e(Xs,id),e(Ee,ld),e(L,cd),v(ht,L,null),e(L,dd),v(mt,L,null),b(t,Vr,g),b(t,Ce,g),e(Ce,ft),e(ft,Qs),v(Wo,Qs,null),e(Ce,pd),e(Ce,Ls),e(Ls,hd),b(t,Pr,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(Vo,D,null),e(D,wd),e(D,Ie),e(Ie,Td),e(Ie,$n),e($n,vd),e(Ie,kd),e(Ie,Hs),e(Hs,Md),e(Ie,Fd),e(D,$d),v(ut,D,null),e(D,Nd),v(gt,D,null),b(t,Gr,g),b(t,xe,g),e(xe,_t),e(_t,Ys),v(Po,Ys,null),e(xe,Jd),e(xe,Os),e(Os,jd),b(t,Xr,g),b(t,A,g),v(Go,A,null),e(A,Ud),e(A,Ze),e(Ze,zd),e(Ze,Ks),e(Ks,Ed),e(Ze,Cd),e(Ze,er),e(er,Id),e(Ze,xd),e(A,Zd),e(A,Xo),e(Xo,qd),e(Xo,Qo),e(Qo,Sd),e(Xo,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,Vd),e(qe,Pd),e(qe,tr),e(tr,Gd),e(qe,Xd),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}),Ve.$set(Do);const or={};g&2&&(or.$$scope={dirty:g,ctx:t}),Xe.$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(Vt.$$.fragment,t),k(Pt.$$.fragment,t),k(Gt.$$.fragment,t),k(Ve.$$.fragment,t),k(Qt.$$.fragment,t),k(Lt.$$.fragment,t),k(Ht.$$.fragment,t),k(Ot.$$.fragment,t),k(eo.$$.fragment,t),k(Xe.$$.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(Co.$$.fragment,t),k(lt.$$.fragment,t),k(ct.$$.fragment,t),k(dt.$$.fragment,t),k(Io.$$.fragment,t),k(xo.$$.fragment,t),k(So.$$.fragment,t),k(ht.$$.fragment,t),k(mt.$$.fragment,t),k(Wo.$$.fragment,t),k(Bo.$$.fragment,t),k(Vo.$$.fragment,t),k(ut.$$.fragment,t),k(gt.$$.fragment,t),k(Po.$$.fragment,t),k(Go.$$.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(Vt.$$.fragment,t),M(Pt.$$.fragment,t),M(Gt.$$.fragment,t),M(Ve.$$.fragment,t),M(Qt.$$.fragment,t),M(Lt.$$.fragment,t),M(Ht.$$.fragment,t),M(Ot.$$.fragment,t),M(eo.$$.fragment,t),M(Xe.$$.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(Co.$$.fragment,t),M(lt.$$.fragment,t),M(ct.$$.fragment,t),M(dt.$$.fragment,t),M(Io.$$.fragment,t),M(xo.$$.fragment,t),M(So.$$.fragment,t),M(ht.$$.fragment,t),M(mt.$$.fragment,t),M(Wo.$$.fragment,t),M(Bo.$$.fragment,t),M(Vo.$$.fragment,t),M(ut.$$.fragment,t),M(gt.$$.fragment,t),M(Po.$$.fragment,t),M(Go.$$.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(Vt),t&&o(Mr),t&&o(U),t&&o(Fr),t&&o(he),F(Pt),t&&o($r),t&&o(C),F(Gt),F(Ve),t&&o(Nr),t&&o(ue),F(Qt),t&&o(Jr),t&&o(j),F(Lt),F(Ht),F(Ot),F(eo),F(Xe),F(to),t&&o(jr),t&&o(_e),F(oo),t&&o(Ur),t&&o(I),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(Cr),t&&o(we),F(go),t&&o(Ir),t&&o(q),F(_o),F(wo),F(Ke),F(et),t&&o(xr),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(Co),F(lt),F(ct),F(dt),t&&o(Ar),t&&o(ze),F(Io),t&&o(Rr),t&&o(W),F(xo),F(So),F(ht),F(mt),t&&o(Vr),t&&o(Ce),F(Wo),t&&o(Pr),t&&o(B),F(Bo),F(Vo),F(ut),F(gt),t&&o(Gr),t&&o(xe),F(Po),t&&o(Xr),t&&o(A),F(Go),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};
