import{S as US,i as NS,s as WS,e as s,k as c,w as T,t as o,M as PS,c as a,d as t,m as p,a as r,x as k,h as n,b as h,N as IS,G as e,g,y as w,q as M,o as $,B as F,v as qS,L as Te}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ae}from"../../chunks/Tip-hf-doc-builder.js";import{D as N}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ke}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Pe}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ve}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as kM}from"../../chunks/PipelineTag-hf-doc-builder.js";function AS(B){let d,y,u,f,b;return f=new ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJlcnRDb25maWclMkMlMjBCZXJ0TW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQkVSVCUyMGJlcnQtYmFzZS11bmNhc2VkJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMEJlcnRDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwYmVydC1iYXNlLXVuY2FzZWQlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMEJlcnRNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertConfig, BertModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a BERT bert-base-uncased style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = BertConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the bert-base-uncased style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){d=s("p"),y=o("Examples:"),u=c(),T(f.$$.fragment)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Examples:"),m.forEach(t),u=p(l),k(f.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,u,m),w(f,l,m),b=!0},p:Te,i(l){b||(M(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function ZS(B){let d,y,u,f,b;return f=new ke({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMEElN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTIwJTIwJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){d=s("p"),y=o("pair mask has the following format:"),u=c(),T(f.$$.fragment)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"pair mask has the following format:"),m.forEach(t),u=p(l),k(f.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,u,m),w(f,l,m),b=!0},p:Te,i(l){b||(M(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function RS(B){let d,y,u,f,b;return f=new ke({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMEElN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTIwJTIwJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){d=s("p"),y=o("pair mask has the following format:"),u=c(),T(f.$$.fragment)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"pair mask has the following format:"),m.forEach(t),u=p(l),k(f.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,u,m),w(f,l,m),b=!0},p:Te,i(l){b||(M(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function VS(B){let d,y,u,f,b;return f=new ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQmVydFRva2VuaXplciUwQSUwQXRmX3Rva2VuaXplciUyMCUzRCUyMFRGQmVydFRva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyYmVydC1iYXNlLXVuY2FzZWQlMjIp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFBertTokenizer

tf_tokenizer = TFBertTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)`}}),{c(){d=s("p"),y=o("Examples:"),u=c(),T(f.$$.fragment)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Examples:"),m.forEach(t),u=p(l),k(f.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,u,m),w(f,l,m),b=!0},p:Te,i(l){b||(M(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function GS(B){let d,y,u,f,b;return f=new ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkJlcnRUb2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJiZXJ0LWJhc2UtdW5jYXNlZCUyMiklMEF0Zl90b2tlbml6ZXIlMjAlM0QlMjBURkJlcnRUb2tlbml6ZXIuZnJvbV90b2tlbml6ZXIodG9rZW5pemVyKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFBertTokenizer

tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
tf_tokenizer = TFBertTokenizer.from_tokenizer(tokenizer)`}}),{c(){d=s("p"),y=o("Examples:"),u=c(),T(f.$$.fragment)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Examples:"),m.forEach(t),u=p(l),k(f.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,u,m),w(f,l,m),b=!0},p:Te,i(l){b||(M(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function SS(B){let d,y,u,f,b;return{c(){d=s("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),f=o("Module"),b=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(m,"CODE",{});var E=r(u);f=n(E,"Module"),E.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,u),e(u,f),e(d,b)},d(l){l&&t(d)}}}function XS(B){let d,y,u,f,b;return f=new ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBCZXJ0TW9kZWwlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmJlcnQtYmFzZS11bmNhc2VkJTIyKSUwQW1vZGVsJTIwJTNEJTIwQmVydE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJiZXJ0LWJhc2UtdW5jYXNlZCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BertModel
<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;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertModel.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){d=s("p"),y=o("Example:"),u=c(),T(f.$$.fragment)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Example:"),m.forEach(t),u=p(l),k(f.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,u,m),w(f,l,m),b=!0},p:Te,i(l){b||(M(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function LS(B){let d,y,u,f,b;return{c(){d=s("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),f=o("Module"),b=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(m,"CODE",{});var E=r(u);f=n(E,"Module"),E.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,u),e(u,f),e(d,b)},d(l){l&&t(d)}}}function OS(B){let d,y,u,f,b;return f=new ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBCZXJ0Rm9yUHJlVHJhaW5pbmclMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmJlcnQtYmFzZS11bmNhc2VkJTIyKSUwQW1vZGVsJTIwJTNEJTIwQmVydEZvclByZVRyYWluaW5nLmZyb21fcHJldHJhaW5lZCglMjJiZXJ0LWJhc2UtdW5jYXNlZCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQXByZWRpY3Rpb25fbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5wcmVkaWN0aW9uX2xvZ2l0cyUwQXNlcV9yZWxhdGlvbnNoaXBfbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5zZXFfcmVsYXRpb25zaGlwX2xvZ2l0cw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BertForPreTraining
<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;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertForPreTraining.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>prediction_logits = outputs.prediction_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>seq_relationship_logits = outputs.seq_relationship_logits`}}),{c(){d=s("p"),y=o("Example:"),u=c(),T(f.$$.fragment)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Example:"),m.forEach(t),u=p(l),k(f.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,u,m),w(f,l,m),b=!0},p:Te,i(l){b||(M(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function DS(B){let d,y,u,f,b;return{c(){d=s("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),f=o("Module"),b=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(m,"CODE",{});var E=r(u);f=n(E,"Module"),E.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,u),e(u,f),e(d,b)},d(l){l&&t(d)}}}function QS(B){let d,y,u,f,b;return f=new ke({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEJlcnRMTUhlYWRNb2RlbCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmJlcnQtYmFzZS11bmNhc2VkJTIyKSUwQW1vZGVsJTIwJTNEJTIwQmVydExNSGVhZE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJiZXJ0LWJhc2UtdW5jYXNlZCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzJTJDJTIwbGFiZWxzJTNEaW5wdXRzJTVCJTIyaW5wdXRfaWRzJTIyJTVEKSUwQWxvc3MlMjAlM0QlMjBvdXRwdXRzLmxvc3MlMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",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, BertLMHeadModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertLMHeadModel.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&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, labels=inputs[<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=s("p"),y=o("Example:"),u=c(),T(f.$$.fragment)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Example:"),m.forEach(t),u=p(l),k(f.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,u,m),w(f,l,m),b=!0},p:Te,i(l){b||(M(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function HS(B){let d,y,u,f,b;return{c(){d=s("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),f=o("Module"),b=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(m,"CODE",{});var E=r(u);f=n(E,"Module"),E.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,u),e(u,f),e(d,b)},d(l){l&&t(d)}}}function YS(B){let d,y,u,f,b;return f=new ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBCZXJ0Rm9yTWFza2VkTE0lMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmJlcnQtYmFzZS11bmNhc2VkJTIyKSUwQW1vZGVsJTIwJTNEJTIwQmVydEZvck1hc2tlZExNLmZyb21fcHJldHJhaW5lZCglMjJiZXJ0LWJhc2UtdW5jYXNlZCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyVGhlJTIwY2FwaXRhbCUyMG9mJTIwRnJhbmNlJTIwaXMlMjAlNUJNQVNLJTVELiUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjByZXRyaWV2ZSUyMGluZGV4JTIwb2YlMjAlNUJNQVNLJTVEJTBBbWFza190b2tlbl9pbmRleCUyMCUzRCUyMChpbnB1dHMuaW5wdXRfaWRzJTIwJTNEJTNEJTIwdG9rZW5pemVyLm1hc2tfdG9rZW5faWQpJTVCMCU1RC5ub256ZXJvKGFzX3R1cGxlJTNEVHJ1ZSklNUIwJTVEJTBBJTBBcHJlZGljdGVkX3Rva2VuX2lkJTIwJTNEJTIwbG9naXRzJTVCMCUyQyUyMG1hc2tfdG9rZW5faW5kZXglNUQuYXJnbWF4KGF4aXMlM0QtMSklMEF0b2tlbml6ZXIuZGVjb2RlKHByZWRpY3RlZF90b2tlbl9pZCklMEElMEFsYWJlbHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyVGhlJTIwY2FwaXRhbCUyMG9mJTIwRnJhbmNlJTIwaXMlMjBQYXJpcy4lMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSU1QiUyMmlucHV0X2lkcyUyMiU1RCUwQSUyMyUyMG1hc2slMjBsYWJlbHMlMjBvZiUyMG5vbi0lNUJNQVNLJTVEJTIwdG9rZW5zJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2gud2hlcmUoaW5wdXRzLmlucHV0X2lkcyUyMCUzRCUzRCUyMHRva2VuaXplci5tYXNrX3Rva2VuX2lkJTJDJTIwbGFiZWxzJTJDJTIwLTEwMCklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBsYWJlbHMlM0RsYWJlbHMpJTBBcm91bmQob3V0cHV0cy5sb3NzLml0ZW0oKSUyQyUyMDIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BertForMaskedLM
<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;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertForMaskedLM.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(outputs.loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">0.88</span>`}}),{c(){d=s("p"),y=o("Example:"),u=c(),T(f.$$.fragment)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Example:"),m.forEach(t),u=p(l),k(f.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,u,m),w(f,l,m),b=!0},p:Te,i(l){b||(M(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function KS(B){let d,y,u,f,b;return{c(){d=s("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),f=o("Module"),b=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(m,"CODE",{});var E=r(u);f=n(E,"Module"),E.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,u),e(u,f),e(d,b)},d(l){l&&t(d)}}}function eX(B){let d,y,u,f,b;return f=new ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBCZXJ0Rm9yTmV4dFNlbnRlbmNlUHJlZGljdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyYmVydC1iYXNlLXVuY2FzZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBCZXJ0Rm9yTmV4dFNlbnRlbmNlUHJlZGljdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyYmVydC1iYXNlLXVuY2FzZWQlMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIySW4lMjBJdGFseSUyQyUyMHBpenphJTIwc2VydmVkJTIwaW4lMjBmb3JtYWwlMjBzZXR0aW5ncyUyQyUyMHN1Y2glMjBhcyUyMGF0JTIwYSUyMHJlc3RhdXJhbnQlMkMlMjBpcyUyMHByZXNlbnRlZCUyMHVuc2xpY2VkLiUyMiUwQW5leHRfc2VudGVuY2UlMjAlM0QlMjAlMjJUaGUlMjBza3klMjBpcyUyMGJsdWUlMjBkdWUlMjB0byUyMHRoZSUyMHNob3J0ZXIlMjB3YXZlbGVuZ3RoJTIwb2YlMjBibHVlJTIwbGlnaHQuJTIyJTBBZW5jb2RpbmclMjAlM0QlMjB0b2tlbml6ZXIocHJvbXB0JTJDJTIwbmV4dF9zZW50ZW5jZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqZW5jb2RpbmclMkMlMjBsYWJlbHMlM0R0b3JjaC5Mb25nVGVuc29yKCU1QjElNUQpKSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRzJTBBYXNzZXJ0JTIwbG9naXRzJTVCMCUyQyUyMDAlNUQlMjAlM0MlMjBsb2dpdHMlNUIwJTJDJTIwMSU1RCUyMCUyMCUyMyUyMG5leHQlMjBzZW50ZW5jZSUyMHdhcyUyMHJhbmRvbQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BertForNextSentencePrediction
<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;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertForNextSentencePrediction.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>next_sentence = <span class="hljs-string">&quot;The sky is blue due to the shorter wavelength of blue light.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer(prompt, next_sentence, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoding, labels=torch.LongTensor([<span class="hljs-number">1</span>]))
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> logits[<span class="hljs-number">0</span>, <span class="hljs-number">0</span>] &lt; logits[<span class="hljs-number">0</span>, <span class="hljs-number">1</span>]  <span class="hljs-comment"># next sentence was random</span>`}}),{c(){d=s("p"),y=o("Example:"),u=c(),T(f.$$.fragment)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Example:"),m.forEach(t),u=p(l),k(f.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,u,m),w(f,l,m),b=!0},p:Te,i(l){b||(M(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function tX(B){let d,y,u,f,b;return{c(){d=s("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),f=o("Module"),b=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(m,"CODE",{});var E=r(u);f=n(E,"Module"),E.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,u),e(u,f),e(d,b)},d(l){l&&t(d)}}}function oX(B){let d,y,u,f,b;return f=new ke({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEJlcnRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydGV4dGF0dGFjayUyRmJlcnQtYmFzZS11bmNhc2VkLXllbHAtcG9sYXJpdHklMjIpJTBBbW9kZWwlMjAlM0QlMjBCZXJ0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydGV4dGF0dGFjayUyRmJlcnQtYmFzZS11bmNhc2VkLXllbHAtcG9sYXJpdHklMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX2NsYXNzX2lkJTIwJTNEJTIwbG9naXRzLmFyZ21heCgpLml0ZW0oKSUwQW1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9jbGFzc19pZCU1RCUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyMEJlcnRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ0ZXh0YXR0YWNrJTJGYmVydC1iYXNlLXVuY2FzZWQteWVscC1wb2xhcml0eSUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcyUwQXJvdW5kKGxvc3MuaXRlbSgpJTJDJTIwMik=",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, BertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;textattack/bert-base-uncased-yelp-polarity&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;textattack/bert-base-uncased-yelp-polarity&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = logits.argmax().item()
<span class="hljs-meta">&gt;&gt;&gt; </span>model.config.id2label[predicted_class_id]
<span class="hljs-string">&#x27;LABEL_1&#x27;</span>

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

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">0.01</span>`}}),{c(){d=s("p"),y=o("Example of single-label classification:"),u=c(),T(f.$$.fragment)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Example of single-label classification:"),m.forEach(t),u=p(l),k(f.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,u,m),w(f,l,m),b=!0},p:Te,i(l){b||(M(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function nX(B){let d,y,u,f,b;return f=new ke({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEJlcnRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydGV4dGF0dGFjayUyRmJlcnQtYmFzZS11bmNhc2VkLXllbHAtcG9sYXJpdHklMjIpJTBBbW9kZWwlMjAlM0QlMjBCZXJ0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydGV4dGF0dGFjayUyRmJlcnQtYmFzZS11bmNhc2VkLXllbHAtcG9sYXJpdHklMjIlMkMlMjBwcm9ibGVtX3R5cGUlM0QlMjJtdWx0aV9sYWJlbF9jbGFzc2lmaWNhdGlvbiUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWRzJTIwJTNEJTIwdG9yY2guYXJhbmdlKDAlMkMlMjBsb2dpdHMuc2hhcGUlNUItMSU1RCklNUJ0b3JjaC5zaWdtb2lkKGxvZ2l0cykuc3F1ZWV6ZShkaW0lM0QwKSUyMCUzRSUyMDAuNSU1RCUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyMEJlcnRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJ0ZXh0YXR0YWNrJTJGYmVydC1iYXNlLXVuY2FzZWQteWVscC1wb2xhcml0eSUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIlMEEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2guc3VtKCUwQSUyMCUyMCUyMCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwub25lX2hvdChwcmVkaWN0ZWRfY2xhc3NfaWRzJTVCTm9uZSUyQyUyMCUzQSU1RC5jbG9uZSgpJTJDJTIwbnVtX2NsYXNzZXMlM0RudW1fbGFiZWxzKSUyQyUyMGRpbSUzRDElMEEpLnRvKHRvcmNoLmZsb2F0KSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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, BertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;textattack/bert-base-uncased-yelp-polarity&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;textattack/bert-base-uncased-yelp-polarity&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 = BertForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;textattack/bert-base-uncased-yelp-polarity&quot;</span>, num_labels=num_labels, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>
<span class="hljs-meta">... </span>)

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

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">0.01</span>`}}),{c(){d=s("p"),y=o("Example:"),u=c(),T(f.$$.fragment)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Example:"),m.forEach(t),u=p(l),k(f.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,u,m),w(f,l,m),b=!0},p:Te,i(l){b||(M(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function lX(B){let d,y,u,f,b;return{c(){d=s("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),f=o("Module"),b=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(m,"CODE",{});var E=r(u);f=n(E,"Module"),E.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,u),e(u,f),e(d,b)},d(l){l&&t(d)}}}function dX(B){let d,y,u,f,b;return f=new ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBCZXJ0Rm9yUXVlc3Rpb25BbnN3ZXJpbmclMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmRlZXBzZXQlMkZiZXJ0LWJhc2UtY2FzZWQtc3F1YWQyJTIyKSUwQW1vZGVsJTIwJTNEJTIwQmVydEZvclF1ZXN0aW9uQW5zd2VyaW5nLmZyb21fcHJldHJhaW5lZCglMjJkZWVwc2V0JTJGYmVydC1iYXNlLWNhc2VkLXNxdWFkMiUyMiklMEElMEFxdWVzdGlvbiUyQyUyMHRleHQlMjAlM0QlMjAlMjJXaG8lMjB3YXMlMjBKaW0lMjBIZW5zb24lM0YlMjIlMkMlMjAlMjJKaW0lMjBIZW5zb24lMjB3YXMlMjBhJTIwbmljZSUyMHB1cHBldCUyMiUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihxdWVzdGlvbiUyQyUyMHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBYW5zd2VyX3N0YXJ0X2luZGV4JTIwJTNEJTIwb3V0cHV0cy5zdGFydF9sb2dpdHMuYXJnbWF4KCklMEFhbnN3ZXJfZW5kX2luZGV4JTIwJTNEJTIwb3V0cHV0cy5lbmRfbG9naXRzLmFyZ21heCgpJTBBJTBBcHJlZGljdF9hbnN3ZXJfdG9rZW5zJTIwJTNEJTIwaW5wdXRzLmlucHV0X2lkcyU1QjAlMkMlMjBhbnN3ZXJfc3RhcnRfaW5kZXglMjAlM0ElMjBhbnN3ZXJfZW5kX2luZGV4JTIwJTJCJTIwMSU1RCUwQXRva2VuaXplci5kZWNvZGUocHJlZGljdF9hbnN3ZXJfdG9rZW5zJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTBBJTBBJTIzJTIwdGFyZ2V0JTIwaXMlMjAlMjJuaWNlJTIwcHVwcGV0JTIyJTBBdGFyZ2V0X3N0YXJ0X2luZGV4JTIwJTNEJTIwdG9yY2gudGVuc29yKCU1QjE0JTVEKSUwQXRhcmdldF9lbmRfaW5kZXglMjAlM0QlMjB0b3JjaC50ZW5zb3IoJTVCMTUlNUQpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzJTJDJTIwc3RhcnRfcG9zaXRpb25zJTNEdGFyZ2V0X3N0YXJ0X2luZGV4JTJDJTIwZW5kX3Bvc2l0aW9ucyUzRHRhcmdldF9lbmRfaW5kZXgpJTBBbG9zcyUyMCUzRCUyMG91dHB1dHMubG9zcyUwQXJvdW5kKGxvc3MuaXRlbSgpJTJDJTIwMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BertForQuestionAnswering
<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;deepset/bert-base-cased-squad2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BertForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;deepset/bert-base-cased-squad2&quot;</span>)

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.decode(predict_answer_tokens, skip_special_tokens=<span class="hljs-literal">True</span>)
<span class="hljs-string">&#x27;a nice puppet&#x27;</span>

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertModel.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertForPreTraining.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, add_special_tokens=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>prediction_logits, seq_relationship_logits = outputs[:<span class="hljs-number">2</span>]`}}),{c(){d=s("p"),y=o("Examples:"),u=c(),T(f.$$.fragment)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Examples:"),m.forEach(t),u=p(l),k(f.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,u,m),w(f,l,m),b=!0},p:Te,i(l){b||(M(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function gX(B){let d,y,u,f,b;return f=new ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkJlcnRMTUhlYWRNb2RlbCUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyYmVydC1iYXNlLXVuY2FzZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBURkJlcnRMTUhlYWRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyYmVydC1iYXNlLXVuY2FzZWQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbChpbnB1dHMpJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFBertLMHeadModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertLMHeadModel.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertForMaskedLM.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertForNextSentencePrediction.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&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;tf&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;ydshieh/bert-base-uncased-yelp-polarity&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;ydshieh/bert-base-uncased-yelp-polarity&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>model.config.id2label[predicted_class_id]
<span class="hljs-string">&#x27;LABEL_1&#x27;</span>`}}),{c(){d=s("p"),y=o("Example:"),u=c(),T(f.$$.fragment)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Example:"),m.forEach(t),u=p(l),k(f.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,u,m),w(f,l,m),b=!0},p:Te,i(l){b||(M(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function BX(B){let d,y;return d=new ke({props:{code:"JTIzJTIwVG8lMjB0cmFpbiUyMGElMjBtb2RlbCUyMG9uJTIwJTYwbnVtX2xhYmVscyU2MCUyMGNsYXNzZXMlMkMlMjB5b3UlMjBjYW4lMjBwYXNzJTIwJTYwbnVtX2xhYmVscyUzRG51bV9sYWJlbHMlNjAlMjB0byUyMCU2MC5mcm9tX3ByZXRyYWluZWQoLi4uKSU2MCUwQW51bV9sYWJlbHMlMjAlM0QlMjBsZW4obW9kZWwuY29uZmlnLmlkMmxhYmVsKSUwQW1vZGVsJTIwJTNEJTIwVEZCZXJ0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyeWRzaGllaCUyRmJlcnQtYmFzZS11bmNhc2VkLXllbHAtcG9sYXJpdHklMjIlMkMlMjBudW1fbGFiZWxzJTNEbnVtX2xhYmVscyklMEElMEFsYWJlbHMlMjAlM0QlMjB0Zi5jb25zdGFudCgxKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcyUwQXJvdW5kKGZsb2F0KGxvc3MpJTJDJTIwMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;ydshieh/bert-base-uncased-yelp-polarity&quot;</span>, num_labels=num_labels)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;dbmdz/bert-large-cased-finetuned-conll03-english&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertForTokenClassification.from_pretrained(<span class="hljs-string">&quot;dbmdz/bert-large-cased-finetuned-conll03-english&quot;</span>)

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;ydshieh/bert-base-cased-squad2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBertForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;ydshieh/bert-base-cased-squad2&quot;</span>)

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.decode(predict_answer_tokens)
<span class="hljs-string">&#x27;a nice puppet&#x27;</span>`}}),{c(){d=s("p"),y=o("Example:"),u=c(),T(f.$$.fragment)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Example:"),m.forEach(t),u=p(l),k(f.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,u,m),w(f,l,m),b=!0},p:Te,i(l){b||(M(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function PX(B){let d,y;return d=new ke({props:{code:"JTIzJTIwdGFyZ2V0JTIwaXMlMjAlMjJuaWNlJTIwcHVwcGV0JTIyJTBBdGFyZ2V0X3N0YXJ0X2luZGV4JTIwJTNEJTIwdGYuY29uc3RhbnQoJTVCMTQlNUQpJTBBdGFyZ2V0X2VuZF9pbmRleCUyMCUzRCUyMHRmLmNvbnN0YW50KCU1QjE1JTVEKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMHN0YXJ0X3Bvc2l0aW9ucyUzRHRhcmdldF9zdGFydF9pbmRleCUyQyUyMGVuZF9wb3NpdGlvbnMlM0R0YXJnZXRfZW5kX2luZGV4KSUwQWxvc3MlMjAlM0QlMjB0Zi5tYXRoLnJlZHVjZV9tZWFuKG91dHB1dHMubG9zcyklMEFyb3VuZChmbG9hdChsb3NzKSUyQyUyMDIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># target is &quot;nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_start_index = tf.constant([<span class="hljs-number">14</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = tf.constant([<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 = tf.math.reduce_mean(outputs.loss)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(<span class="hljs-built_in">float</span>(loss), <span class="hljs-number">2</span>)
<span class="hljs-number">7.41</span>`}}),{c(){T(d.$$.fragment)},l(u){k(d.$$.fragment,u)},m(u,f){w(d,u,f),y=!0},p:Te,i(u){y||(M(d.$$.fragment,u),y=!0)},o(u){$(d.$$.fragment,u),y=!1},d(u){F(d,u)}}}function qX(B){let d,y,u,f,b;return{c(){d=s("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),f=o("Module"),b=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(m,"CODE",{});var E=r(u);f=n(E,"Module"),E.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,u),e(u,f),e(d,b)},d(l){l&&t(d)}}}function AX(B){let d,y,u,f,b;return f=new ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4QmVydE1vZGVsJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyYmVydC1iYXNlLXVuY2FzZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBGbGF4QmVydE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJiZXJ0LWJhc2UtdW5jYXNlZCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIyamF4JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxBertModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertModel.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){d=s("p"),y=o("Example:"),u=c(),T(f.$$.fragment)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Example:"),m.forEach(t),u=p(l),k(f.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,u,m),w(f,l,m),b=!0},p:Te,i(l){b||(M(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function ZX(B){let d,y,u,f,b;return{c(){d=s("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),f=o("Module"),b=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(m,"CODE",{});var E=r(u);f=n(E,"Module"),E.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,u),e(u,f),e(d,b)},d(l){l&&t(d)}}}function RX(B){let d,y,u,f,b;return f=new ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4QmVydEZvclByZVRyYWluaW5nJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyYmVydC1iYXNlLXVuY2FzZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBGbGF4QmVydEZvclByZVRyYWluaW5nLmZyb21fcHJldHJhaW5lZCglMjJiZXJ0LWJhc2UtdW5jYXNlZCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIybnAlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQXByZWRpY3Rpb25fbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5wcmVkaWN0aW9uX2xvZ2l0cyUwQXNlcV9yZWxhdGlvbnNoaXBfbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5zZXFfcmVsYXRpb25zaGlwX2xvZ2l0cw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxBertForPreTraining

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertForPreTraining.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>prediction_logits = outputs.prediction_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>seq_relationship_logits = outputs.seq_relationship_logits`}}),{c(){d=s("p"),y=o("Example:"),u=c(),T(f.$$.fragment)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Example:"),m.forEach(t),u=p(l),k(f.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,u,m),w(f,l,m),b=!0},p:Te,i(l){b||(M(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function VX(B){let d,y,u,f,b;return{c(){d=s("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),f=o("Module"),b=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(m,"CODE",{});var E=r(u);f=n(E,"Module"),E.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,u),e(u,f),e(d,b)},d(l){l&&t(d)}}}function GX(B){let d,y,u,f,b;return f=new ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4QmVydEZvckNhdXNhbExNJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyYmVydC1iYXNlLXVuY2FzZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBGbGF4QmVydEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJiZXJ0LWJhc2UtdW5jYXNlZCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIybnAlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQSUyMyUyMHJldHJpZXZlJTIwbG9ndHMlMjBmb3IlMjBuZXh0JTIwdG9rZW4lMEFuZXh0X3Rva2VuX2xvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRzJTVCJTNBJTJDJTIwLTElNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxBertForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertForCausalLM.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertForMaskedLM.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertForNextSentencePrediction.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&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;jax&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoding)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> logits[<span class="hljs-number">0</span>, <span class="hljs-number">0</span>] &lt; logits[<span class="hljs-number">0</span>, <span class="hljs-number">1</span>]  <span class="hljs-comment"># next sentence was random</span>`}}),{c(){d=s("p"),y=o("Example:"),u=c(),T(f.$$.fragment)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Example:"),m.forEach(t),u=p(l),k(f.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,u,m),w(f,l,m),b=!0},p:Te,i(l){b||(M(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function DX(B){let d,y,u,f,b;return{c(){d=s("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),f=o("Module"),b=o(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(m,"CODE",{});var E=r(u);f=n(E,"Module"),E.forEach(t),b=n(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,u),e(u,f),e(d,b)},d(l){l&&t(d)}}}function QX(B){let d,y,u,f,b;return f=new ke({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4QmVydEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJiZXJ0LWJhc2UtdW5jYXNlZCUyMiklMEFtb2RlbCUyMCUzRCUyMEZsYXhCZXJ0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyYmVydC1iYXNlLXVuY2FzZWQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMmpheCUyMiklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxBertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertForTokenClassification.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBertForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>start_scores = outputs.start_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>end_scores = outputs.end_logits`}}),{c(){d=s("p"),y=o("Example:"),u=c(),T(f.$$.fragment)},l(l){d=a(l,"P",{});var m=r(d);y=n(m,"Example:"),m.forEach(t),u=p(l),k(f.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,u,m),w(f,l,m),b=!0},p:Te,i(l){b||(M(f.$$.fragment,l),b=!0)},o(l){$(f.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(u),F(f,l)}}}function n8(B){let d,y,u,f,b,l,m,E,Ee,we,Z,he,ee,x,je,V,me,qe,O,ie,le,G,de,ze,S,Ce,Me,R,Je,ce,ae,C,U,ue,D,$e,fe,X,Ie,Fe,J,_e,Q,Be,ge,H,xe,se,P,be,Y,Ue,te,I,Ne,W,pe,ye,v,j,Ze,oe,Se,Xe,z,Le,Oe,Ve,De,Qe,q,L,He,Ge,A,Ye,Re,We,Ke,K,et,wM,CT,Nn,aa,rg,Ai,MM,ig,$M,JT,Rm,FM,IT,Zi,UT,tt,Ri,BM,Vi,xM,EM,jM,Gi,zM,Si,CM,JM,IM,Xi,UM,Li,NM,WM,PM,Oi,qM,Di,AM,ZM,RM,Qo,Vm,VM,GM,Qi,SM,XM,Hi,LM,OM,DM,Ho,Gm,QM,HM,Yi,YM,KM,Ki,e0,t0,o0,Yo,Sm,n0,s0,el,a0,r0,tl,i0,l0,d0,lg,Xm,c0,NT,ol,WT,ft,nl,p0,sl,h0,m0,u0,Wn,f0,al,g0,_0,rl,b0,y0,v0,Ko,Lm,T0,k0,il,w0,M0,ll,$0,F0,B0,en,Om,x0,E0,dl,j0,z0,cl,C0,J0,I0,ra,Dm,U0,N0,pl,W0,P0,q0,Qm,hl,A0,Z0,R0,dg,Hm,V0,PT,ml,qT,Pt,tn,Ym,G0,S0,ul,X0,L0,fl,O0,D0,Q0,on,Km,H0,Y0,gl,K0,e2,_l,t2,o2,n2,nn,eu,s2,a2,bl,r2,i2,yl,l2,d2,c2,tu,vl,p2,h2,m2,cg,ou,u2,AT,Tl,ZT,qt,sn,nu,f2,g2,kl,_2,b2,wl,y2,v2,T2,an,su,k2,w2,Ml,M2,$2,$l,F2,B2,x2,ia,au,E2,j2,Fl,z2,C2,J2,ru,Bl,I2,U2,N2,pg,iu,W2,RT,lu,hg,P2,VT,rn,ln,du,q2,A2,xl,Z2,R2,El,V2,G2,S2,dn,cu,X2,L2,jl,O2,D2,zl,Q2,H2,Y2,mg,pu,K2,GT,Cl,e$,ug,t$,ST,la,Jl,o$,Il,n$,s$,a$,Ul,r$,Nl,i$,l$,XT,Wl,d$,fg,c$,LT,hu,Pl,p$,ql,h$,m$,OT,Al,u$,gg,f$,DT,Ft,Zl,g$,Rl,_$,b$,y$,Vl,v$,Gl,T$,k$,w$,Sl,M$,Xl,$$,F$,B$,Ll,x$,Ol,E$,j$,z$,Dl,C$,Ql,J$,I$,U$,Hl,N$,Yl,W$,P$,QT,Pn,da,_g,Kl,q$,bg,A$,HT,so,ed,Z$,Po,R$,mu,V$,G$,uu,S$,X$,td,L$,O$,D$,qn,Q$,fu,H$,Y$,gu,K$,eF,tF,ca,YT,An,pa,yg,od,oF,vg,nF,KT,ot,nd,sF,Tg,aF,rF,sd,iF,_u,lF,dF,cF,cn,ad,pF,kg,hF,mF,rd,bu,uF,wg,fF,gF,yu,_F,Mg,bF,yF,ha,id,vF,ld,TF,$g,kF,wF,MF,ao,dd,$F,Fg,FF,BF,ma,xF,Zn,EF,Bg,jF,zF,xg,CF,JF,IF,vu,cd,e1,Rn,ua,Eg,pd,UF,jg,NF,t1,xt,hd,WF,md,PF,zg,qF,AF,ZF,ud,RF,Tu,VF,GF,SF,pn,fd,XF,Cg,LF,OF,gd,ku,DF,Jg,QF,HF,wu,YF,Ig,KF,eB,ro,_d,tB,Ug,oB,nB,fa,sB,Vn,aB,Ng,rB,iB,Wg,lB,dB,o1,Gn,ga,Pg,bd,cB,qg,pB,n1,Et,yd,hB,Sn,mB,Ag,uB,fB,Zg,gB,_B,bB,vd,yB,Rg,vB,TB,kB,hn,Td,wB,kd,MB,Vg,$B,FB,BB,_a,xB,mn,wd,EB,Xn,jB,Gg,zB,CB,Sg,JB,IB,UB,ba,s1,Ln,ya,Xg,Md,NB,Lg,WB,a1,On,$d,PB,Fd,qB,Mu,AB,ZB,r1,Dn,Bd,RB,xd,VB,$u,GB,SB,i1,qo,Ed,XB,jd,LB,Fu,OB,DB,QB,va,zd,HB,Og,YB,l1,Qn,Ta,Dg,Cd,KB,Qg,ex,d1,nt,Jd,tx,Hg,ox,nx,Id,sx,Bu,ax,rx,ix,Ud,lx,Nd,dx,cx,px,Wd,hx,Pd,mx,ux,fx,gt,gx,Yg,_x,bx,Kg,yx,vx,e_,Tx,kx,t_,wx,Mx,o_,$x,Fx,n_,Bx,xx,Ex,io,qd,jx,Hn,zx,xu,Cx,Jx,s_,Ix,Ux,Nx,ka,Wx,wa,c1,Yn,Ma,a_,Ad,Px,r_,qx,p1,jt,Zd,Ax,Kn,Zx,i_,Rx,Vx,l_,Gx,Sx,Xx,Rd,Lx,Eu,Ox,Dx,Qx,Vd,Hx,Gd,Yx,Kx,eE,lo,Sd,tE,es,oE,ju,nE,sE,d_,aE,rE,iE,$a,lE,Fa,h1,ts,Ba,c_,Xd,dE,p_,cE,m1,zt,Ld,pE,Od,hE,h_,mE,uE,fE,Dd,gE,zu,_E,bE,yE,Qd,vE,Hd,TE,kE,wE,co,Yd,ME,os,$E,Cu,FE,BE,m_,xE,EE,jE,xa,zE,Ea,u1,ns,ja,u_,Kd,CE,f_,JE,f1,Ct,ec,IE,tc,UE,g_,NE,WE,PE,oc,qE,Ju,AE,ZE,RE,nc,VE,sc,GE,SE,XE,po,ac,LE,ss,OE,Iu,DE,QE,__,HE,YE,KE,za,ej,Ca,g1,as,Ja,b_,rc,tj,y_,oj,_1,Jt,ic,nj,lc,sj,v_,aj,rj,ij,dc,lj,Uu,dj,cj,pj,cc,hj,pc,mj,uj,fj,ho,hc,gj,rs,_j,Nu,bj,yj,T_,vj,Tj,kj,Ia,wj,Ua,b1,is,Na,k_,mc,Mj,w_,$j,y1,It,uc,Fj,M_,Bj,xj,fc,Ej,Wu,jj,zj,Cj,gc,Jj,_c,Ij,Uj,Nj,At,bc,Wj,ls,Pj,Pu,qj,Aj,$_,Zj,Rj,Vj,Wa,Gj,Pa,Sj,qa,v1,ds,Aa,F_,yc,Xj,B_,Lj,T1,Ut,vc,Oj,x_,Dj,Qj,Tc,Hj,qu,Yj,Kj,e4,kc,t4,wc,o4,n4,s4,mo,Mc,a4,cs,r4,Au,i4,l4,E_,d4,c4,p4,Za,h4,Ra,k1,ps,Va,j_,$c,m4,z_,u4,w1,Nt,Fc,f4,C_,g4,_4,Bc,b4,Zu,y4,v4,T4,xc,k4,Ec,w4,M4,$4,uo,jc,F4,hs,B4,Ru,x4,E4,J_,j4,z4,C4,Ga,J4,Sa,M1,ms,Xa,I_,zc,I4,U_,U4,$1,Wt,Cc,N4,us,W4,N_,P4,q4,W_,A4,Z4,R4,Jc,V4,Vu,G4,S4,X4,Ic,L4,Uc,O4,D4,Q4,fo,Nc,H4,fs,Y4,Gu,K4,e3,P_,t3,o3,n3,La,s3,Oa,F1,gs,Da,q_,Wc,a3,A_,r3,B1,_t,Pc,i3,Z_,l3,d3,qc,c3,Su,p3,h3,m3,Ac,u3,Zc,f3,g3,_3,Qa,b3,go,Rc,y3,_s,v3,Xu,T3,k3,R_,w3,M3,$3,Ha,F3,Ya,x1,bs,Ka,V_,Vc,B3,G_,x3,E1,bt,Gc,E3,ys,j3,S_,z3,C3,X_,J3,I3,U3,Sc,N3,Lu,W3,P3,q3,Xc,A3,Lc,Z3,R3,V3,er,G3,_o,Oc,S3,vs,X3,Ou,L3,O3,L_,D3,Q3,H3,tr,Y3,or,j1,Ts,nr,O_,Dc,K3,D_,ez,z1,ks,Qc,tz,Zt,Hc,oz,st,nz,Q_,sz,az,H_,rz,iz,Y_,lz,dz,K_,cz,pz,eb,hz,mz,tb,uz,fz,ob,gz,_z,bz,Yc,Kc,yz,nb,vz,Tz,kz,ep,wz,sb,Mz,$z,Fz,ne,Bz,ab,xz,Ez,rb,jz,zz,ib,Cz,Jz,lb,Iz,Uz,db,Nz,Wz,cb,Pz,qz,pb,Az,Zz,hb,Rz,Vz,mb,Gz,Sz,ub,Xz,Lz,fb,Oz,Dz,gb,Qz,Hz,_b,Yz,Kz,bb,eC,tC,yb,oC,nC,vb,sC,aC,Tb,rC,iC,kb,lC,dC,wb,cC,pC,Mb,hC,mC,uC,sr,C1,ws,ar,$b,tp,fC,Fb,gC,J1,yt,op,_C,np,bC,Bb,yC,vC,TC,sp,kC,Du,wC,MC,$C,ap,FC,rp,BC,xC,EC,rr,jC,Rt,ip,zC,Ms,CC,Qu,JC,IC,xb,UC,NC,WC,ir,PC,lr,qC,dr,I1,$s,cr,Eb,lp,AC,jb,ZC,U1,vt,dp,RC,cp,VC,zb,GC,SC,XC,pp,LC,Hu,OC,DC,QC,hp,HC,mp,YC,KC,eJ,pr,tJ,bo,up,oJ,Fs,nJ,Yu,sJ,aJ,Cb,rJ,iJ,lJ,hr,dJ,mr,N1,Bs,ur,Jb,fp,cJ,Ib,pJ,W1,Tt,gp,hJ,Ub,mJ,uJ,_p,fJ,Ku,gJ,_J,bJ,bp,yJ,yp,vJ,TJ,kJ,fr,wJ,Vt,vp,MJ,xs,$J,ef,FJ,BJ,Nb,xJ,EJ,jJ,gr,zJ,_r,CJ,br,P1,Es,yr,Wb,Tp,JJ,Pb,IJ,q1,kt,kp,UJ,qb,NJ,WJ,wp,PJ,tf,qJ,AJ,ZJ,Mp,RJ,$p,VJ,GJ,SJ,vr,XJ,yo,Fp,LJ,js,OJ,of,DJ,QJ,Ab,HJ,YJ,KJ,Tr,eI,kr,A1,zs,wr,Zb,Bp,tI,Rb,oI,Z1,wt,xp,nI,Vb,sI,aI,Ep,rI,nf,iI,lI,dI,jp,cI,zp,pI,hI,mI,Mr,uI,Gt,Cp,fI,Cs,gI,sf,_I,bI,Gb,yI,vI,TI,$r,kI,Fr,wI,Br,R1,Js,xr,Sb,Jp,MI,Xb,$I,V1,Mt,Ip,FI,Is,BI,Lb,xI,EI,Ob,jI,zI,CI,Up,JI,af,II,UI,NI,Np,WI,Wp,PI,qI,AI,Er,ZI,St,Pp,RI,Us,VI,rf,GI,SI,Db,XI,LI,OI,jr,DI,zr,QI,Cr,G1,Ns,Jr,Qb,qp,HI,Hb,YI,S1,at,Ap,KI,Yb,e5,t5,Zp,o5,lf,n5,s5,a5,Rp,r5,Vp,i5,l5,d5,Kb,c5,p5,Ao,ey,Gp,h5,m5,ty,Sp,u5,f5,oy,Xp,g5,_5,ny,Lp,b5,y5,vo,Op,v5,Ws,T5,sy,k5,w5,ay,M5,$5,F5,Ir,B5,Ur,X1,Ps,Nr,ry,Dp,x5,iy,E5,L1,rt,Qp,j5,qs,z5,ly,C5,J5,dy,I5,U5,N5,Hp,W5,df,P5,q5,A5,Yp,Z5,Kp,R5,V5,G5,cy,S5,X5,Zo,py,eh,L5,O5,hy,th,D5,Q5,my,oh,H5,Y5,uy,nh,K5,eU,To,sh,tU,As,oU,fy,nU,sU,gy,aU,rU,iU,Wr,lU,Pr,O1,Zs,qr,_y,ah,dU,by,cU,D1,it,rh,pU,yy,hU,mU,ih,uU,cf,fU,gU,_U,lh,bU,dh,yU,vU,TU,vy,kU,wU,Ro,Ty,ch,MU,$U,ky,ph,FU,BU,wy,hh,xU,EU,My,mh,jU,zU,ko,uh,CU,Rs,JU,$y,IU,UU,Fy,NU,WU,PU,Ar,qU,Zr,Q1,Vs,Rr,By,fh,AU,xy,ZU,H1,lt,gh,RU,_h,VU,Ey,GU,SU,XU,bh,LU,pf,OU,DU,QU,yh,HU,vh,YU,KU,eN,jy,tN,oN,Vo,zy,Th,nN,sN,Cy,kh,aN,rN,Jy,wh,iN,lN,Iy,Mh,dN,cN,wo,$h,pN,Gs,hN,Uy,mN,uN,Ny,fN,gN,_N,Vr,bN,Gr,Y1,Ss,Sr,Wy,Fh,yN,Py,vN,K1,dt,Bh,TN,xh,kN,qy,wN,MN,$N,Eh,FN,hf,BN,xN,EN,jh,jN,zh,zN,CN,JN,Ay,IN,UN,Go,Zy,Ch,NN,WN,Ry,Jh,PN,qN,Vy,Ih,AN,ZN,Gy,Uh,RN,VN,Mo,Nh,GN,Xs,SN,Sy,XN,LN,Xy,ON,DN,QN,Xr,HN,Lr,ek,Ls,Or,Ly,Wh,YN,Oy,KN,tk,ct,Ph,e9,Dy,t9,o9,qh,n9,mf,s9,a9,r9,Ah,i9,Zh,l9,d9,c9,Qy,p9,h9,So,Hy,Rh,m9,u9,Yy,Vh,f9,g9,Ky,Gh,_9,b9,ev,Sh,y9,v9,$o,Xh,T9,Os,k9,tv,w9,M9,ov,$9,F9,B9,Dr,x9,Qr,ok,Ds,Hr,nv,Lh,E9,sv,j9,nk,pt,Oh,z9,av,C9,J9,Dh,I9,uf,U9,N9,W9,Qh,P9,Hh,q9,A9,Z9,rv,R9,V9,Xo,iv,Yh,G9,S9,lv,Kh,X9,L9,dv,em,O9,D9,cv,tm,Q9,H9,Fo,om,Y9,Qs,K9,pv,eW,tW,hv,oW,nW,sW,Yr,aW,Kr,sk,Hs,ei,mv,nm,rW,uv,iW,ak,ht,sm,lW,fv,dW,cW,am,pW,ff,hW,mW,uW,rm,fW,im,gW,_W,bW,gv,yW,vW,Lo,_v,lm,TW,kW,bv,dm,wW,MW,yv,cm,$W,FW,vv,pm,BW,xW,Bo,hm,EW,Ys,jW,Tv,zW,CW,kv,JW,IW,UW,ti,NW,oi,rk,Ks,ni,wv,mm,WW,Mv,PW,ik,mt,um,qW,ea,AW,$v,ZW,RW,Fv,VW,GW,SW,fm,XW,gf,LW,OW,DW,gm,QW,_m,HW,YW,KW,Bv,eP,tP,Oo,xv,bm,oP,nP,Ev,ym,sP,aP,jv,vm,rP,iP,zv,Tm,lP,dP,xo,km,cP,ta,pP,Cv,hP,mP,Jv,uP,fP,gP,si,_P,ai,lk;return l=new Pe({}),de=new Pe({}),Ai=new Pe({}),Zi=new kM({props:{pipeline:"text-classification"}}),ol=new kM({props:{pipeline:"token-classification"}}),ml=new kM({props:{pipeline:"fill-mask"}}),Tl=new kM({props:{pipeline:"question-answering"}}),Kl=new Pe({}),ed=new N({props:{name:"class transformers.BertConfig",anchor:"transformers.BertConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"pad_token_id",val:" = 0"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"use_cache",val:" = True"},{name:"classifier_dropout",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BertConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the BERT 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/bert#transformers.BertModel">BertModel</a> or <a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.TFBertModel">TFBertModel</a>.`,name:"vocab_size"},{anchor:"transformers.BertConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.BertConfig.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.BertConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.BertConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.BertConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.BertConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.BertConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.BertConfig.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.BertConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertModel">BertModel</a> or <a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.TFBertModel">TFBertModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.BertConfig.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.BertConfig.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.BertConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;</code>. For
positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.BertConfig.is_decoder",description:`<strong>is_decoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the model is used as a decoder or not. If <code>False</code>, the model is used as an encoder.`,name:"is_decoder"},{anchor:"transformers.BertConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.BertConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The dropout ratio for the classification head.`,name:"classifier_dropout"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/configuration_bert.py#L72"}}),ca=new ve({props:{anchor:"transformers.BertConfig.example",$$slots:{default:[AS]},$$scope:{ctx:B}}}),od=new Pe({}),nd=new N({props:{name:"class transformers.BertTokenizer",anchor:"transformers.BertTokenizer",parameters:[{name:"vocab_file",val:""},{name:"do_lower_case",val:" = True"},{name:"do_basic_tokenize",val:" = True"},{name:"never_split",val:" = None"},{name:"unk_token",val:" = '[UNK]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BertTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.BertTokenizer.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.BertTokenizer.do_basic_tokenize",description:`<strong>do_basic_tokenize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to do basic tokenization before WordPiece.`,name:"do_basic_tokenize"},{anchor:"transformers.BertTokenizer.never_split",description:`<strong>never_split</strong> (<code>Iterable</code>, <em>optional</em>) &#x2014;
Collection of tokens which will never be split during tokenization. Only has an effect when
<code>do_basic_tokenize=True</code>`,name:"never_split"},{anchor:"transformers.BertTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[UNK]&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.BertTokenizer.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.BertTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[PAD]&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.BertTokenizer.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.BertTokenizer.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.BertTokenizer.tokenize_chinese_chars",description:`<strong>tokenize_chinese_chars</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to tokenize Chinese characters.</p>
<p>This should likely be deactivated for Japanese (see this
<a href="https://github.com/huggingface/transformers/issues/328" rel="nofollow">issue</a>).`,name:"tokenize_chinese_chars"},{anchor:"transformers.BertTokenizer.strip_accents",description:`<strong>strip_accents</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
value for <code>lowercase</code> (as in the original BERT).`,name:"strip_accents"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/tokenization_bert.py#L137"}}),ad=new N({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.BertTokenizer.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.BertTokenizer.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.BertTokenizer.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/bert/tokenization_bert.py#L267",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>
`}}),id=new N({props:{name:"get_special_tokens_mask",anchor:"transformers.BertTokenizer.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.BertTokenizer.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.BertTokenizer.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.BertTokenizer.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/bert/tokenization_bert.py#L292",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>
`}}),dd=new N({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.BertTokenizer.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.BertTokenizer.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.BertTokenizer.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/bert/tokenization_bert.py#L320",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>
`}}),ma=new ve({props:{anchor:"transformers.BertTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[ZS]},$$scope:{ctx:B}}}),cd=new N({props:{name:"save_vocabulary",anchor:"transformers.BertTokenizer.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/bert/tokenization_bert.py#L349"}}),pd=new Pe({}),hd=new N({props:{name:"class transformers.BertTokenizerFast",anchor:"transformers.BertTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"do_lower_case",val:" = True"},{name:"unk_token",val:" = '[UNK]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BertTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.BertTokenizerFast.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.BertTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[UNK]&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.BertTokenizerFast.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.BertTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[PAD]&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.BertTokenizerFast.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.BertTokenizerFast.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.BertTokenizerFast.clean_text",description:`<strong>clean_text</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to clean the text before tokenization by removing any control characters and replacing all
whitespaces by the classic one.`,name:"clean_text"},{anchor:"transformers.BertTokenizerFast.tokenize_chinese_chars",description:`<strong>tokenize_chinese_chars</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to tokenize Chinese characters. This should likely be deactivated for Japanese (see <a href="https://github.com/huggingface/transformers/issues/328" rel="nofollow">this
issue</a>).`,name:"tokenize_chinese_chars"},{anchor:"transformers.BertTokenizerFast.strip_accents",description:`<strong>strip_accents</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
value for <code>lowercase</code> (as in the original BERT).`,name:"strip_accents"},{anchor:"transformers.BertTokenizerFast.wordpieces_prefix",description:`<strong>wordpieces_prefix</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;##&quot;</code>) &#x2014;
The prefix for subwords.`,name:"wordpieces_prefix"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/tokenization_bert_fast.py#L161"}}),fd=new N({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.BertTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:""},{name:"token_ids_1",val:" = None"}],parametersDescription:[{anchor:"transformers.BertTokenizerFast.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.BertTokenizerFast.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/bert/tokenization_bert_fast.py#L249",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>
`}}),_d=new N({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.BertTokenizerFast.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.BertTokenizerFast.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.BertTokenizerFast.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/bert/tokenization_bert_fast.py#L273",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>
`}}),fa=new ve({props:{anchor:"transformers.BertTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[RS]},$$scope:{ctx:B}}}),bd=new Pe({}),yd=new N({props:{name:"class transformers.TFBertTokenizer",anchor:"transformers.TFBertTokenizer",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertTokenizer.vocab_list",description:`<strong>vocab_list</strong> (<code>list</code>) &#x2014;
List containing the vocabulary.`,name:"vocab_list"},{anchor:"transformers.TFBertTokenizer.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.TFBertTokenizer.cls_token_id",description:`<strong>cls_token_id</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_id"},{anchor:"transformers.TFBertTokenizer.sep_token_id",description:`<strong>sep_token_id</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_id"},{anchor:"transformers.TFBertTokenizer.pad_token_id",description:`<strong>pad_token_id</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[PAD]&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token_id"},{anchor:"transformers.TFBertTokenizer.padding",description:`<strong>padding</strong> (<code>str</code>, defaults to <code>&quot;longest&quot;</code>) &#x2014;
The type of padding to use. Can be either <code>&quot;longest&quot;</code>, to pad only up to the longest sample in the batch,
or \`&#x201C;max_length&#x201D;, to pad all inputs to the maximum length supported by the tokenizer.`,name:"padding"},{anchor:"transformers.TFBertTokenizer.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to truncate the sequence to the maximum length.`,name:"truncation"},{anchor:"transformers.TFBertTokenizer.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>, defaults to <code>512</code>) &#x2014;
The maximum length of the sequence, used for padding (if <code>padding</code> is &#x201C;max_length&#x201D;) and/or truncation (if
<code>truncation</code> is <code>True</code>).`,name:"max_length"},{anchor:"transformers.TFBertTokenizer.pad_to_multiple_of",description:`<strong>pad_to_multiple_of</strong> (<code>int</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
If set, the sequence will be padded to a multiple of this value.`,name:"pad_to_multiple_of"},{anchor:"transformers.TFBertTokenizer.return_token_type_ids",description:`<strong>return_token_type_ids</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to return token_type_ids.`,name:"return_token_type_ids"},{anchor:"transformers.TFBertTokenizer.return_attention_mask",description:`<strong>return_attention_mask</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to return the attention_mask.`,name:"return_attention_mask"},{anchor:"transformers.TFBertTokenizer.use_fast_bert_tokenizer",description:`<strong>use_fast_bert_tokenizer</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If True, will use the FastBertTokenizer class from Tensorflow Text. If False, will use the BertTokenizer
class instead. BertTokenizer supports some additional options, but is slower and cannot be exported to
TFLite.`,name:"use_fast_bert_tokenizer"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/tokenization_bert_tf.py#L11"}}),Td=new N({props:{name:"from_pretrained",anchor:"transformers.TFBertTokenizer.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, os.PathLike]"},{name:"*init_inputs",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertTokenizer.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
The name or path to the pre-trained tokenizer.`,name:"pretrained_model_name_or_path"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/tokenization_bert_tf.py#L143"}}),_a=new ve({props:{anchor:"transformers.TFBertTokenizer.from_pretrained.example",$$slots:{default:[VS]},$$scope:{ctx:B}}}),wd=new N({props:{name:"from_tokenizer",anchor:"transformers.TFBertTokenizer.from_tokenizer",parameters:[{name:"tokenizer",val:": PreTrainedTokenizerBase"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertTokenizer.from_tokenizer.tokenizer",description:`<strong>tokenizer</strong> (<code>PreTrainedTokenizerBase</code>) &#x2014;
The tokenizer to use to initialize the <code>TFBertTokenizer</code>.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/tokenization_bert_tf.py#L104"}}),ba=new ve({props:{anchor:"transformers.TFBertTokenizer.from_tokenizer.example",$$slots:{default:[GS]},$$scope:{ctx:B}}}),Md=new Pe({}),$d=new N({props:{name:"class transformers.models.bert.modeling_bert.BertForPreTrainingOutput",anchor:"transformers.models.bert.modeling_bert.BertForPreTrainingOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prediction_logits",val:": FloatTensor = None"},{name:"seq_relationship_logits",val:": FloatTensor = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.bert.modeling_bert.BertForPreTrainingOutput.loss",description:`<strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) &#x2014;
Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.`,name:"loss"},{anchor:"transformers.models.bert.modeling_bert.BertForPreTrainingOutput.prediction_logits",description:`<strong>prediction_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).`,name:"prediction_logits"},{anchor:"transformers.models.bert.modeling_bert.BertForPreTrainingOutput.seq_relationship_logits",description:`<strong>seq_relationship_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) &#x2014;
Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).`,name:"seq_relationship_logits"},{anchor:"transformers.models.bert.modeling_bert.BertForPreTrainingOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.bert.modeling_bert.BertForPreTrainingOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/modeling_bert.py#L771"}}),Bd=new N({props:{name:"class transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput",anchor:"transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput",parameters:[{name:"loss",val:": tf.Tensor | None = None"},{name:"prediction_logits",val:": tf.Tensor = None"},{name:"seq_relationship_logits",val:": tf.Tensor = None"},{name:"hidden_states",val:": Optional[Union[Tuple[tf.Tensor], tf.Tensor]] = None"},{name:"attentions",val:": Optional[Union[Tuple[tf.Tensor], tf.Tensor]] = None"}],parametersDescription:[{anchor:"transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput.prediction_logits",description:`<strong>prediction_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).`,name:"prediction_logits"},{anchor:"transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput.seq_relationship_logits",description:`<strong>seq_relationship_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, 2)</code>) &#x2014;
Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).`,name:"seq_relationship_logits"},{anchor:"transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/modeling_tf_bert.py#L906"}}),Ed=new N({props:{name:"class transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput",anchor:"transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput",parameters:[{name:"prediction_logits",val:": Array = None"},{name:"seq_relationship_logits",val:": Array = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[jax.Array]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[jax.Array]] = None"}],parametersDescription:[{anchor:"transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput.prediction_logits",description:`<strong>prediction_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).`,name:"prediction_logits"},{anchor:"transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput.seq_relationship_logits",description:`<strong>seq_relationship_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, 2)</code>) &#x2014;
Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).`,name:"seq_relationship_logits"},{anchor:"transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/modeling_flax_bert.py#L62"}}),zd=new N({props:{name:"replace",anchor:"transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/flax/struct.py#L111"}}),Cd=new Pe({}),Jd=new N({props:{name:"class transformers.BertModel",anchor:"transformers.BertModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.BertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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/bert/modeling_bert.py#L874"}}),qd=new N({props:{name:"forward",anchor:"transformers.BertModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BertModel.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.BertModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BertModel.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.BertModel.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.BertModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BertModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BertModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BertModel.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.BertModel.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.BertModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.BertModel.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.BertModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.BertModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/modeling_bert.py#L913",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ka=new Ae({props:{$$slots:{default:[SS]},$$scope:{ctx:B}}}),wa=new ve({props:{anchor:"transformers.BertModel.forward.example",$$slots:{default:[XS]},$$scope:{ctx:B}}}),Ad=new Pe({}),Zd=new N({props:{name:"class transformers.BertForPreTraining",anchor:"transformers.BertForPreTraining",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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/bert/modeling_bert.py#L1057"}}),Sd=new N({props:{name:"forward",anchor:"transformers.BertForPreTraining.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"next_sentence_label",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BertForPreTraining.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.BertForPreTraining.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BertForPreTraining.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.BertForPreTraining.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.BertForPreTraining.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BertForPreTraining.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BertForPreTraining.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BertForPreTraining.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.BertForPreTraining.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.</p>
<p>labels (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked),
the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>
next_sentence_label (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>):
Labels for computing the next sequence prediction (classification) loss. Input should be a sequence
pair (see <code>input_ids</code> docstring) Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates sequence B is a continuation of sequence A,</li>
<li>1 indicates sequence B is a random sequence.
kwargs (<code>Dict[str, any]</code>, optional, defaults to <em>{}</em>):
Used to hide legacy arguments that have been deprecated.</li>
</ul>`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/modeling_bert.py#L1075",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.models.bert.modeling_bert.BertForPreTrainingOutput"
>transformers.models.bert.modeling_bert.BertForPreTrainingOutput</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/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) \u2014 Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.</p>
</li>
<li>
<p><strong>prediction_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>seq_relationship_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.models.bert.modeling_bert.BertForPreTrainingOutput"
>transformers.models.bert.modeling_bert.BertForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$a=new Ae({props:{$$slots:{default:[LS]},$$scope:{ctx:B}}}),Fa=new ve({props:{anchor:"transformers.BertForPreTraining.forward.example",$$slots:{default:[OS]},$$scope:{ctx:B}}}),Xd=new Pe({}),Ld=new N({props:{name:"class transformers.BertLMHeadModel",anchor:"transformers.BertLMHeadModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertLMHeadModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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/bert/modeling_bert.py#L1163"}}),Yd=new N({props:{name:"forward",anchor:"transformers.BertLMHeadModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.Tensor]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BertLMHeadModel.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.BertLMHeadModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BertLMHeadModel.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.BertLMHeadModel.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.BertLMHeadModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BertLMHeadModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BertLMHeadModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BertLMHeadModel.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.BertLMHeadModel.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.BertLMHeadModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.BertLMHeadModel.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.BertLMHeadModel.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the left-to-right language modeling loss (next word prediction). Indices should be in
<code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are
ignored (masked), the loss is only computed for the tokens with labels n <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.BertLMHeadModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.BertLMHeadModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/modeling_bert.py#L1184",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key,
value states of the self-attention and the cross-attention layers if model is used in encoder-decoder
setting. Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),xa=new Ae({props:{$$slots:{default:[DS]},$$scope:{ctx:B}}}),Ea=new ve({props:{anchor:"transformers.BertLMHeadModel.forward.example",$$slots:{default:[QS]},$$scope:{ctx:B}}}),Kd=new Pe({}),ec=new N({props:{name:"class transformers.BertForMaskedLM",anchor:"transformers.BertForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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/bert/modeling_bert.py#L1302"}}),ac=new N({props:{name:"forward",anchor:"transformers.BertForMaskedLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BertForMaskedLM.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.BertForMaskedLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BertForMaskedLM.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.BertForMaskedLM.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.BertForMaskedLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BertForMaskedLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BertForMaskedLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BertForMaskedLM.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.BertForMaskedLM.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.BertForMaskedLM.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/bert/modeling_bert.py#L1326",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/bert#transformers.BertConfig"
>BertConfig</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>
`}}),za=new Ae({props:{$$slots:{default:[HS]},$$scope:{ctx:B}}}),Ca=new ve({props:{anchor:"transformers.BertForMaskedLM.forward.example",$$slots:{default:[YS]},$$scope:{ctx:B}}}),rc=new Pe({}),ic=new N({props:{name:"class transformers.BertForNextSentencePrediction",anchor:"transformers.BertForNextSentencePrediction",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertForNextSentencePrediction.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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/bert/modeling_bert.py#L1412"}}),hc=new N({props:{name:"forward",anchor:"transformers.BertForNextSentencePrediction.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BertForNextSentencePrediction.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.BertForNextSentencePrediction.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BertForNextSentencePrediction.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.BertForNextSentencePrediction.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.BertForNextSentencePrediction.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BertForNextSentencePrediction.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BertForNextSentencePrediction.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BertForNextSentencePrediction.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.BertForNextSentencePrediction.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.BertForNextSentencePrediction.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/bert/modeling_bert.py#L1422",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/bert#transformers.BertConfig"
>BertConfig</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>
`}}),Ia=new Ae({props:{$$slots:{default:[KS]},$$scope:{ctx:B}}}),Ua=new ve({props:{anchor:"transformers.BertForNextSentencePrediction.forward.example",$$slots:{default:[eX]},$$scope:{ctx:B}}}),mc=new Pe({}),uc=new N({props:{name:"class transformers.BertForSequenceClassification",anchor:"transformers.BertForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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/bert/modeling_bert.py#L1517"}}),bc=new N({props:{name:"forward",anchor:"transformers.BertForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BertForSequenceClassification.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.BertForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BertForSequenceClassification.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.BertForSequenceClassification.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.BertForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BertForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BertForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BertForSequenceClassification.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.BertForSequenceClassification.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.BertForSequenceClassification.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/bert/modeling_bert.py#L1533",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/bert#transformers.BertConfig"
>BertConfig</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>
`}}),Wa=new Ae({props:{$$slots:{default:[tX]},$$scope:{ctx:B}}}),Pa=new ve({props:{anchor:"transformers.BertForSequenceClassification.forward.example",$$slots:{default:[oX]},$$scope:{ctx:B}}}),qa=new ve({props:{anchor:"transformers.BertForSequenceClassification.forward.example-2",$$slots:{default:[nX]},$$scope:{ctx:B}}}),yc=new Pe({}),vc=new N({props:{name:"class transformers.BertForMultipleChoice",anchor:"transformers.BertForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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/bert/modeling_bert.py#L1620"}}),Mc=new N({props:{name:"forward",anchor:"transformers.BertForMultipleChoice.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BertForMultipleChoice.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.BertForMultipleChoice.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BertForMultipleChoice.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.BertForMultipleChoice.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.BertForMultipleChoice.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BertForMultipleChoice.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BertForMultipleChoice.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BertForMultipleChoice.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.BertForMultipleChoice.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.BertForMultipleChoice.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/bert/modeling_bert.py#L1634",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/bert#transformers.BertConfig"
>BertConfig</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>
`}}),Za=new Ae({props:{$$slots:{default:[sX]},$$scope:{ctx:B}}}),Ra=new ve({props:{anchor:"transformers.BertForMultipleChoice.forward.example",$$slots:{default:[aX]},$$scope:{ctx:B}}}),$c=new Pe({}),Fc=new N({props:{name:"class transformers.BertForTokenClassification",anchor:"transformers.BertForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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/bert/modeling_bert.py#L1714"}}),jc=new N({props:{name:"forward",anchor:"transformers.BertForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BertForTokenClassification.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.BertForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BertForTokenClassification.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.BertForTokenClassification.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.BertForTokenClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BertForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BertForTokenClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BertForTokenClassification.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.BertForTokenClassification.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.BertForTokenClassification.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/bert/modeling_bert.py#L1729",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/bert#transformers.BertConfig"
>BertConfig</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>
`}}),Ga=new Ae({props:{$$slots:{default:[rX]},$$scope:{ctx:B}}}),Sa=new ve({props:{anchor:"transformers.BertForTokenClassification.forward.example",$$slots:{default:[iX]},$$scope:{ctx:B}}}),zc=new Pe({}),Cc=new N({props:{name:"class transformers.BertForQuestionAnswering",anchor:"transformers.BertForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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/bert/modeling_bert.py#L1797"}}),Nc=new N({props:{name:"forward",anchor:"transformers.BertForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"start_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"end_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BertForQuestionAnswering.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.BertForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BertForQuestionAnswering.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.BertForQuestionAnswering.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.BertForQuestionAnswering.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BertForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BertForQuestionAnswering.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BertForQuestionAnswering.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.BertForQuestionAnswering.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.BertForQuestionAnswering.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.BertForQuestionAnswering.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/bert/modeling_bert.py#L1808",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/bert#transformers.BertConfig"
>BertConfig</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>
`}}),La=new Ae({props:{$$slots:{default:[lX]},$$scope:{ctx:B}}}),Oa=new ve({props:{anchor:"transformers.BertForQuestionAnswering.forward.example",$$slots:{default:[dX]},$$scope:{ctx:B}}}),Wc=new Pe({}),Pc=new N({props:{name:"class transformers.TFBertModel",anchor:"transformers.TFBertModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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.TFPreTrainedModel.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/bert/modeling_tf_bert.py#L1038"}}),Qa=new Ae({props:{$$slots:{default:[cX]},$$scope:{ctx:B}}}),Rc=new N({props:{name:"call",anchor:"transformers.TFBertModel.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"encoder_hidden_states",val:": np.ndarray | tf.Tensor | None = None"},{name:"encoder_attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"past_key_values",val:": Optional[Tuple[Tuple[Union[np.ndarray, tf.Tensor]]]] = None"},{name:"use_cache",val:": Optional[bool] = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertModel.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the 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/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertModel.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertModel.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertModel.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertModel.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBertModel.call.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.TFBertModel.call.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.TFBertModel.call.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[tf.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.TFBertModel.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>). Set to <code>False</code> during training, <code>True</code> during generation`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/modeling_tf_bert.py#L1044",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
<p>This output is usually <em>not</em> a good summary of the semantic content of the input, you\u2019re often better with
averaging or pooling the sequence of hidden-states for the whole input sequence.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Ha=new Ae({props:{$$slots:{default:[pX]},$$scope:{ctx:B}}}),Ya=new ve({props:{anchor:"transformers.TFBertModel.call.example",$$slots:{default:[hX]},$$scope:{ctx:B}}}),Vc=new Pe({}),Gc=new N({props:{name:"class transformers.TFBertForPreTraining",anchor:"transformers.TFBertForPreTraining",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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.TFPreTrainedModel.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/bert/modeling_tf_bert.py#L1114"}}),er=new Ae({props:{$$slots:{default:[mX]},$$scope:{ctx:B}}}),Oc=new N({props:{name:"call",anchor:"transformers.TFBertForPreTraining.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"next_sentence_label",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertForPreTraining.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the 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/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForPreTraining.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertForPreTraining.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForPreTraining.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertForPreTraining.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertForPreTraining.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertForPreTraining.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForPreTraining.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForPreTraining.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertForPreTraining.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBertForPreTraining.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.TFBertForPreTraining.call.next_sentence_label",description:`<strong>next_sentence_label</strong> (<code>tf.Tensor</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.TFBertForPreTraining.call.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/bert/modeling_tf_bert.py#L1136",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput"
>transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>prediction_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>seq_relationship_logits</strong> (<code>tf.Tensor</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(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput"
>transformers.models.bert.modeling_tf_bert.TFBertForPreTrainingOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),tr=new Ae({props:{$$slots:{default:[uX]},$$scope:{ctx:B}}}),or=new ve({props:{anchor:"transformers.TFBertForPreTraining.call.example",$$slots:{default:[fX]},$$scope:{ctx:B}}}),Dc=new Pe({}),Qc=new N({props:{name:"class transformers.TFBertLMHeadModel",anchor:"transformers.TFBertLMHeadModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/modeling_tf_bert.py#L1305"}}),Hc=new N({props:{name:"call",anchor:"transformers.TFBertLMHeadModel.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"encoder_hidden_states",val:": np.ndarray | tf.Tensor | None = None"},{name:"encoder_attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"past_key_values",val:": Optional[Tuple[Tuple[Union[np.ndarray, tf.Tensor]]]] = None"},{name:"use_cache",val:": Optional[bool] = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": Optional[bool] = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/modeling_tf_bert.py#L1342",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions"
>transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions"
>transformers.modeling_tf_outputs.TFCausalLMOutputWithCrossAttentions</a> or <code>tuple(tf.Tensor)</code></p>
`}}),sr=new ve({props:{anchor:"transformers.TFBertLMHeadModel.call.example",$$slots:{default:[gX]},$$scope:{ctx:B}}}),tp=new Pe({}),op=new N({props:{name:"class transformers.TFBertForMaskedLM",anchor:"transformers.TFBertForMaskedLM",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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.TFPreTrainedModel.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/bert/modeling_tf_bert.py#L1220"}}),rr=new Ae({props:{$$slots:{default:[_X]},$$scope:{ctx:B}}}),ip=new N({props:{name:"call",anchor:"transformers.TFBertForMaskedLM.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertForMaskedLM.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the 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/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForMaskedLM.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertForMaskedLM.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForMaskedLM.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertForMaskedLM.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertForMaskedLM.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertForMaskedLM.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForMaskedLM.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForMaskedLM.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertForMaskedLM.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBertForMaskedLM.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> or <code>np.ndarray</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/bert/modeling_tf_bert.py#L1248",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFMaskedLMOutput"
>transformers.modeling_tf_outputs.TFMaskedLMOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFMaskedLMOutput"
>transformers.modeling_tf_outputs.TFMaskedLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ir=new Ae({props:{$$slots:{default:[bX]},$$scope:{ctx:B}}}),lr=new ve({props:{anchor:"transformers.TFBertForMaskedLM.call.example",$$slots:{default:[yX]},$$scope:{ctx:B}}}),dr=new ve({props:{anchor:"transformers.TFBertForMaskedLM.call.example-2",$$slots:{default:[vX]},$$scope:{ctx:B}}}),lp=new Pe({}),dp=new N({props:{name:"class transformers.TFBertForNextSentencePrediction",anchor:"transformers.TFBertForNextSentencePrediction",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertForNextSentencePrediction.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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.TFPreTrainedModel.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/bert/modeling_tf_bert.py#L1434"}}),pr=new Ae({props:{$$slots:{default:[TX]},$$scope:{ctx:B}}}),up=new N({props:{name:"call",anchor:"transformers.TFBertForNextSentencePrediction.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"next_sentence_label",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertForNextSentencePrediction.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the 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/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForNextSentencePrediction.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertForNextSentencePrediction.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForNextSentencePrediction.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertForNextSentencePrediction.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertForNextSentencePrediction.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertForNextSentencePrediction.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForNextSentencePrediction.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForNextSentencePrediction.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertForNextSentencePrediction.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/modeling_tf_bert.py#L1444",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFNextSentencePredictorOutput"
>transformers.modeling_tf_outputs.TFNextSentencePredictorOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>next_sentence_label</code> is provided) \u2014 Next sentence prediction loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</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(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFNextSentencePredictorOutput"
>transformers.modeling_tf_outputs.TFNextSentencePredictorOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),hr=new Ae({props:{$$slots:{default:[kX]},$$scope:{ctx:B}}}),mr=new ve({props:{anchor:"transformers.TFBertForNextSentencePrediction.call.example",$$slots:{default:[wX]},$$scope:{ctx:B}}}),fp=new Pe({}),gp=new N({props:{name:"class transformers.TFBertForSequenceClassification",anchor:"transformers.TFBertForSequenceClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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.TFPreTrainedModel.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/bert/modeling_tf_bert.py#L1519"}}),fr=new Ae({props:{$$slots:{default:[MX]},$$scope:{ctx:B}}}),vp=new N({props:{name:"call",anchor:"transformers.TFBertForSequenceClassification.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertForSequenceClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the 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/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForSequenceClassification.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertForSequenceClassification.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForSequenceClassification.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertForSequenceClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertForSequenceClassification.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertForSequenceClassification.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForSequenceClassification.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForSequenceClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertForSequenceClassification.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBertForSequenceClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> or <code>np.ndarray</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/bert/modeling_tf_bert.py#L1540",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, )</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),gr=new Ae({props:{$$slots:{default:[$X]},$$scope:{ctx:B}}}),_r=new ve({props:{anchor:"transformers.TFBertForSequenceClassification.call.example",$$slots:{default:[FX]},$$scope:{ctx:B}}}),br=new ve({props:{anchor:"transformers.TFBertForSequenceClassification.call.example-2",$$slots:{default:[BX]},$$scope:{ctx:B}}}),Tp=new Pe({}),kp=new N({props:{name:"class transformers.TFBertForMultipleChoice",anchor:"transformers.TFBertForMultipleChoice",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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.TFPreTrainedModel.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/bert/modeling_tf_bert.py#L1605"}}),vr=new Ae({props:{$$slots:{default:[xX]},$$scope:{ctx:B}}}),Fp=new N({props:{name:"call",anchor:"transformers.TFBertForMultipleChoice.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertForMultipleChoice.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the 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/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForMultipleChoice.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertForMultipleChoice.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForMultipleChoice.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertForMultipleChoice.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertForMultipleChoice.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertForMultipleChoice.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForMultipleChoice.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForMultipleChoice.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertForMultipleChoice.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBertForMultipleChoice.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> or <code>np.ndarray</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the multiple choice classification loss. Indices should be in <code>[0, ..., num_choices]</code>
where <code>num_choices</code> is the size of the second dimension of the input tensors. (See <code>input_ids</code> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/modeling_tf_bert.py#L1619",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput"
>transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <em>(batch_size, )</em>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_choices)</code>) \u2014 <em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput"
>transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Tr=new Ae({props:{$$slots:{default:[EX]},$$scope:{ctx:B}}}),kr=new ve({props:{anchor:"transformers.TFBertForMultipleChoice.call.example",$$slots:{default:[jX]},$$scope:{ctx:B}}}),Bp=new Pe({}),xp=new N({props:{name:"class transformers.TFBertForTokenClassification",anchor:"transformers.TFBertForTokenClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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.TFPreTrainedModel.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/bert/modeling_tf_bert.py#L1704"}}),Mr=new Ae({props:{$$slots:{default:[zX]},$$scope:{ctx:B}}}),Cp=new N({props:{name:"call",anchor:"transformers.TFBertForTokenClassification.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertForTokenClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the 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/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForTokenClassification.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertForTokenClassification.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForTokenClassification.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertForTokenClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertForTokenClassification.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertForTokenClassification.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForTokenClassification.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForTokenClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertForTokenClassification.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBertForTokenClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> or <code>np.ndarray</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/bert/modeling_tf_bert.py#L1731",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFTokenClassifierOutput"
>transformers.modeling_tf_outputs.TFTokenClassifierOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of unmasked labels, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFTokenClassifierOutput"
>transformers.modeling_tf_outputs.TFTokenClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),$r=new Ae({props:{$$slots:{default:[CX]},$$scope:{ctx:B}}}),Fr=new ve({props:{anchor:"transformers.TFBertForTokenClassification.call.example",$$slots:{default:[JX]},$$scope:{ctx:B}}}),Br=new ve({props:{anchor:"transformers.TFBertForTokenClassification.call.example-2",$$slots:{default:[IX]},$$scope:{ctx:B}}}),Jp=new Pe({}),Ip=new N({props:{name:"class transformers.TFBertForQuestionAnswering",anchor:"transformers.TFBertForQuestionAnswering",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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.TFPreTrainedModel.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/bert/modeling_tf_bert.py#L1794"}}),Er=new Ae({props:{$$slots:{default:[UX]},$$scope:{ctx:B}}}),Pp=new N({props:{name:"call",anchor:"transformers.TFBertForQuestionAnswering.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"start_positions",val:": np.ndarray | tf.Tensor | None = None"},{name:"end_positions",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBertForQuestionAnswering.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the 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/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBertForQuestionAnswering.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBertForQuestionAnswering.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFBertForQuestionAnswering.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBertForQuestionAnswering.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBertForQuestionAnswering.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFBertForQuestionAnswering.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBertForQuestionAnswering.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBertForQuestionAnswering.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBertForQuestionAnswering.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBertForQuestionAnswering.call.start_positions",description:`<strong>start_positions</strong> (<code>tf.Tensor</code> or <code>np.ndarray</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.TFBertForQuestionAnswering.call.end_positions",description:`<strong>end_positions</strong> (<code>tf.Tensor</code> or <code>np.ndarray</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/bert/modeling_tf_bert.py#L1816",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput"
>transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, )</code>, <em>optional</em>, returned when <code>start_positions</code> and <code>end_positions</code> are provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput"
>transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),jr=new Ae({props:{$$slots:{default:[NX]},$$scope:{ctx:B}}}),zr=new ve({props:{anchor:"transformers.TFBertForQuestionAnswering.call.example",$$slots:{default:[WX]},$$scope:{ctx:B}}}),Cr=new ve({props:{anchor:"transformers.TFBertForQuestionAnswering.call.example-2",$$slots:{default:[PX]},$$scope:{ctx:B}}}),qp=new Pe({}),Ap=new N({props:{name:"class transformers.FlaxBertModel",anchor:"transformers.FlaxBertModel",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/modeling_flax_bert.py#L1029"}}),Op=new N({props:{name:"__call__",anchor:"transformers.FlaxBertModel.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.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.FlaxBertModel.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxBertModel.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.FlaxBertModel.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxBertModel.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.FlaxBertModel.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.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/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</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/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ir=new Ae({props:{$$slots:{default:[qX]},$$scope:{ctx:B}}}),Ur=new ve({props:{anchor:"transformers.FlaxBertModel.__call__.example",$$slots:{default:[AX]},$$scope:{ctx:B}}}),Dp=new Pe({}),Qp=new N({props:{name:"class transformers.FlaxBertForPreTraining",anchor:"transformers.FlaxBertForPreTraining",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForPreTraining.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForPreTraining.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/modeling_flax_bert.py#L1104"}}),sh=new N({props:{name:"__call__",anchor:"transformers.FlaxBertForPreTraining.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForPreTraining.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.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.FlaxBertForPreTraining.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxBertForPreTraining.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.FlaxBertForPreTraining.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxBertForPreTraining.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.FlaxBertForPreTraining.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.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/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput"
>transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput</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/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>prediction_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>seq_relationship_logits</strong> (<code>jnp.ndarray</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(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput"
>transformers.models.bert.modeling_flax_bert.FlaxBertForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Wr=new Ae({props:{$$slots:{default:[ZX]},$$scope:{ctx:B}}}),Pr=new ve({props:{anchor:"transformers.FlaxBertForPreTraining.__call__.example",$$slots:{default:[RX]},$$scope:{ctx:B}}}),ah=new Pe({}),rh=new N({props:{name:"class transformers.FlaxBertForCausalLM",anchor:"transformers.FlaxBertForCausalLM",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForCausalLM.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForCausalLM.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/modeling_flax_bert.py#L1677"}}),uh=new N({props:{name:"__call__",anchor:"transformers.FlaxBertForCausalLM.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForCausalLM.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.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.FlaxBertForCausalLM.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxBertForCausalLM.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.FlaxBertForCausalLM.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxBertForCausalLM.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.FlaxBertForCausalLM.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.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/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key, value
states of the self-attention and the cross-attention layers if model is used in encoder-decoder setting.
Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ar=new Ae({props:{$$slots:{default:[VX]},$$scope:{ctx:B}}}),Zr=new ve({props:{anchor:"transformers.FlaxBertForCausalLM.__call__.example",$$slots:{default:[GX]},$$scope:{ctx:B}}}),fh=new Pe({}),gh=new N({props:{name:"class transformers.FlaxBertForMaskedLM",anchor:"transformers.FlaxBertForMaskedLM",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForMaskedLM.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForMaskedLM.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/modeling_flax_bert.py#L1195"}}),$h=new N({props:{name:"__call__",anchor:"transformers.FlaxBertForMaskedLM.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForMaskedLM.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.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.FlaxBertForMaskedLM.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxBertForMaskedLM.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.FlaxBertForMaskedLM.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxBertForMaskedLM.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.FlaxBertForMaskedLM.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.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/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Vr=new Ae({props:{$$slots:{default:[SX]},$$scope:{ctx:B}}}),Gr=new ve({props:{anchor:"transformers.FlaxBertForMaskedLM.__call__.example",$$slots:{default:[XX]},$$scope:{ctx:B}}}),Fh=new Pe({}),Bh=new N({props:{name:"class transformers.FlaxBertForNextSentencePrediction",anchor:"transformers.FlaxBertForNextSentencePrediction",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForNextSentencePrediction.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForNextSentencePrediction.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForNextSentencePrediction.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/modeling_flax_bert.py#L1259"}}),Nh=new N({props:{name:"__call__",anchor:"transformers.FlaxBertForNextSentencePrediction.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForNextSentencePrediction.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.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.FlaxBertForNextSentencePrediction.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxBertForNextSentencePrediction.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.FlaxBertForNextSentencePrediction.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxBertForNextSentencePrediction.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.FlaxBertForNextSentencePrediction.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.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/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxNextSentencePredictorOutput"
>transformers.modeling_flax_outputs.FlaxNextSentencePredictorOutput</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/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</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(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxNextSentencePredictorOutput"
>transformers.modeling_flax_outputs.FlaxNextSentencePredictorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Xr=new Ae({props:{$$slots:{default:[LX]},$$scope:{ctx:B}}}),Lr=new ve({props:{anchor:"transformers.FlaxBertForNextSentencePrediction.__call__.example",$$slots:{default:[OX]},$$scope:{ctx:B}}}),Wh=new Pe({}),Ph=new N({props:{name:"class transformers.FlaxBertForSequenceClassification",anchor:"transformers.FlaxBertForSequenceClassification",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForSequenceClassification.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForSequenceClassification.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/modeling_flax_bert.py#L1362"}}),Xh=new N({props:{name:"__call__",anchor:"transformers.FlaxBertForSequenceClassification.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForSequenceClassification.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.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.FlaxBertForSequenceClassification.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxBertForSequenceClassification.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.FlaxBertForSequenceClassification.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxBertForSequenceClassification.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.FlaxBertForSequenceClassification.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.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/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Dr=new Ae({props:{$$slots:{default:[DX]},$$scope:{ctx:B}}}),Qr=new ve({props:{anchor:"transformers.FlaxBertForSequenceClassification.__call__.example",$$slots:{default:[QX]},$$scope:{ctx:B}}}),Lh=new Pe({}),Oh=new N({props:{name:"class transformers.FlaxBertForMultipleChoice",anchor:"transformers.FlaxBertForMultipleChoice",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForMultipleChoice.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForMultipleChoice.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/modeling_flax_bert.py#L1442"}}),om=new N({props:{name:"__call__",anchor:"transformers.FlaxBertForMultipleChoice.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForMultipleChoice.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.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.FlaxBertForMultipleChoice.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxBertForMultipleChoice.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.FlaxBertForMultipleChoice.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxBertForMultipleChoice.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.FlaxBertForMultipleChoice.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.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/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput"
>transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, num_choices)</code>) \u2014 <em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput"
>transformers.modeling_flax_outputs.FlaxMultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Yr=new Ae({props:{$$slots:{default:[HX]},$$scope:{ctx:B}}}),Kr=new ve({props:{anchor:"transformers.FlaxBertForMultipleChoice.__call__.example",$$slots:{default:[YX]},$$scope:{ctx:B}}}),nm=new Pe({}),sm=new N({props:{name:"class transformers.FlaxBertForTokenClassification",anchor:"transformers.FlaxBertForTokenClassification",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForTokenClassification.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForTokenClassification.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/modeling_flax_bert.py#L1520"}}),hm=new N({props:{name:"__call__",anchor:"transformers.FlaxBertForTokenClassification.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForTokenClassification.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.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.FlaxBertForTokenClassification.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxBertForTokenClassification.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.FlaxBertForTokenClassification.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxBertForTokenClassification.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.FlaxBertForTokenClassification.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.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/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxTokenClassifierOutput"
>transformers.modeling_flax_outputs.FlaxTokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxTokenClassifierOutput"
>transformers.modeling_flax_outputs.FlaxTokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ti=new Ae({props:{$$slots:{default:[KX]},$$scope:{ctx:B}}}),oi=new ve({props:{anchor:"transformers.FlaxBertForTokenClassification.__call__.example",$$slots:{default:[e8]},$$scope:{ctx:B}}}),mm=new Pe({}),um=new N({props:{name:"class transformers.FlaxBertForQuestionAnswering",anchor:"transformers.FlaxBertForQuestionAnswering",parameters:[{name:"config",val:": BertConfig"},{name:"input_shape",val:": typing.Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig">BertConfig</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.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBertForQuestionAnswering.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"},{anchor:"transformers.FlaxBertForQuestionAnswering.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bert/modeling_flax_bert.py#L1593"}}),km=new N({props:{name:"__call__",anchor:"transformers.FlaxBertForQuestionAnswering.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"past_key_values",val:": dict = None"}],parametersDescription:[{anchor:"transformers.FlaxBertForQuestionAnswering.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.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.FlaxBertForQuestionAnswering.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxBertForQuestionAnswering.__call__.token_type_ids",description:`<strong>token_type_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.FlaxBertForQuestionAnswering.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxBertForQuestionAnswering.__call__.head_mask",description:`<strong>head_mask</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional) -- Mask to nullify selected heads of the attention modules. Mask values selected in </code>[0, 1]\`:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.FlaxBertForQuestionAnswering.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.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/bert/modeling_flax_bert.py#L856",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput"
>transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig"
>BertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>start_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput"
>transformers.modeling_flax_outputs.FlaxQuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),si=new Ae({props:{$$slots:{default:[t8]},$$scope:{ctx:B}}}),ai=new ve({props:{anchor:"transformers.FlaxBertForQuestionAnswering.__call__.example",$$slots:{default:[o8]},$$scope:{ctx:B}}}),{c(){d=s("meta"),y=c(),u=s("h1"),f=s("a"),b=s("span"),T(l.$$.fragment),m=c(),E=s("span"),Ee=o("BERT"),we=c(),Z=s("div"),he=s("a"),ee=s("img"),je=c(),V=s("a"),me=s("img"),O=c(),ie=s("h2"),le=s("a"),G=s("span"),T(de.$$.fragment),ze=c(),S=s("span"),Ce=o("Overview"),Me=c(),R=s("p"),Je=o("The BERT model was proposed in "),ce=s("a"),ae=o("BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding"),C=o(` by Jacob Devlin, Ming-Wei Chang, Kenton Lee and Kristina Toutanova. It\u2019s a
bidirectional transformer pretrained using a combination of masked language modeling objective and next sentence
prediction on a large corpus comprising the Toronto Book Corpus and Wikipedia.`),U=c(),ue=s("p"),D=o("The abstract from the paper is the following:"),$e=c(),fe=s("p"),X=s("em"),Ie=o(`We introduce a new language representation model called BERT, which stands for Bidirectional Encoder Representations
from Transformers. Unlike recent language representation models, BERT is designed to pre-train deep bidirectional
representations from unlabeled text by jointly conditioning on both left and right context in all layers. As a result,
the pre-trained BERT model can be fine-tuned with just one additional output layer to create state-of-the-art models
for a wide range of tasks, such as question answering and language inference, without substantial task-specific
architecture modifications.`),Fe=c(),J=s("p"),_e=s("em"),Q=o(`BERT is conceptually simple and empirically powerful. It obtains new state-of-the-art results on eleven natural
language processing tasks, including pushing the GLUE score to 80.5% (7.7% point absolute improvement), MultiNLI
accuracy to 86.7% (4.6% absolute improvement), SQuAD v1.1 question answering Test F1 to 93.2 (1.5 point absolute
improvement) and SQuAD v2.0 Test F1 to 83.1 (5.1 point absolute improvement).`),Be=c(),ge=s("p"),H=o("Tips:"),xe=c(),se=s("ul"),P=s("li"),be=s("p"),Y=o(`BERT is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than
the left.`),Ue=c(),te=s("li"),I=s("p"),Ne=o(`BERT was trained with the masked language modeling (MLM) and next sentence prediction (NSP) objectives. It is
efficient at predicting masked tokens and at NLU in general, but is not optimal for text generation.`),W=c(),pe=s("li"),ye=s("p"),v=o("Corrupts the inputs by using random masking, more precisely, during pretraining, a given percentage of tokens (usually 15%) is masked by:"),j=c(),Ze=s("ul"),oe=s("li"),Se=o("a special mask token with probability 0.8"),Xe=c(),z=s("li"),Le=o("a random token different from the one masked with probability 0.1"),Oe=c(),Ve=s("li"),De=o("the same token with probability 0.1"),Qe=c(),q=s("li"),L=s("p"),He=o("The model must predict the original sentence, but has a second objective: inputs are two sentences A and B (with a separation token in between). With probability 50%, the sentences are consecutive in the corpus, in the remaining 50% they are not related. The model has to predict if the sentences are consecutive or not."),Ge=c(),A=s("p"),Ye=o("This model was contributed by "),Re=s("a"),We=o("thomwolf"),Ke=o(". The original code can be found "),K=s("a"),et=o("here"),wM=o("."),CT=c(),Nn=s("h2"),aa=s("a"),rg=s("span"),T(Ai.$$.fragment),MM=c(),ig=s("span"),$M=o("Resources"),JT=c(),Rm=s("p"),FM=o("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with BERT. If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),IT=c(),T(Zi.$$.fragment),UT=c(),tt=s("ul"),Ri=s("li"),BM=o("A blog post on "),Vi=s("a"),xM=o("BERT Text Classification in a different language"),EM=o("."),jM=c(),Gi=s("li"),zM=o("A notebook for "),Si=s("a"),CM=o("Finetuning BERT (and friends) for multi-label text classification"),JM=o("."),IM=c(),Xi=s("li"),UM=o("A notebook on how to "),Li=s("a"),NM=o("Finetune BERT for multi-label classification using PyTorch"),WM=o(". \u{1F30E}"),PM=c(),Oi=s("li"),qM=o("A notebook on how to "),Di=s("a"),AM=o("warm-start an EncoderDecoder model with BERT for summarization"),ZM=o("."),RM=c(),Qo=s("li"),Vm=s("a"),VM=o("BertForSequenceClassification"),GM=o(" is supported by this "),Qi=s("a"),SM=o("example script"),XM=o(" and "),Hi=s("a"),LM=o("notebook"),OM=o("."),DM=c(),Ho=s("li"),Gm=s("a"),QM=o("TFBertForSequenceClassification"),HM=o(" is supported by this "),Yi=s("a"),YM=o("example script"),KM=o(" and "),Ki=s("a"),e0=o("notebook"),t0=o("."),o0=c(),Yo=s("li"),Sm=s("a"),n0=o("FlaxBertForSequenceClassification"),s0=o(" is supported by this "),el=s("a"),a0=o("example script"),r0=o(" and "),tl=s("a"),i0=o("notebook"),l0=o("."),d0=c(),lg=s("li"),Xm=s("a"),c0=o("Text classification task guide"),NT=c(),T(ol.$$.fragment),WT=c(),ft=s("ul"),nl=s("li"),p0=o("A blog post on how to use "),sl=s("a"),h0=o("Hugging Face Transformers with Keras: Fine-tune a non-English BERT for Named Entity Recognition"),m0=o("."),u0=c(),Wn=s("li"),f0=o("A notebook for "),al=s("a"),g0=o("Finetuning BERT for named-entity recognition"),_0=o(" using only the first wordpiece of each word in the word label during tokenization. To propagate the label of the word to all wordpieces, see this "),rl=s("a"),b0=o("version"),y0=o(" of the notebook instead."),v0=c(),Ko=s("li"),Lm=s("a"),T0=o("BertForTokenClassification"),k0=o(" is supported by this "),il=s("a"),w0=o("example script"),M0=o(" and "),ll=s("a"),$0=o("notebook"),F0=o("."),B0=c(),en=s("li"),Om=s("a"),x0=o("TFBertForTokenClassification"),E0=o(" is supported by this "),dl=s("a"),j0=o("example script"),z0=o(" and "),cl=s("a"),C0=o("notebook"),J0=o("."),I0=c(),ra=s("li"),Dm=s("a"),U0=o("FlaxBertForTokenClassification"),N0=o(" is supported by this "),pl=s("a"),W0=o("example script"),P0=o("."),q0=c(),Qm=s("li"),hl=s("a"),A0=o("Token classification"),Z0=o(" chapter of the \u{1F917} Hugging Face Course."),R0=c(),dg=s("li"),Hm=s("a"),V0=o("Token classification task guide"),PT=c(),T(ml.$$.fragment),qT=c(),Pt=s("ul"),tn=s("li"),Ym=s("a"),G0=o("BertForMaskedLM"),S0=o(" is supported by this "),ul=s("a"),X0=o("example script"),L0=o(" and "),fl=s("a"),O0=o("notebook"),D0=o("."),Q0=c(),on=s("li"),Km=s("a"),H0=o("TFBertForMaskedLM"),Y0=o(" is supported by this "),gl=s("a"),K0=o("example script"),e2=o(" and "),_l=s("a"),t2=o("notebook"),o2=o("."),n2=c(),nn=s("li"),eu=s("a"),s2=o("FlaxBertForMaskedLM"),a2=o(" is supported by this "),bl=s("a"),r2=o("example script"),i2=o(" and "),yl=s("a"),l2=o("notebook"),d2=o("."),c2=c(),tu=s("li"),vl=s("a"),p2=o("Masked language modeling"),h2=o(" chapter of the \u{1F917} Hugging Face Course."),m2=c(),cg=s("li"),ou=s("a"),u2=o("Masked language modeling task guide"),AT=c(),T(Tl.$$.fragment),ZT=c(),qt=s("ul"),sn=s("li"),nu=s("a"),f2=o("BertForQuestionAnswering"),g2=o(" is supported by this "),kl=s("a"),_2=o("example script"),b2=o(" and "),wl=s("a"),y2=o("notebook"),v2=o("."),T2=c(),an=s("li"),su=s("a"),k2=o("TFBertForQuestionAnswering"),w2=o(" is supported by this "),Ml=s("a"),M2=o("example script"),$2=o(" and "),$l=s("a"),F2=o("notebook"),B2=o("."),x2=c(),ia=s("li"),au=s("a"),E2=o("FlaxBertForQuestionAnswering"),j2=o(" is supported by this "),Fl=s("a"),z2=o("example script"),C2=o("."),J2=c(),ru=s("li"),Bl=s("a"),I2=o("Question answering"),U2=o(" chapter of the \u{1F917} Hugging Face Course."),N2=c(),pg=s("li"),iu=s("a"),W2=o("Question answering task guide"),RT=c(),lu=s("p"),hg=s("strong"),P2=o("Multiple choice"),VT=c(),rn=s("ul"),ln=s("li"),du=s("a"),q2=o("BertForMultipleChoice"),A2=o(" is supported by this "),xl=s("a"),Z2=o("example script"),R2=o(" and "),El=s("a"),V2=o("notebook"),G2=o("."),S2=c(),dn=s("li"),cu=s("a"),X2=o("TFBertForMultipleChoice"),L2=o(" is supported by this "),jl=s("a"),O2=o("example script"),D2=o(" and "),zl=s("a"),Q2=o("notebook"),H2=o("."),Y2=c(),mg=s("li"),pu=s("a"),K2=o("Multiple choice task guide"),GT=c(),Cl=s("p"),e$=o("\u26A1\uFE0F "),ug=s("strong"),t$=o("Inference"),ST=c(),la=s("ul"),Jl=s("li"),o$=o("A blog post on how to "),Il=s("a"),n$=o("Accelerate BERT inference with Hugging Face Transformers and AWS Inferentia"),s$=o("."),a$=c(),Ul=s("li"),r$=o("A blog post on how to "),Nl=s("a"),i$=o("Accelerate BERT inference with DeepSpeed-Inference on GPUs"),l$=o("."),XT=c(),Wl=s("p"),d$=o("\u2699\uFE0F "),fg=s("strong"),c$=o("Pretraining"),LT=c(),hu=s("ul"),Pl=s("li"),p$=o("A blog post on "),ql=s("a"),h$=o("Pre-Training BERT with Hugging Face Transformers and Habana Gaudi"),m$=o("."),OT=c(),Al=s("p"),u$=o("\u{1F680} "),gg=s("strong"),f$=o("Deploy"),DT=c(),Ft=s("ul"),Zl=s("li"),g$=o("A blog post on how to "),Rl=s("a"),_$=o("Convert Transformers to ONNX with Hugging Face Optimum"),b$=o("."),y$=c(),Vl=s("li"),v$=o("A blog post on how to "),Gl=s("a"),T$=o("Setup Deep Learning environment for Hugging Face Transformers with Habana Gaudi on AWS"),k$=o("."),w$=c(),Sl=s("li"),M$=o("A blog post on "),Xl=s("a"),$$=o("Autoscaling BERT with Hugging Face Transformers, Amazon SageMaker and Terraform module"),F$=o("."),B$=c(),Ll=s("li"),x$=o("A blog post on "),Ol=s("a"),E$=o("Serverless BERT with HuggingFace, AWS Lambda, and Docker"),j$=o("."),z$=c(),Dl=s("li"),C$=o("A blog post on "),Ql=s("a"),J$=o("Hugging Face Transformers BERT fine-tuning using Amazon SageMaker and Training Compiler"),I$=o("."),U$=c(),Hl=s("li"),N$=o("A blog post on "),Yl=s("a"),W$=o("Task-specific knowledge distillation for BERT using Transformers & Amazon SageMaker"),P$=o("."),QT=c(),Pn=s("h2"),da=s("a"),_g=s("span"),T(Kl.$$.fragment),q$=c(),bg=s("span"),A$=o("BertConfig"),HT=c(),so=s("div"),T(ed.$$.fragment),Z$=c(),Po=s("p"),R$=o("This is the configuration class to store the configuration of a "),mu=s("a"),V$=o("BertModel"),G$=o(" or a "),uu=s("a"),S$=o("TFBertModel"),X$=o(`. It is used to
instantiate a BERT 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 BERT
`),td=s("a"),L$=o("bert-base-uncased"),O$=o(" architecture."),D$=c(),qn=s("p"),Q$=o("Configuration objects inherit from "),fu=s("a"),H$=o("PretrainedConfig"),Y$=o(` and can be used to control the model outputs. Read the
documentation from `),gu=s("a"),K$=o("PretrainedConfig"),eF=o(" for more information."),tF=c(),T(ca.$$.fragment),YT=c(),An=s("h2"),pa=s("a"),yg=s("span"),T(od.$$.fragment),oF=c(),vg=s("span"),nF=o("BertTokenizer"),KT=c(),ot=s("div"),T(nd.$$.fragment),sF=c(),Tg=s("p"),aF=o("Construct a BERT tokenizer. Based on WordPiece."),rF=c(),sd=s("p"),iF=o("This tokenizer inherits from "),_u=s("a"),lF=o("PreTrainedTokenizer"),dF=o(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),cF=c(),cn=s("div"),T(ad.$$.fragment),pF=c(),kg=s("p"),hF=o(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A BERT sequence has the following format:`),mF=c(),rd=s("ul"),bu=s("li"),uF=o("single sequence: "),wg=s("code"),fF=o("[CLS] X [SEP]"),gF=c(),yu=s("li"),_F=o("pair of sequences: "),Mg=s("code"),bF=o("[CLS] A [SEP] B [SEP]"),yF=c(),ha=s("div"),T(id.$$.fragment),vF=c(),ld=s("p"),TF=o(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),$g=s("code"),kF=o("prepare_for_model"),wF=o(" method."),MF=c(),ao=s("div"),T(dd.$$.fragment),$F=c(),Fg=s("p"),FF=o("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),BF=c(),T(ma.$$.fragment),xF=c(),Zn=s("p"),EF=o("If "),Bg=s("code"),jF=o("token_ids_1"),zF=o(" is "),xg=s("code"),CF=o("None"),JF=o(", this method only returns the first portion of the mask (0s)."),IF=c(),vu=s("div"),T(cd.$$.fragment),e1=c(),Rn=s("h2"),ua=s("a"),Eg=s("span"),T(pd.$$.fragment),UF=c(),jg=s("span"),NF=o("BertTokenizerFast"),t1=c(),xt=s("div"),T(hd.$$.fragment),WF=c(),md=s("p"),PF=o("Construct a \u201Cfast\u201D BERT tokenizer (backed by HuggingFace\u2019s "),zg=s("em"),qF=o("tokenizers"),AF=o(" library). Based on WordPiece."),ZF=c(),ud=s("p"),RF=o("This tokenizer inherits from "),Tu=s("a"),VF=o("PreTrainedTokenizerFast"),GF=o(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),SF=c(),pn=s("div"),T(fd.$$.fragment),XF=c(),Cg=s("p"),LF=o(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A BERT sequence has the following format:`),OF=c(),gd=s("ul"),ku=s("li"),DF=o("single sequence: "),Jg=s("code"),QF=o("[CLS] X [SEP]"),HF=c(),wu=s("li"),YF=o("pair of sequences: "),Ig=s("code"),KF=o("[CLS] A [SEP] B [SEP]"),eB=c(),ro=s("div"),T(_d.$$.fragment),tB=c(),Ug=s("p"),oB=o("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),nB=c(),T(fa.$$.fragment),sB=c(),Vn=s("p"),aB=o("If "),Ng=s("code"),rB=o("token_ids_1"),iB=o(" is "),Wg=s("code"),lB=o("None"),dB=o(", this method only returns the first portion of the mask (0s)."),o1=c(),Gn=s("h2"),ga=s("a"),Pg=s("span"),T(bd.$$.fragment),cB=c(),qg=s("span"),pB=o("TFBertTokenizer"),n1=c(),Et=s("div"),T(yd.$$.fragment),hB=c(),Sn=s("p"),mB=o(`This is an in-graph tokenizer for BERT. It should be initialized similarly to other tokenizers, using the
`),Ag=s("code"),uB=o("from_pretrained()"),fB=o(" method. It can also be initialized with the "),Zg=s("code"),gB=o("from_tokenizer()"),_B=o(` method, which imports settings
from an existing standard tokenizer object.`),bB=c(),vd=s("p"),yB=o(`In-graph tokenizers, unlike other Hugging Face tokenizers, are actually Keras layers and are designed to be run
when the model is called, rather than during preprocessing. As a result, they have somewhat more limited options
than standard tokenizer classes. They are most useful when you want to create an end-to-end model that goes
straight from `),Rg=s("code"),vB=o("tf.string"),TB=o(" inputs to outputs."),kB=c(),hn=s("div"),T(Td.$$.fragment),wB=c(),kd=s("p"),MB=o("Instantiate a "),Vg=s("code"),$B=o("TFBertTokenizer"),FB=o(" from a pre-trained tokenizer."),BB=c(),T(_a.$$.fragment),xB=c(),mn=s("div"),T(wd.$$.fragment),EB=c(),Xn=s("p"),jB=o("Initialize a "),Gg=s("code"),zB=o("TFBertTokenizer"),CB=o(" from an existing "),Sg=s("code"),JB=o("Tokenizer"),IB=o("."),UB=c(),T(ba.$$.fragment),s1=c(),Ln=s("h2"),ya=s("a"),Xg=s("span"),T(Md.$$.fragment),NB=c(),Lg=s("span"),WB=o("Bert specific outputs"),a1=c(),On=s("div"),T($d.$$.fragment),PB=c(),Fd=s("p"),qB=o("Output type of "),Mu=s("a"),AB=o("BertForPreTraining"),ZB=o("."),r1=c(),Dn=s("div"),T(Bd.$$.fragment),RB=c(),xd=s("p"),VB=o("Output type of "),$u=s("a"),GB=o("TFBertForPreTraining"),SB=o("."),i1=c(),qo=s("div"),T(Ed.$$.fragment),XB=c(),jd=s("p"),LB=o("Output type of "),Fu=s("a"),OB=o("BertForPreTraining"),DB=o("."),QB=c(),va=s("div"),T(zd.$$.fragment),HB=c(),Og=s("p"),YB=o("\u201CReturns a new object replacing the specified fields with new values."),l1=c(),Qn=s("h2"),Ta=s("a"),Dg=s("span"),T(Cd.$$.fragment),KB=c(),Qg=s("span"),ex=o("BertModel"),d1=c(),nt=s("div"),T(Jd.$$.fragment),tx=c(),Hg=s("p"),ox=o("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),nx=c(),Id=s("p"),sx=o("This model inherits from "),Bu=s("a"),ax=o("PreTrainedModel"),rx=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ix=c(),Ud=s("p"),lx=o("This model is also a PyTorch "),Nd=s("a"),dx=o("torch.nn.Module"),cx=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),px=c(),Wd=s("p"),hx=o(`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),Pd=s("a"),mx=o(`Attention is
all you need`),ux=o(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),fx=c(),gt=s("p"),gx=o("To behave as an decoder the model needs to be initialized with the "),Yg=s("code"),_x=o("is_decoder"),bx=o(` argument of the configuration set
to `),Kg=s("code"),yx=o("True"),vx=o(". To be used in a Seq2Seq model, the model needs to initialized with both "),e_=s("code"),Tx=o("is_decoder"),kx=o(` argument and
`),t_=s("code"),wx=o("add_cross_attention"),Mx=o(" set to "),o_=s("code"),$x=o("True"),Fx=o("; an "),n_=s("code"),Bx=o("encoder_hidden_states"),xx=o(" is then expected as an input to the forward pass."),Ex=c(),io=s("div"),T(qd.$$.fragment),jx=c(),Hn=s("p"),zx=o("The "),xu=s("a"),Cx=o("BertModel"),Jx=o(" forward method, overrides the "),s_=s("code"),Ix=o("__call__"),Ux=o(" special method."),Nx=c(),T(ka.$$.fragment),Wx=c(),T(wa.$$.fragment),c1=c(),Yn=s("h2"),Ma=s("a"),a_=s("span"),T(Ad.$$.fragment),Px=c(),r_=s("span"),qx=o("BertForPreTraining"),p1=c(),jt=s("div"),T(Zd.$$.fragment),Ax=c(),Kn=s("p"),Zx=o("Bert Model with two heads on top as done during the pretraining: a "),i_=s("code"),Rx=o("masked language modeling"),Vx=o(" head and a "),l_=s("code"),Gx=o("next sentence prediction (classification)"),Sx=o(" head."),Xx=c(),Rd=s("p"),Lx=o("This model inherits from "),Eu=s("a"),Ox=o("PreTrainedModel"),Dx=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Qx=c(),Vd=s("p"),Hx=o("This model is also a PyTorch "),Gd=s("a"),Yx=o("torch.nn.Module"),Kx=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),eE=c(),lo=s("div"),T(Sd.$$.fragment),tE=c(),es=s("p"),oE=o("The "),ju=s("a"),nE=o("BertForPreTraining"),sE=o(" forward method, overrides the "),d_=s("code"),aE=o("__call__"),rE=o(" special method."),iE=c(),T($a.$$.fragment),lE=c(),T(Fa.$$.fragment),h1=c(),ts=s("h2"),Ba=s("a"),c_=s("span"),T(Xd.$$.fragment),dE=c(),p_=s("span"),cE=o("BertLMHeadModel"),m1=c(),zt=s("div"),T(Ld.$$.fragment),pE=c(),Od=s("p"),hE=o("Bert Model with a "),h_=s("code"),mE=o("language modeling"),uE=o(" head on top for CLM fine-tuning."),fE=c(),Dd=s("p"),gE=o("This model inherits from "),zu=s("a"),_E=o("PreTrainedModel"),bE=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),yE=c(),Qd=s("p"),vE=o("This model is also a PyTorch "),Hd=s("a"),TE=o("torch.nn.Module"),kE=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),wE=c(),co=s("div"),T(Yd.$$.fragment),ME=c(),os=s("p"),$E=o("The "),Cu=s("a"),FE=o("BertLMHeadModel"),BE=o(" forward method, overrides the "),m_=s("code"),xE=o("__call__"),EE=o(" special method."),jE=c(),T(xa.$$.fragment),zE=c(),T(Ea.$$.fragment),u1=c(),ns=s("h2"),ja=s("a"),u_=s("span"),T(Kd.$$.fragment),CE=c(),f_=s("span"),JE=o("BertForMaskedLM"),f1=c(),Ct=s("div"),T(ec.$$.fragment),IE=c(),tc=s("p"),UE=o("Bert Model with a "),g_=s("code"),NE=o("language modeling"),WE=o(" head on top."),PE=c(),oc=s("p"),qE=o("This model inherits from "),Ju=s("a"),AE=o("PreTrainedModel"),ZE=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),RE=c(),nc=s("p"),VE=o("This model is also a PyTorch "),sc=s("a"),GE=o("torch.nn.Module"),SE=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),XE=c(),po=s("div"),T(ac.$$.fragment),LE=c(),ss=s("p"),OE=o("The "),Iu=s("a"),DE=o("BertForMaskedLM"),QE=o(" forward method, overrides the "),__=s("code"),HE=o("__call__"),YE=o(" special method."),KE=c(),T(za.$$.fragment),ej=c(),T(Ca.$$.fragment),g1=c(),as=s("h2"),Ja=s("a"),b_=s("span"),T(rc.$$.fragment),tj=c(),y_=s("span"),oj=o("BertForNextSentencePrediction"),_1=c(),Jt=s("div"),T(ic.$$.fragment),nj=c(),lc=s("p"),sj=o("Bert Model with a "),v_=s("code"),aj=o("next sentence prediction (classification)"),rj=o(" head on top."),ij=c(),dc=s("p"),lj=o("This model inherits from "),Uu=s("a"),dj=o("PreTrainedModel"),cj=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),pj=c(),cc=s("p"),hj=o("This model is also a PyTorch "),pc=s("a"),mj=o("torch.nn.Module"),uj=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),fj=c(),ho=s("div"),T(hc.$$.fragment),gj=c(),rs=s("p"),_j=o("The "),Nu=s("a"),bj=o("BertForNextSentencePrediction"),yj=o(" forward method, overrides the "),T_=s("code"),vj=o("__call__"),Tj=o(" special method."),kj=c(),T(Ia.$$.fragment),wj=c(),T(Ua.$$.fragment),b1=c(),is=s("h2"),Na=s("a"),k_=s("span"),T(mc.$$.fragment),Mj=c(),w_=s("span"),$j=o("BertForSequenceClassification"),y1=c(),It=s("div"),T(uc.$$.fragment),Fj=c(),M_=s("p"),Bj=o(`Bert Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),xj=c(),fc=s("p"),Ej=o("This model inherits from "),Wu=s("a"),jj=o("PreTrainedModel"),zj=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Cj=c(),gc=s("p"),Jj=o("This model is also a PyTorch "),_c=s("a"),Ij=o("torch.nn.Module"),Uj=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Nj=c(),At=s("div"),T(bc.$$.fragment),Wj=c(),ls=s("p"),Pj=o("The "),Pu=s("a"),qj=o("BertForSequenceClassification"),Aj=o(" forward method, overrides the "),$_=s("code"),Zj=o("__call__"),Rj=o(" special method."),Vj=c(),T(Wa.$$.fragment),Gj=c(),T(Pa.$$.fragment),Sj=c(),T(qa.$$.fragment),v1=c(),ds=s("h2"),Aa=s("a"),F_=s("span"),T(yc.$$.fragment),Xj=c(),B_=s("span"),Lj=o("BertForMultipleChoice"),T1=c(),Ut=s("div"),T(vc.$$.fragment),Oj=c(),x_=s("p"),Dj=o(`Bert 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.`),Qj=c(),Tc=s("p"),Hj=o("This model inherits from "),qu=s("a"),Yj=o("PreTrainedModel"),Kj=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),e4=c(),kc=s("p"),t4=o("This model is also a PyTorch "),wc=s("a"),o4=o("torch.nn.Module"),n4=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),s4=c(),mo=s("div"),T(Mc.$$.fragment),a4=c(),cs=s("p"),r4=o("The "),Au=s("a"),i4=o("BertForMultipleChoice"),l4=o(" forward method, overrides the "),E_=s("code"),d4=o("__call__"),c4=o(" special method."),p4=c(),T(Za.$$.fragment),h4=c(),T(Ra.$$.fragment),k1=c(),ps=s("h2"),Va=s("a"),j_=s("span"),T($c.$$.fragment),m4=c(),z_=s("span"),u4=o("BertForTokenClassification"),w1=c(),Nt=s("div"),T(Fc.$$.fragment),f4=c(),C_=s("p"),g4=o(`Bert 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.`),_4=c(),Bc=s("p"),b4=o("This model inherits from "),Zu=s("a"),y4=o("PreTrainedModel"),v4=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),T4=c(),xc=s("p"),k4=o("This model is also a PyTorch "),Ec=s("a"),w4=o("torch.nn.Module"),M4=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),$4=c(),uo=s("div"),T(jc.$$.fragment),F4=c(),hs=s("p"),B4=o("The "),Ru=s("a"),x4=o("BertForTokenClassification"),E4=o(" forward method, overrides the "),J_=s("code"),j4=o("__call__"),z4=o(" special method."),C4=c(),T(Ga.$$.fragment),J4=c(),T(Sa.$$.fragment),M1=c(),ms=s("h2"),Xa=s("a"),I_=s("span"),T(zc.$$.fragment),I4=c(),U_=s("span"),U4=o("BertForQuestionAnswering"),$1=c(),Wt=s("div"),T(Cc.$$.fragment),N4=c(),us=s("p"),W4=o(`Bert 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 `),N_=s("code"),P4=o("span start logits"),q4=o(" and "),W_=s("code"),A4=o("span end logits"),Z4=o(")."),R4=c(),Jc=s("p"),V4=o("This model inherits from "),Vu=s("a"),G4=o("PreTrainedModel"),S4=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),X4=c(),Ic=s("p"),L4=o("This model is also a PyTorch "),Uc=s("a"),O4=o("torch.nn.Module"),D4=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Q4=c(),fo=s("div"),T(Nc.$$.fragment),H4=c(),fs=s("p"),Y4=o("The "),Gu=s("a"),K4=o("BertForQuestionAnswering"),e3=o(" forward method, overrides the "),P_=s("code"),t3=o("__call__"),o3=o(" special method."),n3=c(),T(La.$$.fragment),s3=c(),T(Oa.$$.fragment),F1=c(),gs=s("h2"),Da=s("a"),q_=s("span"),T(Wc.$$.fragment),a3=c(),A_=s("span"),r3=o("TFBertModel"),B1=c(),_t=s("div"),T(Pc.$$.fragment),i3=c(),Z_=s("p"),l3=o("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),d3=c(),qc=s("p"),c3=o("This model inherits from "),Su=s("a"),p3=o("TFPreTrainedModel"),h3=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),m3=c(),Ac=s("p"),u3=o("This model is also a "),Zc=s("a"),f3=o("tf.keras.Model"),g3=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),_3=c(),T(Qa.$$.fragment),b3=c(),go=s("div"),T(Rc.$$.fragment),y3=c(),_s=s("p"),v3=o("The "),Xu=s("a"),T3=o("TFBertModel"),k3=o(" forward method, overrides the "),R_=s("code"),w3=o("__call__"),M3=o(" special method."),$3=c(),T(Ha.$$.fragment),F3=c(),T(Ya.$$.fragment),x1=c(),bs=s("h2"),Ka=s("a"),V_=s("span"),T(Vc.$$.fragment),B3=c(),G_=s("span"),x3=o("TFBertForPreTraining"),E1=c(),bt=s("div"),T(Gc.$$.fragment),E3=c(),ys=s("p"),j3=o(`Bert Model with two heads on top as done during the pretraining:
a `),S_=s("code"),z3=o("masked language modeling"),C3=o(" head and a "),X_=s("code"),J3=o("next sentence prediction (classification)"),I3=o(" head."),U3=c(),Sc=s("p"),N3=o("This model inherits from "),Lu=s("a"),W3=o("TFPreTrainedModel"),P3=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),q3=c(),Xc=s("p"),A3=o("This model is also a "),Lc=s("a"),Z3=o("tf.keras.Model"),R3=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),V3=c(),T(er.$$.fragment),G3=c(),_o=s("div"),T(Oc.$$.fragment),S3=c(),vs=s("p"),X3=o("The "),Ou=s("a"),L3=o("TFBertForPreTraining"),O3=o(" forward method, overrides the "),L_=s("code"),D3=o("__call__"),Q3=o(" special method."),H3=c(),T(tr.$$.fragment),Y3=c(),T(or.$$.fragment),j1=c(),Ts=s("h2"),nr=s("a"),O_=s("span"),T(Dc.$$.fragment),K3=c(),D_=s("span"),ez=o("TFBertModelLMHeadModel"),z1=c(),ks=s("div"),T(Qc.$$.fragment),tz=c(),Zt=s("div"),T(Hc.$$.fragment),oz=c(),st=s("p"),nz=o("encoder_hidden_states  ("),Q_=s("code"),sz=o("tf.Tensor"),az=o(" of shape "),H_=s("code"),rz=o("(batch_size, sequence_length, hidden_size)"),iz=o(", "),Y_=s("em"),lz=o("optional"),dz=o(`):
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.
encoder_attention_mask (`),K_=s("code"),cz=o("tf.Tensor"),pz=o(" of shape "),eb=s("code"),hz=o("(batch_size, sequence_length)"),mz=o(", "),tb=s("em"),uz=o("optional"),fz=o(`):
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in `),ob=s("code"),gz=o("[0, 1]"),_z=o(":"),bz=c(),Yc=s("ul"),Kc=s("li"),yz=o("1 for tokens that are "),nb=s("strong"),vz=o("not masked"),Tz=o(","),kz=c(),ep=s("li"),wz=o("0 for tokens that are "),sb=s("strong"),Mz=o("masked"),$z=o("."),Fz=c(),ne=s("p"),Bz=o("past_key_values ("),ab=s("code"),xz=o("Tuple[Tuple[tf.Tensor]]"),Ez=o(" of length "),rb=s("code"),jz=o("config.n_layers"),zz=o(`)
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If `),ib=s("code"),Cz=o("past_key_values"),Jz=o(" are used, the user can optionally input only the last "),lb=s("code"),Iz=o("decoder_input_ids"),Uz=o(` (those that
don\u2019t have their past key value states given to this model) of shape `),db=s("code"),Nz=o("(batch_size, 1)"),Wz=o(` instead of all
`),cb=s("code"),Pz=o("decoder_input_ids"),qz=o(" of shape "),pb=s("code"),Az=o("(batch_size, sequence_length)"),Zz=o(`.
use_cache (`),hb=s("code"),Rz=o("bool"),Vz=o(", "),mb=s("em"),Gz=o("optional"),Sz=o(", defaults to "),ub=s("code"),Xz=o("True"),Lz=o(`):
If set to `),fb=s("code"),Oz=o("True"),Dz=o(", "),gb=s("code"),Qz=o("past_key_values"),Hz=o(` key value states are returned and can be used to speed up decoding (see
`),_b=s("code"),Yz=o("past_key_values"),Kz=o("). Set to "),bb=s("code"),eC=o("False"),tC=o(" during training, "),yb=s("code"),oC=o("True"),nC=o(` during generation
labels (`),vb=s("code"),sC=o("tf.Tensor"),aC=o(" or "),Tb=s("code"),rC=o("np.ndarray"),iC=o(" of shape "),kb=s("code"),lC=o("(batch_size, sequence_length)"),dC=o(", "),wb=s("em"),cC=o("optional"),pC=o(`):
Labels for computing the cross entropy classification loss. Indices should be in `),Mb=s("code"),hC=o("[0, ..., config.vocab_size - 1]"),mC=o("."),uC=c(),T(sr.$$.fragment),C1=c(),ws=s("h2"),ar=s("a"),$b=s("span"),T(tp.$$.fragment),fC=c(),Fb=s("span"),gC=o("TFBertForMaskedLM"),J1=c(),yt=s("div"),T(op.$$.fragment),_C=c(),np=s("p"),bC=o("Bert Model with a "),Bb=s("code"),yC=o("language modeling"),vC=o(" head on top."),TC=c(),sp=s("p"),kC=o("This model inherits from "),Du=s("a"),wC=o("TFPreTrainedModel"),MC=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),$C=c(),ap=s("p"),FC=o("This model is also a "),rp=s("a"),BC=o("tf.keras.Model"),xC=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),EC=c(),T(rr.$$.fragment),jC=c(),Rt=s("div"),T(ip.$$.fragment),zC=c(),Ms=s("p"),CC=o("The "),Qu=s("a"),JC=o("TFBertForMaskedLM"),IC=o(" forward method, overrides the "),xb=s("code"),UC=o("__call__"),NC=o(" special method."),WC=c(),T(ir.$$.fragment),PC=c(),T(lr.$$.fragment),qC=c(),T(dr.$$.fragment),I1=c(),$s=s("h2"),cr=s("a"),Eb=s("span"),T(lp.$$.fragment),AC=c(),jb=s("span"),ZC=o("TFBertForNextSentencePrediction"),U1=c(),vt=s("div"),T(dp.$$.fragment),RC=c(),cp=s("p"),VC=o("Bert Model with a "),zb=s("code"),GC=o("next sentence prediction (classification)"),SC=o(" head on top."),XC=c(),pp=s("p"),LC=o("This model inherits from "),Hu=s("a"),OC=o("TFPreTrainedModel"),DC=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),QC=c(),hp=s("p"),HC=o("This model is also a "),mp=s("a"),YC=o("tf.keras.Model"),KC=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),eJ=c(),T(pr.$$.fragment),tJ=c(),bo=s("div"),T(up.$$.fragment),oJ=c(),Fs=s("p"),nJ=o("The "),Yu=s("a"),sJ=o("TFBertForNextSentencePrediction"),aJ=o(" forward method, overrides the "),Cb=s("code"),rJ=o("__call__"),iJ=o(" special method."),lJ=c(),T(hr.$$.fragment),dJ=c(),T(mr.$$.fragment),N1=c(),Bs=s("h2"),ur=s("a"),Jb=s("span"),T(fp.$$.fragment),cJ=c(),Ib=s("span"),pJ=o("TFBertForSequenceClassification"),W1=c(),Tt=s("div"),T(gp.$$.fragment),hJ=c(),Ub=s("p"),mJ=o(`Bert Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),uJ=c(),_p=s("p"),fJ=o("This model inherits from "),Ku=s("a"),gJ=o("TFPreTrainedModel"),_J=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),bJ=c(),bp=s("p"),yJ=o("This model is also a "),yp=s("a"),vJ=o("tf.keras.Model"),TJ=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),kJ=c(),T(fr.$$.fragment),wJ=c(),Vt=s("div"),T(vp.$$.fragment),MJ=c(),xs=s("p"),$J=o("The "),ef=s("a"),FJ=o("TFBertForSequenceClassification"),BJ=o(" forward method, overrides the "),Nb=s("code"),xJ=o("__call__"),EJ=o(" special method."),jJ=c(),T(gr.$$.fragment),zJ=c(),T(_r.$$.fragment),CJ=c(),T(br.$$.fragment),P1=c(),Es=s("h2"),yr=s("a"),Wb=s("span"),T(Tp.$$.fragment),JJ=c(),Pb=s("span"),IJ=o("TFBertForMultipleChoice"),q1=c(),kt=s("div"),T(kp.$$.fragment),UJ=c(),qb=s("p"),NJ=o(`Bert 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.`),WJ=c(),wp=s("p"),PJ=o("This model inherits from "),tf=s("a"),qJ=o("TFPreTrainedModel"),AJ=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ZJ=c(),Mp=s("p"),RJ=o("This model is also a "),$p=s("a"),VJ=o("tf.keras.Model"),GJ=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),SJ=c(),T(vr.$$.fragment),XJ=c(),yo=s("div"),T(Fp.$$.fragment),LJ=c(),js=s("p"),OJ=o("The "),of=s("a"),DJ=o("TFBertForMultipleChoice"),QJ=o(" forward method, overrides the "),Ab=s("code"),HJ=o("__call__"),YJ=o(" special method."),KJ=c(),T(Tr.$$.fragment),eI=c(),T(kr.$$.fragment),A1=c(),zs=s("h2"),wr=s("a"),Zb=s("span"),T(Bp.$$.fragment),tI=c(),Rb=s("span"),oI=o("TFBertForTokenClassification"),Z1=c(),wt=s("div"),T(xp.$$.fragment),nI=c(),Vb=s("p"),sI=o(`Bert 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.`),aI=c(),Ep=s("p"),rI=o("This model inherits from "),nf=s("a"),iI=o("TFPreTrainedModel"),lI=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),dI=c(),jp=s("p"),cI=o("This model is also a "),zp=s("a"),pI=o("tf.keras.Model"),hI=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),mI=c(),T(Mr.$$.fragment),uI=c(),Gt=s("div"),T(Cp.$$.fragment),fI=c(),Cs=s("p"),gI=o("The "),sf=s("a"),_I=o("TFBertForTokenClassification"),bI=o(" forward method, overrides the "),Gb=s("code"),yI=o("__call__"),vI=o(" special method."),TI=c(),T($r.$$.fragment),kI=c(),T(Fr.$$.fragment),wI=c(),T(Br.$$.fragment),R1=c(),Js=s("h2"),xr=s("a"),Sb=s("span"),T(Jp.$$.fragment),MI=c(),Xb=s("span"),$I=o("TFBertForQuestionAnswering"),V1=c(),Mt=s("div"),T(Ip.$$.fragment),FI=c(),Is=s("p"),BI=o(`Bert Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layer on top of the hidden-states output to compute `),Lb=s("code"),xI=o("span start logits"),EI=o(" and "),Ob=s("code"),jI=o("span end logits"),zI=o(")."),CI=c(),Up=s("p"),JI=o("This model inherits from "),af=s("a"),II=o("TFPreTrainedModel"),UI=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),NI=c(),Np=s("p"),WI=o("This model is also a "),Wp=s("a"),PI=o("tf.keras.Model"),qI=o(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),AI=c(),T(Er.$$.fragment),ZI=c(),St=s("div"),T(Pp.$$.fragment),RI=c(),Us=s("p"),VI=o("The "),rf=s("a"),GI=o("TFBertForQuestionAnswering"),SI=o(" forward method, overrides the "),Db=s("code"),XI=o("__call__"),LI=o(" special method."),OI=c(),T(jr.$$.fragment),DI=c(),T(zr.$$.fragment),QI=c(),T(Cr.$$.fragment),G1=c(),Ns=s("h2"),Jr=s("a"),Qb=s("span"),T(qp.$$.fragment),HI=c(),Hb=s("span"),YI=o("FlaxBertModel"),S1=c(),at=s("div"),T(Ap.$$.fragment),KI=c(),Yb=s("p"),e5=o("The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),t5=c(),Zp=s("p"),o5=o("This model inherits from "),lf=s("a"),n5=o("FlaxPreTrainedModel"),s5=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),a5=c(),Rp=s("p"),r5=o("This model is also a Flax Linen "),Vp=s("a"),i5=o("flax.linen.Module"),l5=o(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),d5=c(),Kb=s("p"),c5=o("Finally, this model supports inherent JAX features such as:"),p5=c(),Ao=s("ul"),ey=s("li"),Gp=s("a"),h5=o("Just-In-Time (JIT) compilation"),m5=c(),ty=s("li"),Sp=s("a"),u5=o("Automatic Differentiation"),f5=c(),oy=s("li"),Xp=s("a"),g5=o("Vectorization"),_5=c(),ny=s("li"),Lp=s("a"),b5=o("Parallelization"),y5=c(),vo=s("div"),T(Op.$$.fragment),v5=c(),Ws=s("p"),T5=o("The "),sy=s("code"),k5=o("FlaxBertPreTrainedModel"),w5=o(" forward method, overrides the "),ay=s("code"),M5=o("__call__"),$5=o(" special method."),F5=c(),T(Ir.$$.fragment),B5=c(),T(Ur.$$.fragment),X1=c(),Ps=s("h2"),Nr=s("a"),ry=s("span"),T(Dp.$$.fragment),x5=c(),iy=s("span"),E5=o("FlaxBertForPreTraining"),L1=c(),rt=s("div"),T(Qp.$$.fragment),j5=c(),qs=s("p"),z5=o("Bert Model with two heads on top as done during the pretraining: a "),ly=s("code"),C5=o("masked language modeling"),J5=o(" head and a "),dy=s("code"),I5=o("next sentence prediction (classification)"),U5=o(" head."),N5=c(),Hp=s("p"),W5=o("This model inherits from "),df=s("a"),P5=o("FlaxPreTrainedModel"),q5=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),A5=c(),Yp=s("p"),Z5=o("This model is also a Flax Linen "),Kp=s("a"),R5=o("flax.linen.Module"),V5=o(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),G5=c(),cy=s("p"),S5=o("Finally, this model supports inherent JAX features such as:"),X5=c(),Zo=s("ul"),py=s("li"),eh=s("a"),L5=o("Just-In-Time (JIT) compilation"),O5=c(),hy=s("li"),th=s("a"),D5=o("Automatic Differentiation"),Q5=c(),my=s("li"),oh=s("a"),H5=o("Vectorization"),Y5=c(),uy=s("li"),nh=s("a"),K5=o("Parallelization"),eU=c(),To=s("div"),T(sh.$$.fragment),tU=c(),As=s("p"),oU=o("The "),fy=s("code"),nU=o("FlaxBertPreTrainedModel"),sU=o(" forward method, overrides the "),gy=s("code"),aU=o("__call__"),rU=o(" special method."),iU=c(),T(Wr.$$.fragment),lU=c(),T(Pr.$$.fragment),O1=c(),Zs=s("h2"),qr=s("a"),_y=s("span"),T(ah.$$.fragment),dU=c(),by=s("span"),cU=o("FlaxBertForCausalLM"),D1=c(),it=s("div"),T(rh.$$.fragment),pU=c(),yy=s("p"),hU=o(`Bert Model with a language modeling head on top (a linear layer on top of the hidden-states output) e.g for
autoregressive tasks.`),mU=c(),ih=s("p"),uU=o("This model inherits from "),cf=s("a"),fU=o("FlaxPreTrainedModel"),gU=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),_U=c(),lh=s("p"),bU=o("This model is also a Flax Linen "),dh=s("a"),yU=o("flax.linen.Module"),vU=o(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),TU=c(),vy=s("p"),kU=o("Finally, this model supports inherent JAX features such as:"),wU=c(),Ro=s("ul"),Ty=s("li"),ch=s("a"),MU=o("Just-In-Time (JIT) compilation"),$U=c(),ky=s("li"),ph=s("a"),FU=o("Automatic Differentiation"),BU=c(),wy=s("li"),hh=s("a"),xU=o("Vectorization"),EU=c(),My=s("li"),mh=s("a"),jU=o("Parallelization"),zU=c(),ko=s("div"),T(uh.$$.fragment),CU=c(),Rs=s("p"),JU=o("The "),$y=s("code"),IU=o("FlaxBertPreTrainedModel"),UU=o(" forward method, overrides the "),Fy=s("code"),NU=o("__call__"),WU=o(" special method."),PU=c(),T(Ar.$$.fragment),qU=c(),T(Zr.$$.fragment),Q1=c(),Vs=s("h2"),Rr=s("a"),By=s("span"),T(fh.$$.fragment),AU=c(),xy=s("span"),ZU=o("FlaxBertForMaskedLM"),H1=c(),lt=s("div"),T(gh.$$.fragment),RU=c(),_h=s("p"),VU=o("Bert Model with a "),Ey=s("code"),GU=o("language modeling"),SU=o(" head on top."),XU=c(),bh=s("p"),LU=o("This model inherits from "),pf=s("a"),OU=o("FlaxPreTrainedModel"),DU=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),QU=c(),yh=s("p"),HU=o("This model is also a Flax Linen "),vh=s("a"),YU=o("flax.linen.Module"),KU=o(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),eN=c(),jy=s("p"),tN=o("Finally, this model supports inherent JAX features such as:"),oN=c(),Vo=s("ul"),zy=s("li"),Th=s("a"),nN=o("Just-In-Time (JIT) compilation"),sN=c(),Cy=s("li"),kh=s("a"),aN=o("Automatic Differentiation"),rN=c(),Jy=s("li"),wh=s("a"),iN=o("Vectorization"),lN=c(),Iy=s("li"),Mh=s("a"),dN=o("Parallelization"),cN=c(),wo=s("div"),T($h.$$.fragment),pN=c(),Gs=s("p"),hN=o("The "),Uy=s("code"),mN=o("FlaxBertPreTrainedModel"),uN=o(" forward method, overrides the "),Ny=s("code"),fN=o("__call__"),gN=o(" special method."),_N=c(),T(Vr.$$.fragment),bN=c(),T(Gr.$$.fragment),Y1=c(),Ss=s("h2"),Sr=s("a"),Wy=s("span"),T(Fh.$$.fragment),yN=c(),Py=s("span"),vN=o("FlaxBertForNextSentencePrediction"),K1=c(),dt=s("div"),T(Bh.$$.fragment),TN=c(),xh=s("p"),kN=o("Bert Model with a "),qy=s("code"),wN=o("next sentence prediction (classification)"),MN=o(" head on top."),$N=c(),Eh=s("p"),FN=o("This model inherits from "),hf=s("a"),BN=o("FlaxPreTrainedModel"),xN=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),EN=c(),jh=s("p"),jN=o("This model is also a Flax Linen "),zh=s("a"),zN=o("flax.linen.Module"),CN=o(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),JN=c(),Ay=s("p"),IN=o("Finally, this model supports inherent JAX features such as:"),UN=c(),Go=s("ul"),Zy=s("li"),Ch=s("a"),NN=o("Just-In-Time (JIT) compilation"),WN=c(),Ry=s("li"),Jh=s("a"),PN=o("Automatic Differentiation"),qN=c(),Vy=s("li"),Ih=s("a"),AN=o("Vectorization"),ZN=c(),Gy=s("li"),Uh=s("a"),RN=o("Parallelization"),VN=c(),Mo=s("div"),T(Nh.$$.fragment),GN=c(),Xs=s("p"),SN=o("The "),Sy=s("code"),XN=o("FlaxBertPreTrainedModel"),LN=o(" forward method, overrides the "),Xy=s("code"),ON=o("__call__"),DN=o(" special method."),QN=c(),T(Xr.$$.fragment),HN=c(),T(Lr.$$.fragment),ek=c(),Ls=s("h2"),Or=s("a"),Ly=s("span"),T(Wh.$$.fragment),YN=c(),Oy=s("span"),KN=o("FlaxBertForSequenceClassification"),tk=c(),ct=s("div"),T(Ph.$$.fragment),e9=c(),Dy=s("p"),t9=o(`Bert Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),o9=c(),qh=s("p"),n9=o("This model inherits from "),mf=s("a"),s9=o("FlaxPreTrainedModel"),a9=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),r9=c(),Ah=s("p"),i9=o("This model is also a Flax Linen "),Zh=s("a"),l9=o("flax.linen.Module"),d9=o(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),c9=c(),Qy=s("p"),p9=o("Finally, this model supports inherent JAX features such as:"),h9=c(),So=s("ul"),Hy=s("li"),Rh=s("a"),m9=o("Just-In-Time (JIT) compilation"),u9=c(),Yy=s("li"),Vh=s("a"),f9=o("Automatic Differentiation"),g9=c(),Ky=s("li"),Gh=s("a"),_9=o("Vectorization"),b9=c(),ev=s("li"),Sh=s("a"),y9=o("Parallelization"),v9=c(),$o=s("div"),T(Xh.$$.fragment),T9=c(),Os=s("p"),k9=o("The "),tv=s("code"),w9=o("FlaxBertPreTrainedModel"),M9=o(" forward method, overrides the "),ov=s("code"),$9=o("__call__"),F9=o(" special method."),B9=c(),T(Dr.$$.fragment),x9=c(),T(Qr.$$.fragment),ok=c(),Ds=s("h2"),Hr=s("a"),nv=s("span"),T(Lh.$$.fragment),E9=c(),sv=s("span"),j9=o("FlaxBertForMultipleChoice"),nk=c(),pt=s("div"),T(Oh.$$.fragment),z9=c(),av=s("p"),C9=o(`Bert 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.`),J9=c(),Dh=s("p"),I9=o("This model inherits from "),uf=s("a"),U9=o("FlaxPreTrainedModel"),N9=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),W9=c(),Qh=s("p"),P9=o("This model is also a Flax Linen "),Hh=s("a"),q9=o("flax.linen.Module"),A9=o(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Z9=c(),rv=s("p"),R9=o("Finally, this model supports inherent JAX features such as:"),V9=c(),Xo=s("ul"),iv=s("li"),Yh=s("a"),G9=o("Just-In-Time (JIT) compilation"),S9=c(),lv=s("li"),Kh=s("a"),X9=o("Automatic Differentiation"),L9=c(),dv=s("li"),em=s("a"),O9=o("Vectorization"),D9=c(),cv=s("li"),tm=s("a"),Q9=o("Parallelization"),H9=c(),Fo=s("div"),T(om.$$.fragment),Y9=c(),Qs=s("p"),K9=o("The "),pv=s("code"),eW=o("FlaxBertPreTrainedModel"),tW=o(" forward method, overrides the "),hv=s("code"),oW=o("__call__"),nW=o(" special method."),sW=c(),T(Yr.$$.fragment),aW=c(),T(Kr.$$.fragment),sk=c(),Hs=s("h2"),ei=s("a"),mv=s("span"),T(nm.$$.fragment),rW=c(),uv=s("span"),iW=o("FlaxBertForTokenClassification"),ak=c(),ht=s("div"),T(sm.$$.fragment),lW=c(),fv=s("p"),dW=o(`Bert 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.`),cW=c(),am=s("p"),pW=o("This model inherits from "),ff=s("a"),hW=o("FlaxPreTrainedModel"),mW=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),uW=c(),rm=s("p"),fW=o("This model is also a Flax Linen "),im=s("a"),gW=o("flax.linen.Module"),_W=o(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),bW=c(),gv=s("p"),yW=o("Finally, this model supports inherent JAX features such as:"),vW=c(),Lo=s("ul"),_v=s("li"),lm=s("a"),TW=o("Just-In-Time (JIT) compilation"),kW=c(),bv=s("li"),dm=s("a"),wW=o("Automatic Differentiation"),MW=c(),yv=s("li"),cm=s("a"),$W=o("Vectorization"),FW=c(),vv=s("li"),pm=s("a"),BW=o("Parallelization"),xW=c(),Bo=s("div"),T(hm.$$.fragment),EW=c(),Ys=s("p"),jW=o("The "),Tv=s("code"),zW=o("FlaxBertPreTrainedModel"),CW=o(" forward method, overrides the "),kv=s("code"),JW=o("__call__"),IW=o(" special method."),UW=c(),T(ti.$$.fragment),NW=c(),T(oi.$$.fragment),rk=c(),Ks=s("h2"),ni=s("a"),wv=s("span"),T(mm.$$.fragment),WW=c(),Mv=s("span"),PW=o("FlaxBertForQuestionAnswering"),ik=c(),mt=s("div"),T(um.$$.fragment),qW=c(),ea=s("p"),AW=o(`Bert 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 `),$v=s("code"),ZW=o("span start logits"),RW=o(" and "),Fv=s("code"),VW=o("span end logits"),GW=o(")."),SW=c(),fm=s("p"),XW=o("This model inherits from "),gf=s("a"),LW=o("FlaxPreTrainedModel"),OW=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),DW=c(),gm=s("p"),QW=o("This model is also a Flax Linen "),_m=s("a"),HW=o("flax.linen.Module"),YW=o(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),KW=c(),Bv=s("p"),eP=o("Finally, this model supports inherent JAX features such as:"),tP=c(),Oo=s("ul"),xv=s("li"),bm=s("a"),oP=o("Just-In-Time (JIT) compilation"),nP=c(),Ev=s("li"),ym=s("a"),sP=o("Automatic Differentiation"),aP=c(),jv=s("li"),vm=s("a"),rP=o("Vectorization"),iP=c(),zv=s("li"),Tm=s("a"),lP=o("Parallelization"),dP=c(),xo=s("div"),T(km.$$.fragment),cP=c(),ta=s("p"),pP=o("The "),Cv=s("code"),hP=o("FlaxBertPreTrainedModel"),mP=o(" forward method, overrides the "),Jv=s("code"),uP=o("__call__"),fP=o(" special method."),gP=c(),T(si.$$.fragment),_P=c(),T(ai.$$.fragment),this.h()},l(i){const _=PS('[data-svelte="svelte-1phssyn"]',document.head);d=a(_,"META",{name:!0,content:!0}),_.forEach(t),y=p(i),u=a(i,"H1",{class:!0});var wm=r(u);f=a(wm,"A",{id:!0,class:!0,href:!0});var Iv=r(f);b=a(Iv,"SPAN",{});var Uv=r(b);k(l.$$.fragment,Uv),Uv.forEach(t),Iv.forEach(t),m=p(wm),E=a(wm,"SPAN",{});var Nv=r(E);Ee=n(Nv,"BERT"),Nv.forEach(t),wm.forEach(t),we=p(i),Z=a(i,"DIV",{class:!0});var Mm=r(Z);he=a(Mm,"A",{href:!0});var Wv=r(he);ee=a(Wv,"IMG",{alt:!0,src:!0}),Wv.forEach(t),je=p(Mm),V=a(Mm,"A",{href:!0});var Pv=r(V);me=a(Pv,"IMG",{alt:!0,src:!0}),Pv.forEach(t),Mm.forEach(t),O=p(i),ie=a(i,"H2",{class:!0});var $m=r(ie);le=a($m,"A",{id:!0,class:!0,href:!0});var qv=r(le);G=a(qv,"SPAN",{});var Av=r(G);k(de.$$.fragment,Av),Av.forEach(t),qv.forEach(t),ze=p($m),S=a($m,"SPAN",{});var Zv=r(S);Ce=n(Zv,"Overview"),Zv.forEach(t),$m.forEach(t),Me=p(i),R=a(i,"P",{});var Fm=r(R);Je=n(Fm,"The BERT model was proposed in "),ce=a(Fm,"A",{href:!0,rel:!0});var Rv=r(ce);ae=n(Rv,"BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding"),Rv.forEach(t),C=n(Fm,` by Jacob Devlin, Ming-Wei Chang, Kenton Lee and Kristina Toutanova. It\u2019s a
bidirectional transformer pretrained using a combination of masked language modeling objective and next sentence
prediction on a large corpus comprising the Toronto Book Corpus and Wikipedia.`),Fm.forEach(t),U=p(i),ue=a(i,"P",{});var Vv=r(ue);D=n(Vv,"The abstract from the paper is the following:"),Vv.forEach(t),$e=p(i),fe=a(i,"P",{});var Gv=r(fe);X=a(Gv,"EM",{});var Sv=r(X);Ie=n(Sv,`We introduce a new language representation model called BERT, which stands for Bidirectional Encoder Representations
from Transformers. Unlike recent language representation models, BERT is designed to pre-train deep bidirectional
representations from unlabeled text by jointly conditioning on both left and right context in all layers. As a result,
the pre-trained BERT model can be fine-tuned with just one additional output layer to create state-of-the-art models
for a wide range of tasks, such as question answering and language inference, without substantial task-specific
architecture modifications.`),Sv.forEach(t),Gv.forEach(t),Fe=p(i),J=a(i,"P",{});var Xv=r(J);_e=a(Xv,"EM",{});var Lv=r(_e);Q=n(Lv,`BERT is conceptually simple and empirically powerful. It obtains new state-of-the-art results on eleven natural
language processing tasks, including pushing the GLUE score to 80.5% (7.7% point absolute improvement), MultiNLI
accuracy to 86.7% (4.6% absolute improvement), SQuAD v1.1 question answering Test F1 to 93.2 (1.5 point absolute
improvement) and SQuAD v2.0 Test F1 to 83.1 (5.1 point absolute improvement).`),Lv.forEach(t),Xv.forEach(t),Be=p(i),ge=a(i,"P",{});var Ov=r(ge);H=n(Ov,"Tips:"),Ov.forEach(t),xe=p(i),se=a(i,"UL",{});var Do=r(se);P=a(Do,"LI",{});var Dv=r(P);be=a(Dv,"P",{});var Qv=r(be);Y=n(Qv,`BERT is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than
the left.`),Qv.forEach(t),Dv.forEach(t),Ue=p(Do),te=a(Do,"LI",{});var Hv=r(te);I=a(Hv,"P",{});var Yv=r(I);Ne=n(Yv,`BERT was trained with the masked language modeling (MLM) and next sentence prediction (NSP) objectives. It is
efficient at predicting masked tokens and at NLU in general, but is not optimal for text generation.`),Yv.forEach(t),Hv.forEach(t),W=p(Do),pe=a(Do,"LI",{});var Bm=r(pe);ye=a(Bm,"P",{});var Kv=r(ye);v=n(Kv,"Corrupts the inputs by using random masking, more precisely, during pretraining, a given percentage of tokens (usually 15%) is masked by:"),Kv.forEach(t),j=p(Bm),Ze=a(Bm,"UL",{});var oa=r(Ze);oe=a(oa,"LI",{});var eT=r(oe);Se=n(eT,"a special mask token with probability 0.8"),eT.forEach(t),Xe=p(oa),z=a(oa,"LI",{});var tT=r(z);Le=n(tT,"a random token different from the one masked with probability 0.1"),tT.forEach(t),Oe=p(oa),Ve=a(oa,"LI",{});var oT=r(Ve);De=n(oT,"the same token with probability 0.1"),oT.forEach(t),oa.forEach(t),Bm.forEach(t),Qe=p(Do),q=a(Do,"LI",{});var nT=r(q);L=a(nT,"P",{});var sT=r(L);He=n(sT,"The model must predict the original sentence, but has a second objective: inputs are two sentences A and B (with a separation token in between). With probability 50%, the sentences are consecutive in the corpus, in the remaining 50% they are not related. The model has to predict if the sentences are consecutive or not."),sT.forEach(t),nT.forEach(t),Do.forEach(t),Ge=p(i),A=a(i,"P",{});var na=r(A);Ye=n(na,"This model was contributed by "),Re=a(na,"A",{href:!0,rel:!0});var aT=r(Re);We=n(aT,"thomwolf"),aT.forEach(t),Ke=n(na,". The original code can be found "),K=a(na,"A",{href:!0,rel:!0});var rT=r(K);et=n(rT,"here"),rT.forEach(t),wM=n(na,"."),na.forEach(t),CT=p(i),Nn=a(i,"H2",{class:!0});var xm=r(Nn);aa=a(xm,"A",{id:!0,class:!0,href:!0});var iT=r(aa);rg=a(iT,"SPAN",{});var lT=r(rg);k(Ai.$$.fragment,lT),lT.forEach(t),iT.forEach(t),MM=p(xm),ig=a(xm,"SPAN",{});var dT=r(ig);$M=n(dT,"Resources"),dT.forEach(t),xm.forEach(t),JT=p(i),Rm=a(i,"P",{});var cT=r(Rm);FM=n(cT,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with BERT. If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),cT.forEach(t),IT=p(i),k(Zi.$$.fragment,i),UT=p(i),tt=a(i,"UL",{});var ut=r(tt);Ri=a(ut,"LI",{});var Em=r(Ri);BM=n(Em,"A blog post on "),Vi=a(Em,"A",{href:!0,rel:!0});var pT=r(Vi);xM=n(pT,"BERT Text Classification in a different language"),pT.forEach(t),EM=n(Em,"."),Em.forEach(t),jM=p(ut),Gi=a(ut,"LI",{});var jm=r(Gi);zM=n(jm,"A notebook for "),Si=a(jm,"A",{href:!0,rel:!0});var hT=r(Si);CM=n(hT,"Finetuning BERT (and friends) for multi-label text classification"),hT.forEach(t),JM=n(jm,"."),jm.forEach(t),IM=p(ut),Xi=a(ut,"LI",{});var zm=r(Xi);UM=n(zm,"A notebook on how to "),Li=a(zm,"A",{href:!0,rel:!0});var mT=r(Li);NM=n(mT,"Finetune BERT for multi-label classification using PyTorch"),mT.forEach(t),WM=n(zm,". \u{1F30E}"),zm.forEach(t),PM=p(ut),Oi=a(ut,"LI",{});var Cm=r(Oi);qM=n(Cm,"A notebook on how to "),Di=a(Cm,"A",{href:!0,rel:!0});var uT=r(Di);AM=n(uT,"warm-start an EncoderDecoder model with BERT for summarization"),uT.forEach(t),ZM=n(Cm,"."),Cm.forEach(t),RM=p(ut),Qo=a(ut,"LI",{});var un=r(Qo);Vm=a(un,"A",{href:!0});var fT=r(Vm);VM=n(fT,"BertForSequenceClassification"),fT.forEach(t),GM=n(un," is supported by this "),Qi=a(un,"A",{href:!0,rel:!0});var gT=r(Qi);SM=n(gT,"example script"),gT.forEach(t),XM=n(un," and "),Hi=a(un,"A",{href:!0,rel:!0});var _T=r(Hi);LM=n(_T,"notebook"),_T.forEach(t),OM=n(un,"."),un.forEach(t),DM=p(ut),Ho=a(ut,"LI",{});var fn=r(Ho);Gm=a(fn,"A",{href:!0});var bT=r(Gm);QM=n(bT,"TFBertForSequenceClassification"),bT.forEach(t),HM=n(fn," is supported by this "),Yi=a(fn,"A",{href:!0,rel:!0});var yT=r(Yi);YM=n(yT,"example script"),yT.forEach(t),KM=n(fn," and "),Ki=a(fn,"A",{href:!0,rel:!0});var vT=r(Ki);e0=n(vT,"notebook"),vT.forEach(t),t0=n(fn,"."),fn.forEach(t),o0=p(ut),Yo=a(ut,"LI",{});var gn=r(Yo);Sm=a(gn,"A",{href:!0});var TT=r(Sm);n0=n(TT,"FlaxBertForSequenceClassification"),TT.forEach(t),s0=n(gn," is supported by this "),el=a(gn,"A",{href:!0,rel:!0});var kT=r(el);a0=n(kT,"example script"),kT.forEach(t),r0=n(gn," and "),tl=a(gn,"A",{href:!0,rel:!0});var wT=r(tl);i0=n(wT,"notebook"),wT.forEach(t),l0=n(gn,"."),gn.forEach(t),d0=p(ut),lg=a(ut,"LI",{});var MT=r(lg);Xm=a(MT,"A",{href:!0});var $T=r(Xm);c0=n($T,"Text classification task guide"),$T.forEach(t),MT.forEach(t),ut.forEach(t),NT=p(i),k(ol.$$.fragment,i),WT=p(i),ft=a(i,"UL",{});var $t=r(ft);nl=a($t,"LI",{});var Jm=r(nl);p0=n(Jm,"A blog post on how to use "),sl=a(Jm,"A",{href:!0,rel:!0});var FT=r(sl);h0=n(FT,"Hugging Face Transformers with Keras: Fine-tune a non-English BERT for Named Entity Recognition"),FT.forEach(t),m0=n(Jm,"."),Jm.forEach(t),u0=p($t),Wn=a($t,"LI",{});var sa=r(Wn);f0=n(sa,"A notebook for "),al=a(sa,"A",{href:!0,rel:!0});var BT=r(al);g0=n(BT,"Finetuning BERT for named-entity recognition"),BT.forEach(t),_0=n(sa," using only the first wordpiece of each word in the word label during tokenization. To propagate the label of the word to all wordpieces, see this "),rl=a(sa,"A",{href:!0,rel:!0});var xT=r(rl);b0=n(xT,"version"),xT.forEach(t),y0=n(sa," of the notebook instead."),sa.forEach(t),v0=p($t),Ko=a($t,"LI",{});var _n=r(Ko);Lm=a(_n,"A",{href:!0});var ET=r(Lm);T0=n(ET,"BertForTokenClassification"),ET.forEach(t),k0=n(_n," is supported by this "),il=a(_n,"A",{href:!0,rel:!0});var xP=r(il);w0=n(xP,"example script"),xP.forEach(t),M0=n(_n," and "),ll=a(_n,"A",{href:!0,rel:!0});var EP=r(ll);$0=n(EP,"notebook"),EP.forEach(t),F0=n(_n,"."),_n.forEach(t),B0=p($t),en=a($t,"LI",{});var Im=r(en);Om=a(Im,"A",{href:!0});var jP=r(Om);x0=n(jP,"TFBertForTokenClassification"),jP.forEach(t),E0=n(Im," is supported by this "),dl=a(Im,"A",{href:!0,rel:!0});var zP=r(dl);j0=n(zP,"example script"),zP.forEach(t),z0=n(Im," and "),cl=a(Im,"A",{href:!0,rel:!0});var CP=r(cl);C0=n(CP,"notebook"),CP.forEach(t),J0=n(Im,"."),Im.forEach(t),I0=p($t),ra=a($t,"LI",{});var jT=r(ra);Dm=a(jT,"A",{href:!0});var JP=r(Dm);U0=n(JP,"FlaxBertForTokenClassification"),JP.forEach(t),N0=n(jT," is supported by this "),pl=a(jT,"A",{href:!0,rel:!0});var IP=r(pl);W0=n(IP,"example script"),IP.forEach(t),P0=n(jT,"."),jT.forEach(t),q0=p($t),Qm=a($t,"LI",{});var bP=r(Qm);hl=a(bP,"A",{href:!0,rel:!0});var UP=r(hl);A0=n(UP,"Token classification"),UP.forEach(t),Z0=n(bP," chapter of the \u{1F917} Hugging Face Course."),bP.forEach(t),R0=p($t),dg=a($t,"LI",{});var NP=r(dg);Hm=a(NP,"A",{href:!0});var WP=r(Hm);V0=n(WP,"Token classification task guide"),WP.forEach(t),NP.forEach(t),$t.forEach(t),PT=p(i),k(ml.$$.fragment,i),qT=p(i),Pt=a(i,"UL",{});var bn=r(Pt);tn=a(bn,"LI",{});var Um=r(tn);Ym=a(Um,"A",{href:!0});var PP=r(Ym);G0=n(PP,"BertForMaskedLM"),PP.forEach(t),S0=n(Um," is supported by this "),ul=a(Um,"A",{href:!0,rel:!0});var qP=r(ul);X0=n(qP,"example script"),qP.forEach(t),L0=n(Um," and "),fl=a(Um,"A",{href:!0,rel:!0});var AP=r(fl);O0=n(AP,"notebook"),AP.forEach(t),D0=n(Um,"."),Um.forEach(t),Q0=p(bn),on=a(bn,"LI",{});var Nm=r(on);Km=a(Nm,"A",{href:!0});var ZP=r(Km);H0=n(ZP,"TFBertForMaskedLM"),ZP.forEach(t),Y0=n(Nm," is supported by this "),gl=a(Nm,"A",{href:!0,rel:!0});var RP=r(gl);K0=n(RP,"example script"),RP.forEach(t),e2=n(Nm," and "),_l=a(Nm,"A",{href:!0,rel:!0});var VP=r(_l);t2=n(VP,"notebook"),VP.forEach(t),o2=n(Nm,"."),Nm.forEach(t),n2=p(bn),nn=a(bn,"LI",{});var Wm=r(nn);eu=a(Wm,"A",{href:!0});var GP=r(eu);s2=n(GP,"FlaxBertForMaskedLM"),GP.forEach(t),a2=n(Wm," is supported by this "),bl=a(Wm,"A",{href:!0,rel:!0});var SP=r(bl);r2=n(SP,"example script"),SP.forEach(t),i2=n(Wm," and "),yl=a(Wm,"A",{href:!0,rel:!0});var XP=r(yl);l2=n(XP,"notebook"),XP.forEach(t),d2=n(Wm,"."),Wm.forEach(t),c2=p(bn),tu=a(bn,"LI",{});var yP=r(tu);vl=a(yP,"A",{href:!0,rel:!0});var LP=r(vl);p2=n(LP,"Masked language modeling"),LP.forEach(t),h2=n(yP," chapter of the \u{1F917} Hugging Face Course."),yP.forEach(t),m2=p(bn),cg=a(bn,"LI",{});var OP=r(cg);ou=a(OP,"A",{href:!0});var DP=r(ou);u2=n(DP,"Masked language modeling task guide"),DP.forEach(t),OP.forEach(t),bn.forEach(t),AT=p(i),k(Tl.$$.fragment,i),ZT=p(i),qt=a(i,"UL",{});var yn=r(qt);sn=a(yn,"LI",{});var Pm=r(sn);nu=a(Pm,"A",{href:!0});var QP=r(nu);f2=n(QP,"BertForQuestionAnswering"),QP.forEach(t),g2=n(Pm," is supported by this "),kl=a(Pm,"A",{href:!0,rel:!0});var HP=r(kl);_2=n(HP,"example script"),HP.forEach(t),b2=n(Pm," and "),wl=a(Pm,"A",{href:!0,rel:!0});var YP=r(wl);y2=n(YP,"notebook"),YP.forEach(t),v2=n(Pm,"."),Pm.forEach(t),T2=p(yn),an=a(yn,"LI",{});var qm=r(an);su=a(qm,"A",{href:!0});var KP=r(su);k2=n(KP,"TFBertForQuestionAnswering"),KP.forEach(t),w2=n(qm," is supported by this "),Ml=a(qm,"A",{href:!0,rel:!0});var eq=r(Ml);M2=n(eq,"example script"),eq.forEach(t),$2=n(qm," and "),$l=a(qm,"A",{href:!0,rel:!0});var tq=r($l);F2=n(tq,"notebook"),tq.forEach(t),B2=n(qm,"."),qm.forEach(t),x2=p(yn),ia=a(yn,"LI",{});var zT=r(ia);au=a(zT,"A",{href:!0});var oq=r(au);E2=n(oq,"FlaxBertForQuestionAnswering"),oq.forEach(t),j2=n(zT," is supported by this "),Fl=a(zT,"A",{href:!0,rel:!0});var nq=r(Fl);z2=n(nq,"example script"),nq.forEach(t),C2=n(zT,"."),zT.forEach(t),J2=p(yn),ru=a(yn,"LI",{});var vP=r(ru);Bl=a(vP,"A",{href:!0,rel:!0});var sq=r(Bl);I2=n(sq,"Question answering"),sq.forEach(t),U2=n(vP," chapter of the \u{1F917} Hugging Face Course."),vP.forEach(t),N2=p(yn),pg=a(yn,"LI",{});var aq=r(pg);iu=a(aq,"A",{href:!0});var rq=r(iu);W2=n(rq,"Question answering task guide"),rq.forEach(t),aq.forEach(t),yn.forEach(t),RT=p(i),lu=a(i,"P",{});var iq=r(lu);hg=a(iq,"STRONG",{});var lq=r(hg);P2=n(lq,"Multiple choice"),lq.forEach(t),iq.forEach(t),VT=p(i),rn=a(i,"UL",{});var _f=r(rn);ln=a(_f,"LI",{});var Am=r(ln);du=a(Am,"A",{href:!0});var dq=r(du);q2=n(dq,"BertForMultipleChoice"),dq.forEach(t),A2=n(Am," is supported by this "),xl=a(Am,"A",{href:!0,rel:!0});var cq=r(xl);Z2=n(cq,"example script"),cq.forEach(t),R2=n(Am," and "),El=a(Am,"A",{href:!0,rel:!0});var pq=r(El);V2=n(pq,"notebook"),pq.forEach(t),G2=n(Am,"."),Am.forEach(t),S2=p(_f),dn=a(_f,"LI",{});var Zm=r(dn);cu=a(Zm,"A",{href:!0});var hq=r(cu);X2=n(hq,"TFBertForMultipleChoice"),hq.forEach(t),L2=n(Zm," is supported by this "),jl=a(Zm,"A",{href:!0,rel:!0});var mq=r(jl);O2=n(mq,"example script"),mq.forEach(t),D2=n(Zm," and "),zl=a(Zm,"A",{href:!0,rel:!0});var uq=r(zl);Q2=n(uq,"notebook"),uq.forEach(t),H2=n(Zm,"."),Zm.forEach(t),Y2=p(_f),mg=a(_f,"LI",{});var fq=r(mg);pu=a(fq,"A",{href:!0});var gq=r(pu);K2=n(gq,"Multiple choice task guide"),gq.forEach(t),fq.forEach(t),_f.forEach(t),GT=p(i),Cl=a(i,"P",{});var TP=r(Cl);e$=n(TP,"\u26A1\uFE0F "),ug=a(TP,"STRONG",{});var _q=r(ug);t$=n(_q,"Inference"),_q.forEach(t),TP.forEach(t),ST=p(i),la=a(i,"UL",{});var dk=r(la);Jl=a(dk,"LI",{});var ck=r(Jl);o$=n(ck,"A blog post on how to "),Il=a(ck,"A",{href:!0,rel:!0});var bq=r(Il);n$=n(bq,"Accelerate BERT inference with Hugging Face Transformers and AWS Inferentia"),bq.forEach(t),s$=n(ck,"."),ck.forEach(t),a$=p(dk),Ul=a(dk,"LI",{});var pk=r(Ul);r$=n(pk,"A blog post on how to "),Nl=a(pk,"A",{href:!0,rel:!0});var yq=r(Nl);i$=n(yq,"Accelerate BERT inference with DeepSpeed-Inference on GPUs"),yq.forEach(t),l$=n(pk,"."),pk.forEach(t),dk.forEach(t),XT=p(i),Wl=a(i,"P",{});var kP=r(Wl);d$=n(kP,"\u2699\uFE0F "),fg=a(kP,"STRONG",{});var vq=r(fg);c$=n(vq,"Pretraining"),vq.forEach(t),kP.forEach(t),LT=p(i),hu=a(i,"UL",{});var Tq=r(hu);Pl=a(Tq,"LI",{});var hk=r(Pl);p$=n(hk,"A blog post on "),ql=a(hk,"A",{href:!0,rel:!0});var kq=r(ql);h$=n(kq,"Pre-Training BERT with Hugging Face Transformers and Habana Gaudi"),kq.forEach(t),m$=n(hk,"."),hk.forEach(t),Tq.forEach(t),OT=p(i),Al=a(i,"P",{});var wP=r(Al);u$=n(wP,"\u{1F680} "),gg=a(wP,"STRONG",{});var wq=r(gg);f$=n(wq,"Deploy"),wq.forEach(t),wP.forEach(t),DT=p(i),Ft=a(i,"UL",{});var Eo=r(Ft);Zl=a(Eo,"LI",{});var mk=r(Zl);g$=n(mk,"A blog post on how to "),Rl=a(mk,"A",{href:!0,rel:!0});var Mq=r(Rl);_$=n(Mq,"Convert Transformers to ONNX with Hugging Face Optimum"),Mq.forEach(t),b$=n(mk,"."),mk.forEach(t),y$=p(Eo),Vl=a(Eo,"LI",{});var uk=r(Vl);v$=n(uk,"A blog post on how to "),Gl=a(uk,"A",{href:!0,rel:!0});var $q=r(Gl);T$=n($q,"Setup Deep Learning environment for Hugging Face Transformers with Habana Gaudi on AWS"),$q.forEach(t),k$=n(uk,"."),uk.forEach(t),w$=p(Eo),Sl=a(Eo,"LI",{});var fk=r(Sl);M$=n(fk,"A blog post on "),Xl=a(fk,"A",{href:!0,rel:!0});var Fq=r(Xl);$$=n(Fq,"Autoscaling BERT with Hugging Face Transformers, Amazon SageMaker and Terraform module"),Fq.forEach(t),F$=n(fk,"."),fk.forEach(t),B$=p(Eo),Ll=a(Eo,"LI",{});var gk=r(Ll);x$=n(gk,"A blog post on "),Ol=a(gk,"A",{href:!0,rel:!0});var Bq=r(Ol);E$=n(Bq,"Serverless BERT with HuggingFace, AWS Lambda, and Docker"),Bq.forEach(t),j$=n(gk,"."),gk.forEach(t),z$=p(Eo),Dl=a(Eo,"LI",{});var _k=r(Dl);C$=n(_k,"A blog post on "),Ql=a(_k,"A",{href:!0,rel:!0});var xq=r(Ql);J$=n(xq,"Hugging Face Transformers BERT fine-tuning using Amazon SageMaker and Training Compiler"),xq.forEach(t),I$=n(_k,"."),_k.forEach(t),U$=p(Eo),Hl=a(Eo,"LI",{});var bk=r(Hl);N$=n(bk,"A blog post on "),Yl=a(bk,"A",{href:!0,rel:!0});var Eq=r(Yl);W$=n(Eq,"Task-specific knowledge distillation for BERT using Transformers & Amazon SageMaker"),Eq.forEach(t),P$=n(bk,"."),bk.forEach(t),Eo.forEach(t),QT=p(i),Pn=a(i,"H2",{class:!0});var yk=r(Pn);da=a(yk,"A",{id:!0,class:!0,href:!0});var jq=r(da);_g=a(jq,"SPAN",{});var zq=r(_g);k(Kl.$$.fragment,zq),zq.forEach(t),jq.forEach(t),q$=p(yk),bg=a(yk,"SPAN",{});var Cq=r(bg);A$=n(Cq,"BertConfig"),Cq.forEach(t),yk.forEach(t),HT=p(i),so=a(i,"DIV",{class:!0});var ri=r(so);k(ed.$$.fragment,ri),Z$=p(ri),Po=a(ri,"P",{});var ii=r(Po);R$=n(ii,"This is the configuration class to store the configuration of a "),mu=a(ii,"A",{href:!0});var Jq=r(mu);V$=n(Jq,"BertModel"),Jq.forEach(t),G$=n(ii," or a "),uu=a(ii,"A",{href:!0});var Iq=r(uu);S$=n(Iq,"TFBertModel"),Iq.forEach(t),X$=n(ii,`. It is used to
instantiate a BERT 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 BERT
`),td=a(ii,"A",{href:!0,rel:!0});var Uq=r(td);L$=n(Uq,"bert-base-uncased"),Uq.forEach(t),O$=n(ii," architecture."),ii.forEach(t),D$=p(ri),qn=a(ri,"P",{});var bf=r(qn);Q$=n(bf,"Configuration objects inherit from "),fu=a(bf,"A",{href:!0});var Nq=r(fu);H$=n(Nq,"PretrainedConfig"),Nq.forEach(t),Y$=n(bf,` and can be used to control the model outputs. Read the
documentation from `),gu=a(bf,"A",{href:!0});var Wq=r(gu);K$=n(Wq,"PretrainedConfig"),Wq.forEach(t),eF=n(bf," for more information."),bf.forEach(t),tF=p(ri),k(ca.$$.fragment,ri),ri.forEach(t),YT=p(i),An=a(i,"H2",{class:!0});var vk=r(An);pa=a(vk,"A",{id:!0,class:!0,href:!0});var Pq=r(pa);yg=a(Pq,"SPAN",{});var qq=r(yg);k(od.$$.fragment,qq),qq.forEach(t),Pq.forEach(t),oF=p(vk),vg=a(vk,"SPAN",{});var Aq=r(vg);nF=n(Aq,"BertTokenizer"),Aq.forEach(t),vk.forEach(t),KT=p(i),ot=a(i,"DIV",{class:!0});var Xt=r(ot);k(nd.$$.fragment,Xt),sF=p(Xt),Tg=a(Xt,"P",{});var Zq=r(Tg);aF=n(Zq,"Construct a BERT tokenizer. Based on WordPiece."),Zq.forEach(t),rF=p(Xt),sd=a(Xt,"P",{});var Tk=r(sd);iF=n(Tk,"This tokenizer inherits from "),_u=a(Tk,"A",{href:!0});var Rq=r(_u);lF=n(Rq,"PreTrainedTokenizer"),Rq.forEach(t),dF=n(Tk,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Tk.forEach(t),cF=p(Xt),cn=a(Xt,"DIV",{class:!0});var yf=r(cn);k(ad.$$.fragment,yf),pF=p(yf),kg=a(yf,"P",{});var Vq=r(kg);hF=n(Vq,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A BERT sequence has the following format:`),Vq.forEach(t),mF=p(yf),rd=a(yf,"UL",{});var kk=r(rd);bu=a(kk,"LI",{});var MP=r(bu);uF=n(MP,"single sequence: "),wg=a(MP,"CODE",{});var Gq=r(wg);fF=n(Gq,"[CLS] X [SEP]"),Gq.forEach(t),MP.forEach(t),gF=p(kk),yu=a(kk,"LI",{});var $P=r(yu);_F=n($P,"pair of sequences: "),Mg=a($P,"CODE",{});var Sq=r(Mg);bF=n(Sq,"[CLS] A [SEP] B [SEP]"),Sq.forEach(t),$P.forEach(t),kk.forEach(t),yf.forEach(t),yF=p(Xt),ha=a(Xt,"DIV",{class:!0});var wk=r(ha);k(id.$$.fragment,wk),vF=p(wk),ld=a(wk,"P",{});var Mk=r(ld);TF=n(Mk,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),$g=a(Mk,"CODE",{});var Xq=r($g);kF=n(Xq,"prepare_for_model"),Xq.forEach(t),wF=n(Mk," method."),Mk.forEach(t),wk.forEach(t),MF=p(Xt),ao=a(Xt,"DIV",{class:!0});var li=r(ao);k(dd.$$.fragment,li),$F=p(li),Fg=a(li,"P",{});var Lq=r(Fg);FF=n(Lq,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),Lq.forEach(t),BF=p(li),k(ma.$$.fragment,li),xF=p(li),Zn=a(li,"P",{});var vf=r(Zn);EF=n(vf,"If "),Bg=a(vf,"CODE",{});var Oq=r(Bg);jF=n(Oq,"token_ids_1"),Oq.forEach(t),zF=n(vf," is "),xg=a(vf,"CODE",{});var Dq=r(xg);CF=n(Dq,"None"),Dq.forEach(t),JF=n(vf,", this method only returns the first portion of the mask (0s)."),vf.forEach(t),li.forEach(t),IF=p(Xt),vu=a(Xt,"DIV",{class:!0});var Qq=r(vu);k(cd.$$.fragment,Qq),Qq.forEach(t),Xt.forEach(t),e1=p(i),Rn=a(i,"H2",{class:!0});var $k=r(Rn);ua=a($k,"A",{id:!0,class:!0,href:!0});var Hq=r(ua);Eg=a(Hq,"SPAN",{});var Yq=r(Eg);k(pd.$$.fragment,Yq),Yq.forEach(t),Hq.forEach(t),UF=p($k),jg=a($k,"SPAN",{});var Kq=r(jg);NF=n(Kq,"BertTokenizerFast"),Kq.forEach(t),$k.forEach(t),t1=p(i),xt=a(i,"DIV",{class:!0});var vn=r(xt);k(hd.$$.fragment,vn),WF=p(vn),md=a(vn,"P",{});var Fk=r(md);PF=n(Fk,"Construct a \u201Cfast\u201D BERT tokenizer (backed by HuggingFace\u2019s "),zg=a(Fk,"EM",{});var eA=r(zg);qF=n(eA,"tokenizers"),eA.forEach(t),AF=n(Fk," library). Based on WordPiece."),Fk.forEach(t),ZF=p(vn),ud=a(vn,"P",{});var Bk=r(ud);RF=n(Bk,"This tokenizer inherits from "),Tu=a(Bk,"A",{href:!0});var tA=r(Tu);VF=n(tA,"PreTrainedTokenizerFast"),tA.forEach(t),GF=n(Bk,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Bk.forEach(t),SF=p(vn),pn=a(vn,"DIV",{class:!0});var Tf=r(pn);k(fd.$$.fragment,Tf),XF=p(Tf),Cg=a(Tf,"P",{});var oA=r(Cg);LF=n(oA,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A BERT sequence has the following format:`),oA.forEach(t),OF=p(Tf),gd=a(Tf,"UL",{});var xk=r(gd);ku=a(xk,"LI",{});var FP=r(ku);DF=n(FP,"single sequence: "),Jg=a(FP,"CODE",{});var nA=r(Jg);QF=n(nA,"[CLS] X [SEP]"),nA.forEach(t),FP.forEach(t),HF=p(xk),wu=a(xk,"LI",{});var BP=r(wu);YF=n(BP,"pair of sequences: "),Ig=a(BP,"CODE",{});var sA=r(Ig);KF=n(sA,"[CLS] A [SEP] B [SEP]"),sA.forEach(t),BP.forEach(t),xk.forEach(t),Tf.forEach(t),eB=p(vn),ro=a(vn,"DIV",{class:!0});var di=r(ro);k(_d.$$.fragment,di),tB=p(di),Ug=a(di,"P",{});var aA=r(Ug);oB=n(aA,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),aA.forEach(t),nB=p(di),k(fa.$$.fragment,di),sB=p(di),Vn=a(di,"P",{});var kf=r(Vn);aB=n(kf,"If "),Ng=a(kf,"CODE",{});var rA=r(Ng);rB=n(rA,"token_ids_1"),rA.forEach(t),iB=n(kf," is "),Wg=a(kf,"CODE",{});var iA=r(Wg);lB=n(iA,"None"),iA.forEach(t),dB=n(kf,", this method only returns the first portion of the mask (0s)."),kf.forEach(t),di.forEach(t),vn.forEach(t),o1=p(i),Gn=a(i,"H2",{class:!0});var Ek=r(Gn);ga=a(Ek,"A",{id:!0,class:!0,href:!0});var lA=r(ga);Pg=a(lA,"SPAN",{});var dA=r(Pg);k(bd.$$.fragment,dA),dA.forEach(t),lA.forEach(t),cB=p(Ek),qg=a(Ek,"SPAN",{});var cA=r(qg);pB=n(cA,"TFBertTokenizer"),cA.forEach(t),Ek.forEach(t),n1=p(i),Et=a(i,"DIV",{class:!0});var Tn=r(Et);k(yd.$$.fragment,Tn),hB=p(Tn),Sn=a(Tn,"P",{});var wf=r(Sn);mB=n(wf,`This is an in-graph tokenizer for BERT. It should be initialized similarly to other tokenizers, using the
`),Ag=a(wf,"CODE",{});var pA=r(Ag);uB=n(pA,"from_pretrained()"),pA.forEach(t),fB=n(wf," method. It can also be initialized with the "),Zg=a(wf,"CODE",{});var hA=r(Zg);gB=n(hA,"from_tokenizer()"),hA.forEach(t),_B=n(wf,` method, which imports settings
from an existing standard tokenizer object.`),wf.forEach(t),bB=p(Tn),vd=a(Tn,"P",{});var jk=r(vd);yB=n(jk,`In-graph tokenizers, unlike other Hugging Face tokenizers, are actually Keras layers and are designed to be run
when the model is called, rather than during preprocessing. As a result, they have somewhat more limited options
than standard tokenizer classes. They are most useful when you want to create an end-to-end model that goes
straight from `),Rg=a(jk,"CODE",{});var mA=r(Rg);vB=n(mA,"tf.string"),mA.forEach(t),TB=n(jk," inputs to outputs."),jk.forEach(t),kB=p(Tn),hn=a(Tn,"DIV",{class:!0});var Mf=r(hn);k(Td.$$.fragment,Mf),wB=p(Mf),kd=a(Mf,"P",{});var zk=r(kd);MB=n(zk,"Instantiate a "),Vg=a(zk,"CODE",{});var uA=r(Vg);$B=n(uA,"TFBertTokenizer"),uA.forEach(t),FB=n(zk," from a pre-trained tokenizer."),zk.forEach(t),BB=p(Mf),k(_a.$$.fragment,Mf),Mf.forEach(t),xB=p(Tn),mn=a(Tn,"DIV",{class:!0});var $f=r(mn);k(wd.$$.fragment,$f),EB=p($f),Xn=a($f,"P",{});var Ff=r(Xn);jB=n(Ff,"Initialize a "),Gg=a(Ff,"CODE",{});var fA=r(Gg);zB=n(fA,"TFBertTokenizer"),fA.forEach(t),CB=n(Ff," from an existing "),Sg=a(Ff,"CODE",{});var gA=r(Sg);JB=n(gA,"Tokenizer"),gA.forEach(t),IB=n(Ff,"."),Ff.forEach(t),UB=p($f),k(ba.$$.fragment,$f),$f.forEach(t),Tn.forEach(t),s1=p(i),Ln=a(i,"H2",{class:!0});var Ck=r(Ln);ya=a(Ck,"A",{id:!0,class:!0,href:!0});var _A=r(ya);Xg=a(_A,"SPAN",{});var bA=r(Xg);k(Md.$$.fragment,bA),bA.forEach(t),_A.forEach(t),NB=p(Ck),Lg=a(Ck,"SPAN",{});var yA=r(Lg);WB=n(yA,"Bert specific outputs"),yA.forEach(t),Ck.forEach(t),a1=p(i),On=a(i,"DIV",{class:!0});var Jk=r(On);k($d.$$.fragment,Jk),PB=p(Jk),Fd=a(Jk,"P",{});var Ik=r(Fd);qB=n(Ik,"Output type of "),Mu=a(Ik,"A",{href:!0});var vA=r(Mu);AB=n(vA,"BertForPreTraining"),vA.forEach(t),ZB=n(Ik,"."),Ik.forEach(t),Jk.forEach(t),r1=p(i),Dn=a(i,"DIV",{class:!0});var Uk=r(Dn);k(Bd.$$.fragment,Uk),RB=p(Uk),xd=a(Uk,"P",{});var Nk=r(xd);VB=n(Nk,"Output type of "),$u=a(Nk,"A",{href:!0});var TA=r($u);GB=n(TA,"TFBertForPreTraining"),TA.forEach(t),SB=n(Nk,"."),Nk.forEach(t),Uk.forEach(t),i1=p(i),qo=a(i,"DIV",{class:!0});var Bf=r(qo);k(Ed.$$.fragment,Bf),XB=p(Bf),jd=a(Bf,"P",{});var Wk=r(jd);LB=n(Wk,"Output type of "),Fu=a(Wk,"A",{href:!0});var kA=r(Fu);OB=n(kA,"BertForPreTraining"),kA.forEach(t),DB=n(Wk,"."),Wk.forEach(t),QB=p(Bf),va=a(Bf,"DIV",{class:!0});var Pk=r(va);k(zd.$$.fragment,Pk),HB=p(Pk),Og=a(Pk,"P",{});var wA=r(Og);YB=n(wA,"\u201CReturns a new object replacing the specified fields with new values."),wA.forEach(t),Pk.forEach(t),Bf.forEach(t),l1=p(i),Qn=a(i,"H2",{class:!0});var qk=r(Qn);Ta=a(qk,"A",{id:!0,class:!0,href:!0});var MA=r(Ta);Dg=a(MA,"SPAN",{});var $A=r(Dg);k(Cd.$$.fragment,$A),$A.forEach(t),MA.forEach(t),KB=p(qk),Qg=a(qk,"SPAN",{});var FA=r(Qg);ex=n(FA,"BertModel"),FA.forEach(t),qk.forEach(t),d1=p(i),nt=a(i,"DIV",{class:!0});var Lt=r(nt);k(Jd.$$.fragment,Lt),tx=p(Lt),Hg=a(Lt,"P",{});var BA=r(Hg);ox=n(BA,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),BA.forEach(t),nx=p(Lt),Id=a(Lt,"P",{});var Ak=r(Id);sx=n(Ak,"This model inherits from "),Bu=a(Ak,"A",{href:!0});var xA=r(Bu);ax=n(xA,"PreTrainedModel"),xA.forEach(t),rx=n(Ak,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ak.forEach(t),ix=p(Lt),Ud=a(Lt,"P",{});var Zk=r(Ud);lx=n(Zk,"This model is also a PyTorch "),Nd=a(Zk,"A",{href:!0,rel:!0});var EA=r(Nd);dx=n(EA,"torch.nn.Module"),EA.forEach(t),cx=n(Zk,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Zk.forEach(t),px=p(Lt),Wd=a(Lt,"P",{});var Rk=r(Wd);hx=n(Rk,`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),Pd=a(Rk,"A",{href:!0,rel:!0});var jA=r(Pd);mx=n(jA,`Attention is
all you need`),jA.forEach(t),ux=n(Rk,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),Rk.forEach(t),fx=p(Lt),gt=a(Lt,"P",{});var Ot=r(gt);gx=n(Ot,"To behave as an decoder the model needs to be initialized with the "),Yg=a(Ot,"CODE",{});var zA=r(Yg);_x=n(zA,"is_decoder"),zA.forEach(t),bx=n(Ot,` argument of the configuration set
to `),Kg=a(Ot,"CODE",{});var CA=r(Kg);yx=n(CA,"True"),CA.forEach(t),vx=n(Ot,". To be used in a Seq2Seq model, the model needs to initialized with both "),e_=a(Ot,"CODE",{});var JA=r(e_);Tx=n(JA,"is_decoder"),JA.forEach(t),kx=n(Ot,` argument and
`),t_=a(Ot,"CODE",{});var IA=r(t_);wx=n(IA,"add_cross_attention"),IA.forEach(t),Mx=n(Ot," set to "),o_=a(Ot,"CODE",{});var UA=r(o_);$x=n(UA,"True"),UA.forEach(t),Fx=n(Ot,"; an "),n_=a(Ot,"CODE",{});var NA=r(n_);Bx=n(NA,"encoder_hidden_states"),NA.forEach(t),xx=n(Ot," is then expected as an input to the forward pass."),Ot.forEach(t),Ex=p(Lt),io=a(Lt,"DIV",{class:!0});var ci=r(io);k(qd.$$.fragment,ci),jx=p(ci),Hn=a(ci,"P",{});var xf=r(Hn);zx=n(xf,"The "),xu=a(xf,"A",{href:!0});var WA=r(xu);Cx=n(WA,"BertModel"),WA.forEach(t),Jx=n(xf," forward method, overrides the "),s_=a(xf,"CODE",{});var PA=r(s_);Ix=n(PA,"__call__"),PA.forEach(t),Ux=n(xf," special method."),xf.forEach(t),Nx=p(ci),k(ka.$$.fragment,ci),Wx=p(ci),k(wa.$$.fragment,ci),ci.forEach(t),Lt.forEach(t),c1=p(i),Yn=a(i,"H2",{class:!0});var Vk=r(Yn);Ma=a(Vk,"A",{id:!0,class:!0,href:!0});var qA=r(Ma);a_=a(qA,"SPAN",{});var AA=r(a_);k(Ad.$$.fragment,AA),AA.forEach(t),qA.forEach(t),Px=p(Vk),r_=a(Vk,"SPAN",{});var ZA=r(r_);qx=n(ZA,"BertForPreTraining"),ZA.forEach(t),Vk.forEach(t),p1=p(i),jt=a(i,"DIV",{class:!0});var kn=r(jt);k(Zd.$$.fragment,kn),Ax=p(kn),Kn=a(kn,"P",{});var Ef=r(Kn);Zx=n(Ef,"Bert Model with two heads on top as done during the pretraining: a "),i_=a(Ef,"CODE",{});var RA=r(i_);Rx=n(RA,"masked language modeling"),RA.forEach(t),Vx=n(Ef," head and a "),l_=a(Ef,"CODE",{});var VA=r(l_);Gx=n(VA,"next sentence prediction (classification)"),VA.forEach(t),Sx=n(Ef," head."),Ef.forEach(t),Xx=p(kn),Rd=a(kn,"P",{});var Gk=r(Rd);Lx=n(Gk,"This model inherits from "),Eu=a(Gk,"A",{href:!0});var GA=r(Eu);Ox=n(GA,"PreTrainedModel"),GA.forEach(t),Dx=n(Gk,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Gk.forEach(t),Qx=p(kn),Vd=a(kn,"P",{});var Sk=r(Vd);Hx=n(Sk,"This model is also a PyTorch "),Gd=a(Sk,"A",{href:!0,rel:!0});var SA=r(Gd);Yx=n(SA,"torch.nn.Module"),SA.forEach(t),Kx=n(Sk,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Sk.forEach(t),eE=p(kn),lo=a(kn,"DIV",{class:!0});var pi=r(lo);k(Sd.$$.fragment,pi),tE=p(pi),es=a(pi,"P",{});var jf=r(es);oE=n(jf,"The "),ju=a(jf,"A",{href:!0});var XA=r(ju);nE=n(XA,"BertForPreTraining"),XA.forEach(t),sE=n(jf," forward method, overrides the "),d_=a(jf,"CODE",{});var LA=r(d_);aE=n(LA,"__call__"),LA.forEach(t),rE=n(jf," special method."),jf.forEach(t),iE=p(pi),k($a.$$.fragment,pi),lE=p(pi),k(Fa.$$.fragment,pi),pi.forEach(t),kn.forEach(t),h1=p(i),ts=a(i,"H2",{class:!0});var Xk=r(ts);Ba=a(Xk,"A",{id:!0,class:!0,href:!0});var OA=r(Ba);c_=a(OA,"SPAN",{});var DA=r(c_);k(Xd.$$.fragment,DA),DA.forEach(t),OA.forEach(t),dE=p(Xk),p_=a(Xk,"SPAN",{});var QA=r(p_);cE=n(QA,"BertLMHeadModel"),QA.forEach(t),Xk.forEach(t),m1=p(i),zt=a(i,"DIV",{class:!0});var wn=r(zt);k(Ld.$$.fragment,wn),pE=p(wn),Od=a(wn,"P",{});var Lk=r(Od);hE=n(Lk,"Bert Model with a "),h_=a(Lk,"CODE",{});var HA=r(h_);mE=n(HA,"language modeling"),HA.forEach(t),uE=n(Lk," head on top for CLM fine-tuning."),Lk.forEach(t),fE=p(wn),Dd=a(wn,"P",{});var Ok=r(Dd);gE=n(Ok,"This model inherits from "),zu=a(Ok,"A",{href:!0});var YA=r(zu);_E=n(YA,"PreTrainedModel"),YA.forEach(t),bE=n(Ok,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ok.forEach(t),yE=p(wn),Qd=a(wn,"P",{});var Dk=r(Qd);vE=n(Dk,"This model is also a PyTorch "),Hd=a(Dk,"A",{href:!0,rel:!0});var KA=r(Hd);TE=n(KA,"torch.nn.Module"),KA.forEach(t),kE=n(Dk,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Dk.forEach(t),wE=p(wn),co=a(wn,"DIV",{class:!0});var hi=r(co);k(Yd.$$.fragment,hi),ME=p(hi),os=a(hi,"P",{});var zf=r(os);$E=n(zf,"The "),Cu=a(zf,"A",{href:!0});var eZ=r(Cu);FE=n(eZ,"BertLMHeadModel"),eZ.forEach(t),BE=n(zf," forward method, overrides the "),m_=a(zf,"CODE",{});var tZ=r(m_);xE=n(tZ,"__call__"),tZ.forEach(t),EE=n(zf," special method."),zf.forEach(t),jE=p(hi),k(xa.$$.fragment,hi),zE=p(hi),k(Ea.$$.fragment,hi),hi.forEach(t),wn.forEach(t),u1=p(i),ns=a(i,"H2",{class:!0});var Qk=r(ns);ja=a(Qk,"A",{id:!0,class:!0,href:!0});var oZ=r(ja);u_=a(oZ,"SPAN",{});var nZ=r(u_);k(Kd.$$.fragment,nZ),nZ.forEach(t),oZ.forEach(t),CE=p(Qk),f_=a(Qk,"SPAN",{});var sZ=r(f_);JE=n(sZ,"BertForMaskedLM"),sZ.forEach(t),Qk.forEach(t),f1=p(i),Ct=a(i,"DIV",{class:!0});var Mn=r(Ct);k(ec.$$.fragment,Mn),IE=p(Mn),tc=a(Mn,"P",{});var Hk=r(tc);UE=n(Hk,"Bert Model with a "),g_=a(Hk,"CODE",{});var aZ=r(g_);NE=n(aZ,"language modeling"),aZ.forEach(t),WE=n(Hk," head on top."),Hk.forEach(t),PE=p(Mn),oc=a(Mn,"P",{});var Yk=r(oc);qE=n(Yk,"This model inherits from "),Ju=a(Yk,"A",{href:!0});var rZ=r(Ju);AE=n(rZ,"PreTrainedModel"),rZ.forEach(t),ZE=n(Yk,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Yk.forEach(t),RE=p(Mn),nc=a(Mn,"P",{});var Kk=r(nc);VE=n(Kk,"This model is also a PyTorch "),sc=a(Kk,"A",{href:!0,rel:!0});var iZ=r(sc);GE=n(iZ,"torch.nn.Module"),iZ.forEach(t),SE=n(Kk,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Kk.forEach(t),XE=p(Mn),po=a(Mn,"DIV",{class:!0});var mi=r(po);k(ac.$$.fragment,mi),LE=p(mi),ss=a(mi,"P",{});var Cf=r(ss);OE=n(Cf,"The "),Iu=a(Cf,"A",{href:!0});var lZ=r(Iu);DE=n(lZ,"BertForMaskedLM"),lZ.forEach(t),QE=n(Cf," forward method, overrides the "),__=a(Cf,"CODE",{});var dZ=r(__);HE=n(dZ,"__call__"),dZ.forEach(t),YE=n(Cf," special method."),Cf.forEach(t),KE=p(mi),k(za.$$.fragment,mi),ej=p(mi),k(Ca.$$.fragment,mi),mi.forEach(t),Mn.forEach(t),g1=p(i),as=a(i,"H2",{class:!0});var ew=r(as);Ja=a(ew,"A",{id:!0,class:!0,href:!0});var cZ=r(Ja);b_=a(cZ,"SPAN",{});var pZ=r(b_);k(rc.$$.fragment,pZ),pZ.forEach(t),cZ.forEach(t),tj=p(ew),y_=a(ew,"SPAN",{});var hZ=r(y_);oj=n(hZ,"BertForNextSentencePrediction"),hZ.forEach(t),ew.forEach(t),_1=p(i),Jt=a(i,"DIV",{class:!0});var $n=r(Jt);k(ic.$$.fragment,$n),nj=p($n),lc=a($n,"P",{});var tw=r(lc);sj=n(tw,"Bert Model with a "),v_=a(tw,"CODE",{});var mZ=r(v_);aj=n(mZ,"next sentence prediction (classification)"),mZ.forEach(t),rj=n(tw," head on top."),tw.forEach(t),ij=p($n),dc=a($n,"P",{});var ow=r(dc);lj=n(ow,"This model inherits from "),Uu=a(ow,"A",{href:!0});var uZ=r(Uu);dj=n(uZ,"PreTrainedModel"),uZ.forEach(t),cj=n(ow,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ow.forEach(t),pj=p($n),cc=a($n,"P",{});var nw=r(cc);hj=n(nw,"This model is also a PyTorch "),pc=a(nw,"A",{href:!0,rel:!0});var fZ=r(pc);mj=n(fZ,"torch.nn.Module"),fZ.forEach(t),uj=n(nw,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),nw.forEach(t),fj=p($n),ho=a($n,"DIV",{class:!0});var ui=r(ho);k(hc.$$.fragment,ui),gj=p(ui),rs=a(ui,"P",{});var Jf=r(rs);_j=n(Jf,"The "),Nu=a(Jf,"A",{href:!0});var gZ=r(Nu);bj=n(gZ,"BertForNextSentencePrediction"),gZ.forEach(t),yj=n(Jf," forward method, overrides the "),T_=a(Jf,"CODE",{});var _Z=r(T_);vj=n(_Z,"__call__"),_Z.forEach(t),Tj=n(Jf," special method."),Jf.forEach(t),kj=p(ui),k(Ia.$$.fragment,ui),wj=p(ui),k(Ua.$$.fragment,ui),ui.forEach(t),$n.forEach(t),b1=p(i),is=a(i,"H2",{class:!0});var sw=r(is);Na=a(sw,"A",{id:!0,class:!0,href:!0});var bZ=r(Na);k_=a(bZ,"SPAN",{});var yZ=r(k_);k(mc.$$.fragment,yZ),yZ.forEach(t),bZ.forEach(t),Mj=p(sw),w_=a(sw,"SPAN",{});var vZ=r(w_);$j=n(vZ,"BertForSequenceClassification"),vZ.forEach(t),sw.forEach(t),y1=p(i),It=a(i,"DIV",{class:!0});var Fn=r(It);k(uc.$$.fragment,Fn),Fj=p(Fn),M_=a(Fn,"P",{});var TZ=r(M_);Bj=n(TZ,`Bert Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),TZ.forEach(t),xj=p(Fn),fc=a(Fn,"P",{});var aw=r(fc);Ej=n(aw,"This model inherits from "),Wu=a(aw,"A",{href:!0});var kZ=r(Wu);jj=n(kZ,"PreTrainedModel"),kZ.forEach(t),zj=n(aw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),aw.forEach(t),Cj=p(Fn),gc=a(Fn,"P",{});var rw=r(gc);Jj=n(rw,"This model is also a PyTorch "),_c=a(rw,"A",{href:!0,rel:!0});var wZ=r(_c);Ij=n(wZ,"torch.nn.Module"),wZ.forEach(t),Uj=n(rw,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),rw.forEach(t),Nj=p(Fn),At=a(Fn,"DIV",{class:!0});var Bn=r(At);k(bc.$$.fragment,Bn),Wj=p(Bn),ls=a(Bn,"P",{});var If=r(ls);Pj=n(If,"The "),Pu=a(If,"A",{href:!0});var MZ=r(Pu);qj=n(MZ,"BertForSequenceClassification"),MZ.forEach(t),Aj=n(If," forward method, overrides the "),$_=a(If,"CODE",{});var $Z=r($_);Zj=n($Z,"__call__"),$Z.forEach(t),Rj=n(If," special method."),If.forEach(t),Vj=p(Bn),k(Wa.$$.fragment,Bn),Gj=p(Bn),k(Pa.$$.fragment,Bn),Sj=p(Bn),k(qa.$$.fragment,Bn),Bn.forEach(t),Fn.forEach(t),v1=p(i),ds=a(i,"H2",{class:!0});var iw=r(ds);Aa=a(iw,"A",{id:!0,class:!0,href:!0});var FZ=r(Aa);F_=a(FZ,"SPAN",{});var BZ=r(F_);k(yc.$$.fragment,BZ),BZ.forEach(t),FZ.forEach(t),Xj=p(iw),B_=a(iw,"SPAN",{});var xZ=r(B_);Lj=n(xZ,"BertForMultipleChoice"),xZ.forEach(t),iw.forEach(t),T1=p(i),Ut=a(i,"DIV",{class:!0});var xn=r(Ut);k(vc.$$.fragment,xn),Oj=p(xn),x_=a(xn,"P",{});var EZ=r(x_);Dj=n(EZ,`Bert 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.`),EZ.forEach(t),Qj=p(xn),Tc=a(xn,"P",{});var lw=r(Tc);Hj=n(lw,"This model inherits from "),qu=a(lw,"A",{href:!0});var jZ=r(qu);Yj=n(jZ,"PreTrainedModel"),jZ.forEach(t),Kj=n(lw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),lw.forEach(t),e4=p(xn),kc=a(xn,"P",{});var dw=r(kc);t4=n(dw,"This model is also a PyTorch "),wc=a(dw,"A",{href:!0,rel:!0});var zZ=r(wc);o4=n(zZ,"torch.nn.Module"),zZ.forEach(t),n4=n(dw,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),dw.forEach(t),s4=p(xn),mo=a(xn,"DIV",{class:!0});var fi=r(mo);k(Mc.$$.fragment,fi),a4=p(fi),cs=a(fi,"P",{});var Uf=r(cs);r4=n(Uf,"The "),Au=a(Uf,"A",{href:!0});var CZ=r(Au);i4=n(CZ,"BertForMultipleChoice"),CZ.forEach(t),l4=n(Uf," forward method, overrides the "),E_=a(Uf,"CODE",{});var JZ=r(E_);d4=n(JZ,"__call__"),JZ.forEach(t),c4=n(Uf," special method."),Uf.forEach(t),p4=p(fi),k(Za.$$.fragment,fi),h4=p(fi),k(Ra.$$.fragment,fi),fi.forEach(t),xn.forEach(t),k1=p(i),ps=a(i,"H2",{class:!0});var cw=r(ps);Va=a(cw,"A",{id:!0,class:!0,href:!0});var IZ=r(Va);j_=a(IZ,"SPAN",{});var UZ=r(j_);k($c.$$.fragment,UZ),UZ.forEach(t),IZ.forEach(t),m4=p(cw),z_=a(cw,"SPAN",{});var NZ=r(z_);u4=n(NZ,"BertForTokenClassification"),NZ.forEach(t),cw.forEach(t),w1=p(i),Nt=a(i,"DIV",{class:!0});var En=r(Nt);k(Fc.$$.fragment,En),f4=p(En),C_=a(En,"P",{});var WZ=r(C_);g4=n(WZ,`Bert 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.`),WZ.forEach(t),_4=p(En),Bc=a(En,"P",{});var pw=r(Bc);b4=n(pw,"This model inherits from "),Zu=a(pw,"A",{href:!0});var PZ=r(Zu);y4=n(PZ,"PreTrainedModel"),PZ.forEach(t),v4=n(pw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),pw.forEach(t),T4=p(En),xc=a(En,"P",{});var hw=r(xc);k4=n(hw,"This model is also a PyTorch "),Ec=a(hw,"A",{href:!0,rel:!0});var qZ=r(Ec);w4=n(qZ,"torch.nn.Module"),qZ.forEach(t),M4=n(hw,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),hw.forEach(t),$4=p(En),uo=a(En,"DIV",{class:!0});var gi=r(uo);k(jc.$$.fragment,gi),F4=p(gi),hs=a(gi,"P",{});var Nf=r(hs);B4=n(Nf,"The "),Ru=a(Nf,"A",{href:!0});var AZ=r(Ru);x4=n(AZ,"BertForTokenClassification"),AZ.forEach(t),E4=n(Nf," forward method, overrides the "),J_=a(Nf,"CODE",{});var ZZ=r(J_);j4=n(ZZ,"__call__"),ZZ.forEach(t),z4=n(Nf," special method."),Nf.forEach(t),C4=p(gi),k(Ga.$$.fragment,gi),J4=p(gi),k(Sa.$$.fragment,gi),gi.forEach(t),En.forEach(t),M1=p(i),ms=a(i,"H2",{class:!0});var mw=r(ms);Xa=a(mw,"A",{id:!0,class:!0,href:!0});var RZ=r(Xa);I_=a(RZ,"SPAN",{});var VZ=r(I_);k(zc.$$.fragment,VZ),VZ.forEach(t),RZ.forEach(t),I4=p(mw),U_=a(mw,"SPAN",{});var GZ=r(U_);U4=n(GZ,"BertForQuestionAnswering"),GZ.forEach(t),mw.forEach(t),$1=p(i),Wt=a(i,"DIV",{class:!0});var jn=r(Wt);k(Cc.$$.fragment,jn),N4=p(jn),us=a(jn,"P",{});var Wf=r(us);W4=n(Wf,`Bert 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 `),N_=a(Wf,"CODE",{});var SZ=r(N_);P4=n(SZ,"span start logits"),SZ.forEach(t),q4=n(Wf," and "),W_=a(Wf,"CODE",{});var XZ=r(W_);A4=n(XZ,"span end logits"),XZ.forEach(t),Z4=n(Wf,")."),Wf.forEach(t),R4=p(jn),Jc=a(jn,"P",{});var uw=r(Jc);V4=n(uw,"This model inherits from "),Vu=a(uw,"A",{href:!0});var LZ=r(Vu);G4=n(LZ,"PreTrainedModel"),LZ.forEach(t),S4=n(uw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),uw.forEach(t),X4=p(jn),Ic=a(jn,"P",{});var fw=r(Ic);L4=n(fw,"This model is also a PyTorch "),Uc=a(fw,"A",{href:!0,rel:!0});var OZ=r(Uc);O4=n(OZ,"torch.nn.Module"),OZ.forEach(t),D4=n(fw,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),fw.forEach(t),Q4=p(jn),fo=a(jn,"DIV",{class:!0});var _i=r(fo);k(Nc.$$.fragment,_i),H4=p(_i),fs=a(_i,"P",{});var Pf=r(fs);Y4=n(Pf,"The "),Gu=a(Pf,"A",{href:!0});var DZ=r(Gu);K4=n(DZ,"BertForQuestionAnswering"),DZ.forEach(t),e3=n(Pf," forward method, overrides the "),P_=a(Pf,"CODE",{});var QZ=r(P_);t3=n(QZ,"__call__"),QZ.forEach(t),o3=n(Pf," special method."),Pf.forEach(t),n3=p(_i),k(La.$$.fragment,_i),s3=p(_i),k(Oa.$$.fragment,_i),_i.forEach(t),jn.forEach(t),F1=p(i),gs=a(i,"H2",{class:!0});var gw=r(gs);Da=a(gw,"A",{id:!0,class:!0,href:!0});var HZ=r(Da);q_=a(HZ,"SPAN",{});var YZ=r(q_);k(Wc.$$.fragment,YZ),YZ.forEach(t),HZ.forEach(t),a3=p(gw),A_=a(gw,"SPAN",{});var KZ=r(A_);r3=n(KZ,"TFBertModel"),KZ.forEach(t),gw.forEach(t),B1=p(i),_t=a(i,"DIV",{class:!0});var jo=r(_t);k(Pc.$$.fragment,jo),i3=p(jo),Z_=a(jo,"P",{});var e6=r(Z_);l3=n(e6,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),e6.forEach(t),d3=p(jo),qc=a(jo,"P",{});var _w=r(qc);c3=n(_w,"This model inherits from "),Su=a(_w,"A",{href:!0});var t6=r(Su);p3=n(t6,"TFPreTrainedModel"),t6.forEach(t),h3=n(_w,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),_w.forEach(t),m3=p(jo),Ac=a(jo,"P",{});var bw=r(Ac);u3=n(bw,"This model is also a "),Zc=a(bw,"A",{href:!0,rel:!0});var o6=r(Zc);f3=n(o6,"tf.keras.Model"),o6.forEach(t),g3=n(bw,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),bw.forEach(t),_3=p(jo),k(Qa.$$.fragment,jo),b3=p(jo),go=a(jo,"DIV",{class:!0});var bi=r(go);k(Rc.$$.fragment,bi),y3=p(bi),_s=a(bi,"P",{});var qf=r(_s);v3=n(qf,"The "),Xu=a(qf,"A",{href:!0});var n6=r(Xu);T3=n(n6,"TFBertModel"),n6.forEach(t),k3=n(qf," forward method, overrides the "),R_=a(qf,"CODE",{});var s6=r(R_);w3=n(s6,"__call__"),s6.forEach(t),M3=n(qf," special method."),qf.forEach(t),$3=p(bi),k(Ha.$$.fragment,bi),F3=p(bi),k(Ya.$$.fragment,bi),bi.forEach(t),jo.forEach(t),x1=p(i),bs=a(i,"H2",{class:!0});var yw=r(bs);Ka=a(yw,"A",{id:!0,class:!0,href:!0});var a6=r(Ka);V_=a(a6,"SPAN",{});var r6=r(V_);k(Vc.$$.fragment,r6),r6.forEach(t),a6.forEach(t),B3=p(yw),G_=a(yw,"SPAN",{});var i6=r(G_);x3=n(i6,"TFBertForPreTraining"),i6.forEach(t),yw.forEach(t),E1=p(i),bt=a(i,"DIV",{class:!0});var zo=r(bt);k(Gc.$$.fragment,zo),E3=p(zo),ys=a(zo,"P",{});var Af=r(ys);j3=n(Af,`Bert Model with two heads on top as done during the pretraining:
a `),S_=a(Af,"CODE",{});var l6=r(S_);z3=n(l6,"masked language modeling"),l6.forEach(t),C3=n(Af," head and a "),X_=a(Af,"CODE",{});var d6=r(X_);J3=n(d6,"next sentence prediction (classification)"),d6.forEach(t),I3=n(Af," head."),Af.forEach(t),U3=p(zo),Sc=a(zo,"P",{});var vw=r(Sc);N3=n(vw,"This model inherits from "),Lu=a(vw,"A",{href:!0});var c6=r(Lu);W3=n(c6,"TFPreTrainedModel"),c6.forEach(t),P3=n(vw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),vw.forEach(t),q3=p(zo),Xc=a(zo,"P",{});var Tw=r(Xc);A3=n(Tw,"This model is also a "),Lc=a(Tw,"A",{href:!0,rel:!0});var p6=r(Lc);Z3=n(p6,"tf.keras.Model"),p6.forEach(t),R3=n(Tw,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Tw.forEach(t),V3=p(zo),k(er.$$.fragment,zo),G3=p(zo),_o=a(zo,"DIV",{class:!0});var yi=r(_o);k(Oc.$$.fragment,yi),S3=p(yi),vs=a(yi,"P",{});var Zf=r(vs);X3=n(Zf,"The "),Ou=a(Zf,"A",{href:!0});var h6=r(Ou);L3=n(h6,"TFBertForPreTraining"),h6.forEach(t),O3=n(Zf," forward method, overrides the "),L_=a(Zf,"CODE",{});var m6=r(L_);D3=n(m6,"__call__"),m6.forEach(t),Q3=n(Zf," special method."),Zf.forEach(t),H3=p(yi),k(tr.$$.fragment,yi),Y3=p(yi),k(or.$$.fragment,yi),yi.forEach(t),zo.forEach(t),j1=p(i),Ts=a(i,"H2",{class:!0});var kw=r(Ts);nr=a(kw,"A",{id:!0,class:!0,href:!0});var u6=r(nr);O_=a(u6,"SPAN",{});var f6=r(O_);k(Dc.$$.fragment,f6),f6.forEach(t),u6.forEach(t),K3=p(kw),D_=a(kw,"SPAN",{});var g6=r(D_);ez=n(g6,"TFBertModelLMHeadModel"),g6.forEach(t),kw.forEach(t),z1=p(i),ks=a(i,"DIV",{class:!0});var ww=r(ks);k(Qc.$$.fragment,ww),tz=p(ww),Zt=a(ww,"DIV",{class:!0});var zn=r(Zt);k(Hc.$$.fragment,zn),oz=p(zn),st=a(zn,"P",{});var Bt=r(st);nz=n(Bt,"encoder_hidden_states  ("),Q_=a(Bt,"CODE",{});var _6=r(Q_);sz=n(_6,"tf.Tensor"),_6.forEach(t),az=n(Bt," of shape "),H_=a(Bt,"CODE",{});var b6=r(H_);rz=n(b6,"(batch_size, sequence_length, hidden_size)"),b6.forEach(t),iz=n(Bt,", "),Y_=a(Bt,"EM",{});var y6=r(Y_);lz=n(y6,"optional"),y6.forEach(t),dz=n(Bt,`):
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.
encoder_attention_mask (`),K_=a(Bt,"CODE",{});var v6=r(K_);cz=n(v6,"tf.Tensor"),v6.forEach(t),pz=n(Bt," of shape "),eb=a(Bt,"CODE",{});var T6=r(eb);hz=n(T6,"(batch_size, sequence_length)"),T6.forEach(t),mz=n(Bt,", "),tb=a(Bt,"EM",{});var k6=r(tb);uz=n(k6,"optional"),k6.forEach(t),fz=n(Bt,`):
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in `),ob=a(Bt,"CODE",{});var w6=r(ob);gz=n(w6,"[0, 1]"),w6.forEach(t),_z=n(Bt,":"),Bt.forEach(t),bz=p(zn),Yc=a(zn,"UL",{});var Mw=r(Yc);Kc=a(Mw,"LI",{});var $w=r(Kc);yz=n($w,"1 for tokens that are "),nb=a($w,"STRONG",{});var M6=r(nb);vz=n(M6,"not masked"),M6.forEach(t),Tz=n($w,","),$w.forEach(t),kz=p(Mw),ep=a(Mw,"LI",{});var Fw=r(ep);wz=n(Fw,"0 for tokens that are "),sb=a(Fw,"STRONG",{});var $6=r(sb);Mz=n($6,"masked"),$6.forEach(t),$z=n(Fw,"."),Fw.forEach(t),Mw.forEach(t),Fz=p(zn),ne=a(zn,"P",{});var re=r(ne);Bz=n(re,"past_key_values ("),ab=a(re,"CODE",{});var F6=r(ab);xz=n(F6,"Tuple[Tuple[tf.Tensor]]"),F6.forEach(t),Ez=n(re," of length "),rb=a(re,"CODE",{});var B6=r(rb);jz=n(B6,"config.n_layers"),B6.forEach(t),zz=n(re,`)
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If `),ib=a(re,"CODE",{});var x6=r(ib);Cz=n(x6,"past_key_values"),x6.forEach(t),Jz=n(re," are used, the user can optionally input only the last "),lb=a(re,"CODE",{});var E6=r(lb);Iz=n(E6,"decoder_input_ids"),E6.forEach(t),Uz=n(re,` (those that
don\u2019t have their past key value states given to this model) of shape `),db=a(re,"CODE",{});var j6=r(db);Nz=n(j6,"(batch_size, 1)"),j6.forEach(t),Wz=n(re,` instead of all
`),cb=a(re,"CODE",{});var z6=r(cb);Pz=n(z6,"decoder_input_ids"),z6.forEach(t),qz=n(re," of shape "),pb=a(re,"CODE",{});var C6=r(pb);Az=n(C6,"(batch_size, sequence_length)"),C6.forEach(t),Zz=n(re,`.
use_cache (`),hb=a(re,"CODE",{});var J6=r(hb);Rz=n(J6,"bool"),J6.forEach(t),Vz=n(re,", "),mb=a(re,"EM",{});var I6=r(mb);Gz=n(I6,"optional"),I6.forEach(t),Sz=n(re,", defaults to "),ub=a(re,"CODE",{});var U6=r(ub);Xz=n(U6,"True"),U6.forEach(t),Lz=n(re,`):
If set to `),fb=a(re,"CODE",{});var N6=r(fb);Oz=n(N6,"True"),N6.forEach(t),Dz=n(re,", "),gb=a(re,"CODE",{});var W6=r(gb);Qz=n(W6,"past_key_values"),W6.forEach(t),Hz=n(re,` key value states are returned and can be used to speed up decoding (see
`),_b=a(re,"CODE",{});var P6=r(_b);Yz=n(P6,"past_key_values"),P6.forEach(t),Kz=n(re,"). Set to "),bb=a(re,"CODE",{});var q6=r(bb);eC=n(q6,"False"),q6.forEach(t),tC=n(re," during training, "),yb=a(re,"CODE",{});var A6=r(yb);oC=n(A6,"True"),A6.forEach(t),nC=n(re,` during generation
labels (`),vb=a(re,"CODE",{});var Z6=r(vb);sC=n(Z6,"tf.Tensor"),Z6.forEach(t),aC=n(re," or "),Tb=a(re,"CODE",{});var R6=r(Tb);rC=n(R6,"np.ndarray"),R6.forEach(t),iC=n(re," of shape "),kb=a(re,"CODE",{});var V6=r(kb);lC=n(V6,"(batch_size, sequence_length)"),V6.forEach(t),dC=n(re,", "),wb=a(re,"EM",{});var G6=r(wb);cC=n(G6,"optional"),G6.forEach(t),pC=n(re,`):
Labels for computing the cross entropy classification loss. Indices should be in `),Mb=a(re,"CODE",{});var S6=r(Mb);hC=n(S6,"[0, ..., config.vocab_size - 1]"),S6.forEach(t),mC=n(re,"."),re.forEach(t),uC=p(zn),k(sr.$$.fragment,zn),zn.forEach(t),ww.forEach(t),C1=p(i),ws=a(i,"H2",{class:!0});var Bw=r(ws);ar=a(Bw,"A",{id:!0,class:!0,href:!0});var X6=r(ar);$b=a(X6,"SPAN",{});var L6=r($b);k(tp.$$.fragment,L6),L6.forEach(t),X6.forEach(t),fC=p(Bw),Fb=a(Bw,"SPAN",{});var O6=r(Fb);gC=n(O6,"TFBertForMaskedLM"),O6.forEach(t),Bw.forEach(t),J1=p(i),yt=a(i,"DIV",{class:!0});var Co=r(yt);k(op.$$.fragment,Co),_C=p(Co),np=a(Co,"P",{});var xw=r(np);bC=n(xw,"Bert Model with a "),Bb=a(xw,"CODE",{});var D6=r(Bb);yC=n(D6,"language modeling"),D6.forEach(t),vC=n(xw," head on top."),xw.forEach(t),TC=p(Co),sp=a(Co,"P",{});var Ew=r(sp);kC=n(Ew,"This model inherits from "),Du=a(Ew,"A",{href:!0});var Q6=r(Du);wC=n(Q6,"TFPreTrainedModel"),Q6.forEach(t),MC=n(Ew,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ew.forEach(t),$C=p(Co),ap=a(Co,"P",{});var jw=r(ap);FC=n(jw,"This model is also a "),rp=a(jw,"A",{href:!0,rel:!0});var H6=r(rp);BC=n(H6,"tf.keras.Model"),H6.forEach(t),xC=n(jw,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),jw.forEach(t),EC=p(Co),k(rr.$$.fragment,Co),jC=p(Co),Rt=a(Co,"DIV",{class:!0});var Cn=r(Rt);k(ip.$$.fragment,Cn),zC=p(Cn),Ms=a(Cn,"P",{});var Rf=r(Ms);CC=n(Rf,"The "),Qu=a(Rf,"A",{href:!0});var Y6=r(Qu);JC=n(Y6,"TFBertForMaskedLM"),Y6.forEach(t),IC=n(Rf," forward method, overrides the "),xb=a(Rf,"CODE",{});var K6=r(xb);UC=n(K6,"__call__"),K6.forEach(t),NC=n(Rf," special method."),Rf.forEach(t),WC=p(Cn),k(ir.$$.fragment,Cn),PC=p(Cn),k(lr.$$.fragment,Cn),qC=p(Cn),k(dr.$$.fragment,Cn),Cn.forEach(t),Co.forEach(t),I1=p(i),$s=a(i,"H2",{class:!0});var zw=r($s);cr=a(zw,"A",{id:!0,class:!0,href:!0});var eR=r(cr);Eb=a(eR,"SPAN",{});var tR=r(Eb);k(lp.$$.fragment,tR),tR.forEach(t),eR.forEach(t),AC=p(zw),jb=a(zw,"SPAN",{});var oR=r(jb);ZC=n(oR,"TFBertForNextSentencePrediction"),oR.forEach(t),zw.forEach(t),U1=p(i),vt=a(i,"DIV",{class:!0});var Jo=r(vt);k(dp.$$.fragment,Jo),RC=p(Jo),cp=a(Jo,"P",{});var Cw=r(cp);VC=n(Cw,"Bert Model with a "),zb=a(Cw,"CODE",{});var nR=r(zb);GC=n(nR,"next sentence prediction (classification)"),nR.forEach(t),SC=n(Cw," head on top."),Cw.forEach(t),XC=p(Jo),pp=a(Jo,"P",{});var Jw=r(pp);LC=n(Jw,"This model inherits from "),Hu=a(Jw,"A",{href:!0});var sR=r(Hu);OC=n(sR,"TFPreTrainedModel"),sR.forEach(t),DC=n(Jw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Jw.forEach(t),QC=p(Jo),hp=a(Jo,"P",{});var Iw=r(hp);HC=n(Iw,"This model is also a "),mp=a(Iw,"A",{href:!0,rel:!0});var aR=r(mp);YC=n(aR,"tf.keras.Model"),aR.forEach(t),KC=n(Iw,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Iw.forEach(t),eJ=p(Jo),k(pr.$$.fragment,Jo),tJ=p(Jo),bo=a(Jo,"DIV",{class:!0});var vi=r(bo);k(up.$$.fragment,vi),oJ=p(vi),Fs=a(vi,"P",{});var Vf=r(Fs);nJ=n(Vf,"The "),Yu=a(Vf,"A",{href:!0});var rR=r(Yu);sJ=n(rR,"TFBertForNextSentencePrediction"),rR.forEach(t),aJ=n(Vf," forward method, overrides the "),Cb=a(Vf,"CODE",{});var iR=r(Cb);rJ=n(iR,"__call__"),iR.forEach(t),iJ=n(Vf," special method."),Vf.forEach(t),lJ=p(vi),k(hr.$$.fragment,vi),dJ=p(vi),k(mr.$$.fragment,vi),vi.forEach(t),Jo.forEach(t),N1=p(i),Bs=a(i,"H2",{class:!0});var Uw=r(Bs);ur=a(Uw,"A",{id:!0,class:!0,href:!0});var lR=r(ur);Jb=a(lR,"SPAN",{});var dR=r(Jb);k(fp.$$.fragment,dR),dR.forEach(t),lR.forEach(t),cJ=p(Uw),Ib=a(Uw,"SPAN",{});var cR=r(Ib);pJ=n(cR,"TFBertForSequenceClassification"),cR.forEach(t),Uw.forEach(t),W1=p(i),Tt=a(i,"DIV",{class:!0});var Io=r(Tt);k(gp.$$.fragment,Io),hJ=p(Io),Ub=a(Io,"P",{});var pR=r(Ub);mJ=n(pR,`Bert Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),pR.forEach(t),uJ=p(Io),_p=a(Io,"P",{});var Nw=r(_p);fJ=n(Nw,"This model inherits from "),Ku=a(Nw,"A",{href:!0});var hR=r(Ku);gJ=n(hR,"TFPreTrainedModel"),hR.forEach(t),_J=n(Nw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Nw.forEach(t),bJ=p(Io),bp=a(Io,"P",{});var Ww=r(bp);yJ=n(Ww,"This model is also a "),yp=a(Ww,"A",{href:!0,rel:!0});var mR=r(yp);vJ=n(mR,"tf.keras.Model"),mR.forEach(t),TJ=n(Ww,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Ww.forEach(t),kJ=p(Io),k(fr.$$.fragment,Io),wJ=p(Io),Vt=a(Io,"DIV",{class:!0});var Jn=r(Vt);k(vp.$$.fragment,Jn),MJ=p(Jn),xs=a(Jn,"P",{});var Gf=r(xs);$J=n(Gf,"The "),ef=a(Gf,"A",{href:!0});var uR=r(ef);FJ=n(uR,"TFBertForSequenceClassification"),uR.forEach(t),BJ=n(Gf," forward method, overrides the "),Nb=a(Gf,"CODE",{});var fR=r(Nb);xJ=n(fR,"__call__"),fR.forEach(t),EJ=n(Gf," special method."),Gf.forEach(t),jJ=p(Jn),k(gr.$$.fragment,Jn),zJ=p(Jn),k(_r.$$.fragment,Jn),CJ=p(Jn),k(br.$$.fragment,Jn),Jn.forEach(t),Io.forEach(t),P1=p(i),Es=a(i,"H2",{class:!0});var Pw=r(Es);yr=a(Pw,"A",{id:!0,class:!0,href:!0});var gR=r(yr);Wb=a(gR,"SPAN",{});var _R=r(Wb);k(Tp.$$.fragment,_R),_R.forEach(t),gR.forEach(t),JJ=p(Pw),Pb=a(Pw,"SPAN",{});var bR=r(Pb);IJ=n(bR,"TFBertForMultipleChoice"),bR.forEach(t),Pw.forEach(t),q1=p(i),kt=a(i,"DIV",{class:!0});var Uo=r(kt);k(kp.$$.fragment,Uo),UJ=p(Uo),qb=a(Uo,"P",{});var yR=r(qb);NJ=n(yR,`Bert 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.`),yR.forEach(t),WJ=p(Uo),wp=a(Uo,"P",{});var qw=r(wp);PJ=n(qw,"This model inherits from "),tf=a(qw,"A",{href:!0});var vR=r(tf);qJ=n(vR,"TFPreTrainedModel"),vR.forEach(t),AJ=n(qw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),qw.forEach(t),ZJ=p(Uo),Mp=a(Uo,"P",{});var Aw=r(Mp);RJ=n(Aw,"This model is also a "),$p=a(Aw,"A",{href:!0,rel:!0});var TR=r($p);VJ=n(TR,"tf.keras.Model"),TR.forEach(t),GJ=n(Aw,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Aw.forEach(t),SJ=p(Uo),k(vr.$$.fragment,Uo),XJ=p(Uo),yo=a(Uo,"DIV",{class:!0});var Ti=r(yo);k(Fp.$$.fragment,Ti),LJ=p(Ti),js=a(Ti,"P",{});var Sf=r(js);OJ=n(Sf,"The "),of=a(Sf,"A",{href:!0});var kR=r(of);DJ=n(kR,"TFBertForMultipleChoice"),kR.forEach(t),QJ=n(Sf," forward method, overrides the "),Ab=a(Sf,"CODE",{});var wR=r(Ab);HJ=n(wR,"__call__"),wR.forEach(t),YJ=n(Sf," special method."),Sf.forEach(t),KJ=p(Ti),k(Tr.$$.fragment,Ti),eI=p(Ti),k(kr.$$.fragment,Ti),Ti.forEach(t),Uo.forEach(t),A1=p(i),zs=a(i,"H2",{class:!0});var Zw=r(zs);wr=a(Zw,"A",{id:!0,class:!0,href:!0});var MR=r(wr);Zb=a(MR,"SPAN",{});var $R=r(Zb);k(Bp.$$.fragment,$R),$R.forEach(t),MR.forEach(t),tI=p(Zw),Rb=a(Zw,"SPAN",{});var FR=r(Rb);oI=n(FR,"TFBertForTokenClassification"),FR.forEach(t),Zw.forEach(t),Z1=p(i),wt=a(i,"DIV",{class:!0});var No=r(wt);k(xp.$$.fragment,No),nI=p(No),Vb=a(No,"P",{});var BR=r(Vb);sI=n(BR,`Bert 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.`),BR.forEach(t),aI=p(No),Ep=a(No,"P",{});var Rw=r(Ep);rI=n(Rw,"This model inherits from "),nf=a(Rw,"A",{href:!0});var xR=r(nf);iI=n(xR,"TFPreTrainedModel"),xR.forEach(t),lI=n(Rw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Rw.forEach(t),dI=p(No),jp=a(No,"P",{});var Vw=r(jp);cI=n(Vw,"This model is also a "),zp=a(Vw,"A",{href:!0,rel:!0});var ER=r(zp);pI=n(ER,"tf.keras.Model"),ER.forEach(t),hI=n(Vw,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Vw.forEach(t),mI=p(No),k(Mr.$$.fragment,No),uI=p(No),Gt=a(No,"DIV",{class:!0});var In=r(Gt);k(Cp.$$.fragment,In),fI=p(In),Cs=a(In,"P",{});var Xf=r(Cs);gI=n(Xf,"The "),sf=a(Xf,"A",{href:!0});var jR=r(sf);_I=n(jR,"TFBertForTokenClassification"),jR.forEach(t),bI=n(Xf," forward method, overrides the "),Gb=a(Xf,"CODE",{});var zR=r(Gb);yI=n(zR,"__call__"),zR.forEach(t),vI=n(Xf," special method."),Xf.forEach(t),TI=p(In),k($r.$$.fragment,In),kI=p(In),k(Fr.$$.fragment,In),wI=p(In),k(Br.$$.fragment,In),In.forEach(t),No.forEach(t),R1=p(i),Js=a(i,"H2",{class:!0});var Gw=r(Js);xr=a(Gw,"A",{id:!0,class:!0,href:!0});var CR=r(xr);Sb=a(CR,"SPAN",{});var JR=r(Sb);k(Jp.$$.fragment,JR),JR.forEach(t),CR.forEach(t),MI=p(Gw),Xb=a(Gw,"SPAN",{});var IR=r(Xb);$I=n(IR,"TFBertForQuestionAnswering"),IR.forEach(t),Gw.forEach(t),V1=p(i),Mt=a(i,"DIV",{class:!0});var Wo=r(Mt);k(Ip.$$.fragment,Wo),FI=p(Wo),Is=a(Wo,"P",{});var Lf=r(Is);BI=n(Lf,`Bert Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layer on top of the hidden-states output to compute `),Lb=a(Lf,"CODE",{});var UR=r(Lb);xI=n(UR,"span start logits"),UR.forEach(t),EI=n(Lf," and "),Ob=a(Lf,"CODE",{});var NR=r(Ob);jI=n(NR,"span end logits"),NR.forEach(t),zI=n(Lf,")."),Lf.forEach(t),CI=p(Wo),Up=a(Wo,"P",{});var Sw=r(Up);JI=n(Sw,"This model inherits from "),af=a(Sw,"A",{href:!0});var WR=r(af);II=n(WR,"TFPreTrainedModel"),WR.forEach(t),UI=n(Sw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Sw.forEach(t),NI=p(Wo),Np=a(Wo,"P",{});var Xw=r(Np);WI=n(Xw,"This model is also a "),Wp=a(Xw,"A",{href:!0,rel:!0});var PR=r(Wp);PI=n(PR,"tf.keras.Model"),PR.forEach(t),qI=n(Xw,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Xw.forEach(t),AI=p(Wo),k(Er.$$.fragment,Wo),ZI=p(Wo),St=a(Wo,"DIV",{class:!0});var Un=r(St);k(Pp.$$.fragment,Un),RI=p(Un),Us=a(Un,"P",{});var Of=r(Us);VI=n(Of,"The "),rf=a(Of,"A",{href:!0});var qR=r(rf);GI=n(qR,"TFBertForQuestionAnswering"),qR.forEach(t),SI=n(Of," forward method, overrides the "),Db=a(Of,"CODE",{});var AR=r(Db);XI=n(AR,"__call__"),AR.forEach(t),LI=n(Of," special method."),Of.forEach(t),OI=p(Un),k(jr.$$.fragment,Un),DI=p(Un),k(zr.$$.fragment,Un),QI=p(Un),k(Cr.$$.fragment,Un),Un.forEach(t),Wo.forEach(t),G1=p(i),Ns=a(i,"H2",{class:!0});var Lw=r(Ns);Jr=a(Lw,"A",{id:!0,class:!0,href:!0});var ZR=r(Jr);Qb=a(ZR,"SPAN",{});var RR=r(Qb);k(qp.$$.fragment,RR),RR.forEach(t),ZR.forEach(t),HI=p(Lw),Hb=a(Lw,"SPAN",{});var VR=r(Hb);YI=n(VR,"FlaxBertModel"),VR.forEach(t),Lw.forEach(t),S1=p(i),at=a(i,"DIV",{class:!0});var Dt=r(at);k(Ap.$$.fragment,Dt),KI=p(Dt),Yb=a(Dt,"P",{});var GR=r(Yb);e5=n(GR,"The bare Bert Model transformer outputting raw hidden-states without any specific head on top."),GR.forEach(t),t5=p(Dt),Zp=a(Dt,"P",{});var Ow=r(Zp);o5=n(Ow,"This model inherits from "),lf=a(Ow,"A",{href:!0});var SR=r(lf);n5=n(SR,"FlaxPreTrainedModel"),SR.forEach(t),s5=n(Ow,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),Ow.forEach(t),a5=p(Dt),Rp=a(Dt,"P",{});var Dw=r(Rp);r5=n(Dw,"This model is also a Flax Linen "),Vp=a(Dw,"A",{href:!0,rel:!0});var XR=r(Vp);i5=n(XR,"flax.linen.Module"),XR.forEach(t),l5=n(Dw,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Dw.forEach(t),d5=p(Dt),Kb=a(Dt,"P",{});var LR=r(Kb);c5=n(LR,"Finally, this model supports inherent JAX features such as:"),LR.forEach(t),p5=p(Dt),Ao=a(Dt,"UL",{});var ki=r(Ao);ey=a(ki,"LI",{});var OR=r(ey);Gp=a(OR,"A",{href:!0,rel:!0});var DR=r(Gp);h5=n(DR,"Just-In-Time (JIT) compilation"),DR.forEach(t),OR.forEach(t),m5=p(ki),ty=a(ki,"LI",{});var QR=r(ty);Sp=a(QR,"A",{href:!0,rel:!0});var HR=r(Sp);u5=n(HR,"Automatic Differentiation"),HR.forEach(t),QR.forEach(t),f5=p(ki),oy=a(ki,"LI",{});var YR=r(oy);Xp=a(YR,"A",{href:!0,rel:!0});var KR=r(Xp);g5=n(KR,"Vectorization"),KR.forEach(t),YR.forEach(t),_5=p(ki),ny=a(ki,"LI",{});var eV=r(ny);Lp=a(eV,"A",{href:!0,rel:!0});var tV=r(Lp);b5=n(tV,"Parallelization"),tV.forEach(t),eV.forEach(t),ki.forEach(t),y5=p(Dt),vo=a(Dt,"DIV",{class:!0});var wi=r(vo);k(Op.$$.fragment,wi),v5=p(wi),Ws=a(wi,"P",{});var Df=r(Ws);T5=n(Df,"The "),sy=a(Df,"CODE",{});var oV=r(sy);k5=n(oV,"FlaxBertPreTrainedModel"),oV.forEach(t),w5=n(Df," forward method, overrides the "),ay=a(Df,"CODE",{});var nV=r(ay);M5=n(nV,"__call__"),nV.forEach(t),$5=n(Df," special method."),Df.forEach(t),F5=p(wi),k(Ir.$$.fragment,wi),B5=p(wi),k(Ur.$$.fragment,wi),wi.forEach(t),Dt.forEach(t),X1=p(i),Ps=a(i,"H2",{class:!0});var Qw=r(Ps);Nr=a(Qw,"A",{id:!0,class:!0,href:!0});var sV=r(Nr);ry=a(sV,"SPAN",{});var aV=r(ry);k(Dp.$$.fragment,aV),aV.forEach(t),sV.forEach(t),x5=p(Qw),iy=a(Qw,"SPAN",{});var rV=r(iy);E5=n(rV,"FlaxBertForPreTraining"),rV.forEach(t),Qw.forEach(t),L1=p(i),rt=a(i,"DIV",{class:!0});var Qt=r(rt);k(Qp.$$.fragment,Qt),j5=p(Qt),qs=a(Qt,"P",{});var Qf=r(qs);z5=n(Qf,"Bert Model with two heads on top as done during the pretraining: a "),ly=a(Qf,"CODE",{});var iV=r(ly);C5=n(iV,"masked language modeling"),iV.forEach(t),J5=n(Qf," head and a "),dy=a(Qf,"CODE",{});var lV=r(dy);I5=n(lV,"next sentence prediction (classification)"),lV.forEach(t),U5=n(Qf," head."),Qf.forEach(t),N5=p(Qt),Hp=a(Qt,"P",{});var Hw=r(Hp);W5=n(Hw,"This model inherits from "),df=a(Hw,"A",{href:!0});var dV=r(df);P5=n(dV,"FlaxPreTrainedModel"),dV.forEach(t),q5=n(Hw,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),Hw.forEach(t),A5=p(Qt),Yp=a(Qt,"P",{});var Yw=r(Yp);Z5=n(Yw,"This model is also a Flax Linen "),Kp=a(Yw,"A",{href:!0,rel:!0});var cV=r(Kp);R5=n(cV,"flax.linen.Module"),cV.forEach(t),V5=n(Yw,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Yw.forEach(t),G5=p(Qt),cy=a(Qt,"P",{});var pV=r(cy);S5=n(pV,"Finally, this model supports inherent JAX features such as:"),pV.forEach(t),X5=p(Qt),Zo=a(Qt,"UL",{});var Mi=r(Zo);py=a(Mi,"LI",{});var hV=r(py);eh=a(hV,"A",{href:!0,rel:!0});var mV=r(eh);L5=n(mV,"Just-In-Time (JIT) compilation"),mV.forEach(t),hV.forEach(t),O5=p(Mi),hy=a(Mi,"LI",{});var uV=r(hy);th=a(uV,"A",{href:!0,rel:!0});var fV=r(th);D5=n(fV,"Automatic Differentiation"),fV.forEach(t),uV.forEach(t),Q5=p(Mi),my=a(Mi,"LI",{});var gV=r(my);oh=a(gV,"A",{href:!0,rel:!0});var _V=r(oh);H5=n(_V,"Vectorization"),_V.forEach(t),gV.forEach(t),Y5=p(Mi),uy=a(Mi,"LI",{});var bV=r(uy);nh=a(bV,"A",{href:!0,rel:!0});var yV=r(nh);K5=n(yV,"Parallelization"),yV.forEach(t),bV.forEach(t),Mi.forEach(t),eU=p(Qt),To=a(Qt,"DIV",{class:!0});var $i=r(To);k(sh.$$.fragment,$i),tU=p($i),As=a($i,"P",{});var Hf=r(As);oU=n(Hf,"The "),fy=a(Hf,"CODE",{});var vV=r(fy);nU=n(vV,"FlaxBertPreTrainedModel"),vV.forEach(t),sU=n(Hf," forward method, overrides the "),gy=a(Hf,"CODE",{});var TV=r(gy);aU=n(TV,"__call__"),TV.forEach(t),rU=n(Hf," special method."),Hf.forEach(t),iU=p($i),k(Wr.$$.fragment,$i),lU=p($i),k(Pr.$$.fragment,$i),$i.forEach(t),Qt.forEach(t),O1=p(i),Zs=a(i,"H2",{class:!0});var Kw=r(Zs);qr=a(Kw,"A",{id:!0,class:!0,href:!0});var kV=r(qr);_y=a(kV,"SPAN",{});var wV=r(_y);k(ah.$$.fragment,wV),wV.forEach(t),kV.forEach(t),dU=p(Kw),by=a(Kw,"SPAN",{});var MV=r(by);cU=n(MV,"FlaxBertForCausalLM"),MV.forEach(t),Kw.forEach(t),D1=p(i),it=a(i,"DIV",{class:!0});var Ht=r(it);k(rh.$$.fragment,Ht),pU=p(Ht),yy=a(Ht,"P",{});var $V=r(yy);hU=n($V,`Bert Model with a language modeling head on top (a linear layer on top of the hidden-states output) e.g for
autoregressive tasks.`),$V.forEach(t),mU=p(Ht),ih=a(Ht,"P",{});var eM=r(ih);uU=n(eM,"This model inherits from "),cf=a(eM,"A",{href:!0});var FV=r(cf);fU=n(FV,"FlaxPreTrainedModel"),FV.forEach(t),gU=n(eM,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),eM.forEach(t),_U=p(Ht),lh=a(Ht,"P",{});var tM=r(lh);bU=n(tM,"This model is also a Flax Linen "),dh=a(tM,"A",{href:!0,rel:!0});var BV=r(dh);yU=n(BV,"flax.linen.Module"),BV.forEach(t),vU=n(tM,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),tM.forEach(t),TU=p(Ht),vy=a(Ht,"P",{});var xV=r(vy);kU=n(xV,"Finally, this model supports inherent JAX features such as:"),xV.forEach(t),wU=p(Ht),Ro=a(Ht,"UL",{});var Fi=r(Ro);Ty=a(Fi,"LI",{});var EV=r(Ty);ch=a(EV,"A",{href:!0,rel:!0});var jV=r(ch);MU=n(jV,"Just-In-Time (JIT) compilation"),jV.forEach(t),EV.forEach(t),$U=p(Fi),ky=a(Fi,"LI",{});var zV=r(ky);ph=a(zV,"A",{href:!0,rel:!0});var CV=r(ph);FU=n(CV,"Automatic Differentiation"),CV.forEach(t),zV.forEach(t),BU=p(Fi),wy=a(Fi,"LI",{});var JV=r(wy);hh=a(JV,"A",{href:!0,rel:!0});var IV=r(hh);xU=n(IV,"Vectorization"),IV.forEach(t),JV.forEach(t),EU=p(Fi),My=a(Fi,"LI",{});var UV=r(My);mh=a(UV,"A",{href:!0,rel:!0});var NV=r(mh);jU=n(NV,"Parallelization"),NV.forEach(t),UV.forEach(t),Fi.forEach(t),zU=p(Ht),ko=a(Ht,"DIV",{class:!0});var Bi=r(ko);k(uh.$$.fragment,Bi),CU=p(Bi),Rs=a(Bi,"P",{});var Yf=r(Rs);JU=n(Yf,"The "),$y=a(Yf,"CODE",{});var WV=r($y);IU=n(WV,"FlaxBertPreTrainedModel"),WV.forEach(t),UU=n(Yf," forward method, overrides the "),Fy=a(Yf,"CODE",{});var PV=r(Fy);NU=n(PV,"__call__"),PV.forEach(t),WU=n(Yf," special method."),Yf.forEach(t),PU=p(Bi),k(Ar.$$.fragment,Bi),qU=p(Bi),k(Zr.$$.fragment,Bi),Bi.forEach(t),Ht.forEach(t),Q1=p(i),Vs=a(i,"H2",{class:!0});var oM=r(Vs);Rr=a(oM,"A",{id:!0,class:!0,href:!0});var qV=r(Rr);By=a(qV,"SPAN",{});var AV=r(By);k(fh.$$.fragment,AV),AV.forEach(t),qV.forEach(t),AU=p(oM),xy=a(oM,"SPAN",{});var ZV=r(xy);ZU=n(ZV,"FlaxBertForMaskedLM"),ZV.forEach(t),oM.forEach(t),H1=p(i),lt=a(i,"DIV",{class:!0});var Yt=r(lt);k(gh.$$.fragment,Yt),RU=p(Yt),_h=a(Yt,"P",{});var nM=r(_h);VU=n(nM,"Bert Model with a "),Ey=a(nM,"CODE",{});var RV=r(Ey);GU=n(RV,"language modeling"),RV.forEach(t),SU=n(nM," head on top."),nM.forEach(t),XU=p(Yt),bh=a(Yt,"P",{});var sM=r(bh);LU=n(sM,"This model inherits from "),pf=a(sM,"A",{href:!0});var VV=r(pf);OU=n(VV,"FlaxPreTrainedModel"),VV.forEach(t),DU=n(sM,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),sM.forEach(t),QU=p(Yt),yh=a(Yt,"P",{});var aM=r(yh);HU=n(aM,"This model is also a Flax Linen "),vh=a(aM,"A",{href:!0,rel:!0});var GV=r(vh);YU=n(GV,"flax.linen.Module"),GV.forEach(t),KU=n(aM,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),aM.forEach(t),eN=p(Yt),jy=a(Yt,"P",{});var SV=r(jy);tN=n(SV,"Finally, this model supports inherent JAX features such as:"),SV.forEach(t),oN=p(Yt),Vo=a(Yt,"UL",{});var xi=r(Vo);zy=a(xi,"LI",{});var XV=r(zy);Th=a(XV,"A",{href:!0,rel:!0});var LV=r(Th);nN=n(LV,"Just-In-Time (JIT) compilation"),LV.forEach(t),XV.forEach(t),sN=p(xi),Cy=a(xi,"LI",{});var OV=r(Cy);kh=a(OV,"A",{href:!0,rel:!0});var DV=r(kh);aN=n(DV,"Automatic Differentiation"),DV.forEach(t),OV.forEach(t),rN=p(xi),Jy=a(xi,"LI",{});var QV=r(Jy);wh=a(QV,"A",{href:!0,rel:!0});var HV=r(wh);iN=n(HV,"Vectorization"),HV.forEach(t),QV.forEach(t),lN=p(xi),Iy=a(xi,"LI",{});var YV=r(Iy);Mh=a(YV,"A",{href:!0,rel:!0});var KV=r(Mh);dN=n(KV,"Parallelization"),KV.forEach(t),YV.forEach(t),xi.forEach(t),cN=p(Yt),wo=a(Yt,"DIV",{class:!0});var Ei=r(wo);k($h.$$.fragment,Ei),pN=p(Ei),Gs=a(Ei,"P",{});var Kf=r(Gs);hN=n(Kf,"The "),Uy=a(Kf,"CODE",{});var eG=r(Uy);mN=n(eG,"FlaxBertPreTrainedModel"),eG.forEach(t),uN=n(Kf," forward method, overrides the "),Ny=a(Kf,"CODE",{});var tG=r(Ny);fN=n(tG,"__call__"),tG.forEach(t),gN=n(Kf," special method."),Kf.forEach(t),_N=p(Ei),k(Vr.$$.fragment,Ei),bN=p(Ei),k(Gr.$$.fragment,Ei),Ei.forEach(t),Yt.forEach(t),Y1=p(i),Ss=a(i,"H2",{class:!0});var rM=r(Ss);Sr=a(rM,"A",{id:!0,class:!0,href:!0});var oG=r(Sr);Wy=a(oG,"SPAN",{});var nG=r(Wy);k(Fh.$$.fragment,nG),nG.forEach(t),oG.forEach(t),yN=p(rM),Py=a(rM,"SPAN",{});var sG=r(Py);vN=n(sG,"FlaxBertForNextSentencePrediction"),sG.forEach(t),rM.forEach(t),K1=p(i),dt=a(i,"DIV",{class:!0});var Kt=r(dt);k(Bh.$$.fragment,Kt),TN=p(Kt),xh=a(Kt,"P",{});var iM=r(xh);kN=n(iM,"Bert Model with a "),qy=a(iM,"CODE",{});var aG=r(qy);wN=n(aG,"next sentence prediction (classification)"),aG.forEach(t),MN=n(iM," head on top."),iM.forEach(t),$N=p(Kt),Eh=a(Kt,"P",{});var lM=r(Eh);FN=n(lM,"This model inherits from "),hf=a(lM,"A",{href:!0});var rG=r(hf);BN=n(rG,"FlaxPreTrainedModel"),rG.forEach(t),xN=n(lM,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),lM.forEach(t),EN=p(Kt),jh=a(Kt,"P",{});var dM=r(jh);jN=n(dM,"This model is also a Flax Linen "),zh=a(dM,"A",{href:!0,rel:!0});var iG=r(zh);zN=n(iG,"flax.linen.Module"),iG.forEach(t),CN=n(dM,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),dM.forEach(t),JN=p(Kt),Ay=a(Kt,"P",{});var lG=r(Ay);IN=n(lG,"Finally, this model supports inherent JAX features such as:"),lG.forEach(t),UN=p(Kt),Go=a(Kt,"UL",{});var ji=r(Go);Zy=a(ji,"LI",{});var dG=r(Zy);Ch=a(dG,"A",{href:!0,rel:!0});var cG=r(Ch);NN=n(cG,"Just-In-Time (JIT) compilation"),cG.forEach(t),dG.forEach(t),WN=p(ji),Ry=a(ji,"LI",{});var pG=r(Ry);Jh=a(pG,"A",{href:!0,rel:!0});var hG=r(Jh);PN=n(hG,"Automatic Differentiation"),hG.forEach(t),pG.forEach(t),qN=p(ji),Vy=a(ji,"LI",{});var mG=r(Vy);Ih=a(mG,"A",{href:!0,rel:!0});var uG=r(Ih);AN=n(uG,"Vectorization"),uG.forEach(t),mG.forEach(t),ZN=p(ji),Gy=a(ji,"LI",{});var fG=r(Gy);Uh=a(fG,"A",{href:!0,rel:!0});var gG=r(Uh);RN=n(gG,"Parallelization"),gG.forEach(t),fG.forEach(t),ji.forEach(t),VN=p(Kt),Mo=a(Kt,"DIV",{class:!0});var zi=r(Mo);k(Nh.$$.fragment,zi),GN=p(zi),Xs=a(zi,"P",{});var eg=r(Xs);SN=n(eg,"The "),Sy=a(eg,"CODE",{});var _G=r(Sy);XN=n(_G,"FlaxBertPreTrainedModel"),_G.forEach(t),LN=n(eg," forward method, overrides the "),Xy=a(eg,"CODE",{});var bG=r(Xy);ON=n(bG,"__call__"),bG.forEach(t),DN=n(eg," special method."),eg.forEach(t),QN=p(zi),k(Xr.$$.fragment,zi),HN=p(zi),k(Lr.$$.fragment,zi),zi.forEach(t),Kt.forEach(t),ek=p(i),Ls=a(i,"H2",{class:!0});var cM=r(Ls);Or=a(cM,"A",{id:!0,class:!0,href:!0});var yG=r(Or);Ly=a(yG,"SPAN",{});var vG=r(Ly);k(Wh.$$.fragment,vG),vG.forEach(t),yG.forEach(t),YN=p(cM),Oy=a(cM,"SPAN",{});var TG=r(Oy);KN=n(TG,"FlaxBertForSequenceClassification"),TG.forEach(t),cM.forEach(t),tk=p(i),ct=a(i,"DIV",{class:!0});var eo=r(ct);k(Ph.$$.fragment,eo),e9=p(eo),Dy=a(eo,"P",{});var kG=r(Dy);t9=n(kG,`Bert Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),kG.forEach(t),o9=p(eo),qh=a(eo,"P",{});var pM=r(qh);n9=n(pM,"This model inherits from "),mf=a(pM,"A",{href:!0});var wG=r(mf);s9=n(wG,"FlaxPreTrainedModel"),wG.forEach(t),a9=n(pM,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),pM.forEach(t),r9=p(eo),Ah=a(eo,"P",{});var hM=r(Ah);i9=n(hM,"This model is also a Flax Linen "),Zh=a(hM,"A",{href:!0,rel:!0});var MG=r(Zh);l9=n(MG,"flax.linen.Module"),MG.forEach(t),d9=n(hM,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),hM.forEach(t),c9=p(eo),Qy=a(eo,"P",{});var $G=r(Qy);p9=n($G,"Finally, this model supports inherent JAX features such as:"),$G.forEach(t),h9=p(eo),So=a(eo,"UL",{});var Ci=r(So);Hy=a(Ci,"LI",{});var FG=r(Hy);Rh=a(FG,"A",{href:!0,rel:!0});var BG=r(Rh);m9=n(BG,"Just-In-Time (JIT) compilation"),BG.forEach(t),FG.forEach(t),u9=p(Ci),Yy=a(Ci,"LI",{});var xG=r(Yy);Vh=a(xG,"A",{href:!0,rel:!0});var EG=r(Vh);f9=n(EG,"Automatic Differentiation"),EG.forEach(t),xG.forEach(t),g9=p(Ci),Ky=a(Ci,"LI",{});var jG=r(Ky);Gh=a(jG,"A",{href:!0,rel:!0});var zG=r(Gh);_9=n(zG,"Vectorization"),zG.forEach(t),jG.forEach(t),b9=p(Ci),ev=a(Ci,"LI",{});var CG=r(ev);Sh=a(CG,"A",{href:!0,rel:!0});var JG=r(Sh);y9=n(JG,"Parallelization"),JG.forEach(t),CG.forEach(t),Ci.forEach(t),v9=p(eo),$o=a(eo,"DIV",{class:!0});var Ji=r($o);k(Xh.$$.fragment,Ji),T9=p(Ji),Os=a(Ji,"P",{});var tg=r(Os);k9=n(tg,"The "),tv=a(tg,"CODE",{});var IG=r(tv);w9=n(IG,"FlaxBertPreTrainedModel"),IG.forEach(t),M9=n(tg," forward method, overrides the "),ov=a(tg,"CODE",{});var UG=r(ov);$9=n(UG,"__call__"),UG.forEach(t),F9=n(tg," special method."),tg.forEach(t),B9=p(Ji),k(Dr.$$.fragment,Ji),x9=p(Ji),k(Qr.$$.fragment,Ji),Ji.forEach(t),eo.forEach(t),ok=p(i),Ds=a(i,"H2",{class:!0});var mM=r(Ds);Hr=a(mM,"A",{id:!0,class:!0,href:!0});var NG=r(Hr);nv=a(NG,"SPAN",{});var WG=r(nv);k(Lh.$$.fragment,WG),WG.forEach(t),NG.forEach(t),E9=p(mM),sv=a(mM,"SPAN",{});var PG=r(sv);j9=n(PG,"FlaxBertForMultipleChoice"),PG.forEach(t),mM.forEach(t),nk=p(i),pt=a(i,"DIV",{class:!0});var to=r(pt);k(Oh.$$.fragment,to),z9=p(to),av=a(to,"P",{});var qG=r(av);C9=n(qG,`Bert 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.`),qG.forEach(t),J9=p(to),Dh=a(to,"P",{});var uM=r(Dh);I9=n(uM,"This model inherits from "),uf=a(uM,"A",{href:!0});var AG=r(uf);U9=n(AG,"FlaxPreTrainedModel"),AG.forEach(t),N9=n(uM,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),uM.forEach(t),W9=p(to),Qh=a(to,"P",{});var fM=r(Qh);P9=n(fM,"This model is also a Flax Linen "),Hh=a(fM,"A",{href:!0,rel:!0});var ZG=r(Hh);q9=n(ZG,"flax.linen.Module"),ZG.forEach(t),A9=n(fM,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),fM.forEach(t),Z9=p(to),rv=a(to,"P",{});var RG=r(rv);R9=n(RG,"Finally, this model supports inherent JAX features such as:"),RG.forEach(t),V9=p(to),Xo=a(to,"UL",{});var Ii=r(Xo);iv=a(Ii,"LI",{});var VG=r(iv);Yh=a(VG,"A",{href:!0,rel:!0});var GG=r(Yh);G9=n(GG,"Just-In-Time (JIT) compilation"),GG.forEach(t),VG.forEach(t),S9=p(Ii),lv=a(Ii,"LI",{});var SG=r(lv);Kh=a(SG,"A",{href:!0,rel:!0});var XG=r(Kh);X9=n(XG,"Automatic Differentiation"),XG.forEach(t),SG.forEach(t),L9=p(Ii),dv=a(Ii,"LI",{});var LG=r(dv);em=a(LG,"A",{href:!0,rel:!0});var OG=r(em);O9=n(OG,"Vectorization"),OG.forEach(t),LG.forEach(t),D9=p(Ii),cv=a(Ii,"LI",{});var DG=r(cv);tm=a(DG,"A",{href:!0,rel:!0});var QG=r(tm);Q9=n(QG,"Parallelization"),QG.forEach(t),DG.forEach(t),Ii.forEach(t),H9=p(to),Fo=a(to,"DIV",{class:!0});var Ui=r(Fo);k(om.$$.fragment,Ui),Y9=p(Ui),Qs=a(Ui,"P",{});var og=r(Qs);K9=n(og,"The "),pv=a(og,"CODE",{});var HG=r(pv);eW=n(HG,"FlaxBertPreTrainedModel"),HG.forEach(t),tW=n(og," forward method, overrides the "),hv=a(og,"CODE",{});var YG=r(hv);oW=n(YG,"__call__"),YG.forEach(t),nW=n(og," special method."),og.forEach(t),sW=p(Ui),k(Yr.$$.fragment,Ui),aW=p(Ui),k(Kr.$$.fragment,Ui),Ui.forEach(t),to.forEach(t),sk=p(i),Hs=a(i,"H2",{class:!0});var gM=r(Hs);ei=a(gM,"A",{id:!0,class:!0,href:!0});var KG=r(ei);mv=a(KG,"SPAN",{});var eS=r(mv);k(nm.$$.fragment,eS),eS.forEach(t),KG.forEach(t),rW=p(gM),uv=a(gM,"SPAN",{});var tS=r(uv);iW=n(tS,"FlaxBertForTokenClassification"),tS.forEach(t),gM.forEach(t),ak=p(i),ht=a(i,"DIV",{class:!0});var oo=r(ht);k(sm.$$.fragment,oo),lW=p(oo),fv=a(oo,"P",{});var oS=r(fv);dW=n(oS,`Bert 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.`),oS.forEach(t),cW=p(oo),am=a(oo,"P",{});var _M=r(am);pW=n(_M,"This model inherits from "),ff=a(_M,"A",{href:!0});var nS=r(ff);hW=n(nS,"FlaxPreTrainedModel"),nS.forEach(t),mW=n(_M,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),_M.forEach(t),uW=p(oo),rm=a(oo,"P",{});var bM=r(rm);fW=n(bM,"This model is also a Flax Linen "),im=a(bM,"A",{href:!0,rel:!0});var sS=r(im);gW=n(sS,"flax.linen.Module"),sS.forEach(t),_W=n(bM,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),bM.forEach(t),bW=p(oo),gv=a(oo,"P",{});var aS=r(gv);yW=n(aS,"Finally, this model supports inherent JAX features such as:"),aS.forEach(t),vW=p(oo),Lo=a(oo,"UL",{});var Ni=r(Lo);_v=a(Ni,"LI",{});var rS=r(_v);lm=a(rS,"A",{href:!0,rel:!0});var iS=r(lm);TW=n(iS,"Just-In-Time (JIT) compilation"),iS.forEach(t),rS.forEach(t),kW=p(Ni),bv=a(Ni,"LI",{});var lS=r(bv);dm=a(lS,"A",{href:!0,rel:!0});var dS=r(dm);wW=n(dS,"Automatic Differentiation"),dS.forEach(t),lS.forEach(t),MW=p(Ni),yv=a(Ni,"LI",{});var cS=r(yv);cm=a(cS,"A",{href:!0,rel:!0});var pS=r(cm);$W=n(pS,"Vectorization"),pS.forEach(t),cS.forEach(t),FW=p(Ni),vv=a(Ni,"LI",{});var hS=r(vv);pm=a(hS,"A",{href:!0,rel:!0});var mS=r(pm);BW=n(mS,"Parallelization"),mS.forEach(t),hS.forEach(t),Ni.forEach(t),xW=p(oo),Bo=a(oo,"DIV",{class:!0});var Wi=r(Bo);k(hm.$$.fragment,Wi),EW=p(Wi),Ys=a(Wi,"P",{});var ng=r(Ys);jW=n(ng,"The "),Tv=a(ng,"CODE",{});var uS=r(Tv);zW=n(uS,"FlaxBertPreTrainedModel"),uS.forEach(t),CW=n(ng," forward method, overrides the "),kv=a(ng,"CODE",{});var fS=r(kv);JW=n(fS,"__call__"),fS.forEach(t),IW=n(ng," special method."),ng.forEach(t),UW=p(Wi),k(ti.$$.fragment,Wi),NW=p(Wi),k(oi.$$.fragment,Wi),Wi.forEach(t),oo.forEach(t),rk=p(i),Ks=a(i,"H2",{class:!0});var yM=r(Ks);ni=a(yM,"A",{id:!0,class:!0,href:!0});var gS=r(ni);wv=a(gS,"SPAN",{});var _S=r(wv);k(mm.$$.fragment,_S),_S.forEach(t),gS.forEach(t),WW=p(yM),Mv=a(yM,"SPAN",{});var bS=r(Mv);PW=n(bS,"FlaxBertForQuestionAnswering"),bS.forEach(t),yM.forEach(t),ik=p(i),mt=a(i,"DIV",{class:!0});var no=r(mt);k(um.$$.fragment,no),qW=p(no),ea=a(no,"P",{});var sg=r(ea);AW=n(sg,`Bert 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 `),$v=a(sg,"CODE",{});var yS=r($v);ZW=n(yS,"span start logits"),yS.forEach(t),RW=n(sg," and "),Fv=a(sg,"CODE",{});var vS=r(Fv);VW=n(vS,"span end logits"),vS.forEach(t),GW=n(sg,")."),sg.forEach(t),SW=p(no),fm=a(no,"P",{});var vM=r(fm);XW=n(vM,"This model inherits from "),gf=a(vM,"A",{href:!0});var TS=r(gf);LW=n(TS,"FlaxPreTrainedModel"),TS.forEach(t),OW=n(vM,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),vM.forEach(t),DW=p(no),gm=a(no,"P",{});var TM=r(gm);QW=n(TM,"This model is also a Flax Linen "),_m=a(TM,"A",{href:!0,rel:!0});var kS=r(_m);HW=n(kS,"flax.linen.Module"),kS.forEach(t),YW=n(TM,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),TM.forEach(t),KW=p(no),Bv=a(no,"P",{});var wS=r(Bv);eP=n(wS,"Finally, this model supports inherent JAX features such as:"),wS.forEach(t),tP=p(no),Oo=a(no,"UL",{});var Pi=r(Oo);xv=a(Pi,"LI",{});var MS=r(xv);bm=a(MS,"A",{href:!0,rel:!0});var $S=r(bm);oP=n($S,"Just-In-Time (JIT) compilation"),$S.forEach(t),MS.forEach(t),nP=p(Pi),Ev=a(Pi,"LI",{});var FS=r(Ev);ym=a(FS,"A",{href:!0,rel:!0});var BS=r(ym);sP=n(BS,"Automatic Differentiation"),BS.forEach(t),FS.forEach(t),aP=p(Pi),jv=a(Pi,"LI",{});var xS=r(jv);vm=a(xS,"A",{href:!0,rel:!0});var ES=r(vm);rP=n(ES,"Vectorization"),ES.forEach(t),xS.forEach(t),iP=p(Pi),zv=a(Pi,"LI",{});var jS=r(zv);Tm=a(jS,"A",{href:!0,rel:!0});var zS=r(Tm);lP=n(zS,"Parallelization"),zS.forEach(t),jS.forEach(t),Pi.forEach(t),dP=p(no),xo=a(no,"DIV",{class:!0});var qi=r(xo);k(km.$$.fragment,qi),cP=p(qi),ta=a(qi,"P",{});var ag=r(ta);pP=n(ag,"The "),Cv=a(ag,"CODE",{});var CS=r(Cv);hP=n(CS,"FlaxBertPreTrainedModel"),CS.forEach(t),mP=n(ag," forward method, overrides the "),Jv=a(ag,"CODE",{});var JS=r(Jv);uP=n(JS,"__call__"),JS.forEach(t),fP=n(ag," special method."),ag.forEach(t),gP=p(qi),k(si.$$.fragment,qi),_P=p(qi),k(ai.$$.fragment,qi),qi.forEach(t),no.forEach(t),this.h()},h(){h(d,"name","hf:doc:metadata"),h(d,"content",JSON.stringify(s8)),h(f,"id","bert"),h(f,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(f,"href","#bert"),h(u,"class","relative group"),h(ee,"alt","Models"),IS(ee.src,x="https://img.shields.io/badge/All_model_pages-bert-blueviolet")||h(ee,"src",x),h(he,"href","https://huggingface.co/models?filter=bert"),h(me,"alt","Spaces"),IS(me.src,qe="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||h(me,"src",qe),h(V,"href","https://huggingface.co/spaces/docs-demos/bert-base-uncased"),h(Z,"class","flex flex-wrap space-x-1"),h(le,"id","overview"),h(le,"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(le,"href","#overview"),h(ie,"class","relative group"),h(ce,"href","https://arxiv.org/abs/1810.04805"),h(ce,"rel","nofollow"),h(Re,"href","https://huggingface.co/thomwolf"),h(Re,"rel","nofollow"),h(K,"href","https://github.com/google-research/bert"),h(K,"rel","nofollow"),h(aa,"id","resources"),h(aa,"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(aa,"href","#resources"),h(Nn,"class","relative group"),h(Vi,"href","https://www.philschmid.de/bert-text-classification-in-a-different-language"),h(Vi,"rel","nofollow"),h(Si,"href","https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/BERT/Fine_tuning_BERT_(and_friends)_for_multi_label_text_classification.ipynb"),h(Si,"rel","nofollow"),h(Li,"href","https://colab.research.google.com/github/abhimishra91/transformers-tutorials/blob/master/transformers_multi_label_classification.ipynb"),h(Li,"rel","nofollow"),h(Di,"href","https://colab.research.google.com/github/patrickvonplaten/notebooks/blob/master/BERT2BERT_for_CNN_Dailymail.ipynb"),h(Di,"rel","nofollow"),h(Vm,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertForSequenceClassification"),h(Qi,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/text-classification"),h(Qi,"rel","nofollow"),h(Hi,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification.ipynb"),h(Hi,"rel","nofollow"),h(Gm,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.TFBertForSequenceClassification"),h(Yi,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/text-classification"),h(Yi,"rel","nofollow"),h(Ki,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification-tf.ipynb"),h(Ki,"rel","nofollow"),h(Sm,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.FlaxBertForSequenceClassification"),h(el,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/text-classification"),h(el,"rel","nofollow"),h(tl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification_flax.ipynb"),h(tl,"rel","nofollow"),h(Xm,"href","../tasks/sequence_classification"),h(sl,"href","https://www.philschmid.de/huggingface-transformers-keras-tf"),h(sl,"rel","nofollow"),h(al,"href","https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/Custom_Named_Entity_Recognition_with_BERT_only_first_wordpiece.ipynb"),h(al,"rel","nofollow"),h(rl,"href","https://github.com/NielsRogge/Transformers-Tutorials/blob/master/BERT/Custom_Named_Entity_Recognition_with_BERT.ipynb"),h(rl,"rel","nofollow"),h(Lm,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertForTokenClassification"),h(il,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/token-classification"),h(il,"rel","nofollow"),h(ll,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/token_classification.ipynb"),h(ll,"rel","nofollow"),h(Om,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.TFBertForTokenClassification"),h(dl,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/token-classification"),h(dl,"rel","nofollow"),h(cl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/token_classification-tf.ipynb"),h(cl,"rel","nofollow"),h(Dm,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.FlaxBertForTokenClassification"),h(pl,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/token-classification"),h(pl,"rel","nofollow"),h(hl,"href","https://huggingface.co/course/chapter7/2?fw=pt"),h(hl,"rel","nofollow"),h(Hm,"href","../tasks/token_classification"),h(Ym,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertForMaskedLM"),h(ul,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/language-modeling#robertabertdistilbert-and-masked-language-modeling"),h(ul,"rel","nofollow"),h(fl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling.ipynb"),h(fl,"rel","nofollow"),h(Km,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.TFBertForMaskedLM"),h(gl,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/language-modeling#run_mlmpy"),h(gl,"rel","nofollow"),h(_l,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling-tf.ipynb"),h(_l,"rel","nofollow"),h(eu,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.FlaxBertForMaskedLM"),h(bl,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/language-modeling#masked-language-modeling"),h(bl,"rel","nofollow"),h(yl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/masked_language_modeling_flax.ipynb"),h(yl,"rel","nofollow"),h(vl,"href","https://huggingface.co/course/chapter7/3?fw=pt"),h(vl,"rel","nofollow"),h(ou,"href","../tasks/masked_language_modeling"),h(nu,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertForQuestionAnswering"),h(kl,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/question-answering"),h(kl,"rel","nofollow"),h(wl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/question_answering.ipynb"),h(wl,"rel","nofollow"),h(su,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.TFBertForQuestionAnswering"),h(Ml,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/question-answering"),h(Ml,"rel","nofollow"),h($l,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/question_answering-tf.ipynb"),h($l,"rel","nofollow"),h(au,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.FlaxBertForQuestionAnswering"),h(Fl,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/question-answering"),h(Fl,"rel","nofollow"),h(Bl,"href","https://huggingface.co/course/chapter7/7?fw=pt"),h(Bl,"rel","nofollow"),h(iu,"href","../tasks/question_answering"),h(du,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertForMultipleChoice"),h(xl,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/multiple-choice"),h(xl,"rel","nofollow"),h(El,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/multiple_choice.ipynb"),h(El,"rel","nofollow"),h(cu,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.TFBertForMultipleChoice"),h(jl,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/multiple-choice"),h(jl,"rel","nofollow"),h(zl,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/multiple_choice-tf.ipynb"),h(zl,"rel","nofollow"),h(pu,"href","../tasks/multiple_choice"),h(Il,"href","https://huggingface.co/blog/bert-inferentia-sagemaker"),h(Il,"rel","nofollow"),h(Nl,"href","https://www.philschmid.de/bert-deepspeed-inference"),h(Nl,"rel","nofollow"),h(ql,"href","https://www.philschmid.de/pre-training-bert-habana"),h(ql,"rel","nofollow"),h(Rl,"href","https://www.philschmid.de/convert-transformers-to-onnx"),h(Rl,"rel","nofollow"),h(Gl,"href","https://www.philschmid.de/getting-started-habana-gaudi#conclusion"),h(Gl,"rel","nofollow"),h(Xl,"href","https://www.philschmid.de/terraform-huggingface-amazon-sagemaker-advanced"),h(Xl,"rel","nofollow"),h(Ol,"href","https://www.philschmid.de/serverless-bert-with-huggingface-aws-lambda-docker"),h(Ol,"rel","nofollow"),h(Ql,"href","https://www.philschmid.de/huggingface-amazon-sagemaker-training-compiler"),h(Ql,"rel","nofollow"),h(Yl,"href","https://www.philschmid.de/knowledge-distillation-bert-transformers"),h(Yl,"rel","nofollow"),h(da,"id","transformers.BertConfig"),h(da,"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(da,"href","#transformers.BertConfig"),h(Pn,"class","relative group"),h(mu,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertModel"),h(uu,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.TFBertModel"),h(td,"href","https://huggingface.co/bert-base-uncased"),h(td,"rel","nofollow"),h(fu,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),h(gu,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),h(so,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(pa,"id","transformers.BertTokenizer"),h(pa,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(pa,"href","#transformers.BertTokenizer"),h(An,"class","relative group"),h(_u,"href","/docs/transformers/v4.31.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),h(cn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ha,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ao,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(vu,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ua,"id","transformers.BertTokenizerFast"),h(ua,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ua,"href","#transformers.BertTokenizerFast"),h(Rn,"class","relative group"),h(Tu,"href","/docs/transformers/v4.31.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),h(pn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ro,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ga,"id","transformers.TFBertTokenizer"),h(ga,"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(ga,"href","#transformers.TFBertTokenizer"),h(Gn,"class","relative group"),h(hn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(mn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ya,"id","transformers.models.bert.modeling_bert.BertForPreTrainingOutput"),h(ya,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ya,"href","#transformers.models.bert.modeling_bert.BertForPreTrainingOutput"),h(Ln,"class","relative group"),h(Mu,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertForPreTraining"),h(On,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h($u,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.TFBertForPreTraining"),h(Dn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Fu,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertForPreTraining"),h(va,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(qo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ta,"id","transformers.BertModel"),h(Ta,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Ta,"href","#transformers.BertModel"),h(Qn,"class","relative group"),h(Bu,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),h(Nd,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Nd,"rel","nofollow"),h(Pd,"href","https://arxiv.org/abs/1706.03762"),h(Pd,"rel","nofollow"),h(xu,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertModel"),h(io,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ma,"id","transformers.BertForPreTraining"),h(Ma,"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(Ma,"href","#transformers.BertForPreTraining"),h(Yn,"class","relative group"),h(Eu,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),h(Gd,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Gd,"rel","nofollow"),h(ju,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertForPreTraining"),h(lo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ba,"id","transformers.BertLMHeadModel"),h(Ba,"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(Ba,"href","#transformers.BertLMHeadModel"),h(ts,"class","relative group"),h(zu,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),h(Hd,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Hd,"rel","nofollow"),h(Cu,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertLMHeadModel"),h(co,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ja,"id","transformers.BertForMaskedLM"),h(ja,"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(ja,"href","#transformers.BertForMaskedLM"),h(ns,"class","relative group"),h(Ju,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),h(sc,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(sc,"rel","nofollow"),h(Iu,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertForMaskedLM"),h(po,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ja,"id","transformers.BertForNextSentencePrediction"),h(Ja,"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(Ja,"href","#transformers.BertForNextSentencePrediction"),h(as,"class","relative group"),h(Uu,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),h(pc,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(pc,"rel","nofollow"),h(Nu,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertForNextSentencePrediction"),h(ho,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Na,"id","transformers.BertForSequenceClassification"),h(Na,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Na,"href","#transformers.BertForSequenceClassification"),h(is,"class","relative group"),h(Wu,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),h(_c,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(_c,"rel","nofollow"),h(Pu,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertForSequenceClassification"),h(At,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Aa,"id","transformers.BertForMultipleChoice"),h(Aa,"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(Aa,"href","#transformers.BertForMultipleChoice"),h(ds,"class","relative group"),h(qu,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),h(wc,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(wc,"rel","nofollow"),h(Au,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertForMultipleChoice"),h(mo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Va,"id","transformers.BertForTokenClassification"),h(Va,"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(Va,"href","#transformers.BertForTokenClassification"),h(ps,"class","relative group"),h(Zu,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),h(Ec,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Ec,"rel","nofollow"),h(Ru,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertForTokenClassification"),h(uo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Xa,"id","transformers.BertForQuestionAnswering"),h(Xa,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Xa,"href","#transformers.BertForQuestionAnswering"),h(ms,"class","relative group"),h(Vu,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),h(Uc,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Uc,"rel","nofollow"),h(Gu,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertForQuestionAnswering"),h(fo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Wt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Da,"id","transformers.TFBertModel"),h(Da,"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(Da,"href","#transformers.TFBertModel"),h(gs,"class","relative group"),h(Su,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.TFPreTrainedModel"),h(Zc,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(Zc,"rel","nofollow"),h(Xu,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.TFBertModel"),h(go,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ka,"id","transformers.TFBertForPreTraining"),h(Ka,"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(Ka,"href","#transformers.TFBertForPreTraining"),h(bs,"class","relative group"),h(Lu,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.TFPreTrainedModel"),h(Lc,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(Lc,"rel","nofollow"),h(Ou,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.TFBertForPreTraining"),h(_o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(nr,"id","transformers.TFBertLMHeadModel"),h(nr,"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(nr,"href","#transformers.TFBertLMHeadModel"),h(Ts,"class","relative group"),h(Zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ks,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ar,"id","transformers.TFBertForMaskedLM"),h(ar,"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(ar,"href","#transformers.TFBertForMaskedLM"),h(ws,"class","relative group"),h(Du,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.TFPreTrainedModel"),h(rp,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(rp,"rel","nofollow"),h(Qu,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.TFBertForMaskedLM"),h(Rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(cr,"id","transformers.TFBertForNextSentencePrediction"),h(cr,"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(cr,"href","#transformers.TFBertForNextSentencePrediction"),h($s,"class","relative group"),h(Hu,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.TFPreTrainedModel"),h(mp,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(mp,"rel","nofollow"),h(Yu,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.TFBertForNextSentencePrediction"),h(bo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(vt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ur,"id","transformers.TFBertForSequenceClassification"),h(ur,"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(ur,"href","#transformers.TFBertForSequenceClassification"),h(Bs,"class","relative group"),h(Ku,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.TFPreTrainedModel"),h(yp,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(yp,"rel","nofollow"),h(ef,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.TFBertForSequenceClassification"),h(Vt,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(yr,"id","transformers.TFBertForMultipleChoice"),h(yr,"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(yr,"href","#transformers.TFBertForMultipleChoice"),h(Es,"class","relative group"),h(tf,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.TFPreTrainedModel"),h($p,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h($p,"rel","nofollow"),h(of,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.TFBertForMultipleChoice"),h(yo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(wr,"id","transformers.TFBertForTokenClassification"),h(wr,"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(wr,"href","#transformers.TFBertForTokenClassification"),h(zs,"class","relative group"),h(nf,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.TFPreTrainedModel"),h(zp,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(zp,"rel","nofollow"),h(sf,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.TFBertForTokenClassification"),h(Gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(wt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(xr,"id","transformers.TFBertForQuestionAnswering"),h(xr,"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(xr,"href","#transformers.TFBertForQuestionAnswering"),h(Js,"class","relative group"),h(af,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.TFPreTrainedModel"),h(Wp,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(Wp,"rel","nofollow"),h(rf,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.TFBertForQuestionAnswering"),h(St,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Jr,"id","transformers.FlaxBertModel"),h(Jr,"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(Jr,"href","#transformers.FlaxBertModel"),h(Ns,"class","relative group"),h(lf,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(Vp,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(Vp,"rel","nofollow"),h(Gp,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(Gp,"rel","nofollow"),h(Sp,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(Sp,"rel","nofollow"),h(Xp,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(Xp,"rel","nofollow"),h(Lp,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(Lp,"rel","nofollow"),h(vo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Nr,"id","transformers.FlaxBertForPreTraining"),h(Nr,"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(Nr,"href","#transformers.FlaxBertForPreTraining"),h(Ps,"class","relative group"),h(df,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(Kp,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(Kp,"rel","nofollow"),h(eh,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(eh,"rel","nofollow"),h(th,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(th,"rel","nofollow"),h(oh,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(oh,"rel","nofollow"),h(nh,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(nh,"rel","nofollow"),h(To,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(qr,"id","transformers.FlaxBertForCausalLM"),h(qr,"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(qr,"href","#transformers.FlaxBertForCausalLM"),h(Zs,"class","relative group"),h(cf,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(dh,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(dh,"rel","nofollow"),h(ch,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(ch,"rel","nofollow"),h(ph,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(ph,"rel","nofollow"),h(hh,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(hh,"rel","nofollow"),h(mh,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(mh,"rel","nofollow"),h(ko,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Rr,"id","transformers.FlaxBertForMaskedLM"),h(Rr,"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(Rr,"href","#transformers.FlaxBertForMaskedLM"),h(Vs,"class","relative group"),h(pf,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(vh,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(vh,"rel","nofollow"),h(Th,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(Th,"rel","nofollow"),h(kh,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(kh,"rel","nofollow"),h(wh,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(wh,"rel","nofollow"),h(Mh,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(Mh,"rel","nofollow"),h(wo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Sr,"id","transformers.FlaxBertForNextSentencePrediction"),h(Sr,"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(Sr,"href","#transformers.FlaxBertForNextSentencePrediction"),h(Ss,"class","relative group"),h(hf,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(zh,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(zh,"rel","nofollow"),h(Ch,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(Ch,"rel","nofollow"),h(Jh,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(Jh,"rel","nofollow"),h(Ih,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(Ih,"rel","nofollow"),h(Uh,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(Uh,"rel","nofollow"),h(Mo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Or,"id","transformers.FlaxBertForSequenceClassification"),h(Or,"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(Or,"href","#transformers.FlaxBertForSequenceClassification"),h(Ls,"class","relative group"),h(mf,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(Zh,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(Zh,"rel","nofollow"),h(Rh,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(Rh,"rel","nofollow"),h(Vh,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(Vh,"rel","nofollow"),h(Gh,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(Gh,"rel","nofollow"),h(Sh,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(Sh,"rel","nofollow"),h($o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Hr,"id","transformers.FlaxBertForMultipleChoice"),h(Hr,"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(Hr,"href","#transformers.FlaxBertForMultipleChoice"),h(Ds,"class","relative group"),h(uf,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(Hh,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(Hh,"rel","nofollow"),h(Yh,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(Yh,"rel","nofollow"),h(Kh,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(Kh,"rel","nofollow"),h(em,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(em,"rel","nofollow"),h(tm,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(tm,"rel","nofollow"),h(Fo,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ei,"id","transformers.FlaxBertForTokenClassification"),h(ei,"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(ei,"href","#transformers.FlaxBertForTokenClassification"),h(Hs,"class","relative group"),h(ff,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(im,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(im,"rel","nofollow"),h(lm,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(lm,"rel","nofollow"),h(dm,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(dm,"rel","nofollow"),h(cm,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(cm,"rel","nofollow"),h(pm,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(pm,"rel","nofollow"),h(Bo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ni,"id","transformers.FlaxBertForQuestionAnswering"),h(ni,"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(ni,"href","#transformers.FlaxBertForQuestionAnswering"),h(Ks,"class","relative group"),h(gf,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),h(_m,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),h(_m,"rel","nofollow"),h(bm,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),h(bm,"rel","nofollow"),h(ym,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),h(ym,"rel","nofollow"),h(vm,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),h(vm,"rel","nofollow"),h(Tm,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),h(Tm,"rel","nofollow"),h(xo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(i,_){e(document.head,d),g(i,y,_),g(i,u,_),e(u,f),e(f,b),w(l,b,null),e(u,m),e(u,E),e(E,Ee),g(i,we,_),g(i,Z,_),e(Z,he),e(he,ee),e(Z,je),e(Z,V),e(V,me),g(i,O,_),g(i,ie,_),e(ie,le),e(le,G),w(de,G,null),e(ie,ze),e(ie,S),e(S,Ce),g(i,Me,_),g(i,R,_),e(R,Je),e(R,ce),e(ce,ae),e(R,C),g(i,U,_),g(i,ue,_),e(ue,D),g(i,$e,_),g(i,fe,_),e(fe,X),e(X,Ie),g(i,Fe,_),g(i,J,_),e(J,_e),e(_e,Q),g(i,Be,_),g(i,ge,_),e(ge,H),g(i,xe,_),g(i,se,_),e(se,P),e(P,be),e(be,Y),e(se,Ue),e(se,te),e(te,I),e(I,Ne),e(se,W),e(se,pe),e(pe,ye),e(ye,v),e(pe,j),e(pe,Ze),e(Ze,oe),e(oe,Se),e(Ze,Xe),e(Ze,z),e(z,Le),e(Ze,Oe),e(Ze,Ve),e(Ve,De),e(se,Qe),e(se,q),e(q,L),e(L,He),g(i,Ge,_),g(i,A,_),e(A,Ye),e(A,Re),e(Re,We),e(A,Ke),e(A,K),e(K,et),e(A,wM),g(i,CT,_),g(i,Nn,_),e(Nn,aa),e(aa,rg),w(Ai,rg,null),e(Nn,MM),e(Nn,ig),e(ig,$M),g(i,JT,_),g(i,Rm,_),e(Rm,FM),g(i,IT,_),w(Zi,i,_),g(i,UT,_),g(i,tt,_),e(tt,Ri),e(Ri,BM),e(Ri,Vi),e(Vi,xM),e(Ri,EM),e(tt,jM),e(tt,Gi),e(Gi,zM),e(Gi,Si),e(Si,CM),e(Gi,JM),e(tt,IM),e(tt,Xi),e(Xi,UM),e(Xi,Li),e(Li,NM),e(Xi,WM),e(tt,PM),e(tt,Oi),e(Oi,qM),e(Oi,Di),e(Di,AM),e(Oi,ZM),e(tt,RM),e(tt,Qo),e(Qo,Vm),e(Vm,VM),e(Qo,GM),e(Qo,Qi),e(Qi,SM),e(Qo,XM),e(Qo,Hi),e(Hi,LM),e(Qo,OM),e(tt,DM),e(tt,Ho),e(Ho,Gm),e(Gm,QM),e(Ho,HM),e(Ho,Yi),e(Yi,YM),e(Ho,KM),e(Ho,Ki),e(Ki,e0),e(Ho,t0),e(tt,o0),e(tt,Yo),e(Yo,Sm),e(Sm,n0),e(Yo,s0),e(Yo,el),e(el,a0),e(Yo,r0),e(Yo,tl),e(tl,i0),e(Yo,l0),e(tt,d0),e(tt,lg),e(lg,Xm),e(Xm,c0),g(i,NT,_),w(ol,i,_),g(i,WT,_),g(i,ft,_),e(ft,nl),e(nl,p0),e(nl,sl),e(sl,h0),e(nl,m0),e(ft,u0),e(ft,Wn),e(Wn,f0),e(Wn,al),e(al,g0),e(Wn,_0),e(Wn,rl),e(rl,b0),e(Wn,y0),e(ft,v0),e(ft,Ko),e(Ko,Lm),e(Lm,T0),e(Ko,k0),e(Ko,il),e(il,w0),e(Ko,M0),e(Ko,ll),e(ll,$0),e(Ko,F0),e(ft,B0),e(ft,en),e(en,Om),e(Om,x0),e(en,E0),e(en,dl),e(dl,j0),e(en,z0),e(en,cl),e(cl,C0),e(en,J0),e(ft,I0),e(ft,ra),e(ra,Dm),e(Dm,U0),e(ra,N0),e(ra,pl),e(pl,W0),e(ra,P0),e(ft,q0),e(ft,Qm),e(Qm,hl),e(hl,A0),e(Qm,Z0),e(ft,R0),e(ft,dg),e(dg,Hm),e(Hm,V0),g(i,PT,_),w(ml,i,_),g(i,qT,_),g(i,Pt,_),e(Pt,tn),e(tn,Ym),e(Ym,G0),e(tn,S0),e(tn,ul),e(ul,X0),e(tn,L0),e(tn,fl),e(fl,O0),e(tn,D0),e(Pt,Q0),e(Pt,on),e(on,Km),e(Km,H0),e(on,Y0),e(on,gl),e(gl,K0),e(on,e2),e(on,_l),e(_l,t2),e(on,o2),e(Pt,n2),e(Pt,nn),e(nn,eu),e(eu,s2),e(nn,a2),e(nn,bl),e(bl,r2),e(nn,i2),e(nn,yl),e(yl,l2),e(nn,d2),e(Pt,c2),e(Pt,tu),e(tu,vl),e(vl,p2),e(tu,h2),e(Pt,m2),e(Pt,cg),e(cg,ou),e(ou,u2),g(i,AT,_),w(Tl,i,_),g(i,ZT,_),g(i,qt,_),e(qt,sn),e(sn,nu),e(nu,f2),e(sn,g2),e(sn,kl),e(kl,_2),e(sn,b2),e(sn,wl),e(wl,y2),e(sn,v2),e(qt,T2),e(qt,an),e(an,su),e(su,k2),e(an,w2),e(an,Ml),e(Ml,M2),e(an,$2),e(an,$l),e($l,F2),e(an,B2),e(qt,x2),e(qt,ia),e(ia,au),e(au,E2),e(ia,j2),e(ia,Fl),e(Fl,z2),e(ia,C2),e(qt,J2),e(qt,ru),e(ru,Bl),e(Bl,I2),e(ru,U2),e(qt,N2),e(qt,pg),e(pg,iu),e(iu,W2),g(i,RT,_),g(i,lu,_),e(lu,hg),e(hg,P2),g(i,VT,_),g(i,rn,_),e(rn,ln),e(ln,du),e(du,q2),e(ln,A2),e(ln,xl),e(xl,Z2),e(ln,R2),e(ln,El),e(El,V2),e(ln,G2),e(rn,S2),e(rn,dn),e(dn,cu),e(cu,X2),e(dn,L2),e(dn,jl),e(jl,O2),e(dn,D2),e(dn,zl),e(zl,Q2),e(dn,H2),e(rn,Y2),e(rn,mg),e(mg,pu),e(pu,K2),g(i,GT,_),g(i,Cl,_),e(Cl,e$),e(Cl,ug),e(ug,t$),g(i,ST,_),g(i,la,_),e(la,Jl),e(Jl,o$),e(Jl,Il),e(Il,n$),e(Jl,s$),e(la,a$),e(la,Ul),e(Ul,r$),e(Ul,Nl),e(Nl,i$),e(Ul,l$),g(i,XT,_),g(i,Wl,_),e(Wl,d$),e(Wl,fg),e(fg,c$),g(i,LT,_),g(i,hu,_),e(hu,Pl),e(Pl,p$),e(Pl,ql),e(ql,h$),e(Pl,m$),g(i,OT,_),g(i,Al,_),e(Al,u$),e(Al,gg),e(gg,f$),g(i,DT,_),g(i,Ft,_),e(Ft,Zl),e(Zl,g$),e(Zl,Rl),e(Rl,_$),e(Zl,b$),e(Ft,y$),e(Ft,Vl),e(Vl,v$),e(Vl,Gl),e(Gl,T$),e(Vl,k$),e(Ft,w$),e(Ft,Sl),e(Sl,M$),e(Sl,Xl),e(Xl,$$),e(Sl,F$),e(Ft,B$),e(Ft,Ll),e(Ll,x$),e(Ll,Ol),e(Ol,E$),e(Ll,j$),e(Ft,z$),e(Ft,Dl),e(Dl,C$),e(Dl,Ql),e(Ql,J$),e(Dl,I$),e(Ft,U$),e(Ft,Hl),e(Hl,N$),e(Hl,Yl),e(Yl,W$),e(Hl,P$),g(i,QT,_),g(i,Pn,_),e(Pn,da),e(da,_g),w(Kl,_g,null),e(Pn,q$),e(Pn,bg),e(bg,A$),g(i,HT,_),g(i,so,_),w(ed,so,null),e(so,Z$),e(so,Po),e(Po,R$),e(Po,mu),e(mu,V$),e(Po,G$),e(Po,uu),e(uu,S$),e(Po,X$),e(Po,td),e(td,L$),e(Po,O$),e(so,D$),e(so,qn),e(qn,Q$),e(qn,fu),e(fu,H$),e(qn,Y$),e(qn,gu),e(gu,K$),e(qn,eF),e(so,tF),w(ca,so,null),g(i,YT,_),g(i,An,_),e(An,pa),e(pa,yg),w(od,yg,null),e(An,oF),e(An,vg),e(vg,nF),g(i,KT,_),g(i,ot,_),w(nd,ot,null),e(ot,sF),e(ot,Tg),e(Tg,aF),e(ot,rF),e(ot,sd),e(sd,iF),e(sd,_u),e(_u,lF),e(sd,dF),e(ot,cF),e(ot,cn),w(ad,cn,null),e(cn,pF),e(cn,kg),e(kg,hF),e(cn,mF),e(cn,rd),e(rd,bu),e(bu,uF),e(bu,wg),e(wg,fF),e(rd,gF),e(rd,yu),e(yu,_F),e(yu,Mg),e(Mg,bF),e(ot,yF),e(ot,ha),w(id,ha,null),e(ha,vF),e(ha,ld),e(ld,TF),e(ld,$g),e($g,kF),e(ld,wF),e(ot,MF),e(ot,ao),w(dd,ao,null),e(ao,$F),e(ao,Fg),e(Fg,FF),e(ao,BF),w(ma,ao,null),e(ao,xF),e(ao,Zn),e(Zn,EF),e(Zn,Bg),e(Bg,jF),e(Zn,zF),e(Zn,xg),e(xg,CF),e(Zn,JF),e(ot,IF),e(ot,vu),w(cd,vu,null),g(i,e1,_),g(i,Rn,_),e(Rn,ua),e(ua,Eg),w(pd,Eg,null),e(Rn,UF),e(Rn,jg),e(jg,NF),g(i,t1,_),g(i,xt,_),w(hd,xt,null),e(xt,WF),e(xt,md),e(md,PF),e(md,zg),e(zg,qF),e(md,AF),e(xt,ZF),e(xt,ud),e(ud,RF),e(ud,Tu),e(Tu,VF),e(ud,GF),e(xt,SF),e(xt,pn),w(fd,pn,null),e(pn,XF),e(pn,Cg),e(Cg,LF),e(pn,OF),e(pn,gd),e(gd,ku),e(ku,DF),e(ku,Jg),e(Jg,QF),e(gd,HF),e(gd,wu),e(wu,YF),e(wu,Ig),e(Ig,KF),e(xt,eB),e(xt,ro),w(_d,ro,null),e(ro,tB),e(ro,Ug),e(Ug,oB),e(ro,nB),w(fa,ro,null),e(ro,sB),e(ro,Vn),e(Vn,aB),e(Vn,Ng),e(Ng,rB),e(Vn,iB),e(Vn,Wg),e(Wg,lB),e(Vn,dB),g(i,o1,_),g(i,Gn,_),e(Gn,ga),e(ga,Pg),w(bd,Pg,null),e(Gn,cB),e(Gn,qg),e(qg,pB),g(i,n1,_),g(i,Et,_),w(yd,Et,null),e(Et,hB),e(Et,Sn),e(Sn,mB),e(Sn,Ag),e(Ag,uB),e(Sn,fB),e(Sn,Zg),e(Zg,gB),e(Sn,_B),e(Et,bB),e(Et,vd),e(vd,yB),e(vd,Rg),e(Rg,vB),e(vd,TB),e(Et,kB),e(Et,hn),w(Td,hn,null),e(hn,wB),e(hn,kd),e(kd,MB),e(kd,Vg),e(Vg,$B),e(kd,FB),e(hn,BB),w(_a,hn,null),e(Et,xB),e(Et,mn),w(wd,mn,null),e(mn,EB),e(mn,Xn),e(Xn,jB),e(Xn,Gg),e(Gg,zB),e(Xn,CB),e(Xn,Sg),e(Sg,JB),e(Xn,IB),e(mn,UB),w(ba,mn,null),g(i,s1,_),g(i,Ln,_),e(Ln,ya),e(ya,Xg),w(Md,Xg,null),e(Ln,NB),e(Ln,Lg),e(Lg,WB),g(i,a1,_),g(i,On,_),w($d,On,null),e(On,PB),e(On,Fd),e(Fd,qB),e(Fd,Mu),e(Mu,AB),e(Fd,ZB),g(i,r1,_),g(i,Dn,_),w(Bd,Dn,null),e(Dn,RB),e(Dn,xd),e(xd,VB),e(xd,$u),e($u,GB),e(xd,SB),g(i,i1,_),g(i,qo,_),w(Ed,qo,null),e(qo,XB),e(qo,jd),e(jd,LB),e(jd,Fu),e(Fu,OB),e(jd,DB),e(qo,QB),e(qo,va),w(zd,va,null),e(va,HB),e(va,Og),e(Og,YB),g(i,l1,_),g(i,Qn,_),e(Qn,Ta),e(Ta,Dg),w(Cd,Dg,null),e(Qn,KB),e(Qn,Qg),e(Qg,ex),g(i,d1,_),g(i,nt,_),w(Jd,nt,null),e(nt,tx),e(nt,Hg),e(Hg,ox),e(nt,nx),e(nt,Id),e(Id,sx),e(Id,Bu),e(Bu,ax),e(Id,rx),e(nt,ix),e(nt,Ud),e(Ud,lx),e(Ud,Nd),e(Nd,dx),e(Ud,cx),e(nt,px),e(nt,Wd),e(Wd,hx),e(Wd,Pd),e(Pd,mx),e(Wd,ux),e(nt,fx),e(nt,gt),e(gt,gx),e(gt,Yg),e(Yg,_x),e(gt,bx),e(gt,Kg),e(Kg,yx),e(gt,vx),e(gt,e_),e(e_,Tx),e(gt,kx),e(gt,t_),e(t_,wx),e(gt,Mx),e(gt,o_),e(o_,$x),e(gt,Fx),e(gt,n_),e(n_,Bx),e(gt,xx),e(nt,Ex),e(nt,io),w(qd,io,null),e(io,jx),e(io,Hn),e(Hn,zx),e(Hn,xu),e(xu,Cx),e(Hn,Jx),e(Hn,s_),e(s_,Ix),e(Hn,Ux),e(io,Nx),w(ka,io,null),e(io,Wx),w(wa,io,null),g(i,c1,_),g(i,Yn,_),e(Yn,Ma),e(Ma,a_),w(Ad,a_,null),e(Yn,Px),e(Yn,r_),e(r_,qx),g(i,p1,_),g(i,jt,_),w(Zd,jt,null),e(jt,Ax),e(jt,Kn),e(Kn,Zx),e(Kn,i_),e(i_,Rx),e(Kn,Vx),e(Kn,l_),e(l_,Gx),e(Kn,Sx),e(jt,Xx),e(jt,Rd),e(Rd,Lx),e(Rd,Eu),e(Eu,Ox),e(Rd,Dx),e(jt,Qx),e(jt,Vd),e(Vd,Hx),e(Vd,Gd),e(Gd,Yx),e(Vd,Kx),e(jt,eE),e(jt,lo),w(Sd,lo,null),e(lo,tE),e(lo,es),e(es,oE),e(es,ju),e(ju,nE),e(es,sE),e(es,d_),e(d_,aE),e(es,rE),e(lo,iE),w($a,lo,null),e(lo,lE),w(Fa,lo,null),g(i,h1,_),g(i,ts,_),e(ts,Ba),e(Ba,c_),w(Xd,c_,null),e(ts,dE),e(ts,p_),e(p_,cE),g(i,m1,_),g(i,zt,_),w(Ld,zt,null),e(zt,pE),e(zt,Od),e(Od,hE),e(Od,h_),e(h_,mE),e(Od,uE),e(zt,fE),e(zt,Dd),e(Dd,gE),e(Dd,zu),e(zu,_E),e(Dd,bE),e(zt,yE),e(zt,Qd),e(Qd,vE),e(Qd,Hd),e(Hd,TE),e(Qd,kE),e(zt,wE),e(zt,co),w(Yd,co,null),e(co,ME),e(co,os),e(os,$E),e(os,Cu),e(Cu,FE),e(os,BE),e(os,m_),e(m_,xE),e(os,EE),e(co,jE),w(xa,co,null),e(co,zE),w(Ea,co,null),g(i,u1,_),g(i,ns,_),e(ns,ja),e(ja,u_),w(Kd,u_,null),e(ns,CE),e(ns,f_),e(f_,JE),g(i,f1,_),g(i,Ct,_),w(ec,Ct,null),e(Ct,IE),e(Ct,tc),e(tc,UE),e(tc,g_),e(g_,NE),e(tc,WE),e(Ct,PE),e(Ct,oc),e(oc,qE),e(oc,Ju),e(Ju,AE),e(oc,ZE),e(Ct,RE),e(Ct,nc),e(nc,VE),e(nc,sc),e(sc,GE),e(nc,SE),e(Ct,XE),e(Ct,po),w(ac,po,null),e(po,LE),e(po,ss),e(ss,OE),e(ss,Iu),e(Iu,DE),e(ss,QE),e(ss,__),e(__,HE),e(ss,YE),e(po,KE),w(za,po,null),e(po,ej),w(Ca,po,null),g(i,g1,_),g(i,as,_),e(as,Ja),e(Ja,b_),w(rc,b_,null),e(as,tj),e(as,y_),e(y_,oj),g(i,_1,_),g(i,Jt,_),w(ic,Jt,null),e(Jt,nj),e(Jt,lc),e(lc,sj),e(lc,v_),e(v_,aj),e(lc,rj),e(Jt,ij),e(Jt,dc),e(dc,lj),e(dc,Uu),e(Uu,dj),e(dc,cj),e(Jt,pj),e(Jt,cc),e(cc,hj),e(cc,pc),e(pc,mj),e(cc,uj),e(Jt,fj),e(Jt,ho),w(hc,ho,null),e(ho,gj),e(ho,rs),e(rs,_j),e(rs,Nu),e(Nu,bj),e(rs,yj),e(rs,T_),e(T_,vj),e(rs,Tj),e(ho,kj),w(Ia,ho,null),e(ho,wj),w(Ua,ho,null),g(i,b1,_),g(i,is,_),e(is,Na),e(Na,k_),w(mc,k_,null),e(is,Mj),e(is,w_),e(w_,$j),g(i,y1,_),g(i,It,_),w(uc,It,null),e(It,Fj),e(It,M_),e(M_,Bj),e(It,xj),e(It,fc),e(fc,Ej),e(fc,Wu),e(Wu,jj),e(fc,zj),e(It,Cj),e(It,gc),e(gc,Jj),e(gc,_c),e(_c,Ij),e(gc,Uj),e(It,Nj),e(It,At),w(bc,At,null),e(At,Wj),e(At,ls),e(ls,Pj),e(ls,Pu),e(Pu,qj),e(ls,Aj),e(ls,$_),e($_,Zj),e(ls,Rj),e(At,Vj),w(Wa,At,null),e(At,Gj),w(Pa,At,null),e(At,Sj),w(qa,At,null),g(i,v1,_),g(i,ds,_),e(ds,Aa),e(Aa,F_),w(yc,F_,null),e(ds,Xj),e(ds,B_),e(B_,Lj),g(i,T1,_),g(i,Ut,_),w(vc,Ut,null),e(Ut,Oj),e(Ut,x_),e(x_,Dj),e(Ut,Qj),e(Ut,Tc),e(Tc,Hj),e(Tc,qu),e(qu,Yj),e(Tc,Kj),e(Ut,e4),e(Ut,kc),e(kc,t4),e(kc,wc),e(wc,o4),e(kc,n4),e(Ut,s4),e(Ut,mo),w(Mc,mo,null),e(mo,a4),e(mo,cs),e(cs,r4),e(cs,Au),e(Au,i4),e(cs,l4),e(cs,E_),e(E_,d4),e(cs,c4),e(mo,p4),w(Za,mo,null),e(mo,h4),w(Ra,mo,null),g(i,k1,_),g(i,ps,_),e(ps,Va),e(Va,j_),w($c,j_,null),e(ps,m4),e(ps,z_),e(z_,u4),g(i,w1,_),g(i,Nt,_),w(Fc,Nt,null),e(Nt,f4),e(Nt,C_),e(C_,g4),e(Nt,_4),e(Nt,Bc),e(Bc,b4),e(Bc,Zu),e(Zu,y4),e(Bc,v4),e(Nt,T4),e(Nt,xc),e(xc,k4),e(xc,Ec),e(Ec,w4),e(xc,M4),e(Nt,$4),e(Nt,uo),w(jc,uo,null),e(uo,F4),e(uo,hs),e(hs,B4),e(hs,Ru),e(Ru,x4),e(hs,E4),e(hs,J_),e(J_,j4),e(hs,z4),e(uo,C4),w(Ga,uo,null),e(uo,J4),w(Sa,uo,null),g(i,M1,_),g(i,ms,_),e(ms,Xa),e(Xa,I_),w(zc,I_,null),e(ms,I4),e(ms,U_),e(U_,U4),g(i,$1,_),g(i,Wt,_),w(Cc,Wt,null),e(Wt,N4),e(Wt,us),e(us,W4),e(us,N_),e(N_,P4),e(us,q4),e(us,W_),e(W_,A4),e(us,Z4),e(Wt,R4),e(Wt,Jc),e(Jc,V4),e(Jc,Vu),e(Vu,G4),e(Jc,S4),e(Wt,X4),e(Wt,Ic),e(Ic,L4),e(Ic,Uc),e(Uc,O4),e(Ic,D4),e(Wt,Q4),e(Wt,fo),w(Nc,fo,null),e(fo,H4),e(fo,fs),e(fs,Y4),e(fs,Gu),e(Gu,K4),e(fs,e3),e(fs,P_),e(P_,t3),e(fs,o3),e(fo,n3),w(La,fo,null),e(fo,s3),w(Oa,fo,null),g(i,F1,_),g(i,gs,_),e(gs,Da),e(Da,q_),w(Wc,q_,null),e(gs,a3),e(gs,A_),e(A_,r3),g(i,B1,_),g(i,_t,_),w(Pc,_t,null),e(_t,i3),e(_t,Z_),e(Z_,l3),e(_t,d3),e(_t,qc),e(qc,c3),e(qc,Su),e(Su,p3),e(qc,h3),e(_t,m3),e(_t,Ac),e(Ac,u3),e(Ac,Zc),e(Zc,f3),e(Ac,g3),e(_t,_3),w(Qa,_t,null),e(_t,b3),e(_t,go),w(Rc,go,null),e(go,y3),e(go,_s),e(_s,v3),e(_s,Xu),e(Xu,T3),e(_s,k3),e(_s,R_),e(R_,w3),e(_s,M3),e(go,$3),w(Ha,go,null),e(go,F3),w(Ya,go,null),g(i,x1,_),g(i,bs,_),e(bs,Ka),e(Ka,V_),w(Vc,V_,null),e(bs,B3),e(bs,G_),e(G_,x3),g(i,E1,_),g(i,bt,_),w(Gc,bt,null),e(bt,E3),e(bt,ys),e(ys,j3),e(ys,S_),e(S_,z3),e(ys,C3),e(ys,X_),e(X_,J3),e(ys,I3),e(bt,U3),e(bt,Sc),e(Sc,N3),e(Sc,Lu),e(Lu,W3),e(Sc,P3),e(bt,q3),e(bt,Xc),e(Xc,A3),e(Xc,Lc),e(Lc,Z3),e(Xc,R3),e(bt,V3),w(er,bt,null),e(bt,G3),e(bt,_o),w(Oc,_o,null),e(_o,S3),e(_o,vs),e(vs,X3),e(vs,Ou),e(Ou,L3),e(vs,O3),e(vs,L_),e(L_,D3),e(vs,Q3),e(_o,H3),w(tr,_o,null),e(_o,Y3),w(or,_o,null),g(i,j1,_),g(i,Ts,_),e(Ts,nr),e(nr,O_),w(Dc,O_,null),e(Ts,K3),e(Ts,D_),e(D_,ez),g(i,z1,_),g(i,ks,_),w(Qc,ks,null),e(ks,tz),e(ks,Zt),w(Hc,Zt,null),e(Zt,oz),e(Zt,st),e(st,nz),e(st,Q_),e(Q_,sz),e(st,az),e(st,H_),e(H_,rz),e(st,iz),e(st,Y_),e(Y_,lz),e(st,dz),e(st,K_),e(K_,cz),e(st,pz),e(st,eb),e(eb,hz),e(st,mz),e(st,tb),e(tb,uz),e(st,fz),e(st,ob),e(ob,gz),e(st,_z),e(Zt,bz),e(Zt,Yc),e(Yc,Kc),e(Kc,yz),e(Kc,nb),e(nb,vz),e(Kc,Tz),e(Yc,kz),e(Yc,ep),e(ep,wz),e(ep,sb),e(sb,Mz),e(ep,$z),e(Zt,Fz),e(Zt,ne),e(ne,Bz),e(ne,ab),e(ab,xz),e(ne,Ez),e(ne,rb),e(rb,jz),e(ne,zz),e(ne,ib),e(ib,Cz),e(ne,Jz),e(ne,lb),e(lb,Iz),e(ne,Uz),e(ne,db),e(db,Nz),e(ne,Wz),e(ne,cb),e(cb,Pz),e(ne,qz),e(ne,pb),e(pb,Az),e(ne,Zz),e(ne,hb),e(hb,Rz),e(ne,Vz),e(ne,mb),e(mb,Gz),e(ne,Sz),e(ne,ub),e(ub,Xz),e(ne,Lz),e(ne,fb),e(fb,Oz),e(ne,Dz),e(ne,gb),e(gb,Qz),e(ne,Hz),e(ne,_b),e(_b,Yz),e(ne,Kz),e(ne,bb),e(bb,eC),e(ne,tC),e(ne,yb),e(yb,oC),e(ne,nC),e(ne,vb),e(vb,sC),e(ne,aC),e(ne,Tb),e(Tb,rC),e(ne,iC),e(ne,kb),e(kb,lC),e(ne,dC),e(ne,wb),e(wb,cC),e(ne,pC),e(ne,Mb),e(Mb,hC),e(ne,mC),e(Zt,uC),w(sr,Zt,null),g(i,C1,_),g(i,ws,_),e(ws,ar),e(ar,$b),w(tp,$b,null),e(ws,fC),e(ws,Fb),e(Fb,gC),g(i,J1,_),g(i,yt,_),w(op,yt,null),e(yt,_C),e(yt,np),e(np,bC),e(np,Bb),e(Bb,yC),e(np,vC),e(yt,TC),e(yt,sp),e(sp,kC),e(sp,Du),e(Du,wC),e(sp,MC),e(yt,$C),e(yt,ap),e(ap,FC),e(ap,rp),e(rp,BC),e(ap,xC),e(yt,EC),w(rr,yt,null),e(yt,jC),e(yt,Rt),w(ip,Rt,null),e(Rt,zC),e(Rt,Ms),e(Ms,CC),e(Ms,Qu),e(Qu,JC),e(Ms,IC),e(Ms,xb),e(xb,UC),e(Ms,NC),e(Rt,WC),w(ir,Rt,null),e(Rt,PC),w(lr,Rt,null),e(Rt,qC),w(dr,Rt,null),g(i,I1,_),g(i,$s,_),e($s,cr),e(cr,Eb),w(lp,Eb,null),e($s,AC),e($s,jb),e(jb,ZC),g(i,U1,_),g(i,vt,_),w(dp,vt,null),e(vt,RC),e(vt,cp),e(cp,VC),e(cp,zb),e(zb,GC),e(cp,SC),e(vt,XC),e(vt,pp),e(pp,LC),e(pp,Hu),e(Hu,OC),e(pp,DC),e(vt,QC),e(vt,hp),e(hp,HC),e(hp,mp),e(mp,YC),e(hp,KC),e(vt,eJ),w(pr,vt,null),e(vt,tJ),e(vt,bo),w(up,bo,null),e(bo,oJ),e(bo,Fs),e(Fs,nJ),e(Fs,Yu),e(Yu,sJ),e(Fs,aJ),e(Fs,Cb),e(Cb,rJ),e(Fs,iJ),e(bo,lJ),w(hr,bo,null),e(bo,dJ),w(mr,bo,null),g(i,N1,_),g(i,Bs,_),e(Bs,ur),e(ur,Jb),w(fp,Jb,null),e(Bs,cJ),e(Bs,Ib),e(Ib,pJ),g(i,W1,_),g(i,Tt,_),w(gp,Tt,null),e(Tt,hJ),e(Tt,Ub),e(Ub,mJ),e(Tt,uJ),e(Tt,_p),e(_p,fJ),e(_p,Ku),e(Ku,gJ),e(_p,_J),e(Tt,bJ),e(Tt,bp),e(bp,yJ),e(bp,yp),e(yp,vJ),e(bp,TJ),e(Tt,kJ),w(fr,Tt,null),e(Tt,wJ),e(Tt,Vt),w(vp,Vt,null),e(Vt,MJ),e(Vt,xs),e(xs,$J),e(xs,ef),e(ef,FJ),e(xs,BJ),e(xs,Nb),e(Nb,xJ),e(xs,EJ),e(Vt,jJ),w(gr,Vt,null),e(Vt,zJ),w(_r,Vt,null),e(Vt,CJ),w(br,Vt,null),g(i,P1,_),g(i,Es,_),e(Es,yr),e(yr,Wb),w(Tp,Wb,null),e(Es,JJ),e(Es,Pb),e(Pb,IJ),g(i,q1,_),g(i,kt,_),w(kp,kt,null),e(kt,UJ),e(kt,qb),e(qb,NJ),e(kt,WJ),e(kt,wp),e(wp,PJ),e(wp,tf),e(tf,qJ),e(wp,AJ),e(kt,ZJ),e(kt,Mp),e(Mp,RJ),e(Mp,$p),e($p,VJ),e(Mp,GJ),e(kt,SJ),w(vr,kt,null),e(kt,XJ),e(kt,yo),w(Fp,yo,null),e(yo,LJ),e(yo,js),e(js,OJ),e(js,of),e(of,DJ),e(js,QJ),e(js,Ab),e(Ab,HJ),e(js,YJ),e(yo,KJ),w(Tr,yo,null),e(yo,eI),w(kr,yo,null),g(i,A1,_),g(i,zs,_),e(zs,wr),e(wr,Zb),w(Bp,Zb,null),e(zs,tI),e(zs,Rb),e(Rb,oI),g(i,Z1,_),g(i,wt,_),w(xp,wt,null),e(wt,nI),e(wt,Vb),e(Vb,sI),e(wt,aI),e(wt,Ep),e(Ep,rI),e(Ep,nf),e(nf,iI),e(Ep,lI),e(wt,dI),e(wt,jp),e(jp,cI),e(jp,zp),e(zp,pI),e(jp,hI),e(wt,mI),w(Mr,wt,null),e(wt,uI),e(wt,Gt),w(Cp,Gt,null),e(Gt,fI),e(Gt,Cs),e(Cs,gI),e(Cs,sf),e(sf,_I),e(Cs,bI),e(Cs,Gb),e(Gb,yI),e(Cs,vI),e(Gt,TI),w($r,Gt,null),e(Gt,kI),w(Fr,Gt,null),e(Gt,wI),w(Br,Gt,null),g(i,R1,_),g(i,Js,_),e(Js,xr),e(xr,Sb),w(Jp,Sb,null),e(Js,MI),e(Js,Xb),e(Xb,$I),g(i,V1,_),g(i,Mt,_),w(Ip,Mt,null),e(Mt,FI),e(Mt,Is),e(Is,BI),e(Is,Lb),e(Lb,xI),e(Is,EI),e(Is,Ob),e(Ob,jI),e(Is,zI),e(Mt,CI),e(Mt,Up),e(Up,JI),e(Up,af),e(af,II),e(Up,UI),e(Mt,NI),e(Mt,Np),e(Np,WI),e(Np,Wp),e(Wp,PI),e(Np,qI),e(Mt,AI),w(Er,Mt,null),e(Mt,ZI),e(Mt,St),w(Pp,St,null),e(St,RI),e(St,Us),e(Us,VI),e(Us,rf),e(rf,GI),e(Us,SI),e(Us,Db),e(Db,XI),e(Us,LI),e(St,OI),w(jr,St,null),e(St,DI),w(zr,St,null),e(St,QI),w(Cr,St,null),g(i,G1,_),g(i,Ns,_),e(Ns,Jr),e(Jr,Qb),w(qp,Qb,null),e(Ns,HI),e(Ns,Hb),e(Hb,YI),g(i,S1,_),g(i,at,_),w(Ap,at,null),e(at,KI),e(at,Yb),e(Yb,e5),e(at,t5),e(at,Zp),e(Zp,o5),e(Zp,lf),e(lf,n5),e(Zp,s5),e(at,a5),e(at,Rp),e(Rp,r5),e(Rp,Vp),e(Vp,i5),e(Rp,l5),e(at,d5),e(at,Kb),e(Kb,c5),e(at,p5),e(at,Ao),e(Ao,ey),e(ey,Gp),e(Gp,h5),e(Ao,m5),e(Ao,ty),e(ty,Sp),e(Sp,u5),e(Ao,f5),e(Ao,oy),e(oy,Xp),e(Xp,g5),e(Ao,_5),e(Ao,ny),e(ny,Lp),e(Lp,b5),e(at,y5),e(at,vo),w(Op,vo,null),e(vo,v5),e(vo,Ws),e(Ws,T5),e(Ws,sy),e(sy,k5),e(Ws,w5),e(Ws,ay),e(ay,M5),e(Ws,$5),e(vo,F5),w(Ir,vo,null),e(vo,B5),w(Ur,vo,null),g(i,X1,_),g(i,Ps,_),e(Ps,Nr),e(Nr,ry),w(Dp,ry,null),e(Ps,x5),e(Ps,iy),e(iy,E5),g(i,L1,_),g(i,rt,_),w(Qp,rt,null),e(rt,j5),e(rt,qs),e(qs,z5),e(qs,ly),e(ly,C5),e(qs,J5),e(qs,dy),e(dy,I5),e(qs,U5),e(rt,N5),e(rt,Hp),e(Hp,W5),e(Hp,df),e(df,P5),e(Hp,q5),e(rt,A5),e(rt,Yp),e(Yp,Z5),e(Yp,Kp),e(Kp,R5),e(Yp,V5),e(rt,G5),e(rt,cy),e(cy,S5),e(rt,X5),e(rt,Zo),e(Zo,py),e(py,eh),e(eh,L5),e(Zo,O5),e(Zo,hy),e(hy,th),e(th,D5),e(Zo,Q5),e(Zo,my),e(my,oh),e(oh,H5),e(Zo,Y5),e(Zo,uy),e(uy,nh),e(nh,K5),e(rt,eU),e(rt,To),w(sh,To,null),e(To,tU),e(To,As),e(As,oU),e(As,fy),e(fy,nU),e(As,sU),e(As,gy),e(gy,aU),e(As,rU),e(To,iU),w(Wr,To,null),e(To,lU),w(Pr,To,null),g(i,O1,_),g(i,Zs,_),e(Zs,qr),e(qr,_y),w(ah,_y,null),e(Zs,dU),e(Zs,by),e(by,cU),g(i,D1,_),g(i,it,_),w(rh,it,null),e(it,pU),e(it,yy),e(yy,hU),e(it,mU),e(it,ih),e(ih,uU),e(ih,cf),e(cf,fU),e(ih,gU),e(it,_U),e(it,lh),e(lh,bU),e(lh,dh),e(dh,yU),e(lh,vU),e(it,TU),e(it,vy),e(vy,kU),e(it,wU),e(it,Ro),e(Ro,Ty),e(Ty,ch),e(ch,MU),e(Ro,$U),e(Ro,ky),e(ky,ph),e(ph,FU),e(Ro,BU),e(Ro,wy),e(wy,hh),e(hh,xU),e(Ro,EU),e(Ro,My),e(My,mh),e(mh,jU),e(it,zU),e(it,ko),w(uh,ko,null),e(ko,CU),e(ko,Rs),e(Rs,JU),e(Rs,$y),e($y,IU),e(Rs,UU),e(Rs,Fy),e(Fy,NU),e(Rs,WU),e(ko,PU),w(Ar,ko,null),e(ko,qU),w(Zr,ko,null),g(i,Q1,_),g(i,Vs,_),e(Vs,Rr),e(Rr,By),w(fh,By,null),e(Vs,AU),e(Vs,xy),e(xy,ZU),g(i,H1,_),g(i,lt,_),w(gh,lt,null),e(lt,RU),e(lt,_h),e(_h,VU),e(_h,Ey),e(Ey,GU),e(_h,SU),e(lt,XU),e(lt,bh),e(bh,LU),e(bh,pf),e(pf,OU),e(bh,DU),e(lt,QU),e(lt,yh),e(yh,HU),e(yh,vh),e(vh,YU),e(yh,KU),e(lt,eN),e(lt,jy),e(jy,tN),e(lt,oN),e(lt,Vo),e(Vo,zy),e(zy,Th),e(Th,nN),e(Vo,sN),e(Vo,Cy),e(Cy,kh),e(kh,aN),e(Vo,rN),e(Vo,Jy),e(Jy,wh),e(wh,iN),e(Vo,lN),e(Vo,Iy),e(Iy,Mh),e(Mh,dN),e(lt,cN),e(lt,wo),w($h,wo,null),e(wo,pN),e(wo,Gs),e(Gs,hN),e(Gs,Uy),e(Uy,mN),e(Gs,uN),e(Gs,Ny),e(Ny,fN),e(Gs,gN),e(wo,_N),w(Vr,wo,null),e(wo,bN),w(Gr,wo,null),g(i,Y1,_),g(i,Ss,_),e(Ss,Sr),e(Sr,Wy),w(Fh,Wy,null),e(Ss,yN),e(Ss,Py),e(Py,vN),g(i,K1,_),g(i,dt,_),w(Bh,dt,null),e(dt,TN),e(dt,xh),e(xh,kN),e(xh,qy),e(qy,wN),e(xh,MN),e(dt,$N),e(dt,Eh),e(Eh,FN),e(Eh,hf),e(hf,BN),e(Eh,xN),e(dt,EN),e(dt,jh),e(jh,jN),e(jh,zh),e(zh,zN),e(jh,CN),e(dt,JN),e(dt,Ay),e(Ay,IN),e(dt,UN),e(dt,Go),e(Go,Zy),e(Zy,Ch),e(Ch,NN),e(Go,WN),e(Go,Ry),e(Ry,Jh),e(Jh,PN),e(Go,qN),e(Go,Vy),e(Vy,Ih),e(Ih,AN),e(Go,ZN),e(Go,Gy),e(Gy,Uh),e(Uh,RN),e(dt,VN),e(dt,Mo),w(Nh,Mo,null),e(Mo,GN),e(Mo,Xs),e(Xs,SN),e(Xs,Sy),e(Sy,XN),e(Xs,LN),e(Xs,Xy),e(Xy,ON),e(Xs,DN),e(Mo,QN),w(Xr,Mo,null),e(Mo,HN),w(Lr,Mo,null),g(i,ek,_),g(i,Ls,_),e(Ls,Or),e(Or,Ly),w(Wh,Ly,null),e(Ls,YN),e(Ls,Oy),e(Oy,KN),g(i,tk,_),g(i,ct,_),w(Ph,ct,null),e(ct,e9),e(ct,Dy),e(Dy,t9),e(ct,o9),e(ct,qh),e(qh,n9),e(qh,mf),e(mf,s9),e(qh,a9),e(ct,r9),e(ct,Ah),e(Ah,i9),e(Ah,Zh),e(Zh,l9),e(Ah,d9),e(ct,c9),e(ct,Qy),e(Qy,p9),e(ct,h9),e(ct,So),e(So,Hy),e(Hy,Rh),e(Rh,m9),e(So,u9),e(So,Yy),e(Yy,Vh),e(Vh,f9),e(So,g9),e(So,Ky),e(Ky,Gh),e(Gh,_9),e(So,b9),e(So,ev),e(ev,Sh),e(Sh,y9),e(ct,v9),e(ct,$o),w(Xh,$o,null),e($o,T9),e($o,Os),e(Os,k9),e(Os,tv),e(tv,w9),e(Os,M9),e(Os,ov),e(ov,$9),e(Os,F9),e($o,B9),w(Dr,$o,null),e($o,x9),w(Qr,$o,null),g(i,ok,_),g(i,Ds,_),e(Ds,Hr),e(Hr,nv),w(Lh,nv,null),e(Ds,E9),e(Ds,sv),e(sv,j9),g(i,nk,_),g(i,pt,_),w(Oh,pt,null),e(pt,z9),e(pt,av),e(av,C9),e(pt,J9),e(pt,Dh),e(Dh,I9),e(Dh,uf),e(uf,U9),e(Dh,N9),e(pt,W9),e(pt,Qh),e(Qh,P9),e(Qh,Hh),e(Hh,q9),e(Qh,A9),e(pt,Z9),e(pt,rv),e(rv,R9),e(pt,V9),e(pt,Xo),e(Xo,iv),e(iv,Yh),e(Yh,G9),e(Xo,S9),e(Xo,lv),e(lv,Kh),e(Kh,X9),e(Xo,L9),e(Xo,dv),e(dv,em),e(em,O9),e(Xo,D9),e(Xo,cv),e(cv,tm),e(tm,Q9),e(pt,H9),e(pt,Fo),w(om,Fo,null),e(Fo,Y9),e(Fo,Qs),e(Qs,K9),e(Qs,pv),e(pv,eW),e(Qs,tW),e(Qs,hv),e(hv,oW),e(Qs,nW),e(Fo,sW),w(Yr,Fo,null),e(Fo,aW),w(Kr,Fo,null),g(i,sk,_),g(i,Hs,_),e(Hs,ei),e(ei,mv),w(nm,mv,null),e(Hs,rW),e(Hs,uv),e(uv,iW),g(i,ak,_),g(i,ht,_),w(sm,ht,null),e(ht,lW),e(ht,fv),e(fv,dW),e(ht,cW),e(ht,am),e(am,pW),e(am,ff),e(ff,hW),e(am,mW),e(ht,uW),e(ht,rm),e(rm,fW),e(rm,im),e(im,gW),e(rm,_W),e(ht,bW),e(ht,gv),e(gv,yW),e(ht,vW),e(ht,Lo),e(Lo,_v),e(_v,lm),e(lm,TW),e(Lo,kW),e(Lo,bv),e(bv,dm),e(dm,wW),e(Lo,MW),e(Lo,yv),e(yv,cm),e(cm,$W),e(Lo,FW),e(Lo,vv),e(vv,pm),e(pm,BW),e(ht,xW),e(ht,Bo),w(hm,Bo,null),e(Bo,EW),e(Bo,Ys),e(Ys,jW),e(Ys,Tv),e(Tv,zW),e(Ys,CW),e(Ys,kv),e(kv,JW),e(Ys,IW),e(Bo,UW),w(ti,Bo,null),e(Bo,NW),w(oi,Bo,null),g(i,rk,_),g(i,Ks,_),e(Ks,ni),e(ni,wv),w(mm,wv,null),e(Ks,WW),e(Ks,Mv),e(Mv,PW),g(i,ik,_),g(i,mt,_),w(um,mt,null),e(mt,qW),e(mt,ea),e(ea,AW),e(ea,$v),e($v,ZW),e(ea,RW),e(ea,Fv),e(Fv,VW),e(ea,GW),e(mt,SW),e(mt,fm),e(fm,XW),e(fm,gf),e(gf,LW),e(fm,OW),e(mt,DW),e(mt,gm),e(gm,QW),e(gm,_m),e(_m,HW),e(gm,YW),e(mt,KW),e(mt,Bv),e(Bv,eP),e(mt,tP),e(mt,Oo),e(Oo,xv),e(xv,bm),e(bm,oP),e(Oo,nP),e(Oo,Ev),e(Ev,ym),e(ym,sP),e(Oo,aP),e(Oo,jv),e(jv,vm),e(vm,rP),e(Oo,iP),e(Oo,zv),e(zv,Tm),e(Tm,lP),e(mt,dP),e(mt,xo),w(km,xo,null),e(xo,cP),e(xo,ta),e(ta,pP),e(ta,Cv),e(Cv,hP),e(ta,mP),e(ta,Jv),e(Jv,uP),e(ta,fP),e(xo,gP),w(si,xo,null),e(xo,_P),w(ai,xo,null),lk=!0},p(i,[_]){const wm={};_&2&&(wm.$$scope={dirty:_,ctx:i}),ca.$set(wm);const Iv={};_&2&&(Iv.$$scope={dirty:_,ctx:i}),ma.$set(Iv);const Uv={};_&2&&(Uv.$$scope={dirty:_,ctx:i}),fa.$set(Uv);const Nv={};_&2&&(Nv.$$scope={dirty:_,ctx:i}),_a.$set(Nv);const Mm={};_&2&&(Mm.$$scope={dirty:_,ctx:i}),ba.$set(Mm);const Wv={};_&2&&(Wv.$$scope={dirty:_,ctx:i}),ka.$set(Wv);const Pv={};_&2&&(Pv.$$scope={dirty:_,ctx:i}),wa.$set(Pv);const $m={};_&2&&($m.$$scope={dirty:_,ctx:i}),$a.$set($m);const qv={};_&2&&(qv.$$scope={dirty:_,ctx:i}),Fa.$set(qv);const Av={};_&2&&(Av.$$scope={dirty:_,ctx:i}),xa.$set(Av);const Zv={};_&2&&(Zv.$$scope={dirty:_,ctx:i}),Ea.$set(Zv);const Fm={};_&2&&(Fm.$$scope={dirty:_,ctx:i}),za.$set(Fm);const Rv={};_&2&&(Rv.$$scope={dirty:_,ctx:i}),Ca.$set(Rv);const Vv={};_&2&&(Vv.$$scope={dirty:_,ctx:i}),Ia.$set(Vv);const Gv={};_&2&&(Gv.$$scope={dirty:_,ctx:i}),Ua.$set(Gv);const Sv={};_&2&&(Sv.$$scope={dirty:_,ctx:i}),Wa.$set(Sv);const Xv={};_&2&&(Xv.$$scope={dirty:_,ctx:i}),Pa.$set(Xv);const Lv={};_&2&&(Lv.$$scope={dirty:_,ctx:i}),qa.$set(Lv);const Ov={};_&2&&(Ov.$$scope={dirty:_,ctx:i}),Za.$set(Ov);const Do={};_&2&&(Do.$$scope={dirty:_,ctx:i}),Ra.$set(Do);const Dv={};_&2&&(Dv.$$scope={dirty:_,ctx:i}),Ga.$set(Dv);const Qv={};_&2&&(Qv.$$scope={dirty:_,ctx:i}),Sa.$set(Qv);const Hv={};_&2&&(Hv.$$scope={dirty:_,ctx:i}),La.$set(Hv);const Yv={};_&2&&(Yv.$$scope={dirty:_,ctx:i}),Oa.$set(Yv);const Bm={};_&2&&(Bm.$$scope={dirty:_,ctx:i}),Qa.$set(Bm);const Kv={};_&2&&(Kv.$$scope={dirty:_,ctx:i}),Ha.$set(Kv);const oa={};_&2&&(oa.$$scope={dirty:_,ctx:i}),Ya.$set(oa);const eT={};_&2&&(eT.$$scope={dirty:_,ctx:i}),er.$set(eT);const tT={};_&2&&(tT.$$scope={dirty:_,ctx:i}),tr.$set(tT);const oT={};_&2&&(oT.$$scope={dirty:_,ctx:i}),or.$set(oT);const nT={};_&2&&(nT.$$scope={dirty:_,ctx:i}),sr.$set(nT);const sT={};_&2&&(sT.$$scope={dirty:_,ctx:i}),rr.$set(sT);const na={};_&2&&(na.$$scope={dirty:_,ctx:i}),ir.$set(na);const aT={};_&2&&(aT.$$scope={dirty:_,ctx:i}),lr.$set(aT);const rT={};_&2&&(rT.$$scope={dirty:_,ctx:i}),dr.$set(rT);const xm={};_&2&&(xm.$$scope={dirty:_,ctx:i}),pr.$set(xm);const iT={};_&2&&(iT.$$scope={dirty:_,ctx:i}),hr.$set(iT);const lT={};_&2&&(lT.$$scope={dirty:_,ctx:i}),mr.$set(lT);const dT={};_&2&&(dT.$$scope={dirty:_,ctx:i}),fr.$set(dT);const cT={};_&2&&(cT.$$scope={dirty:_,ctx:i}),gr.$set(cT);const ut={};_&2&&(ut.$$scope={dirty:_,ctx:i}),_r.$set(ut);const Em={};_&2&&(Em.$$scope={dirty:_,ctx:i}),br.$set(Em);const pT={};_&2&&(pT.$$scope={dirty:_,ctx:i}),vr.$set(pT);const jm={};_&2&&(jm.$$scope={dirty:_,ctx:i}),Tr.$set(jm);const hT={};_&2&&(hT.$$scope={dirty:_,ctx:i}),kr.$set(hT);const zm={};_&2&&(zm.$$scope={dirty:_,ctx:i}),Mr.$set(zm);const mT={};_&2&&(mT.$$scope={dirty:_,ctx:i}),$r.$set(mT);const Cm={};_&2&&(Cm.$$scope={dirty:_,ctx:i}),Fr.$set(Cm);const uT={};_&2&&(uT.$$scope={dirty:_,ctx:i}),Br.$set(uT);const un={};_&2&&(un.$$scope={dirty:_,ctx:i}),Er.$set(un);const fT={};_&2&&(fT.$$scope={dirty:_,ctx:i}),jr.$set(fT);const gT={};_&2&&(gT.$$scope={dirty:_,ctx:i}),zr.$set(gT);const _T={};_&2&&(_T.$$scope={dirty:_,ctx:i}),Cr.$set(_T);const fn={};_&2&&(fn.$$scope={dirty:_,ctx:i}),Ir.$set(fn);const bT={};_&2&&(bT.$$scope={dirty:_,ctx:i}),Ur.$set(bT);const yT={};_&2&&(yT.$$scope={dirty:_,ctx:i}),Wr.$set(yT);const vT={};_&2&&(vT.$$scope={dirty:_,ctx:i}),Pr.$set(vT);const gn={};_&2&&(gn.$$scope={dirty:_,ctx:i}),Ar.$set(gn);const TT={};_&2&&(TT.$$scope={dirty:_,ctx:i}),Zr.$set(TT);const kT={};_&2&&(kT.$$scope={dirty:_,ctx:i}),Vr.$set(kT);const wT={};_&2&&(wT.$$scope={dirty:_,ctx:i}),Gr.$set(wT);const MT={};_&2&&(MT.$$scope={dirty:_,ctx:i}),Xr.$set(MT);const $T={};_&2&&($T.$$scope={dirty:_,ctx:i}),Lr.$set($T);const $t={};_&2&&($t.$$scope={dirty:_,ctx:i}),Dr.$set($t);const Jm={};_&2&&(Jm.$$scope={dirty:_,ctx:i}),Qr.$set(Jm);const FT={};_&2&&(FT.$$scope={dirty:_,ctx:i}),Yr.$set(FT);const sa={};_&2&&(sa.$$scope={dirty:_,ctx:i}),Kr.$set(sa);const BT={};_&2&&(BT.$$scope={dirty:_,ctx:i}),ti.$set(BT);const xT={};_&2&&(xT.$$scope={dirty:_,ctx:i}),oi.$set(xT);const _n={};_&2&&(_n.$$scope={dirty:_,ctx:i}),si.$set(_n);const ET={};_&2&&(ET.$$scope={dirty:_,ctx:i}),ai.$set(ET)},i(i){lk||(M(l.$$.fragment,i),M(de.$$.fragment,i),M(Ai.$$.fragment,i),M(Zi.$$.fragment,i),M(ol.$$.fragment,i),M(ml.$$.fragment,i),M(Tl.$$.fragment,i),M(Kl.$$.fragment,i),M(ed.$$.fragment,i),M(ca.$$.fragment,i),M(od.$$.fragment,i),M(nd.$$.fragment,i),M(ad.$$.fragment,i),M(id.$$.fragment,i),M(dd.$$.fragment,i),M(ma.$$.fragment,i),M(cd.$$.fragment,i),M(pd.$$.fragment,i),M(hd.$$.fragment,i),M(fd.$$.fragment,i),M(_d.$$.fragment,i),M(fa.$$.fragment,i),M(bd.$$.fragment,i),M(yd.$$.fragment,i),M(Td.$$.fragment,i),M(_a.$$.fragment,i),M(wd.$$.fragment,i),M(ba.$$.fragment,i),M(Md.$$.fragment,i),M($d.$$.fragment,i),M(Bd.$$.fragment,i),M(Ed.$$.fragment,i),M(zd.$$.fragment,i),M(Cd.$$.fragment,i),M(Jd.$$.fragment,i),M(qd.$$.fragment,i),M(ka.$$.fragment,i),M(wa.$$.fragment,i),M(Ad.$$.fragment,i),M(Zd.$$.fragment,i),M(Sd.$$.fragment,i),M($a.$$.fragment,i),M(Fa.$$.fragment,i),M(Xd.$$.fragment,i),M(Ld.$$.fragment,i),M(Yd.$$.fragment,i),M(xa.$$.fragment,i),M(Ea.$$.fragment,i),M(Kd.$$.fragment,i),M(ec.$$.fragment,i),M(ac.$$.fragment,i),M(za.$$.fragment,i),M(Ca.$$.fragment,i),M(rc.$$.fragment,i),M(ic.$$.fragment,i),M(hc.$$.fragment,i),M(Ia.$$.fragment,i),M(Ua.$$.fragment,i),M(mc.$$.fragment,i),M(uc.$$.fragment,i),M(bc.$$.fragment,i),M(Wa.$$.fragment,i),M(Pa.$$.fragment,i),M(qa.$$.fragment,i),M(yc.$$.fragment,i),M(vc.$$.fragment,i),M(Mc.$$.fragment,i),M(Za.$$.fragment,i),M(Ra.$$.fragment,i),M($c.$$.fragment,i),M(Fc.$$.fragment,i),M(jc.$$.fragment,i),M(Ga.$$.fragment,i),M(Sa.$$.fragment,i),M(zc.$$.fragment,i),M(Cc.$$.fragment,i),M(Nc.$$.fragment,i),M(La.$$.fragment,i),M(Oa.$$.fragment,i),M(Wc.$$.fragment,i),M(Pc.$$.fragment,i),M(Qa.$$.fragment,i),M(Rc.$$.fragment,i),M(Ha.$$.fragment,i),M(Ya.$$.fragment,i),M(Vc.$$.fragment,i),M(Gc.$$.fragment,i),M(er.$$.fragment,i),M(Oc.$$.fragment,i),M(tr.$$.fragment,i),M(or.$$.fragment,i),M(Dc.$$.fragment,i),M(Qc.$$.fragment,i),M(Hc.$$.fragment,i),M(sr.$$.fragment,i),M(tp.$$.fragment,i),M(op.$$.fragment,i),M(rr.$$.fragment,i),M(ip.$$.fragment,i),M(ir.$$.fragment,i),M(lr.$$.fragment,i),M(dr.$$.fragment,i),M(lp.$$.fragment,i),M(dp.$$.fragment,i),M(pr.$$.fragment,i),M(up.$$.fragment,i),M(hr.$$.fragment,i),M(mr.$$.fragment,i),M(fp.$$.fragment,i),M(gp.$$.fragment,i),M(fr.$$.fragment,i),M(vp.$$.fragment,i),M(gr.$$.fragment,i),M(_r.$$.fragment,i),M(br.$$.fragment,i),M(Tp.$$.fragment,i),M(kp.$$.fragment,i),M(vr.$$.fragment,i),M(Fp.$$.fragment,i),M(Tr.$$.fragment,i),M(kr.$$.fragment,i),M(Bp.$$.fragment,i),M(xp.$$.fragment,i),M(Mr.$$.fragment,i),M(Cp.$$.fragment,i),M($r.$$.fragment,i),M(Fr.$$.fragment,i),M(Br.$$.fragment,i),M(Jp.$$.fragment,i),M(Ip.$$.fragment,i),M(Er.$$.fragment,i),M(Pp.$$.fragment,i),M(jr.$$.fragment,i),M(zr.$$.fragment,i),M(Cr.$$.fragment,i),M(qp.$$.fragment,i),M(Ap.$$.fragment,i),M(Op.$$.fragment,i),M(Ir.$$.fragment,i),M(Ur.$$.fragment,i),M(Dp.$$.fragment,i),M(Qp.$$.fragment,i),M(sh.$$.fragment,i),M(Wr.$$.fragment,i),M(Pr.$$.fragment,i),M(ah.$$.fragment,i),M(rh.$$.fragment,i),M(uh.$$.fragment,i),M(Ar.$$.fragment,i),M(Zr.$$.fragment,i),M(fh.$$.fragment,i),M(gh.$$.fragment,i),M($h.$$.fragment,i),M(Vr.$$.fragment,i),M(Gr.$$.fragment,i),M(Fh.$$.fragment,i),M(Bh.$$.fragment,i),M(Nh.$$.fragment,i),M(Xr.$$.fragment,i),M(Lr.$$.fragment,i),M(Wh.$$.fragment,i),M(Ph.$$.fragment,i),M(Xh.$$.fragment,i),M(Dr.$$.fragment,i),M(Qr.$$.fragment,i),M(Lh.$$.fragment,i),M(Oh.$$.fragment,i),M(om.$$.fragment,i),M(Yr.$$.fragment,i),M(Kr.$$.fragment,i),M(nm.$$.fragment,i),M(sm.$$.fragment,i),M(hm.$$.fragment,i),M(ti.$$.fragment,i),M(oi.$$.fragment,i),M(mm.$$.fragment,i),M(um.$$.fragment,i),M(km.$$.fragment,i),M(si.$$.fragment,i),M(ai.$$.fragment,i),lk=!0)},o(i){$(l.$$.fragment,i),$(de.$$.fragment,i),$(Ai.$$.fragment,i),$(Zi.$$.fragment,i),$(ol.$$.fragment,i),$(ml.$$.fragment,i),$(Tl.$$.fragment,i),$(Kl.$$.fragment,i),$(ed.$$.fragment,i),$(ca.$$.fragment,i),$(od.$$.fragment,i),$(nd.$$.fragment,i),$(ad.$$.fragment,i),$(id.$$.fragment,i),$(dd.$$.fragment,i),$(ma.$$.fragment,i),$(cd.$$.fragment,i),$(pd.$$.fragment,i),$(hd.$$.fragment,i),$(fd.$$.fragment,i),$(_d.$$.fragment,i),$(fa.$$.fragment,i),$(bd.$$.fragment,i),$(yd.$$.fragment,i),$(Td.$$.fragment,i),$(_a.$$.fragment,i),$(wd.$$.fragment,i),$(ba.$$.fragment,i),$(Md.$$.fragment,i),$($d.$$.fragment,i),$(Bd.$$.fragment,i),$(Ed.$$.fragment,i),$(zd.$$.fragment,i),$(Cd.$$.fragment,i),$(Jd.$$.fragment,i),$(qd.$$.fragment,i),$(ka.$$.fragment,i),$(wa.$$.fragment,i),$(Ad.$$.fragment,i),$(Zd.$$.fragment,i),$(Sd.$$.fragment,i),$($a.$$.fragment,i),$(Fa.$$.fragment,i),$(Xd.$$.fragment,i),$(Ld.$$.fragment,i),$(Yd.$$.fragment,i),$(xa.$$.fragment,i),$(Ea.$$.fragment,i),$(Kd.$$.fragment,i),$(ec.$$.fragment,i),$(ac.$$.fragment,i),$(za.$$.fragment,i),$(Ca.$$.fragment,i),$(rc.$$.fragment,i),$(ic.$$.fragment,i),$(hc.$$.fragment,i),$(Ia.$$.fragment,i),$(Ua.$$.fragment,i),$(mc.$$.fragment,i),$(uc.$$.fragment,i),$(bc.$$.fragment,i),$(Wa.$$.fragment,i),$(Pa.$$.fragment,i),$(qa.$$.fragment,i),$(yc.$$.fragment,i),$(vc.$$.fragment,i),$(Mc.$$.fragment,i),$(Za.$$.fragment,i),$(Ra.$$.fragment,i),$($c.$$.fragment,i),$(Fc.$$.fragment,i),$(jc.$$.fragment,i),$(Ga.$$.fragment,i),$(Sa.$$.fragment,i),$(zc.$$.fragment,i),$(Cc.$$.fragment,i),$(Nc.$$.fragment,i),$(La.$$.fragment,i),$(Oa.$$.fragment,i),$(Wc.$$.fragment,i),$(Pc.$$.fragment,i),$(Qa.$$.fragment,i),$(Rc.$$.fragment,i),$(Ha.$$.fragment,i),$(Ya.$$.fragment,i),$(Vc.$$.fragment,i),$(Gc.$$.fragment,i),$(er.$$.fragment,i),$(Oc.$$.fragment,i),$(tr.$$.fragment,i),$(or.$$.fragment,i),$(Dc.$$.fragment,i),$(Qc.$$.fragment,i),$(Hc.$$.fragment,i),$(sr.$$.fragment,i),$(tp.$$.fragment,i),$(op.$$.fragment,i),$(rr.$$.fragment,i),$(ip.$$.fragment,i),$(ir.$$.fragment,i),$(lr.$$.fragment,i),$(dr.$$.fragment,i),$(lp.$$.fragment,i),$(dp.$$.fragment,i),$(pr.$$.fragment,i),$(up.$$.fragment,i),$(hr.$$.fragment,i),$(mr.$$.fragment,i),$(fp.$$.fragment,i),$(gp.$$.fragment,i),$(fr.$$.fragment,i),$(vp.$$.fragment,i),$(gr.$$.fragment,i),$(_r.$$.fragment,i),$(br.$$.fragment,i),$(Tp.$$.fragment,i),$(kp.$$.fragment,i),$(vr.$$.fragment,i),$(Fp.$$.fragment,i),$(Tr.$$.fragment,i),$(kr.$$.fragment,i),$(Bp.$$.fragment,i),$(xp.$$.fragment,i),$(Mr.$$.fragment,i),$(Cp.$$.fragment,i),$($r.$$.fragment,i),$(Fr.$$.fragment,i),$(Br.$$.fragment,i),$(Jp.$$.fragment,i),$(Ip.$$.fragment,i),$(Er.$$.fragment,i),$(Pp.$$.fragment,i),$(jr.$$.fragment,i),$(zr.$$.fragment,i),$(Cr.$$.fragment,i),$(qp.$$.fragment,i),$(Ap.$$.fragment,i),$(Op.$$.fragment,i),$(Ir.$$.fragment,i),$(Ur.$$.fragment,i),$(Dp.$$.fragment,i),$(Qp.$$.fragment,i),$(sh.$$.fragment,i),$(Wr.$$.fragment,i),$(Pr.$$.fragment,i),$(ah.$$.fragment,i),$(rh.$$.fragment,i),$(uh.$$.fragment,i),$(Ar.$$.fragment,i),$(Zr.$$.fragment,i),$(fh.$$.fragment,i),$(gh.$$.fragment,i),$($h.$$.fragment,i),$(Vr.$$.fragment,i),$(Gr.$$.fragment,i),$(Fh.$$.fragment,i),$(Bh.$$.fragment,i),$(Nh.$$.fragment,i),$(Xr.$$.fragment,i),$(Lr.$$.fragment,i),$(Wh.$$.fragment,i),$(Ph.$$.fragment,i),$(Xh.$$.fragment,i),$(Dr.$$.fragment,i),$(Qr.$$.fragment,i),$(Lh.$$.fragment,i),$(Oh.$$.fragment,i),$(om.$$.fragment,i),$(Yr.$$.fragment,i),$(Kr.$$.fragment,i),$(nm.$$.fragment,i),$(sm.$$.fragment,i),$(hm.$$.fragment,i),$(ti.$$.fragment,i),$(oi.$$.fragment,i),$(mm.$$.fragment,i),$(um.$$.fragment,i),$(km.$$.fragment,i),$(si.$$.fragment,i),$(ai.$$.fragment,i),lk=!1},d(i){t(d),i&&t(y),i&&t(u),F(l),i&&t(we),i&&t(Z),i&&t(O),i&&t(ie),F(de),i&&t(Me),i&&t(R),i&&t(U),i&&t(ue),i&&t($e),i&&t(fe),i&&t(Fe),i&&t(J),i&&t(Be),i&&t(ge),i&&t(xe),i&&t(se),i&&t(Ge),i&&t(A),i&&t(CT),i&&t(Nn),F(Ai),i&&t(JT),i&&t(Rm),i&&t(IT),F(Zi,i),i&&t(UT),i&&t(tt),i&&t(NT),F(ol,i),i&&t(WT),i&&t(ft),i&&t(PT),F(ml,i),i&&t(qT),i&&t(Pt),i&&t(AT),F(Tl,i),i&&t(ZT),i&&t(qt),i&&t(RT),i&&t(lu),i&&t(VT),i&&t(rn),i&&t(GT),i&&t(Cl),i&&t(ST),i&&t(la),i&&t(XT),i&&t(Wl),i&&t(LT),i&&t(hu),i&&t(OT),i&&t(Al),i&&t(DT),i&&t(Ft),i&&t(QT),i&&t(Pn),F(Kl),i&&t(HT),i&&t(so),F(ed),F(ca),i&&t(YT),i&&t(An),F(od),i&&t(KT),i&&t(ot),F(nd),F(ad),F(id),F(dd),F(ma),F(cd),i&&t(e1),i&&t(Rn),F(pd),i&&t(t1),i&&t(xt),F(hd),F(fd),F(_d),F(fa),i&&t(o1),i&&t(Gn),F(bd),i&&t(n1),i&&t(Et),F(yd),F(Td),F(_a),F(wd),F(ba),i&&t(s1),i&&t(Ln),F(Md),i&&t(a1),i&&t(On),F($d),i&&t(r1),i&&t(Dn),F(Bd),i&&t(i1),i&&t(qo),F(Ed),F(zd),i&&t(l1),i&&t(Qn),F(Cd),i&&t(d1),i&&t(nt),F(Jd),F(qd),F(ka),F(wa),i&&t(c1),i&&t(Yn),F(Ad),i&&t(p1),i&&t(jt),F(Zd),F(Sd),F($a),F(Fa),i&&t(h1),i&&t(ts),F(Xd),i&&t(m1),i&&t(zt),F(Ld),F(Yd),F(xa),F(Ea),i&&t(u1),i&&t(ns),F(Kd),i&&t(f1),i&&t(Ct),F(ec),F(ac),F(za),F(Ca),i&&t(g1),i&&t(as),F(rc),i&&t(_1),i&&t(Jt),F(ic),F(hc),F(Ia),F(Ua),i&&t(b1),i&&t(is),F(mc),i&&t(y1),i&&t(It),F(uc),F(bc),F(Wa),F(Pa),F(qa),i&&t(v1),i&&t(ds),F(yc),i&&t(T1),i&&t(Ut),F(vc),F(Mc),F(Za),F(Ra),i&&t(k1),i&&t(ps),F($c),i&&t(w1),i&&t(Nt),F(Fc),F(jc),F(Ga),F(Sa),i&&t(M1),i&&t(ms),F(zc),i&&t($1),i&&t(Wt),F(Cc),F(Nc),F(La),F(Oa),i&&t(F1),i&&t(gs),F(Wc),i&&t(B1),i&&t(_t),F(Pc),F(Qa),F(Rc),F(Ha),F(Ya),i&&t(x1),i&&t(bs),F(Vc),i&&t(E1),i&&t(bt),F(Gc),F(er),F(Oc),F(tr),F(or),i&&t(j1),i&&t(Ts),F(Dc),i&&t(z1),i&&t(ks),F(Qc),F(Hc),F(sr),i&&t(C1),i&&t(ws),F(tp),i&&t(J1),i&&t(yt),F(op),F(rr),F(ip),F(ir),F(lr),F(dr),i&&t(I1),i&&t($s),F(lp),i&&t(U1),i&&t(vt),F(dp),F(pr),F(up),F(hr),F(mr),i&&t(N1),i&&t(Bs),F(fp),i&&t(W1),i&&t(Tt),F(gp),F(fr),F(vp),F(gr),F(_r),F(br),i&&t(P1),i&&t(Es),F(Tp),i&&t(q1),i&&t(kt),F(kp),F(vr),F(Fp),F(Tr),F(kr),i&&t(A1),i&&t(zs),F(Bp),i&&t(Z1),i&&t(wt),F(xp),F(Mr),F(Cp),F($r),F(Fr),F(Br),i&&t(R1),i&&t(Js),F(Jp),i&&t(V1),i&&t(Mt),F(Ip),F(Er),F(Pp),F(jr),F(zr),F(Cr),i&&t(G1),i&&t(Ns),F(qp),i&&t(S1),i&&t(at),F(Ap),F(Op),F(Ir),F(Ur),i&&t(X1),i&&t(Ps),F(Dp),i&&t(L1),i&&t(rt),F(Qp),F(sh),F(Wr),F(Pr),i&&t(O1),i&&t(Zs),F(ah),i&&t(D1),i&&t(it),F(rh),F(uh),F(Ar),F(Zr),i&&t(Q1),i&&t(Vs),F(fh),i&&t(H1),i&&t(lt),F(gh),F($h),F(Vr),F(Gr),i&&t(Y1),i&&t(Ss),F(Fh),i&&t(K1),i&&t(dt),F(Bh),F(Nh),F(Xr),F(Lr),i&&t(ek),i&&t(Ls),F(Wh),i&&t(tk),i&&t(ct),F(Ph),F(Xh),F(Dr),F(Qr),i&&t(ok),i&&t(Ds),F(Lh),i&&t(nk),i&&t(pt),F(Oh),F(om),F(Yr),F(Kr),i&&t(sk),i&&t(Hs),F(nm),i&&t(ak),i&&t(ht),F(sm),F(hm),F(ti),F(oi),i&&t(rk),i&&t(Ks),F(mm),i&&t(ik),i&&t(mt),F(um),F(km),F(si),F(ai)}}}const s8={local:"bert",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.BertConfig",title:"BertConfig"},{local:"transformers.BertTokenizer",title:"BertTokenizer"},{local:"transformers.BertTokenizerFast",title:"BertTokenizerFast"},{local:"transformers.TFBertTokenizer",title:"TFBertTokenizer"},{local:"transformers.models.bert.modeling_bert.BertForPreTrainingOutput",title:"Bert specific outputs"},{local:"transformers.BertModel",title:"BertModel"},{local:"transformers.BertForPreTraining",title:"BertForPreTraining"},{local:"transformers.BertLMHeadModel",title:"BertLMHeadModel"},{local:"transformers.BertForMaskedLM",title:"BertForMaskedLM"},{local:"transformers.BertForNextSentencePrediction",title:"BertForNextSentencePrediction"},{local:"transformers.BertForSequenceClassification",title:"BertForSequenceClassification"},{local:"transformers.BertForMultipleChoice",title:"BertForMultipleChoice"},{local:"transformers.BertForTokenClassification",title:"BertForTokenClassification"},{local:"transformers.BertForQuestionAnswering",title:"BertForQuestionAnswering"},{local:"transformers.TFBertModel",title:"TFBertModel"},{local:"transformers.TFBertForPreTraining",title:"TFBertForPreTraining"},{local:"transformers.TFBertLMHeadModel",title:"TFBertModelLMHeadModel"},{local:"transformers.TFBertForMaskedLM",title:"TFBertForMaskedLM"},{local:"transformers.TFBertForNextSentencePrediction",title:"TFBertForNextSentencePrediction"},{local:"transformers.TFBertForSequenceClassification",title:"TFBertForSequenceClassification"},{local:"transformers.TFBertForMultipleChoice",title:"TFBertForMultipleChoice"},{local:"transformers.TFBertForTokenClassification",title:"TFBertForTokenClassification"},{local:"transformers.TFBertForQuestionAnswering",title:"TFBertForQuestionAnswering"},{local:"transformers.FlaxBertModel",title:"FlaxBertModel"},{local:"transformers.FlaxBertForPreTraining",title:"FlaxBertForPreTraining"},{local:"transformers.FlaxBertForCausalLM",title:"FlaxBertForCausalLM"},{local:"transformers.FlaxBertForMaskedLM",title:"FlaxBertForMaskedLM"},{local:"transformers.FlaxBertForNextSentencePrediction",title:"FlaxBertForNextSentencePrediction"},{local:"transformers.FlaxBertForSequenceClassification",title:"FlaxBertForSequenceClassification"},{local:"transformers.FlaxBertForMultipleChoice",title:"FlaxBertForMultipleChoice"},{local:"transformers.FlaxBertForTokenClassification",title:"FlaxBertForTokenClassification"},{local:"transformers.FlaxBertForQuestionAnswering",title:"FlaxBertForQuestionAnswering"}],title:"BERT"};function a8(B){return qS(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class m8 extends US{constructor(d){super();NS(this,d,a8,n8,WS,{})}}export{m8 as default,s8 as metadata};
