import{S as Fw,i as Ew,s as jw,e as r,k as p,w as v,t as o,M as Jw,c as a,d as t,m as h,a as i,x as k,h as n,b as g,G as e,g as _,y as w,q as $,o as B,B as F,v as Cw,L as Le}from"../../chunks/vendor-hf-doc-builder.js";import{T as Qe}from"../../chunks/Tip-hf-doc-builder.js";import{D as ne}from"../../chunks/Docstring-hf-doc-builder.js";import{C as He}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ye}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as De}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function zw(C){let d,y,m,u,M;return u=new He({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1vYmlsZUJlcnRDb25maWclMkMlMjBNb2JpbGVCZXJ0TW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwTW9iaWxlQkVSVCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwTW9iaWxlQmVydENvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBjb25maWd1cmF0aW9uJTIwYWJvdmUlMEFtb2RlbCUyMCUzRCUyME1vYmlsZUJlcnRNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MobileBertConfig, MobileBertModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a MobileBERT configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = MobileBertConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the configuration above</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileBertModel(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=r("p"),y=o("Examples:"),m=p(),v(u.$$.fragment)},l(l){d=a(l,"P",{});var c=i(d);y=n(c,"Examples:"),c.forEach(t),m=h(l),k(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,y),_(l,m,c),w(u,l,c),M=!0},p:Le,i(l){M||($(u.$$.fragment,l),M=!0)},o(l){B(u.$$.fragment,l),M=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function Uw(C){let d,y,m,u,M;return u=new He({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=r("p"),y=o("sequence pair mask has the following format:"),m=p(),v(u.$$.fragment)},l(l){d=a(l,"P",{});var c=i(d);y=n(c,"sequence pair mask has the following format:"),c.forEach(t),m=h(l),k(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,y),_(l,m,c),w(u,l,c),M=!0},p:Le,i(l){M||($(u.$$.fragment,l),M=!0)},o(l){B(u.$$.fragment,l),M=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function xw(C){let d,y,m,u,M;return u=new He({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=r("p"),y=o("sequence pair mask has the following format:"),m=p(),v(u.$$.fragment)},l(l){d=a(l,"P",{});var c=i(d);y=n(c,"sequence pair mask has the following format:"),c.forEach(t),m=h(l),k(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,y),_(l,m,c),w(u,l,c),M=!0},p:Le,i(l){M||($(u.$$.fragment,l),M=!0)},o(l){B(u.$$.fragment,l),M=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function Iw(C){let d,y,m,u,M;return{c(){d=r("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),M=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 c=i(d);y=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(c,"CODE",{});var J=i(m);u=n(J,"Module"),J.forEach(t),M=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){_(l,d,c),e(d,y),e(d,m),e(m,u),e(d,M)},d(l){l&&t(d)}}}function Nw(C){let d,y,m,u,M;return u=new He({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBNb2JpbGVCZXJ0TW9kZWwlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRm1vYmlsZWJlcnQtdW5jYXNlZCUyMiklMEFtb2RlbCUyMCUzRCUyME1vYmlsZUJlcnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGbW9iaWxlYmVydC11bmNhc2VkJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MobileBertModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileBertModel.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-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=r("p"),y=o("Example:"),m=p(),v(u.$$.fragment)},l(l){d=a(l,"P",{});var c=i(d);y=n(c,"Example:"),c.forEach(t),m=h(l),k(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,y),_(l,m,c),w(u,l,c),M=!0},p:Le,i(l){M||($(u.$$.fragment,l),M=!0)},o(l){B(u.$$.fragment,l),M=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function Ww(C){let d,y,m,u,M;return{c(){d=r("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),M=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 c=i(d);y=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(c,"CODE",{});var J=i(m);u=n(J,"Module"),J.forEach(t),M=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){_(l,d,c),e(d,y),e(d,m),e(m,u),e(d,M)},d(l){l&&t(d)}}}function Zw(C){let d,y,m,u,M;return u=new He({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBNb2JpbGVCZXJ0Rm9yUHJlVHJhaW5pbmclMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRm1vYmlsZWJlcnQtdW5jYXNlZCUyMiklMEFtb2RlbCUyMCUzRCUyME1vYmlsZUJlcnRGb3JQcmVUcmFpbmluZy5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGbW9iaWxlYmVydC11bmNhc2VkJTIyKSUwQSUwQWlucHV0X2lkcyUyMCUzRCUyMHRvcmNoLnRlbnNvcih0b2tlbml6ZXIuZW5jb2RlKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjBhZGRfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSkudW5zcXVlZXplKDApJTBBJTIzJTIwQmF0Y2glMjBzaXplJTIwMSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbChpbnB1dF9pZHMpJTBBJTBBcHJlZGljdGlvbl9sb2dpdHMlMjAlM0QlMjBvdXRwdXRzLnByZWRpY3Rpb25fbG9naXRzJTBBc2VxX3JlbGF0aW9uc2hpcF9sb2dpdHMlMjAlM0QlMjBvdXRwdXRzLnNlcV9yZWxhdGlvbnNoaXBfbG9naXRz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MobileBertForPreTraining
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileBertForPreTraining.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = torch.tensor(tokenizer.encode(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, add_special_tokens=<span class="hljs-literal">True</span>)).unsqueeze(<span class="hljs-number">0</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 = outputs.prediction_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>seq_relationship_logits = outputs.seq_relationship_logits`}}),{c(){d=r("p"),y=o("Examples:"),m=p(),v(u.$$.fragment)},l(l){d=a(l,"P",{});var c=i(d);y=n(c,"Examples:"),c.forEach(t),m=h(l),k(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,y),_(l,m,c),w(u,l,c),M=!0},p:Le,i(l){M||($(u.$$.fragment,l),M=!0)},o(l){B(u.$$.fragment,l),M=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function qw(C){let d,y,m,u,M;return{c(){d=r("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),M=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 c=i(d);y=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(c,"CODE",{});var J=i(m);u=n(J,"Module"),J.forEach(t),M=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){_(l,d,c),e(d,y),e(d,m),e(m,u),e(d,M)},d(l){l&&t(d)}}}function Pw(C){let d,y,m,u,M;return u=new He({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBNb2JpbGVCZXJ0Rm9yTWFza2VkTE0lMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRm1vYmlsZWJlcnQtdW5jYXNlZCUyMiklMEFtb2RlbCUyMCUzRCUyME1vYmlsZUJlcnRGb3JNYXNrZWRMTS5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGbW9iaWxlYmVydC11bmNhc2VkJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJUaGUlMjBjYXBpdGFsJTIwb2YlMjBGcmFuY2UlMjBpcyUyMCU1Qk1BU0slNUQuJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQSUyMyUyMHJldHJpZXZlJTIwaW5kZXglMjBvZiUyMCU1Qk1BU0slNUQlMEFtYXNrX3Rva2VuX2luZGV4JTIwJTNEJTIwKGlucHV0cy5pbnB1dF9pZHMlMjAlM0QlM0QlMjB0b2tlbml6ZXIubWFza190b2tlbl9pZCklNUIwJTVELm5vbnplcm8oYXNfdHVwbGUlM0RUcnVlKSU1QjAlNUQlMEElMEFwcmVkaWN0ZWRfdG9rZW5faWQlMjAlM0QlMjBsb2dpdHMlNUIwJTJDJTIwbWFza190b2tlbl9pbmRleCU1RC5hcmdtYXgoYXhpcyUzRC0xKSUwQXRva2VuaXplci5kZWNvZGUocHJlZGljdGVkX3Rva2VuX2lkKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRva2VuaXplciglMjJUaGUlMjBjYXBpdGFsJTIwb2YlMjBGcmFuY2UlMjBpcyUyMFBhcmlzLiUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTVCJTIyaW5wdXRfaWRzJTIyJTVEJTBBJTIzJTIwbWFzayUyMGxhYmVscyUyMG9mJTIwbm9uLSU1Qk1BU0slNUQlMjB0b2tlbnMlMEFsYWJlbHMlMjAlM0QlMjB0b3JjaC53aGVyZShpbnB1dHMuaW5wdXRfaWRzJTIwJTNEJTNEJTIwdG9rZW5pemVyLm1hc2tfdG9rZW5faWQlMkMlMjBsYWJlbHMlMkMlMjAtMTAwKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscyklMEFyb3VuZChvdXRwdXRzLmxvc3MuaXRlbSgpJTJDJTIwMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MobileBertForMaskedLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileBertForMaskedLM.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-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.57</span>`}}),{c(){d=r("p"),y=o("Example:"),m=p(),v(u.$$.fragment)},l(l){d=a(l,"P",{});var c=i(d);y=n(c,"Example:"),c.forEach(t),m=h(l),k(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,y),_(l,m,c),w(u,l,c),M=!0},p:Le,i(l){M||($(u.$$.fragment,l),M=!0)},o(l){B(u.$$.fragment,l),M=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function Rw(C){let d,y,m,u,M;return{c(){d=r("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),M=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 c=i(d);y=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(c,"CODE",{});var J=i(m);u=n(J,"Module"),J.forEach(t),M=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){_(l,d,c),e(d,y),e(d,m),e(m,u),e(d,M)},d(l){l&&t(d)}}}function Gw(C){let d,y,m,u,M;return u=new He({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBNb2JpbGVCZXJ0Rm9yTmV4dFNlbnRlbmNlUHJlZGljdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGbW9iaWxlYmVydC11bmNhc2VkJTIyKSUwQW1vZGVsJTIwJTNEJTIwTW9iaWxlQmVydEZvck5leHRTZW50ZW5jZVByZWRpY3Rpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRm1vYmlsZWJlcnQtdW5jYXNlZCUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJJbiUyMEl0YWx5JTJDJTIwcGl6emElMjBzZXJ2ZWQlMjBpbiUyMGZvcm1hbCUyMHNldHRpbmdzJTJDJTIwc3VjaCUyMGFzJTIwYXQlMjBhJTIwcmVzdGF1cmFudCUyQyUyMGlzJTIwcHJlc2VudGVkJTIwdW5zbGljZWQuJTIyJTBBbmV4dF9zZW50ZW5jZSUyMCUzRCUyMCUyMlRoZSUyMHNreSUyMGlzJTIwYmx1ZSUyMGR1ZSUyMHRvJTIwdGhlJTIwc2hvcnRlciUyMHdhdmVsZW5ndGglMjBvZiUyMGJsdWUlMjBsaWdodC4lMjIlMEFlbmNvZGluZyUyMCUzRCUyMHRva2VuaXplcihwcm9tcHQlMkMlMjBuZXh0X3NlbnRlbmNlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKiplbmNvZGluZyUyQyUyMGxhYmVscyUzRHRvcmNoLkxvbmdUZW5zb3IoJTVCMSU1RCkpJTBBbG9zcyUyMCUzRCUyMG91dHB1dHMubG9zcyUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MobileBertForNextSentencePrediction
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileBertForNextSentencePrediction.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-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>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=r("p"),y=o("Examples:"),m=p(),v(u.$$.fragment)},l(l){d=a(l,"P",{});var c=i(d);y=n(c,"Examples:"),c.forEach(t),m=h(l),k(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,y),_(l,m,c),w(u,l,c),M=!0},p:Le,i(l){M||($(u.$$.fragment,l),M=!0)},o(l){B(u.$$.fragment,l),M=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function Vw(C){let d,y,m,u,M;return{c(){d=r("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),M=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 c=i(d);y=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(c,"CODE",{});var J=i(m);u=n(J,"Module"),J.forEach(t),M=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){_(l,d,c),e(d,y),e(d,m),e(m,u),e(d,M)},d(l){l&&t(d)}}}function Aw(C){let d,y,m,u,M;return u=new He({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyME1vYmlsZUJlcnRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIybG9yZHR0MTMlMkZlbW8tbW9iaWxlYmVydCUyMiklMEFtb2RlbCUyMCUzRCUyME1vYmlsZUJlcnRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJsb3JkdHQxMyUyRmVtby1tb2JpbGViZXJ0JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQXByZWRpY3RlZF9jbGFzc19pZCUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoKS5pdGVtKCklMEFtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfY2xhc3NfaWQlNUQlMEElMEElMjMlMjBUbyUyMHRyYWluJTIwYSUyMG1vZGVsJTIwb24lMjAlNjBudW1fbGFiZWxzJTYwJTIwY2xhc3NlcyUyQyUyMHlvdSUyMGNhbiUyMHBhc3MlMjAlNjBudW1fbGFiZWxzJTNEbnVtX2xhYmVscyU2MCUyMHRvJTIwJTYwLmZyb21fcHJldHJhaW5lZCguLi4pJTYwJTBBbnVtX2xhYmVscyUyMCUzRCUyMGxlbihtb2RlbC5jb25maWcuaWQybGFiZWwpJTBBbW9kZWwlMjAlM0QlMjBNb2JpbGVCZXJ0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIybG9yZHR0MTMlMkZlbW8tbW9iaWxlYmVydCUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcyUwQXJvdW5kKGxvc3MuaXRlbSgpJTJDJTIwMik=",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, MobileBertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;lordtt13/emo-mobilebert&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;lordtt13/emo-mobilebert&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;others&#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 = MobileBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;lordtt13/emo-mobilebert&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">4.72</span>`}}),{c(){d=r("p"),y=o("Example of single-label classification:"),m=p(),v(u.$$.fragment)},l(l){d=a(l,"P",{});var c=i(d);y=n(c,"Example of single-label classification:"),c.forEach(t),m=h(l),k(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,y),_(l,m,c),w(u,l,c),M=!0},p:Le,i(l){M||($(u.$$.fragment,l),M=!0)},o(l){B(u.$$.fragment,l),M=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function Sw(C){let d,y,m,u,M;return u=new He({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyME1vYmlsZUJlcnRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIybG9yZHR0MTMlMkZlbW8tbW9iaWxlYmVydCUyMiklMEFtb2RlbCUyMCUzRCUyME1vYmlsZUJlcnRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJsb3JkdHQxMyUyRmVtby1tb2JpbGViZXJ0JTIyJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX2NsYXNzX2lkcyUyMCUzRCUyMHRvcmNoLmFyYW5nZSgwJTJDJTIwbG9naXRzLnNoYXBlJTVCLTElNUQpJTVCdG9yY2guc2lnbW9pZChsb2dpdHMpLnNxdWVlemUoZGltJTNEMCklMjAlM0UlMjAwLjUlNUQlMEElMEElMjMlMjBUbyUyMHRyYWluJTIwYSUyMG1vZGVsJTIwb24lMjAlNjBudW1fbGFiZWxzJTYwJTIwY2xhc3NlcyUyQyUyMHlvdSUyMGNhbiUyMHBhc3MlMjAlNjBudW1fbGFiZWxzJTNEbnVtX2xhYmVscyU2MCUyMHRvJTIwJTYwLmZyb21fcHJldHJhaW5lZCguLi4pJTYwJTBBbnVtX2xhYmVscyUyMCUzRCUyMGxlbihtb2RlbC5jb25maWcuaWQybGFiZWwpJTBBbW9kZWwlMjAlM0QlMjBNb2JpbGVCZXJ0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIybG9yZHR0MTMlMkZlbW8tbW9iaWxlYmVydCUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIlMEEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2guc3VtKCUwQSUyMCUyMCUyMCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwub25lX2hvdChwcmVkaWN0ZWRfY2xhc3NfaWRzJTVCTm9uZSUyQyUyMCUzQSU1RC5jbG9uZSgpJTJDJTIwbnVtX2NsYXNzZXMlM0RudW1fbGFiZWxzKSUyQyUyMGRpbSUzRDElMEEpLnRvKHRvcmNoLmZsb2F0KSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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, MobileBertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;lordtt13/emo-mobilebert&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MobileBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;lordtt13/emo-mobilebert&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 = MobileBertForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;lordtt13/emo-mobilebert&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=r("p"),y=o("Example of multi-label classification:"),m=p(),v(u.$$.fragment)},l(l){d=a(l,"P",{});var c=i(d);y=n(c,"Example of multi-label classification:"),c.forEach(t),m=h(l),k(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,y),_(l,m,c),w(u,l,c),M=!0},p:Le,i(l){M||($(u.$$.fragment,l),M=!0)},o(l){B(u.$$.fragment,l),M=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function Xw(C){let d,y,m,u,M;return{c(){d=r("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),M=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 c=i(d);y=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(c,"CODE",{});var J=i(m);u=n(J,"Module"),J.forEach(t),M=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){_(l,d,c),e(d,y),e(d,m),e(m,u),e(d,M)},d(l){l&&t(d)}}}function Ow(C){let d,y,m,u,M;return u=new He({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBNb2JpbGVCZXJ0Rm9yTXVsdGlwbGVDaG9pY2UlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRm1vYmlsZWJlcnQtdW5jYXNlZCUyMiklMEFtb2RlbCUyMCUzRCUyME1vYmlsZUJlcnRGb3JNdWx0aXBsZUNob2ljZS5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGbW9iaWxlYmVydC11bmNhc2VkJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMkluJTIwSXRhbHklMkMlMjBwaXp6YSUyMHNlcnZlZCUyMGluJTIwZm9ybWFsJTIwc2V0dGluZ3MlMkMlMjBzdWNoJTIwYXMlMjBhdCUyMGElMjByZXN0YXVyYW50JTJDJTIwaXMlMjBwcmVzZW50ZWQlMjB1bnNsaWNlZC4lMjIlMEFjaG9pY2UwJTIwJTNEJTIwJTIySXQlMjBpcyUyMGVhdGVuJTIwd2l0aCUyMGElMjBmb3JrJTIwYW5kJTIwYSUyMGtuaWZlLiUyMiUwQWNob2ljZTElMjAlM0QlMjAlMjJJdCUyMGlzJTIwZWF0ZW4lMjB3aGlsZSUyMGhlbGQlMjBpbiUyMHRoZSUyMGhhbmQuJTIyJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2gudGVuc29yKDApLnVuc3F1ZWV6ZSgwKSUyMCUyMCUyMyUyMGNob2ljZTAlMjBpcyUyMGNvcnJlY3QlMjAoYWNjb3JkaW5nJTIwdG8lMjBXaWtpcGVkaWElMjAlM0IpKSUyQyUyMGJhdGNoJTIwc2l6ZSUyMDElMEElMEFlbmNvZGluZyUyMCUzRCUyMHRva2VuaXplciglNUJwcm9tcHQlMkMlMjBwcm9tcHQlNUQlMkMlMjAlNUJjaG9pY2UwJTJDJTIwY2hvaWNlMSU1RCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMkMlMjBwYWRkaW5nJTNEVHJ1ZSklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKiolN0JrJTNBJTIwdi51bnNxdWVlemUoMCklMjBmb3IlMjBrJTJDJTIwdiUyMGluJTIwZW5jb2RpbmcuaXRlbXMoKSU3RCUyQyUyMGxhYmVscyUzRGxhYmVscyklMjAlMjAlMjMlMjBiYXRjaCUyMHNpemUlMjBpcyUyMDElMEElMEElMjMlMjB0aGUlMjBsaW5lYXIlMjBjbGFzc2lmaWVyJTIwc3RpbGwlMjBuZWVkcyUyMHRvJTIwYmUlMjB0cmFpbmVkJTBBbG9zcyUyMCUzRCUyMG91dHB1dHMubG9zcyUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MobileBertForMultipleChoice
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFMobileBertForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;google/mobilebert-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=r("p"),y=o("Example:"),m=p(),v(u.$$.fragment)},l(l){d=a(l,"P",{});var c=i(d);y=n(c,"Example:"),c.forEach(t),m=h(l),k(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,y),_(l,m,c),w(u,l,c),M=!0},p:Le,i(l){M||($(u.$$.fragment,l),M=!0)},o(l){B(u.$$.fragment,l),M=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function b2(C){let d,y,m,u,M,l,c,J,ye,me,q,re,K,T,Te,S,ve,ue,R,ke,ie,O,we,fe,V,$e,ge,A,ce,Be,te,z,I,_e,G,pe,Fe,Q,he,Ee,x,se,D,le,je,L,de,Je,W,be,P,ae,ee,U,Ce,N,ze,Me;return{c(){d=r("p"),y=o("TensorFlow models and layers in "),m=r("code"),u=o("transformers"),M=o(" accept two formats as input:"),l=p(),c=r("ul"),J=r("li"),ye=o("having all inputs as keyword arguments (like PyTorch models), or"),me=p(),q=r("li"),re=o("having all inputs as a list, tuple or dict in the first positional argument."),K=p(),T=r("p"),Te=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 `),S=r("code"),ve=o("model.fit()"),ue=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),R=r("code"),ke=o("model.fit()"),ie=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),O=r("code"),we=o("fit()"),fe=o(" and "),V=r("code"),$e=o("predict()"),ge=o(`, such as when creating your own layers or models with
the Keras `),A=r("code"),ce=o("Functional"),Be=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),te=p(),z=r("ul"),I=r("li"),_e=o("a single Tensor with "),G=r("code"),pe=o("input_ids"),Fe=o(" only and nothing else: "),Q=r("code"),he=o("model(input_ids)"),Ee=p(),x=r("li"),se=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),D=r("code"),le=o("model([input_ids, attention_mask])"),je=o(" or "),L=r("code"),de=o("model([input_ids, attention_mask, token_type_ids])"),Je=p(),W=r("li"),be=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),P=r("code"),ae=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ee=p(),U=r("p"),Ce=o(`Note that when creating models and layers with
`),N=r("a"),ze=o("subclassing"),Me=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(f){d=a(f,"P",{});var E=i(d);y=n(E,"TensorFlow models and layers in "),m=a(E,"CODE",{});var Ie=i(m);u=n(Ie,"transformers"),Ie.forEach(t),M=n(E," accept two formats as input:"),E.forEach(t),l=h(f),c=a(f,"UL",{});var oe=i(c);J=a(oe,"LI",{});var Ve=i(J);ye=n(Ve,"having all inputs as keyword arguments (like PyTorch models), or"),Ve.forEach(t),me=h(oe),q=a(oe,"LI",{});var qe=i(q);re=n(qe,"having all inputs as a list, tuple or dict in the first positional argument."),qe.forEach(t),oe.forEach(t),K=h(f),T=a(f,"P",{});var j=i(T);Te=n(j,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),S=a(j,"CODE",{});var Ae=i(S);ve=n(Ae,"model.fit()"),Ae.forEach(t),ue=n(j,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),R=a(j,"CODE",{});var Se=i(R);ke=n(Se,"model.fit()"),Se.forEach(t),ie=n(j,` supports! If, however, you want to use the second
format outside of Keras methods like `),O=a(j,"CODE",{});var Pe=i(O);we=n(Pe,"fit()"),Pe.forEach(t),fe=n(j," and "),V=a(j,"CODE",{});var Ne=i(V);$e=n(Ne,"predict()"),Ne.forEach(t),ge=n(j,`, such as when creating your own layers or models with
the Keras `),A=a(j,"CODE",{});var Xe=i(A);ce=n(Xe,"Functional"),Xe.forEach(t),Be=n(j,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),j.forEach(t),te=h(f),z=a(f,"UL",{});var Z=i(z);I=a(Z,"LI",{});var X=i(I);_e=n(X,"a single Tensor with "),G=a(X,"CODE",{});var We=i(G);pe=n(We,"input_ids"),We.forEach(t),Fe=n(X," only and nothing else: "),Q=a(X,"CODE",{});var Oe=i(Q);he=n(Oe,"model(input_ids)"),Oe.forEach(t),X.forEach(t),Ee=h(Z),x=a(Z,"LI",{});var H=i(x);se=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),D=a(H,"CODE",{});var Re=i(D);le=n(Re,"model([input_ids, attention_mask])"),Re.forEach(t),je=n(H," or "),L=a(H,"CODE",{});var Ze=i(L);de=n(Ze,"model([input_ids, attention_mask, token_type_ids])"),Ze.forEach(t),H.forEach(t),Je=h(Z),W=a(Z,"LI",{});var Ue=i(W);be=n(Ue,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),P=a(Ue,"CODE",{});var Ge=i(P);ae=n(Ge,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ge.forEach(t),Ue.forEach(t),Z.forEach(t),ee=h(f),U=a(f,"P",{});var Y=i(U);Ce=n(Y,`Note that when creating models and layers with
`),N=a(Y,"A",{href:!0,rel:!0});var xe=i(N);ze=n(xe,"subclassing"),xe.forEach(t),Me=n(Y,` 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!`),Y.forEach(t),this.h()},h(){g(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),g(N,"rel","nofollow")},m(f,E){_(f,d,E),e(d,y),e(d,m),e(m,u),e(d,M),_(f,l,E),_(f,c,E),e(c,J),e(J,ye),e(c,me),e(c,q),e(q,re),_(f,K,E),_(f,T,E),e(T,Te),e(T,S),e(S,ve),e(T,ue),e(T,R),e(R,ke),e(T,ie),e(T,O),e(O,we),e(T,fe),e(T,V),e(V,$e),e(T,ge),e(T,A),e(A,ce),e(T,Be),_(f,te,E),_(f,z,E),e(z,I),e(I,_e),e(I,G),e(G,pe),e(I,Fe),e(I,Q),e(Q,he),e(z,Ee),e(z,x),e(x,se),e(x,D),e(D,le),e(x,je),e(x,L),e(L,de),e(z,Je),e(z,W),e(W,be),e(W,P),e(P,ae),_(f,ee,E),_(f,U,E),e(U,Ce),e(U,N),e(N,ze),e(U,Me)},d(f){f&&t(d),f&&t(l),f&&t(c),f&&t(K),f&&t(T),f&&t(te),f&&t(z),f&&t(ee),f&&t(U)}}}function M2(C){let d,y,m,u,M;return{c(){d=r("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),M=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 c=i(d);y=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(c,"CODE",{});var J=i(m);u=n(J,"Module"),J.forEach(t),M=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){_(l,d,c),e(d,y),e(d,m),e(m,u),e(d,M)},d(l){l&&t(d)}}}function y2(C){let d,y,m,u,M;return u=new He({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURk1vYmlsZUJlcnRGb3JUb2tlbkNsYXNzaWZpY2F0aW9uJTBBaW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ2dW1pY2hpZW4lMkZtb2JpbGViZXJ0LWZpbmV0dW5lZC1uZXIlMjIpJTBBbW9kZWwlMjAlM0QlMjBURk1vYmlsZUJlcnRGb3JUb2tlbkNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ2dW1pY2hpZW4lMkZtb2JpbGViZXJ0LWZpbmV0dW5lZC1uZXIlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUwQSUyMCUyMCUyMCUyMCUyMkh1Z2dpbmdGYWNlJTIwaXMlMjBhJTIwY29tcGFueSUyMGJhc2VkJTIwaW4lMjBQYXJpcyUyMGFuZCUyME5ldyUyMFlvcmslMjIlMkMlMjBhZGRfc3BlY2lhbF90b2tlbnMlM0RGYWxzZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIlMEEpJTBBJTBBbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQXByZWRpY3RlZF90b2tlbl9jbGFzc19pZHMlMjAlM0QlMjB0Zi5tYXRoLmFyZ21heChsb2dpdHMlMkMlMjBheGlzJTNELTEpJTBBJTBBJTIzJTIwTm90ZSUyMHRoYXQlMjB0b2tlbnMlMjBhcmUlMjBjbGFzc2lmaWVkJTIwcmF0aGVyJTIwdGhlbiUyMGlucHV0JTIwd29yZHMlMjB3aGljaCUyMG1lYW5zJTIwdGhhdCUwQSUyMyUyMHRoZXJlJTIwbWlnaHQlMjBiZSUyMG1vcmUlMjBwcmVkaWN0ZWQlMjB0b2tlbiUyMGNsYXNzZXMlMjB0aGFuJTIwd29yZHMuJTBBJTIzJTIwTXVsdGlwbGUlMjB0b2tlbiUyMGNsYXNzZXMlMjBtaWdodCUyMGFjY291bnQlMjBmb3IlMjB0aGUlMjBzYW1lJTIwd29yZCUwQXByZWRpY3RlZF90b2tlbnNfY2xhc3NlcyUyMCUzRCUyMCU1Qm1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnQlNUQlMjBmb3IlMjB0JTIwaW4lMjBwcmVkaWN0ZWRfdG9rZW5fY2xhc3NfaWRzJTVCMCU1RC5udW1weSgpLnRvbGlzdCgpJTVEJTBBcHJlZGljdGVkX3Rva2Vuc19jbGFzc2Vz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFMobileBertForTokenClassification
<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;vumichien/mobilebert-finetuned-ner&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFMobileBertForTokenClassification.from_pretrained(<span class="hljs-string">&quot;vumichien/mobilebert-finetuned-ner&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;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=r("p"),y=o("Example:"),m=p(),v(u.$$.fragment)},l(l){d=a(l,"P",{});var c=i(d);y=n(c,"Example:"),c.forEach(t),m=h(l),k(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,y),_(l,m,c),w(u,l,c),M=!0},p:Le,i(l){M||($(u.$$.fragment,l),M=!0)},o(l){B(u.$$.fragment,l),M=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function T2(C){let d,y;return d=new He({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.03</span>`}}),{c(){v(d.$$.fragment)},l(m){k(d.$$.fragment,m)},m(m,u){w(d,m,u),y=!0},p:Le,i(m){y||($(d.$$.fragment,m),y=!0)},o(m){B(d.$$.fragment,m),y=!1},d(m){F(d,m)}}}function v2(C){let d,y,m,u,M,l,c,J,ye,me,q,re,K,T,Te,S,ve,ue,R,ke,ie,O,we,fe,V,$e,ge,A,ce,Be,te,z,I,_e,G,pe,Fe,Q,he,Ee,x,se,D,le,je,L,de,Je,W,be,P,ae,ee,U,Ce,N,ze,Me;return{c(){d=r("p"),y=o("TensorFlow models and layers in "),m=r("code"),u=o("transformers"),M=o(" accept two formats as input:"),l=p(),c=r("ul"),J=r("li"),ye=o("having all inputs as keyword arguments (like PyTorch models), or"),me=p(),q=r("li"),re=o("having all inputs as a list, tuple or dict in the first positional argument."),K=p(),T=r("p"),Te=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 `),S=r("code"),ve=o("model.fit()"),ue=o(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),R=r("code"),ke=o("model.fit()"),ie=o(` supports! If, however, you want to use the second
format outside of Keras methods like `),O=r("code"),we=o("fit()"),fe=o(" and "),V=r("code"),$e=o("predict()"),ge=o(`, such as when creating your own layers or models with
the Keras `),A=r("code"),ce=o("Functional"),Be=o(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),te=p(),z=r("ul"),I=r("li"),_e=o("a single Tensor with "),G=r("code"),pe=o("input_ids"),Fe=o(" only and nothing else: "),Q=r("code"),he=o("model(input_ids)"),Ee=p(),x=r("li"),se=o(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),D=r("code"),le=o("model([input_ids, attention_mask])"),je=o(" or "),L=r("code"),de=o("model([input_ids, attention_mask, token_type_ids])"),Je=p(),W=r("li"),be=o(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),P=r("code"),ae=o('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ee=p(),U=r("p"),Ce=o(`Note that when creating models and layers with
`),N=r("a"),ze=o("subclassing"),Me=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(f){d=a(f,"P",{});var E=i(d);y=n(E,"TensorFlow models and layers in "),m=a(E,"CODE",{});var Ie=i(m);u=n(Ie,"transformers"),Ie.forEach(t),M=n(E," accept two formats as input:"),E.forEach(t),l=h(f),c=a(f,"UL",{});var oe=i(c);J=a(oe,"LI",{});var Ve=i(J);ye=n(Ve,"having all inputs as keyword arguments (like PyTorch models), or"),Ve.forEach(t),me=h(oe),q=a(oe,"LI",{});var qe=i(q);re=n(qe,"having all inputs as a list, tuple or dict in the first positional argument."),qe.forEach(t),oe.forEach(t),K=h(f),T=a(f,"P",{});var j=i(T);Te=n(j,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),S=a(j,"CODE",{});var Ae=i(S);ve=n(Ae,"model.fit()"),Ae.forEach(t),ue=n(j,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),R=a(j,"CODE",{});var Se=i(R);ke=n(Se,"model.fit()"),Se.forEach(t),ie=n(j,` supports! If, however, you want to use the second
format outside of Keras methods like `),O=a(j,"CODE",{});var Pe=i(O);we=n(Pe,"fit()"),Pe.forEach(t),fe=n(j," and "),V=a(j,"CODE",{});var Ne=i(V);$e=n(Ne,"predict()"),Ne.forEach(t),ge=n(j,`, such as when creating your own layers or models with
the Keras `),A=a(j,"CODE",{});var Xe=i(A);ce=n(Xe,"Functional"),Xe.forEach(t),Be=n(j,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),j.forEach(t),te=h(f),z=a(f,"UL",{});var Z=i(z);I=a(Z,"LI",{});var X=i(I);_e=n(X,"a single Tensor with "),G=a(X,"CODE",{});var We=i(G);pe=n(We,"input_ids"),We.forEach(t),Fe=n(X," only and nothing else: "),Q=a(X,"CODE",{});var Oe=i(Q);he=n(Oe,"model(input_ids)"),Oe.forEach(t),X.forEach(t),Ee=h(Z),x=a(Z,"LI",{});var H=i(x);se=n(H,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),D=a(H,"CODE",{});var Re=i(D);le=n(Re,"model([input_ids, attention_mask])"),Re.forEach(t),je=n(H," or "),L=a(H,"CODE",{});var Ze=i(L);de=n(Ze,"model([input_ids, attention_mask, token_type_ids])"),Ze.forEach(t),H.forEach(t),Je=h(Z),W=a(Z,"LI",{});var Ue=i(W);be=n(Ue,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),P=a(Ue,"CODE",{});var Ge=i(P);ae=n(Ge,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ge.forEach(t),Ue.forEach(t),Z.forEach(t),ee=h(f),U=a(f,"P",{});var Y=i(U);Ce=n(Y,`Note that when creating models and layers with
`),N=a(Y,"A",{href:!0,rel:!0});var xe=i(N);ze=n(xe,"subclassing"),xe.forEach(t),Me=n(Y,` 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!`),Y.forEach(t),this.h()},h(){g(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),g(N,"rel","nofollow")},m(f,E){_(f,d,E),e(d,y),e(d,m),e(m,u),e(d,M),_(f,l,E),_(f,c,E),e(c,J),e(J,ye),e(c,me),e(c,q),e(q,re),_(f,K,E),_(f,T,E),e(T,Te),e(T,S),e(S,ve),e(T,ue),e(T,R),e(R,ke),e(T,ie),e(T,O),e(O,we),e(T,fe),e(T,V),e(V,$e),e(T,ge),e(T,A),e(A,ce),e(T,Be),_(f,te,E),_(f,z,E),e(z,I),e(I,_e),e(I,G),e(G,pe),e(I,Fe),e(I,Q),e(Q,he),e(z,Ee),e(z,x),e(x,se),e(x,D),e(D,le),e(x,je),e(x,L),e(L,de),e(z,Je),e(z,W),e(W,be),e(W,P),e(P,ae),_(f,ee,E),_(f,U,E),e(U,Ce),e(U,N),e(N,ze),e(U,Me)},d(f){f&&t(d),f&&t(l),f&&t(c),f&&t(K),f&&t(T),f&&t(te),f&&t(z),f&&t(ee),f&&t(U)}}}function k2(C){let d,y,m,u,M;return{c(){d=r("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r("code"),u=o("Module"),M=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 c=i(d);y=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(c,"CODE",{});var J=i(m);u=n(J,"Module"),J.forEach(t),M=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){_(l,d,c),e(d,y),e(d,m),e(m,u),e(d,M)},d(l){l&&t(d)}}}function w2(C){let d,y,m,u,M;return u=new He({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURk1vYmlsZUJlcnRGb3JRdWVzdGlvbkFuc3dlcmluZyUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydnVtaWNoaWVuJTJGbW9iaWxlYmVydC11bmNhc2VkLXNxdWFkLXYyJTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZNb2JpbGVCZXJ0Rm9yUXVlc3Rpb25BbnN3ZXJpbmcuZnJvbV9wcmV0cmFpbmVkKCUyMnZ1bWljaGllbiUyRm1vYmlsZWJlcnQtdW5jYXNlZC1zcXVhZC12MiUyMiklMEElMEFxdWVzdGlvbiUyQyUyMHRleHQlMjAlM0QlMjAlMjJXaG8lMjB3YXMlMjBKaW0lMjBIZW5zb24lM0YlMjIlMkMlMjAlMjJKaW0lMjBIZW5zb24lMjB3YXMlMjBhJTIwbmljZSUyMHB1cHBldCUyMiUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihxdWVzdGlvbiUyQyUyMHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFhbnN3ZXJfc3RhcnRfaW5kZXglMjAlM0QlMjBpbnQodGYubWF0aC5hcmdtYXgob3V0cHV0cy5zdGFydF9sb2dpdHMlMkMlMjBheGlzJTNELTEpJTVCMCU1RCklMEFhbnN3ZXJfZW5kX2luZGV4JTIwJTNEJTIwaW50KHRmLm1hdGguYXJnbWF4KG91dHB1dHMuZW5kX2xvZ2l0cyUyQyUyMGF4aXMlM0QtMSklNUIwJTVEKSUwQSUwQXByZWRpY3RfYW5zd2VyX3Rva2VucyUyMCUzRCUyMGlucHV0cy5pbnB1dF9pZHMlNUIwJTJDJTIwYW5zd2VyX3N0YXJ0X2luZGV4JTIwJTNBJTIwYW5zd2VyX2VuZF9pbmRleCUyMCUyQiUyMDElNUQlMEF0b2tlbml6ZXIuZGVjb2RlKHByZWRpY3RfYW5zd2VyX3Rva2Vucyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFMobileBertForQuestionAnswering
<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;vumichien/mobilebert-uncased-squad-v2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFMobileBertForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;vumichien/mobilebert-uncased-squad-v2&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=r("p"),y=o("Example:"),m=p(),v(u.$$.fragment)},l(l){d=a(l,"P",{});var c=i(d);y=n(c,"Example:"),c.forEach(t),m=h(l),k(u.$$.fragment,l)},m(l,c){_(l,d,c),e(d,y),_(l,m,c),w(u,l,c),M=!0},p:Le,i(l){M||($(u.$$.fragment,l),M=!0)},o(l){B(u.$$.fragment,l),M=!1},d(l){l&&t(d),l&&t(m),F(u,l)}}}function $2(C){let d,y;return d=new He({props:{code:"JTIzJTIwdGFyZ2V0JTIwaXMlMjAlMjJuaWNlJTIwcHVwcGV0JTIyJTBBdGFyZ2V0X3N0YXJ0X2luZGV4JTIwJTNEJTIwdGYuY29uc3RhbnQoJTVCMTIlNUQpJTBBdGFyZ2V0X2VuZF9pbmRleCUyMCUzRCUyMHRmLmNvbnN0YW50KCU1QjEzJTVEKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMHN0YXJ0X3Bvc2l0aW9ucyUzRHRhcmdldF9zdGFydF9pbmRleCUyQyUyMGVuZF9wb3NpdGlvbnMlM0R0YXJnZXRfZW5kX2luZGV4KSUwQWxvc3MlMjAlM0QlMjB0Zi5tYXRoLnJlZHVjZV9tZWFuKG91dHB1dHMubG9zcyklMEFyb3VuZChmbG9hdChsb3NzKSUyQyUyMDIp",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">12</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = tf.constant([<span class="hljs-number">13</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">3.98</span>`}}),{c(){v(d.$$.fragment)},l(m){k(d.$$.fragment,m)},m(m,u){w(d,m,u),y=!0},p:Le,i(m){y||($(d.$$.fragment,m),y=!0)},o(m){B(d.$$.fragment,m),y=!1},d(m){F(d,m)}}}function B2(C){let d,y,m,u,M,l,c,J,ye,me,q,re,K,T,Te,S,ve,ue,R,ke,ie,O,we,fe,V,$e,ge,A,ce,Be,te,z,I,_e,G,pe,Fe,Q,he,Ee,x,se,D,le,je,L,de,Je,W,be,P,ae,ee,U,Ce,N,ze,Me,f,E,Ie,oe,Ve,qe,j,Ae,Se,Pe,Ne,Xe,Z,X,We,Oe,H,Re,Ze,Ue,Ge,Y,xe,gl,Us,qh,_l,Ph,qc,dt,xs,Rh,Qt,Gh,oi,Vh,Ah,ni,Sh,Xh,Is,Oh,Qh,Dh,ho,Lh,si,Hh,Yh,ri,Kh,em,tm,sn,om,bl,nm,Pc,mo,rn,Ml,Ns,sm,yl,rm,Rc,Ke,Ws,am,Tl,im,lm,Zs,dm,ai,cm,pm,hm,Lt,qs,mm,vl,um,fm,Ps,ii,gm,kl,_m,bm,li,Mm,wl,ym,Tm,an,Rs,vm,$l,km,wm,Bt,Gs,$m,Bl,Bm,Fm,ln,Em,uo,jm,Fl,Jm,Cm,El,zm,Um,xm,dn,Vs,Im,As,Nm,jl,Wm,Zm,Gc,fo,cn,Jl,Ss,qm,Cl,Pm,Vc,ct,Xs,Rm,Os,Gm,zl,Vm,Am,Sm,Qs,Xm,di,Om,Qm,Dm,Ht,Ds,Lm,Ul,Hm,Ym,Ls,ci,Km,xl,eu,tu,pi,ou,Il,nu,su,Ft,Hs,ru,Nl,au,iu,pn,lu,go,du,Wl,cu,pu,Zl,hu,mu,Ac,_o,hn,ql,Ys,uu,Pl,fu,Sc,bo,Ks,gu,er,_u,hi,bu,Mu,Xc,Mo,tr,yu,or,Tu,mi,vu,ku,Oc,yo,mn,Rl,nr,wu,Gl,$u,Qc,et,sr,Bu,Vl,Fu,Eu,rr,ju,ui,Ju,Cu,zu,ar,Uu,ir,xu,Iu,Nu,Al,lr,Wu,Zu,Et,dr,qu,To,Pu,fi,Ru,Gu,Sl,Vu,Au,Su,un,Xu,fn,Dc,vo,gn,Xl,cr,Ou,Ol,Qu,Lc,pt,pr,Du,ko,Lu,Ql,Hu,Yu,Dl,Ku,ef,tf,hr,of,gi,nf,sf,rf,mr,af,ur,lf,df,cf,jt,fr,pf,wo,hf,_i,mf,uf,Ll,ff,gf,_f,_n,bf,bn,Hc,$o,Mn,Hl,gr,Mf,Yl,yf,Yc,ht,_r,Tf,br,vf,Kl,kf,wf,$f,Mr,Bf,bi,Ff,Ef,jf,yr,Jf,Tr,Cf,zf,Uf,Jt,vr,xf,Bo,If,Mi,Nf,Wf,ed,Zf,qf,Pf,yn,Rf,Tn,Kc,Fo,vn,td,kr,Gf,od,Vf,ep,mt,wr,Af,$r,Sf,nd,Xf,Of,Qf,Br,Df,yi,Lf,Hf,Yf,Fr,Kf,Er,eg,tg,og,Ct,jr,ng,Eo,sg,Ti,rg,ag,sd,ig,lg,dg,kn,cg,wn,tp,jo,$n,rd,Jr,pg,ad,hg,op,ut,Cr,mg,id,ug,fg,zr,gg,vi,_g,bg,Mg,Ur,yg,xr,Tg,vg,kg,bt,Ir,wg,Jo,$g,ki,Bg,Fg,ld,Eg,jg,Jg,Bn,Cg,Fn,zg,En,np,Co,jn,dd,Nr,Ug,cd,xg,sp,ft,Wr,Ig,pd,Ng,Wg,Zr,Zg,wi,qg,Pg,Rg,qr,Gg,Pr,Vg,Ag,Sg,zt,Rr,Xg,zo,Og,$i,Qg,Dg,hd,Lg,Hg,Yg,Jn,Kg,Cn,rp,Uo,zn,md,Gr,e_,ud,t_,ap,gt,Vr,o_,fd,n_,s_,Ar,r_,Bi,a_,i_,l_,Sr,d_,Xr,c_,p_,h_,Ut,Or,m_,xo,u_,Fi,f_,g_,gd,__,b_,M_,Un,y_,xn,ip,Io,In,_d,Qr,T_,bd,v_,lp,_t,Dr,k_,No,w_,Md,$_,B_,yd,F_,E_,j_,Lr,J_,Ei,C_,z_,U_,Hr,x_,Yr,I_,N_,W_,xt,Kr,Z_,Wo,q_,ji,P_,R_,Td,G_,V_,A_,Nn,S_,Wn,dp,Zo,Zn,vd,ea,X_,kd,O_,cp,tt,ta,Q_,wd,D_,L_,oa,H_,Ji,Y_,K_,eb,na,tb,sa,ob,nb,sb,qn,rb,It,ra,ab,qo,ib,Ci,lb,db,$d,cb,pb,hb,Pn,mb,Rn,pp,Po,Gn,Bd,aa,ub,Fd,fb,hp,ot,ia,gb,Ro,_b,Ed,bb,Mb,jd,yb,Tb,vb,la,kb,zi,wb,$b,Bb,da,Fb,ca,Eb,jb,Jb,Vn,Cb,Nt,pa,zb,Go,Ub,Ui,xb,Ib,Jd,Nb,Wb,Zb,An,qb,Sn,mp,Vo,Xn,Cd,ha,Pb,zd,Rb,up,nt,ma,Gb,ua,Vb,Ud,Ab,Sb,Xb,fa,Ob,xi,Qb,Db,Lb,ga,Hb,_a,Yb,Kb,eM,On,tM,Mt,ba,oM,Ao,nM,Ii,sM,rM,xd,aM,iM,lM,Qn,dM,Dn,cM,Ln,fp,So,Hn,Id,Ma,pM,Nd,hM,gp,st,ya,mM,Ta,uM,Wd,fM,gM,_M,va,bM,Ni,MM,yM,TM,ka,vM,wa,kM,wM,$M,Yn,BM,Wt,$a,FM,Xo,EM,Wi,jM,JM,Zd,CM,zM,UM,Kn,xM,es,_p,Oo,ts,qd,Ba,IM,Pd,NM,bp,rt,Fa,WM,Rd,ZM,qM,Ea,PM,Zi,RM,GM,VM,ja,AM,Ja,SM,XM,OM,os,QM,yt,Ca,DM,Qo,LM,qi,HM,YM,Gd,KM,ey,ty,ns,oy,ss,ny,rs,Mp,Do,as,Vd,za,sy,Ad,ry,yp,at,Ua,ay,Sd,iy,ly,xa,dy,Pi,cy,py,hy,Ia,my,Na,uy,fy,gy,is,_y,Zt,Wa,by,Lo,My,Ri,yy,Ty,Xd,vy,ky,wy,ls,$y,ds,Tp,Ho,cs,Od,Za,By,Qd,Fy,vp,it,qa,Ey,Dd,jy,Jy,Pa,Cy,Gi,zy,Uy,xy,Ra,Iy,Ga,Ny,Wy,Zy,ps,qy,Tt,Va,Py,Yo,Ry,Vi,Gy,Vy,Ld,Ay,Sy,Xy,hs,Oy,ms,Qy,us,kp,Ko,fs,Hd,Aa,Dy,Yd,Ly,wp,lt,Sa,Hy,en,Yy,Kd,Ky,eT,ec,tT,oT,nT,Xa,sT,Ai,rT,aT,iT,Oa,lT,Qa,dT,cT,pT,gs,hT,vt,Da,mT,tn,uT,Si,fT,gT,tc,_T,bT,MT,_s,yT,bs,TT,Ms,$p;return l=new Ye({}),T=new Ye({}),U=new Ye({}),Us=new Ye({}),xs=new ne({props:{name:"class transformers.MobileBertConfig",anchor:"transformers.MobileBertConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 512"},{name:"num_hidden_layers",val:" = 24"},{name:"num_attention_heads",val:" = 4"},{name:"intermediate_size",val:" = 512"},{name:"hidden_act",val:" = 'relu'"},{name:"hidden_dropout_prob",val:" = 0.0"},{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:"embedding_size",val:" = 128"},{name:"trigram_input",val:" = True"},{name:"use_bottleneck",val:" = True"},{name:"intra_bottleneck_size",val:" = 128"},{name:"use_bottleneck_attention",val:" = False"},{name:"key_query_shared_bottleneck",val:" = True"},{name:"num_feedforward_networks",val:" = 4"},{name:"normalization_type",val:" = 'no_norm'"},{name:"classifier_activation",val:" = True"},{name:"classifier_dropout",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MobileBertConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the MobileBERT 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.33.0/en/model_doc/mobilebert#transformers.MobileBertModel">MobileBertModel</a> or <a href="/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.TFMobileBertModel">TFMobileBertModel</a>.`,name:"vocab_size"},{anchor:"transformers.MobileBertConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.MobileBertConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 24) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.MobileBertConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.MobileBertConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.MobileBertConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;relu&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.MobileBertConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.MobileBertConfig.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.MobileBertConfig.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.MobileBertConfig.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.33.0/en/model_doc/mobilebert#transformers.MobileBertModel">MobileBertModel</a> or
<a href="/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.TFMobileBertModel">TFMobileBertModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.MobileBertConfig.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.MobileBertConfig.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.MobileBertConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
The ID of the token in the word embedding to use as padding.`,name:"pad_token_id"},{anchor:"transformers.MobileBertConfig.embedding_size",description:`<strong>embedding_size</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
The dimension of the word embedding vectors.`,name:"embedding_size"},{anchor:"transformers.MobileBertConfig.trigram_input",description:`<strong>trigram_input</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Use a convolution of trigram as input.`,name:"trigram_input"},{anchor:"transformers.MobileBertConfig.use_bottleneck",description:`<strong>use_bottleneck</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use bottleneck in BERT.`,name:"use_bottleneck"},{anchor:"transformers.MobileBertConfig.intra_bottleneck_size",description:`<strong>intra_bottleneck_size</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
Size of bottleneck layer output.`,name:"intra_bottleneck_size"},{anchor:"transformers.MobileBertConfig.use_bottleneck_attention",description:`<strong>use_bottleneck_attention</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use attention inputs from the bottleneck transformation.`,name:"use_bottleneck_attention"},{anchor:"transformers.MobileBertConfig.key_query_shared_bottleneck",description:`<strong>key_query_shared_bottleneck</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use the same linear transformation for query&amp;key in the bottleneck.`,name:"key_query_shared_bottleneck"},{anchor:"transformers.MobileBertConfig.num_feedforward_networks",description:`<strong>num_feedforward_networks</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Number of FFNs in a block.`,name:"num_feedforward_networks"},{anchor:"transformers.MobileBertConfig.normalization_type",description:`<strong>normalization_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;no_norm&quot;</code>) &#x2014;
The normalization type in MobileBERT.`,name:"normalization_type"},{anchor:"transformers.MobileBertConfig.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.33.0/src/transformers/models/mobilebert/configuration_mobilebert.py#L31"}}),sn=new De({props:{anchor:"transformers.MobileBertConfig.example",$$slots:{default:[zw]},$$scope:{ctx:C}}}),Ns=new Ye({}),Ws=new ne({props:{name:"class transformers.MobileBertTokenizer",anchor:"transformers.MobileBertTokenizer",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.MobileBertTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.MobileBertTokenizer.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.MobileBertTokenizer.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.MobileBertTokenizer.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.MobileBertTokenizer.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.MobileBertTokenizer.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.MobileBertTokenizer.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.MobileBertTokenizer.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.MobileBertTokenizer.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.MobileBertTokenizer.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.MobileBertTokenizer.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 MobileBERT).`,name:"strip_accents"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/mobilebert/tokenization_mobilebert.py#L65"}}),qs=new ne({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.MobileBertTokenizer.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.MobileBertTokenizer.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.MobileBertTokenizer.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.33.0/src/transformers/models/mobilebert/tokenization_mobilebert.py#L197",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>
`}}),Rs=new ne({props:{name:"convert_tokens_to_string",anchor:"transformers.MobileBertTokenizer.convert_tokens_to_string",parameters:[{name:"tokens",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/mobilebert/tokenization_mobilebert.py#L192"}}),Gs=new ne({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.MobileBertTokenizer.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.MobileBertTokenizer.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.MobileBertTokenizer.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.33.0/src/transformers/models/mobilebert/tokenization_mobilebert.py#L250",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>
`}}),ln=new De({props:{anchor:"transformers.MobileBertTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[Uw]},$$scope:{ctx:C}}}),Vs=new ne({props:{name:"get_special_tokens_mask",anchor:"transformers.MobileBertTokenizer.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.MobileBertTokenizer.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.MobileBertTokenizer.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.MobileBertTokenizer.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.33.0/src/transformers/models/mobilebert/tokenization_mobilebert.py#L222",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>
`}}),Ss=new Ye({}),Xs=new ne({props:{name:"class transformers.MobileBertTokenizerFast",anchor:"transformers.MobileBertTokenizerFast",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.MobileBertTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.MobileBertTokenizerFast.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.MobileBertTokenizerFast.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.MobileBertTokenizerFast.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.MobileBertTokenizerFast.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.MobileBertTokenizerFast.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.MobileBertTokenizerFast.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.MobileBertTokenizerFast.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.MobileBertTokenizerFast.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.MobileBertTokenizerFast.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 MobileBERT).`,name:"strip_accents"},{anchor:"transformers.MobileBertTokenizerFast.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.33.0/src/transformers/models/mobilebert/tokenization_mobilebert_fast.py#L46"}}),Ds=new ne({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.MobileBertTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:""},{name:"token_ids_1",val:" = None"}],parametersDescription:[{anchor:"transformers.MobileBertTokenizerFast.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.MobileBertTokenizerFast.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.33.0/src/transformers/models/mobilebert/tokenization_mobilebert_fast.py#L134",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>
`}}),Hs=new ne({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.MobileBertTokenizerFast.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.MobileBertTokenizerFast.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.MobileBertTokenizerFast.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.33.0/src/transformers/models/mobilebert/tokenization_mobilebert_fast.py#L158",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>
`}}),pn=new De({props:{anchor:"transformers.MobileBertTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[xw]},$$scope:{ctx:C}}}),Ys=new Ye({}),Ks=new ne({props:{name:"class transformers.models.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput",anchor:"transformers.models.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput",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.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput.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.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput.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.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput.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.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput.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.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput.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.33.0/src/transformers/models/mobilebert/modeling_mobilebert.py#L710"}}),tr=new ne({props:{name:"class transformers.models.mobilebert.modeling_tf_mobilebert.TFMobileBertForPreTrainingOutput",anchor:"transformers.models.mobilebert.modeling_tf_mobilebert.TFMobileBertForPreTrainingOutput",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:": Tuple[tf.Tensor] | None = None"},{name:"attentions",val:": Tuple[tf.Tensor] | None = None"}],parametersDescription:[{anchor:"transformers.models.mobilebert.modeling_tf_mobilebert.TFMobileBertForPreTrainingOutput.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.mobilebert.modeling_tf_mobilebert.TFMobileBertForPreTrainingOutput.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.mobilebert.modeling_tf_mobilebert.TFMobileBertForPreTrainingOutput.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.mobilebert.modeling_tf_mobilebert.TFMobileBertForPreTrainingOutput.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.33.0/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L829"}}),nr=new Ye({}),sr=new ne({props:{name:"class transformers.MobileBertModel",anchor:"transformers.MobileBertModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.MobileBertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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.33.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.33.0/src/transformers/models/mobilebert/modeling_mobilebert.py#L813"}}),dr=new ne({props:{name:"forward",anchor:"transformers.MobileBertModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MobileBertModel.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.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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.MobileBertModel.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.MobileBertModel.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.MobileBertModel.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.MobileBertModel.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.MobileBertModel.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.MobileBertModel.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.MobileBertModel.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.MobileBertModel.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.33.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.33.0/src/transformers/models/mobilebert/modeling_mobilebert.py#L843",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</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.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),un=new Qe({props:{$$slots:{default:[Iw]},$$scope:{ctx:C}}}),fn=new De({props:{anchor:"transformers.MobileBertModel.forward.example",$$slots:{default:[Nw]},$$scope:{ctx:C}}}),cr=new Ye({}),pr=new ne({props:{name:"class transformers.MobileBertForPreTraining",anchor:"transformers.MobileBertForPreTraining",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.MobileBertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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.33.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.33.0/src/transformers/models/mobilebert/modeling_mobilebert.py#L927"}}),fr=new ne({props:{name:"forward",anchor:"transformers.MobileBertForPreTraining.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"next_sentence_label",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"return_dict",val:": typing.Optional[torch.FloatTensor] = None"}],parametersDescription:[{anchor:"transformers.MobileBertForPreTraining.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.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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.MobileBertForPreTraining.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.MobileBertForPreTraining.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.MobileBertForPreTraining.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.MobileBertForPreTraining.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.MobileBertForPreTraining.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.MobileBertForPreTraining.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.MobileBertForPreTraining.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.MobileBertForPreTraining.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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MobileBertForPreTraining.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.MobileBertForPreTraining.forward.next_sentence_label",description:`<strong>next_sentence_label</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the next sequence prediction (classification) loss. Input should be a sequence pair
(see <code>input_ids</code> docstring) Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates sequence B is a continuation of sequence A,</li>
<li>1 indicates sequence B is a random sequence.</li>
</ul>`,name:"next_sentence_label"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/mobilebert/modeling_mobilebert.py#L952",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.models.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput"
>transformers.models.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput</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.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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.33.0/en/model_doc/mobilebert#transformers.models.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput"
>transformers.models.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),_n=new Qe({props:{$$slots:{default:[Ww]},$$scope:{ctx:C}}}),bn=new De({props:{anchor:"transformers.MobileBertForPreTraining.forward.example",$$slots:{default:[Zw]},$$scope:{ctx:C}}}),gr=new Ye({}),_r=new ne({props:{name:"class transformers.MobileBertForMaskedLM",anchor:"transformers.MobileBertForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.MobileBertForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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.33.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.33.0/src/transformers/models/mobilebert/modeling_mobilebert.py#L1035"}}),vr=new ne({props:{name:"forward",anchor:"transformers.MobileBertForMaskedLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.MobileBertForMaskedLM.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.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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.MobileBertForMaskedLM.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.MobileBertForMaskedLM.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.MobileBertForMaskedLM.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.MobileBertForMaskedLM.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.MobileBertForMaskedLM.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.MobileBertForMaskedLM.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.MobileBertForMaskedLM.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.MobileBertForMaskedLM.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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MobileBertForMaskedLM.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.33.0/src/transformers/models/mobilebert/modeling_mobilebert.py#L1060",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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.33.0/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),yn=new Qe({props:{$$slots:{default:[qw]},$$scope:{ctx:C}}}),Tn=new De({props:{anchor:"transformers.MobileBertForMaskedLM.forward.example",$$slots:{default:[Pw]},$$scope:{ctx:C}}}),kr=new Ye({}),wr=new ne({props:{name:"class transformers.MobileBertForNextSentencePrediction",anchor:"transformers.MobileBertForNextSentencePrediction",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.MobileBertForNextSentencePrediction.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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.33.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.33.0/src/transformers/models/mobilebert/modeling_mobilebert.py#L1135"}}),jr=new ne({props:{name:"forward",anchor:"transformers.MobileBertForNextSentencePrediction.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.MobileBertForNextSentencePrediction.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.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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.MobileBertForNextSentencePrediction.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.MobileBertForNextSentencePrediction.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.MobileBertForNextSentencePrediction.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.MobileBertForNextSentencePrediction.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.MobileBertForNextSentencePrediction.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.MobileBertForNextSentencePrediction.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.MobileBertForNextSentencePrediction.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.MobileBertForNextSentencePrediction.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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MobileBertForNextSentencePrediction.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.33.0/src/transformers/models/mobilebert/modeling_mobilebert.py#L1145",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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.33.0/en/main_classes/output#transformers.modeling_outputs.NextSentencePredictorOutput"
>transformers.modeling_outputs.NextSentencePredictorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),kn=new Qe({props:{$$slots:{default:[Rw]},$$scope:{ctx:C}}}),wn=new De({props:{anchor:"transformers.MobileBertForNextSentencePrediction.forward.example",$$slots:{default:[Gw]},$$scope:{ctx:C}}}),Jr=new Ye({}),Cr=new ne({props:{name:"class transformers.MobileBertForSequenceClassification",anchor:"transformers.MobileBertForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.MobileBertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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.33.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.33.0/src/transformers/models/mobilebert/modeling_mobilebert.py#L1239"}}),Ir=new ne({props:{name:"forward",anchor:"transformers.MobileBertForSequenceClassification.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.MobileBertForSequenceClassification.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.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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.MobileBertForSequenceClassification.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.MobileBertForSequenceClassification.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.MobileBertForSequenceClassification.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.MobileBertForSequenceClassification.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.MobileBertForSequenceClassification.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.MobileBertForSequenceClassification.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.MobileBertForSequenceClassification.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.MobileBertForSequenceClassification.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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MobileBertForSequenceClassification.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.33.0/src/transformers/models/mobilebert/modeling_mobilebert.py#L1255",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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.33.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Bn=new Qe({props:{$$slots:{default:[Vw]},$$scope:{ctx:C}}}),Fn=new De({props:{anchor:"transformers.MobileBertForSequenceClassification.forward.example",$$slots:{default:[Aw]},$$scope:{ctx:C}}}),En=new De({props:{anchor:"transformers.MobileBertForSequenceClassification.forward.example-2",$$slots:{default:[Sw]},$$scope:{ctx:C}}}),Nr=new Ye({}),Wr=new ne({props:{name:"class transformers.MobileBertForMultipleChoice",anchor:"transformers.MobileBertForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.MobileBertForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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.33.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.33.0/src/transformers/models/mobilebert/modeling_mobilebert.py#L1447"}}),Rr=new ne({props:{name:"forward",anchor:"transformers.MobileBertForMultipleChoice.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.MobileBertForMultipleChoice.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.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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.MobileBertForMultipleChoice.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.MobileBertForMultipleChoice.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.MobileBertForMultipleChoice.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.MobileBertForMultipleChoice.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.MobileBertForMultipleChoice.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.MobileBertForMultipleChoice.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.MobileBertForMultipleChoice.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.MobileBertForMultipleChoice.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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MobileBertForMultipleChoice.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.33.0/src/transformers/models/mobilebert/modeling_mobilebert.py#L1461",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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.33.0/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Jn=new Qe({props:{$$slots:{default:[Xw]},$$scope:{ctx:C}}}),Cn=new De({props:{anchor:"transformers.MobileBertForMultipleChoice.forward.example",$$slots:{default:[Ow]},$$scope:{ctx:C}}}),Gr=new Ye({}),Vr=new ne({props:{name:"class transformers.MobileBertForTokenClassification",anchor:"transformers.MobileBertForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.MobileBertForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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.33.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.33.0/src/transformers/models/mobilebert/modeling_mobilebert.py#L1544"}}),Or=new ne({props:{name:"forward",anchor:"transformers.MobileBertForTokenClassification.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.MobileBertForTokenClassification.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.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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.MobileBertForTokenClassification.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.MobileBertForTokenClassification.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.MobileBertForTokenClassification.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.MobileBertForTokenClassification.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.MobileBertForTokenClassification.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.MobileBertForTokenClassification.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.MobileBertForTokenClassification.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.MobileBertForTokenClassification.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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MobileBertForTokenClassification.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.33.0/src/transformers/models/mobilebert/modeling_mobilebert.py#L1559",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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.33.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Un=new Qe({props:{$$slots:{default:[Qw]},$$scope:{ctx:C}}}),xn=new De({props:{anchor:"transformers.MobileBertForTokenClassification.forward.example",$$slots:{default:[Dw]},$$scope:{ctx:C}}}),Qr=new Ye({}),Dr=new ne({props:{name:"class transformers.MobileBertForQuestionAnswering",anchor:"transformers.MobileBertForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.MobileBertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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.33.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.33.0/src/transformers/models/mobilebert/modeling_mobilebert.py#L1343"}}),Kr=new ne({props:{name:"forward",anchor:"transformers.MobileBertForQuestionAnswering.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.MobileBertForQuestionAnswering.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.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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.MobileBertForQuestionAnswering.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.MobileBertForQuestionAnswering.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.MobileBertForQuestionAnswering.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.MobileBertForQuestionAnswering.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.MobileBertForQuestionAnswering.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.MobileBertForQuestionAnswering.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.MobileBertForQuestionAnswering.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.MobileBertForQuestionAnswering.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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MobileBertForQuestionAnswering.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.MobileBertForQuestionAnswering.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.33.0/src/transformers/models/mobilebert/modeling_mobilebert.py#L1354",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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.33.0/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Nn=new Qe({props:{$$slots:{default:[Lw]},$$scope:{ctx:C}}}),Wn=new De({props:{anchor:"transformers.MobileBertForQuestionAnswering.forward.example",$$slots:{default:[Hw]},$$scope:{ctx:C}}}),ea=new Ye({}),ta=new ne({props:{name:"class transformers.TFMobileBertModel",anchor:"transformers.TFMobileBertModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMobileBertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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.33.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.33.0/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L961"}}),qn=new Qe({props:{$$slots:{default:[Yw]},$$scope:{ctx:C}}}),ra=new ne({props:{name:"call",anchor:"transformers.TFMobileBertModel.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFMobileBertModel.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.33.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.TFMobileBertModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFMobileBertModel.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>Numpy array</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.TFMobileBertModel.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFMobileBertModel.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFMobileBertModel.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFMobileBertModel.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.TFMobileBertModel.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.TFMobileBertModel.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.33.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.TFMobileBertModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L966",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</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.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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>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.33.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Pn=new Qe({props:{$$slots:{default:[Kw]},$$scope:{ctx:C}}}),Rn=new De({props:{anchor:"transformers.TFMobileBertModel.call.example",$$slots:{default:[e2]},$$scope:{ctx:C}}}),aa=new Ye({}),ia=new ne({props:{name:"class transformers.TFMobileBertForPreTraining",anchor:"transformers.TFMobileBertForPreTraining",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMobileBertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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.33.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.33.0/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1009"}}),Vn=new Qe({props:{$$slots:{default:[t2]},$$scope:{ctx:C}}}),pa=new ne({props:{name:"call",anchor:"transformers.TFMobileBertForPreTraining.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.TFMobileBertForPreTraining.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.33.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.TFMobileBertForPreTraining.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFMobileBertForPreTraining.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>Numpy array</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.TFMobileBertForPreTraining.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFMobileBertForPreTraining.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFMobileBertForPreTraining.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFMobileBertForPreTraining.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.TFMobileBertForPreTraining.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.TFMobileBertForPreTraining.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.33.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.TFMobileBertForPreTraining.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1023",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.models.mobilebert.modeling_tf_mobilebert.TFMobileBertForPreTrainingOutput"
>transformers.models.mobilebert.modeling_tf_mobilebert.TFMobileBertForPreTrainingOutput</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.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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.33.0/en/model_doc/mobilebert#transformers.models.mobilebert.modeling_tf_mobilebert.TFMobileBertForPreTrainingOutput"
>transformers.models.mobilebert.modeling_tf_mobilebert.TFMobileBertForPreTrainingOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),An=new Qe({props:{$$slots:{default:[o2]},$$scope:{ctx:C}}}),Sn=new De({props:{anchor:"transformers.TFMobileBertForPreTraining.call.example",$$slots:{default:[n2]},$$scope:{ctx:C}}}),ha=new Ye({}),ma=new ne({props:{name:"class transformers.TFMobileBertForMaskedLM",anchor:"transformers.TFMobileBertForMaskedLM",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMobileBertForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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.33.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.33.0/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1093"}}),On=new Qe({props:{$$slots:{default:[s2]},$$scope:{ctx:C}}}),ba=new ne({props:{name:"call",anchor:"transformers.TFMobileBertForMaskedLM.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.TFMobileBertForMaskedLM.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.33.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.TFMobileBertForMaskedLM.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFMobileBertForMaskedLM.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>Numpy array</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.TFMobileBertForMaskedLM.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFMobileBertForMaskedLM.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFMobileBertForMaskedLM.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFMobileBertForMaskedLM.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.TFMobileBertForMaskedLM.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.TFMobileBertForMaskedLM.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.33.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.TFMobileBertForMaskedLM.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFMobileBertForMaskedLM.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`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1114",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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.33.0/en/main_classes/output#transformers.modeling_tf_outputs.TFMaskedLMOutput"
>transformers.modeling_tf_outputs.TFMaskedLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Qn=new Qe({props:{$$slots:{default:[r2]},$$scope:{ctx:C}}}),Dn=new De({props:{anchor:"transformers.TFMobileBertForMaskedLM.call.example",$$slots:{default:[a2]},$$scope:{ctx:C}}}),Ln=new De({props:{anchor:"transformers.TFMobileBertForMaskedLM.call.example-2",$$slots:{default:[i2]},$$scope:{ctx:C}}}),Ma=new Ye({}),ya=new ne({props:{name:"class transformers.TFMobileBertForNextSentencePrediction",anchor:"transformers.TFMobileBertForNextSentencePrediction",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMobileBertForNextSentencePrediction.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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.33.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.33.0/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1186"}}),Yn=new Qe({props:{$$slots:{default:[l2]},$$scope:{ctx:C}}}),$a=new ne({props:{name:"call",anchor:"transformers.TFMobileBertForNextSentencePrediction.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.TFMobileBertForNextSentencePrediction.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.33.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.TFMobileBertForNextSentencePrediction.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFMobileBertForNextSentencePrediction.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>Numpy array</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.TFMobileBertForNextSentencePrediction.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFMobileBertForNextSentencePrediction.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFMobileBertForNextSentencePrediction.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFMobileBertForNextSentencePrediction.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.TFMobileBertForNextSentencePrediction.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.TFMobileBertForNextSentencePrediction.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.33.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.TFMobileBertForNextSentencePrediction.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1196",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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.33.0/en/main_classes/output#transformers.modeling_tf_outputs.TFNextSentencePredictorOutput"
>transformers.modeling_tf_outputs.TFNextSentencePredictorOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Kn=new Qe({props:{$$slots:{default:[d2]},$$scope:{ctx:C}}}),es=new De({props:{anchor:"transformers.TFMobileBertForNextSentencePrediction.call.example",$$slots:{default:[c2]},$$scope:{ctx:C}}}),Ba=new Ye({}),Fa=new ne({props:{name:"class transformers.TFMobileBertForSequenceClassification",anchor:"transformers.TFMobileBertForSequenceClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMobileBertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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.33.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.33.0/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1271"}}),os=new Qe({props:{$$slots:{default:[p2]},$$scope:{ctx:C}}}),Ca=new ne({props:{name:"call",anchor:"transformers.TFMobileBertForSequenceClassification.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.TFMobileBertForSequenceClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.33.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.TFMobileBertForSequenceClassification.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFMobileBertForSequenceClassification.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>Numpy array</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.TFMobileBertForSequenceClassification.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFMobileBertForSequenceClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFMobileBertForSequenceClassification.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFMobileBertForSequenceClassification.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.TFMobileBertForSequenceClassification.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.TFMobileBertForSequenceClassification.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.33.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.TFMobileBertForSequenceClassification.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFMobileBertForSequenceClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1294",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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.33.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ns=new Qe({props:{$$slots:{default:[h2]},$$scope:{ctx:C}}}),ss=new De({props:{anchor:"transformers.TFMobileBertForSequenceClassification.call.example",$$slots:{default:[m2]},$$scope:{ctx:C}}}),rs=new De({props:{anchor:"transformers.TFMobileBertForSequenceClassification.call.example-2",$$slots:{default:[u2]},$$scope:{ctx:C}}}),za=new Ye({}),Ua=new ne({props:{name:"class transformers.TFMobileBertForMultipleChoice",anchor:"transformers.TFMobileBertForMultipleChoice",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMobileBertForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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.33.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.33.0/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1460"}}),is=new Qe({props:{$$slots:{default:[f2]},$$scope:{ctx:C}}}),Wa=new ne({props:{name:"call",anchor:"transformers.TFMobileBertForMultipleChoice.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.TFMobileBertForMultipleChoice.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.33.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.TFMobileBertForMultipleChoice.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFMobileBertForMultipleChoice.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
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.TFMobileBertForMultipleChoice.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFMobileBertForMultipleChoice.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFMobileBertForMultipleChoice.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFMobileBertForMultipleChoice.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.TFMobileBertForMultipleChoice.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.TFMobileBertForMultipleChoice.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.33.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.TFMobileBertForMultipleChoice.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFMobileBertForMultipleChoice.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the multiple choice classification loss. Indices should be in <code>[0, ..., num_choices]</code>
where <code>num_choices</code> is the size of the second dimension of the input tensors. (See <code>input_ids</code> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1479",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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.33.0/en/main_classes/output#transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput"
>transformers.modeling_tf_outputs.TFMultipleChoiceModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ls=new Qe({props:{$$slots:{default:[g2]},$$scope:{ctx:C}}}),ds=new De({props:{anchor:"transformers.TFMobileBertForMultipleChoice.call.example",$$slots:{default:[_2]},$$scope:{ctx:C}}}),Za=new Ye({}),qa=new ne({props:{name:"class transformers.TFMobileBertForTokenClassification",anchor:"transformers.TFMobileBertForTokenClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMobileBertForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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.33.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.33.0/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1561"}}),ps=new Qe({props:{$$slots:{default:[b2]},$$scope:{ctx:C}}}),Va=new ne({props:{name:"call",anchor:"transformers.TFMobileBertForTokenClassification.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.TFMobileBertForTokenClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.33.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.TFMobileBertForTokenClassification.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFMobileBertForTokenClassification.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>Numpy array</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.TFMobileBertForTokenClassification.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFMobileBertForTokenClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFMobileBertForTokenClassification.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFMobileBertForTokenClassification.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.TFMobileBertForTokenClassification.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.TFMobileBertForTokenClassification.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.33.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.TFMobileBertForTokenClassification.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFMobileBertForTokenClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1585",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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.33.0/en/main_classes/output#transformers.modeling_tf_outputs.TFTokenClassifierOutput"
>transformers.modeling_tf_outputs.TFTokenClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),hs=new Qe({props:{$$slots:{default:[M2]},$$scope:{ctx:C}}}),ms=new De({props:{anchor:"transformers.TFMobileBertForTokenClassification.call.example",$$slots:{default:[y2]},$$scope:{ctx:C}}}),us=new De({props:{anchor:"transformers.TFMobileBertForTokenClassification.call.example-2",$$slots:{default:[T2]},$$scope:{ctx:C}}}),Aa=new Ye({}),Sa=new ne({props:{name:"class transformers.TFMobileBertForQuestionAnswering",anchor:"transformers.TFMobileBertForQuestionAnswering",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMobileBertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig">MobileBertConfig</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.33.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.33.0/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1361"}}),gs=new Qe({props:{$$slots:{default:[v2]},$$scope:{ctx:C}}}),Da=new ne({props:{name:"call",anchor:"transformers.TFMobileBertForQuestionAnswering.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.TFMobileBertForQuestionAnswering.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.33.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.TFMobileBertForQuestionAnswering.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFMobileBertForQuestionAnswering.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>Numpy array</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.TFMobileBertForQuestionAnswering.call.position_ids",description:`<strong>position_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFMobileBertForQuestionAnswering.call.head_mask",description:`<strong>head_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFMobileBertForQuestionAnswering.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFMobileBertForQuestionAnswering.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.TFMobileBertForQuestionAnswering.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.TFMobileBertForQuestionAnswering.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.33.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.TFMobileBertForQuestionAnswering.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFMobileBertForQuestionAnswering.call.start_positions",description:`<strong>start_positions</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.TFMobileBertForQuestionAnswering.call.end_positions",description:`<strong>end_positions</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/mobilebert/modeling_tf_mobilebert.py#L1380",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.0/en/model_doc/mobilebert#transformers.MobileBertConfig"
>MobileBertConfig</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.33.0/en/main_classes/output#transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput"
>transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),_s=new Qe({props:{$$slots:{default:[k2]},$$scope:{ctx:C}}}),bs=new De({props:{anchor:"transformers.TFMobileBertForQuestionAnswering.call.example",$$slots:{default:[w2]},$$scope:{ctx:C}}}),Ms=new De({props:{anchor:"transformers.TFMobileBertForQuestionAnswering.call.example-2",$$slots:{default:[$2]},$$scope:{ctx:C}}}),{c(){d=r("meta"),y=p(),m=r("h1"),u=r("a"),M=r("span"),v(l.$$.fragment),c=p(),J=r("span"),ye=o("MobileBERT"),me=p(),q=r("h2"),re=r("a"),K=r("span"),v(T.$$.fragment),Te=p(),S=r("span"),ve=o("Overview"),ue=p(),R=r("p"),ke=o("The MobileBERT model was proposed in "),ie=r("a"),O=o("MobileBERT: a Compact Task-Agnostic BERT for Resource-Limited Devices"),we=o(` by Zhiqing Sun, Hongkun Yu, Xiaodan Song, Renjie Liu, Yiming Yang, and Denny
Zhou. It\u2019s a bidirectional transformer based on the BERT model, which is compressed and accelerated using several
approaches.`),fe=p(),V=r("p"),$e=o("The abstract from the paper is the following:"),ge=p(),A=r("p"),ce=r("em"),Be=o(`Natural Language Processing (NLP) has recently achieved great success by using huge pre-trained models with hundreds
of millions of parameters. However, these models suffer from heavy model sizes and high latency such that they cannot
be deployed to resource-limited mobile devices. In this paper, we propose MobileBERT for compressing and accelerating
the popular BERT model. Like the original BERT, MobileBERT is task-agnostic, that is, it can be generically applied to
various downstream NLP tasks via simple fine-tuning. Basically, MobileBERT is a thin version of BERT_LARGE, while
equipped with bottleneck structures and a carefully designed balance between self-attentions and feed-forward networks.
To train MobileBERT, we first train a specially designed teacher model, an inverted-bottleneck incorporated BERT_LARGE
model. Then, we conduct knowledge transfer from this teacher to MobileBERT. Empirical studies show that MobileBERT is
4.3x smaller and 5.5x faster than BERT_BASE while achieving competitive results on well-known benchmarks. On the
natural language inference tasks of GLUE, MobileBERT achieves a GLUEscore o 77.7 (0.6 lower than BERT_BASE), and 62 ms
latency on a Pixel 4 phone. On the SQuAD v1.1/v2.0 question answering task, MobileBERT achieves a dev F1 score of
90.0/79.2 (1.5/2.1 higher than BERT_BASE).`),te=p(),z=r("p"),I=o("Tips:"),_e=p(),G=r("ul"),pe=r("li"),Fe=o(`MobileBERT is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather
than the left.`),Q=p(),he=r("li"),Ee=o(`MobileBERT is similar to BERT and therefore relies on the masked language modeling (MLM) objective. It is therefore
efficient at predicting masked tokens and at NLU in general, but is not optimal for text generation. Models trained
with a causal language modeling (CLM) objective are better in that regard.`),x=p(),se=r("p"),D=o("This model was contributed by "),le=r("a"),je=o("vshampor"),L=o(". The original code can be found "),de=r("a"),Je=o("here"),W=o("."),be=p(),P=r("h2"),ae=r("a"),ee=r("span"),v(U.$$.fragment),Ce=p(),N=r("span"),ze=o("Documentation resources"),Me=p(),f=r("ul"),E=r("li"),Ie=r("a"),oe=o("Text classification task guide"),Ve=p(),qe=r("li"),j=r("a"),Ae=o("Token classification task guide"),Se=p(),Pe=r("li"),Ne=r("a"),Xe=o("Question answering task guide"),Z=p(),X=r("li"),We=r("a"),Oe=o("Masked language modeling task guide"),H=p(),Re=r("li"),Ze=r("a"),Ue=o("Multiple choice task guide"),Ge=p(),Y=r("h2"),xe=r("a"),gl=r("span"),v(Us.$$.fragment),qh=p(),_l=r("span"),Ph=o("MobileBertConfig"),qc=p(),dt=r("div"),v(xs.$$.fragment),Rh=p(),Qt=r("p"),Gh=o("This is the configuration class to store the configuration of a "),oi=r("a"),Vh=o("MobileBertModel"),Ah=o(" or a "),ni=r("a"),Sh=o("TFMobileBertModel"),Xh=o(`. It
is used to instantiate a MobileBERT 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 MobileBERT
`),Is=r("a"),Oh=o("google/mobilebert-uncased"),Qh=o(" architecture."),Dh=p(),ho=r("p"),Lh=o("Configuration objects inherit from "),si=r("a"),Hh=o("PretrainedConfig"),Yh=o(` and can be used to control the model outputs. Read the
documentation from `),ri=r("a"),Kh=o("PretrainedConfig"),em=o(" for more information."),tm=p(),v(sn.$$.fragment),om=p(),bl=r("p"),nm=o(`Attributes: pretrained_config_archive_map (Dict[str, str]): A dictionary containing all the available pre-trained
checkpoints.`),Pc=p(),mo=r("h2"),rn=r("a"),Ml=r("span"),v(Ns.$$.fragment),sm=p(),yl=r("span"),rm=o("MobileBertTokenizer"),Rc=p(),Ke=r("div"),v(Ws.$$.fragment),am=p(),Tl=r("p"),im=o("Construct a MobileBERT tokenizer. Based on WordPiece."),lm=p(),Zs=r("p"),dm=o("This tokenizer inherits from "),ai=r("a"),cm=o("PreTrainedTokenizer"),pm=o(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),hm=p(),Lt=r("div"),v(qs.$$.fragment),mm=p(),vl=r("p"),um=o(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A MobileBERT sequence has the following format:`),fm=p(),Ps=r("ul"),ii=r("li"),gm=o("single sequence: "),kl=r("code"),_m=o("[CLS] X [SEP]"),bm=p(),li=r("li"),Mm=o("pair of sequences: "),wl=r("code"),ym=o("[CLS] A [SEP] B [SEP]"),Tm=p(),an=r("div"),v(Rs.$$.fragment),vm=p(),$l=r("p"),km=o("Converts a sequence of tokens (string) in a single string."),wm=p(),Bt=r("div"),v(Gs.$$.fragment),$m=p(),Bl=r("p"),Bm=o("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A MobileBERT"),Fm=p(),v(ln.$$.fragment),Em=p(),uo=r("p"),jm=o("If "),Fl=r("code"),Jm=o("token_ids_1"),Cm=o(" is "),El=r("code"),zm=o("None"),Um=o(", this method only returns the first portion of the mask (0s)."),xm=p(),dn=r("div"),v(Vs.$$.fragment),Im=p(),As=r("p"),Nm=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 `),jl=r("code"),Wm=o("prepare_for_model"),Zm=o(" method."),Gc=p(),fo=r("h2"),cn=r("a"),Jl=r("span"),v(Ss.$$.fragment),qm=p(),Cl=r("span"),Pm=o("MobileBertTokenizerFast"),Vc=p(),ct=r("div"),v(Xs.$$.fragment),Rm=p(),Os=r("p"),Gm=o("Construct a \u201Cfast\u201D MobileBERT tokenizer (backed by HuggingFace\u2019s "),zl=r("em"),Vm=o("tokenizers"),Am=o(" library). Based on WordPiece."),Sm=p(),Qs=r("p"),Xm=o("This tokenizer inherits from "),di=r("a"),Om=o("PreTrainedTokenizerFast"),Qm=o(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Dm=p(),Ht=r("div"),v(Ds.$$.fragment),Lm=p(),Ul=r("p"),Hm=o(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A MobileBERT sequence has the following format:`),Ym=p(),Ls=r("ul"),ci=r("li"),Km=o("single sequence: "),xl=r("code"),eu=o("[CLS] X [SEP]"),tu=p(),pi=r("li"),ou=o("pair of sequences: "),Il=r("code"),nu=o("[CLS] A [SEP] B [SEP]"),su=p(),Ft=r("div"),v(Hs.$$.fragment),ru=p(),Nl=r("p"),au=o("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A MobileBERT"),iu=p(),v(pn.$$.fragment),lu=p(),go=r("p"),du=o("If "),Wl=r("code"),cu=o("token_ids_1"),pu=o(" is "),Zl=r("code"),hu=o("None"),mu=o(", this method only returns the first portion of the mask (0s)."),Ac=p(),_o=r("h2"),hn=r("a"),ql=r("span"),v(Ys.$$.fragment),uu=p(),Pl=r("span"),fu=o("MobileBert specific outputs"),Sc=p(),bo=r("div"),v(Ks.$$.fragment),gu=p(),er=r("p"),_u=o("Output type of "),hi=r("a"),bu=o("MobileBertForPreTraining"),Mu=o("."),Xc=p(),Mo=r("div"),v(tr.$$.fragment),yu=p(),or=r("p"),Tu=o("Output type of "),mi=r("a"),vu=o("TFMobileBertForPreTraining"),ku=o("."),Oc=p(),yo=r("h2"),mn=r("a"),Rl=r("span"),v(nr.$$.fragment),wu=p(),Gl=r("span"),$u=o("MobileBertModel"),Qc=p(),et=r("div"),v(sr.$$.fragment),Bu=p(),Vl=r("p"),Fu=o("The bare MobileBert Model transformer outputting raw hidden-states without any specific head on top."),Eu=p(),rr=r("p"),ju=o("This model inherits from "),ui=r("a"),Ju=o("PreTrainedModel"),Cu=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.)`),zu=p(),ar=r("p"),Uu=o("This model is also a PyTorch "),ir=r("a"),xu=o("torch.nn.Module"),Iu=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Nu=p(),Al=r("p"),lr=r("a"),Wu=o("https://arxiv.org/pdf/2004.02984.pdf"),Zu=p(),Et=r("div"),v(dr.$$.fragment),qu=p(),To=r("p"),Pu=o("The "),fi=r("a"),Ru=o("MobileBertModel"),Gu=o(" forward method, overrides the "),Sl=r("code"),Vu=o("__call__"),Au=o(" special method."),Su=p(),v(un.$$.fragment),Xu=p(),v(fn.$$.fragment),Dc=p(),vo=r("h2"),gn=r("a"),Xl=r("span"),v(cr.$$.fragment),Ou=p(),Ol=r("span"),Qu=o("MobileBertForPreTraining"),Lc=p(),pt=r("div"),v(pr.$$.fragment),Du=p(),ko=r("p"),Lu=o("MobileBert Model with two heads on top as done during the pretraining: a "),Ql=r("code"),Hu=o("masked language modeling"),Yu=o(` head and a
`),Dl=r("code"),Ku=o("next sentence prediction (classification)"),ef=o(" head."),tf=p(),hr=r("p"),of=o("This model inherits from "),gi=r("a"),nf=o("PreTrainedModel"),sf=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.)`),rf=p(),mr=r("p"),af=o("This model is also a PyTorch "),ur=r("a"),lf=o("torch.nn.Module"),df=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),cf=p(),jt=r("div"),v(fr.$$.fragment),pf=p(),wo=r("p"),hf=o("The "),_i=r("a"),mf=o("MobileBertForPreTraining"),uf=o(" forward method, overrides the "),Ll=r("code"),ff=o("__call__"),gf=o(" special method."),_f=p(),v(_n.$$.fragment),bf=p(),v(bn.$$.fragment),Hc=p(),$o=r("h2"),Mn=r("a"),Hl=r("span"),v(gr.$$.fragment),Mf=p(),Yl=r("span"),yf=o("MobileBertForMaskedLM"),Yc=p(),ht=r("div"),v(_r.$$.fragment),Tf=p(),br=r("p"),vf=o("MobileBert Model with a "),Kl=r("code"),kf=o("language modeling"),wf=o(" head on top."),$f=p(),Mr=r("p"),Bf=o("This model inherits from "),bi=r("a"),Ff=o("PreTrainedModel"),Ef=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.)`),jf=p(),yr=r("p"),Jf=o("This model is also a PyTorch "),Tr=r("a"),Cf=o("torch.nn.Module"),zf=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Uf=p(),Jt=r("div"),v(vr.$$.fragment),xf=p(),Bo=r("p"),If=o("The "),Mi=r("a"),Nf=o("MobileBertForMaskedLM"),Wf=o(" forward method, overrides the "),ed=r("code"),Zf=o("__call__"),qf=o(" special method."),Pf=p(),v(yn.$$.fragment),Rf=p(),v(Tn.$$.fragment),Kc=p(),Fo=r("h2"),vn=r("a"),td=r("span"),v(kr.$$.fragment),Gf=p(),od=r("span"),Vf=o("MobileBertForNextSentencePrediction"),ep=p(),mt=r("div"),v(wr.$$.fragment),Af=p(),$r=r("p"),Sf=o("MobileBert Model with a "),nd=r("code"),Xf=o("next sentence prediction (classification)"),Of=o(" head on top."),Qf=p(),Br=r("p"),Df=o("This model inherits from "),yi=r("a"),Lf=o("PreTrainedModel"),Hf=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.)`),Yf=p(),Fr=r("p"),Kf=o("This model is also a PyTorch "),Er=r("a"),eg=o("torch.nn.Module"),tg=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),og=p(),Ct=r("div"),v(jr.$$.fragment),ng=p(),Eo=r("p"),sg=o("The "),Ti=r("a"),rg=o("MobileBertForNextSentencePrediction"),ag=o(" forward method, overrides the "),sd=r("code"),ig=o("__call__"),lg=o(" special method."),dg=p(),v(kn.$$.fragment),cg=p(),v(wn.$$.fragment),tp=p(),jo=r("h2"),$n=r("a"),rd=r("span"),v(Jr.$$.fragment),pg=p(),ad=r("span"),hg=o("MobileBertForSequenceClassification"),op=p(),ut=r("div"),v(Cr.$$.fragment),mg=p(),id=r("p"),ug=o(`MobileBert Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),fg=p(),zr=r("p"),gg=o("This model inherits from "),vi=r("a"),_g=o("PreTrainedModel"),bg=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.)`),Mg=p(),Ur=r("p"),yg=o("This model is also a PyTorch "),xr=r("a"),Tg=o("torch.nn.Module"),vg=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),kg=p(),bt=r("div"),v(Ir.$$.fragment),wg=p(),Jo=r("p"),$g=o("The "),ki=r("a"),Bg=o("MobileBertForSequenceClassification"),Fg=o(" forward method, overrides the "),ld=r("code"),Eg=o("__call__"),jg=o(" special method."),Jg=p(),v(Bn.$$.fragment),Cg=p(),v(Fn.$$.fragment),zg=p(),v(En.$$.fragment),np=p(),Co=r("h2"),jn=r("a"),dd=r("span"),v(Nr.$$.fragment),Ug=p(),cd=r("span"),xg=o("MobileBertForMultipleChoice"),sp=p(),ft=r("div"),v(Wr.$$.fragment),Ig=p(),pd=r("p"),Ng=o(`MobileBert 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.`),Wg=p(),Zr=r("p"),Zg=o("This model inherits from "),wi=r("a"),qg=o("PreTrainedModel"),Pg=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.)`),Rg=p(),qr=r("p"),Gg=o("This model is also a PyTorch "),Pr=r("a"),Vg=o("torch.nn.Module"),Ag=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Sg=p(),zt=r("div"),v(Rr.$$.fragment),Xg=p(),zo=r("p"),Og=o("The "),$i=r("a"),Qg=o("MobileBertForMultipleChoice"),Dg=o(" forward method, overrides the "),hd=r("code"),Lg=o("__call__"),Hg=o(" special method."),Yg=p(),v(Jn.$$.fragment),Kg=p(),v(Cn.$$.fragment),rp=p(),Uo=r("h2"),zn=r("a"),md=r("span"),v(Gr.$$.fragment),e_=p(),ud=r("span"),t_=o("MobileBertForTokenClassification"),ap=p(),gt=r("div"),v(Vr.$$.fragment),o_=p(),fd=r("p"),n_=o(`MobileBert 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.`),s_=p(),Ar=r("p"),r_=o("This model inherits from "),Bi=r("a"),a_=o("PreTrainedModel"),i_=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),l_=p(),Sr=r("p"),d_=o("This model is also a PyTorch "),Xr=r("a"),c_=o("torch.nn.Module"),p_=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),h_=p(),Ut=r("div"),v(Or.$$.fragment),m_=p(),xo=r("p"),u_=o("The "),Fi=r("a"),f_=o("MobileBertForTokenClassification"),g_=o(" forward method, overrides the "),gd=r("code"),__=o("__call__"),b_=o(" special method."),M_=p(),v(Un.$$.fragment),y_=p(),v(xn.$$.fragment),ip=p(),Io=r("h2"),In=r("a"),_d=r("span"),v(Qr.$$.fragment),T_=p(),bd=r("span"),v_=o("MobileBertForQuestionAnswering"),lp=p(),_t=r("div"),v(Dr.$$.fragment),k_=p(),No=r("p"),w_=o(`MobileBert 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 `),Md=r("code"),$_=o("span start logits"),B_=o(" and "),yd=r("code"),F_=o("span end logits"),E_=o(")."),j_=p(),Lr=r("p"),J_=o("This model inherits from "),Ei=r("a"),C_=o("PreTrainedModel"),z_=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.)`),U_=p(),Hr=r("p"),x_=o("This model is also a PyTorch "),Yr=r("a"),I_=o("torch.nn.Module"),N_=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),W_=p(),xt=r("div"),v(Kr.$$.fragment),Z_=p(),Wo=r("p"),q_=o("The "),ji=r("a"),P_=o("MobileBertForQuestionAnswering"),R_=o(" forward method, overrides the "),Td=r("code"),G_=o("__call__"),V_=o(" special method."),A_=p(),v(Nn.$$.fragment),S_=p(),v(Wn.$$.fragment),dp=p(),Zo=r("h2"),Zn=r("a"),vd=r("span"),v(ea.$$.fragment),X_=p(),kd=r("span"),O_=o("TFMobileBertModel"),cp=p(),tt=r("div"),v(ta.$$.fragment),Q_=p(),wd=r("p"),D_=o("The bare MobileBert Model transformer outputting raw hidden-states without any specific head on top."),L_=p(),oa=r("p"),H_=o("This model inherits from "),Ji=r("a"),Y_=o("TFPreTrainedModel"),K_=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.)`),eb=p(),na=r("p"),tb=o("This model is also a "),sa=r("a"),ob=o("tf.keras.Model"),nb=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.`),sb=p(),v(qn.$$.fragment),rb=p(),It=r("div"),v(ra.$$.fragment),ab=p(),qo=r("p"),ib=o("The "),Ci=r("a"),lb=o("TFMobileBertModel"),db=o(" forward method, overrides the "),$d=r("code"),cb=o("__call__"),pb=o(" special method."),hb=p(),v(Pn.$$.fragment),mb=p(),v(Rn.$$.fragment),pp=p(),Po=r("h2"),Gn=r("a"),Bd=r("span"),v(aa.$$.fragment),ub=p(),Fd=r("span"),fb=o("TFMobileBertForPreTraining"),hp=p(),ot=r("div"),v(ia.$$.fragment),gb=p(),Ro=r("p"),_b=o("MobileBert Model with two heads on top as done during the pretraining: a "),Ed=r("code"),bb=o("masked language modeling"),Mb=o(` head and a
`),jd=r("code"),yb=o("next sentence prediction (classification)"),Tb=o(" head."),vb=p(),la=r("p"),kb=o("This model inherits from "),zi=r("a"),wb=o("TFPreTrainedModel"),$b=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.)`),Bb=p(),da=r("p"),Fb=o("This model is also a "),ca=r("a"),Eb=o("tf.keras.Model"),jb=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.`),Jb=p(),v(Vn.$$.fragment),Cb=p(),Nt=r("div"),v(pa.$$.fragment),zb=p(),Go=r("p"),Ub=o("The "),Ui=r("a"),xb=o("TFMobileBertForPreTraining"),Ib=o(" forward method, overrides the "),Jd=r("code"),Nb=o("__call__"),Wb=o(" special method."),Zb=p(),v(An.$$.fragment),qb=p(),v(Sn.$$.fragment),mp=p(),Vo=r("h2"),Xn=r("a"),Cd=r("span"),v(ha.$$.fragment),Pb=p(),zd=r("span"),Rb=o("TFMobileBertForMaskedLM"),up=p(),nt=r("div"),v(ma.$$.fragment),Gb=p(),ua=r("p"),Vb=o("MobileBert Model with a "),Ud=r("code"),Ab=o("language modeling"),Sb=o(" head on top."),Xb=p(),fa=r("p"),Ob=o("This model inherits from "),xi=r("a"),Qb=o("TFPreTrainedModel"),Db=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.)`),Lb=p(),ga=r("p"),Hb=o("This model is also a "),_a=r("a"),Yb=o("tf.keras.Model"),Kb=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.`),eM=p(),v(On.$$.fragment),tM=p(),Mt=r("div"),v(ba.$$.fragment),oM=p(),Ao=r("p"),nM=o("The "),Ii=r("a"),sM=o("TFMobileBertForMaskedLM"),rM=o(" forward method, overrides the "),xd=r("code"),aM=o("__call__"),iM=o(" special method."),lM=p(),v(Qn.$$.fragment),dM=p(),v(Dn.$$.fragment),cM=p(),v(Ln.$$.fragment),fp=p(),So=r("h2"),Hn=r("a"),Id=r("span"),v(Ma.$$.fragment),pM=p(),Nd=r("span"),hM=o("TFMobileBertForNextSentencePrediction"),gp=p(),st=r("div"),v(ya.$$.fragment),mM=p(),Ta=r("p"),uM=o("MobileBert Model with a "),Wd=r("code"),fM=o("next sentence prediction (classification)"),gM=o(" head on top."),_M=p(),va=r("p"),bM=o("This model inherits from "),Ni=r("a"),MM=o("TFPreTrainedModel"),yM=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.)`),TM=p(),ka=r("p"),vM=o("This model is also a "),wa=r("a"),kM=o("tf.keras.Model"),wM=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.`),$M=p(),v(Yn.$$.fragment),BM=p(),Wt=r("div"),v($a.$$.fragment),FM=p(),Xo=r("p"),EM=o("The "),Wi=r("a"),jM=o("TFMobileBertForNextSentencePrediction"),JM=o(" forward method, overrides the "),Zd=r("code"),CM=o("__call__"),zM=o(" special method."),UM=p(),v(Kn.$$.fragment),xM=p(),v(es.$$.fragment),_p=p(),Oo=r("h2"),ts=r("a"),qd=r("span"),v(Ba.$$.fragment),IM=p(),Pd=r("span"),NM=o("TFMobileBertForSequenceClassification"),bp=p(),rt=r("div"),v(Fa.$$.fragment),WM=p(),Rd=r("p"),ZM=o(`MobileBert Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),qM=p(),Ea=r("p"),PM=o("This model inherits from "),Zi=r("a"),RM=o("TFPreTrainedModel"),GM=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.)`),VM=p(),ja=r("p"),AM=o("This model is also a "),Ja=r("a"),SM=o("tf.keras.Model"),XM=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.`),OM=p(),v(os.$$.fragment),QM=p(),yt=r("div"),v(Ca.$$.fragment),DM=p(),Qo=r("p"),LM=o("The "),qi=r("a"),HM=o("TFMobileBertForSequenceClassification"),YM=o(" forward method, overrides the "),Gd=r("code"),KM=o("__call__"),ey=o(" special method."),ty=p(),v(ns.$$.fragment),oy=p(),v(ss.$$.fragment),ny=p(),v(rs.$$.fragment),Mp=p(),Do=r("h2"),as=r("a"),Vd=r("span"),v(za.$$.fragment),sy=p(),Ad=r("span"),ry=o("TFMobileBertForMultipleChoice"),yp=p(),at=r("div"),v(Ua.$$.fragment),ay=p(),Sd=r("p"),iy=o(`MobileBert 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.`),ly=p(),xa=r("p"),dy=o("This model inherits from "),Pi=r("a"),cy=o("TFPreTrainedModel"),py=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.)`),hy=p(),Ia=r("p"),my=o("This model is also a "),Na=r("a"),uy=o("tf.keras.Model"),fy=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.`),gy=p(),v(is.$$.fragment),_y=p(),Zt=r("div"),v(Wa.$$.fragment),by=p(),Lo=r("p"),My=o("The "),Ri=r("a"),yy=o("TFMobileBertForMultipleChoice"),Ty=o(" forward method, overrides the "),Xd=r("code"),vy=o("__call__"),ky=o(" special method."),wy=p(),v(ls.$$.fragment),$y=p(),v(ds.$$.fragment),Tp=p(),Ho=r("h2"),cs=r("a"),Od=r("span"),v(Za.$$.fragment),By=p(),Qd=r("span"),Fy=o("TFMobileBertForTokenClassification"),vp=p(),it=r("div"),v(qa.$$.fragment),Ey=p(),Dd=r("p"),jy=o(`MobileBert 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.`),Jy=p(),Pa=r("p"),Cy=o("This model inherits from "),Gi=r("a"),zy=o("TFPreTrainedModel"),Uy=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.)`),xy=p(),Ra=r("p"),Iy=o("This model is also a "),Ga=r("a"),Ny=o("tf.keras.Model"),Wy=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.`),Zy=p(),v(ps.$$.fragment),qy=p(),Tt=r("div"),v(Va.$$.fragment),Py=p(),Yo=r("p"),Ry=o("The "),Vi=r("a"),Gy=o("TFMobileBertForTokenClassification"),Vy=o(" forward method, overrides the "),Ld=r("code"),Ay=o("__call__"),Sy=o(" special method."),Xy=p(),v(hs.$$.fragment),Oy=p(),v(ms.$$.fragment),Qy=p(),v(us.$$.fragment),kp=p(),Ko=r("h2"),fs=r("a"),Hd=r("span"),v(Aa.$$.fragment),Dy=p(),Yd=r("span"),Ly=o("TFMobileBertForQuestionAnswering"),wp=p(),lt=r("div"),v(Sa.$$.fragment),Hy=p(),en=r("p"),Yy=o(`MobileBert 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 `),Kd=r("code"),Ky=o("span start logits"),eT=o(" and "),ec=r("code"),tT=o("span end logits"),oT=o(")."),nT=p(),Xa=r("p"),sT=o("This model inherits from "),Ai=r("a"),rT=o("TFPreTrainedModel"),aT=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.)`),iT=p(),Oa=r("p"),lT=o("This model is also a "),Qa=r("a"),dT=o("tf.keras.Model"),cT=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.`),pT=p(),v(gs.$$.fragment),hT=p(),vt=r("div"),v(Da.$$.fragment),mT=p(),tn=r("p"),uT=o("The "),Si=r("a"),fT=o("TFMobileBertForQuestionAnswering"),gT=o(" forward method, overrides the "),tc=r("code"),_T=o("__call__"),bT=o(" special method."),MT=p(),v(_s.$$.fragment),yT=p(),v(bs.$$.fragment),TT=p(),v(Ms.$$.fragment),this.h()},l(s){const b=Jw('[data-svelte="svelte-1phssyn"]',document.head);d=a(b,"META",{name:!0,content:!0}),b.forEach(t),y=h(s),m=a(s,"H1",{class:!0});var La=i(m);u=a(La,"A",{id:!0,class:!0,href:!0});var oc=i(u);M=a(oc,"SPAN",{});var nc=i(M);k(l.$$.fragment,nc),nc.forEach(t),oc.forEach(t),c=h(La),J=a(La,"SPAN",{});var sc=i(J);ye=n(sc,"MobileBERT"),sc.forEach(t),La.forEach(t),me=h(s),q=a(s,"H2",{class:!0});var Ha=i(q);re=a(Ha,"A",{id:!0,class:!0,href:!0});var rc=i(re);K=a(rc,"SPAN",{});var ac=i(K);k(T.$$.fragment,ac),ac.forEach(t),rc.forEach(t),Te=h(Ha),S=a(Ha,"SPAN",{});var ic=i(S);ve=n(ic,"Overview"),ic.forEach(t),Ha.forEach(t),ue=h(s),R=a(s,"P",{});var Ya=i(R);ke=n(Ya,"The MobileBERT model was proposed in "),ie=a(Ya,"A",{href:!0,rel:!0});var lc=i(ie);O=n(lc,"MobileBERT: a Compact Task-Agnostic BERT for Resource-Limited Devices"),lc.forEach(t),we=n(Ya,` by Zhiqing Sun, Hongkun Yu, Xiaodan Song, Renjie Liu, Yiming Yang, and Denny
Zhou. It\u2019s a bidirectional transformer based on the BERT model, which is compressed and accelerated using several
approaches.`),Ya.forEach(t),fe=h(s),V=a(s,"P",{});var dc=i(V);$e=n(dc,"The abstract from the paper is the following:"),dc.forEach(t),ge=h(s),A=a(s,"P",{});var cc=i(A);ce=a(cc,"EM",{});var pc=i(ce);Be=n(pc,`Natural Language Processing (NLP) has recently achieved great success by using huge pre-trained models with hundreds
of millions of parameters. However, these models suffer from heavy model sizes and high latency such that they cannot
be deployed to resource-limited mobile devices. In this paper, we propose MobileBERT for compressing and accelerating
the popular BERT model. Like the original BERT, MobileBERT is task-agnostic, that is, it can be generically applied to
various downstream NLP tasks via simple fine-tuning. Basically, MobileBERT is a thin version of BERT_LARGE, while
equipped with bottleneck structures and a carefully designed balance between self-attentions and feed-forward networks.
To train MobileBERT, we first train a specially designed teacher model, an inverted-bottleneck incorporated BERT_LARGE
model. Then, we conduct knowledge transfer from this teacher to MobileBERT. Empirical studies show that MobileBERT is
4.3x smaller and 5.5x faster than BERT_BASE while achieving competitive results on well-known benchmarks. On the
natural language inference tasks of GLUE, MobileBERT achieves a GLUEscore o 77.7 (0.6 lower than BERT_BASE), and 62 ms
latency on a Pixel 4 phone. On the SQuAD v1.1/v2.0 question answering task, MobileBERT achieves a dev F1 score of
90.0/79.2 (1.5/2.1 higher than BERT_BASE).`),pc.forEach(t),cc.forEach(t),te=h(s),z=a(s,"P",{});var hc=i(z);I=n(hc,"Tips:"),hc.forEach(t),_e=h(s),G=a(s,"UL",{});var Ka=i(G);pe=a(Ka,"LI",{});var mc=i(pe);Fe=n(mc,`MobileBERT is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather
than the left.`),mc.forEach(t),Q=h(Ka),he=a(Ka,"LI",{});var uc=i(he);Ee=n(uc,`MobileBERT is similar to BERT and therefore relies on the masked language modeling (MLM) objective. It is therefore
efficient at predicting masked tokens and at NLU in general, but is not optimal for text generation. Models trained
with a causal language modeling (CLM) objective are better in that regard.`),uc.forEach(t),Ka.forEach(t),x=h(s),se=a(s,"P",{});var on=i(se);D=n(on,"This model was contributed by "),le=a(on,"A",{href:!0,rel:!0});var fc=i(le);je=n(fc,"vshampor"),fc.forEach(t),L=n(on,". The original code can be found "),de=a(on,"A",{href:!0,rel:!0});var gc=i(de);Je=n(gc,"here"),gc.forEach(t),W=n(on,"."),on.forEach(t),be=h(s),P=a(s,"H2",{class:!0});var ei=i(P);ae=a(ei,"A",{id:!0,class:!0,href:!0});var _c=i(ae);ee=a(_c,"SPAN",{});var bc=i(ee);k(U.$$.fragment,bc),bc.forEach(t),_c.forEach(t),Ce=h(ei),N=a(ei,"SPAN",{});var Mc=i(N);ze=n(Mc,"Documentation resources"),Mc.forEach(t),ei.forEach(t),Me=h(s),f=a(s,"UL",{});var wt=i(f);E=a(wt,"LI",{});var yc=i(E);Ie=a(yc,"A",{href:!0});var Tc=i(Ie);oe=n(Tc,"Text classification task guide"),Tc.forEach(t),yc.forEach(t),Ve=h(wt),qe=a(wt,"LI",{});var vc=i(qe);j=a(vc,"A",{href:!0});var kc=i(j);Ae=n(kc,"Token classification task guide"),kc.forEach(t),vc.forEach(t),Se=h(wt),Pe=a(wt,"LI",{});var wc=i(Pe);Ne=a(wc,"A",{href:!0});var $c=i(Ne);Xe=n($c,"Question answering task guide"),$c.forEach(t),wc.forEach(t),Z=h(wt),X=a(wt,"LI",{});var Bc=i(X);We=a(Bc,"A",{href:!0});var Fc=i(We);Oe=n(Fc,"Masked language modeling task guide"),Fc.forEach(t),Bc.forEach(t),H=h(wt),Re=a(wt,"LI",{});var Ec=i(Re);Ze=a(Ec,"A",{href:!0});var jc=i(Ze);Ue=n(jc,"Multiple choice task guide"),jc.forEach(t),Ec.forEach(t),wt.forEach(t),Ge=h(s),Y=a(s,"H2",{class:!0});var ti=i(Y);xe=a(ti,"A",{id:!0,class:!0,href:!0});var Jc=i(xe);gl=a(Jc,"SPAN",{});var Cc=i(gl);k(Us.$$.fragment,Cc),Cc.forEach(t),Jc.forEach(t),qh=h(ti),_l=a(ti,"SPAN",{});var zc=i(_l);Ph=n(zc,"MobileBertConfig"),zc.forEach(t),ti.forEach(t),qc=h(s),dt=a(s,"DIV",{class:!0});var $t=i(dt);k(xs.$$.fragment,$t),Rh=h($t),Qt=a($t,"P",{});var Dt=i(Qt);Gh=n(Dt,"This is the configuration class to store the configuration of a "),oi=a(Dt,"A",{href:!0});var Uc=i(oi);Vh=n(Uc,"MobileBertModel"),Uc.forEach(t),Ah=n(Dt," or a "),ni=a(Dt,"A",{href:!0});var xc=i(ni);Sh=n(xc,"TFMobileBertModel"),xc.forEach(t),Xh=n(Dt,`. It
is used to instantiate a MobileBERT 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 MobileBERT
`),Is=a(Dt,"A",{href:!0,rel:!0});var Ic=i(Is);Oh=n(Ic,"google/mobilebert-uncased"),Ic.forEach(t),Qh=n(Dt," architecture."),Dt.forEach(t),Dh=h($t),ho=a($t,"P",{});var nn=i(ho);Lh=n(nn,"Configuration objects inherit from "),si=a(nn,"A",{href:!0});var Nc=i(si);Hh=n(Nc,"PretrainedConfig"),Nc.forEach(t),Yh=n(nn,` and can be used to control the model outputs. Read the
documentation from `),ri=a(nn,"A",{href:!0});var Wc=i(ri);Kh=n(Wc,"PretrainedConfig"),Wc.forEach(t),em=n(nn," for more information."),nn.forEach(t),tm=h($t),k(sn.$$.fragment,$t),om=h($t),bl=a($t,"P",{});var Zc=i(bl);nm=n(Zc,`Attributes: pretrained_config_archive_map (Dict[str, str]): A dictionary containing all the available pre-trained
checkpoints.`),Zc.forEach(t),$t.forEach(t),Pc=h(s),mo=a(s,"H2",{class:!0});var Bp=i(mo);rn=a(Bp,"A",{id:!0,class:!0,href:!0});var BT=i(rn);Ml=a(BT,"SPAN",{});var FT=i(Ml);k(Ns.$$.fragment,FT),FT.forEach(t),BT.forEach(t),sm=h(Bp),yl=a(Bp,"SPAN",{});var ET=i(yl);rm=n(ET,"MobileBertTokenizer"),ET.forEach(t),Bp.forEach(t),Rc=h(s),Ke=a(s,"DIV",{class:!0});var kt=i(Ke);k(Ws.$$.fragment,kt),am=h(kt),Tl=a(kt,"P",{});var jT=i(Tl);im=n(jT,"Construct a MobileBERT tokenizer. Based on WordPiece."),jT.forEach(t),lm=h(kt),Zs=a(kt,"P",{});var Fp=i(Zs);dm=n(Fp,"This tokenizer inherits from "),ai=a(Fp,"A",{href:!0});var JT=i(ai);cm=n(JT,"PreTrainedTokenizer"),JT.forEach(t),pm=n(Fp,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Fp.forEach(t),hm=h(kt),Lt=a(kt,"DIV",{class:!0});var Xi=i(Lt);k(qs.$$.fragment,Xi),mm=h(Xi),vl=a(Xi,"P",{});var CT=i(vl);um=n(CT,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A MobileBERT sequence has the following format:`),CT.forEach(t),fm=h(Xi),Ps=a(Xi,"UL",{});var Ep=i(Ps);ii=a(Ep,"LI",{});var vT=i(ii);gm=n(vT,"single sequence: "),kl=a(vT,"CODE",{});var zT=i(kl);_m=n(zT,"[CLS] X [SEP]"),zT.forEach(t),vT.forEach(t),bm=h(Ep),li=a(Ep,"LI",{});var kT=i(li);Mm=n(kT,"pair of sequences: "),wl=a(kT,"CODE",{});var UT=i(wl);ym=n(UT,"[CLS] A [SEP] B [SEP]"),UT.forEach(t),kT.forEach(t),Ep.forEach(t),Xi.forEach(t),Tm=h(kt),an=a(kt,"DIV",{class:!0});var jp=i(an);k(Rs.$$.fragment,jp),vm=h(jp),$l=a(jp,"P",{});var xT=i($l);km=n(xT,"Converts a sequence of tokens (string) in a single string."),xT.forEach(t),jp.forEach(t),wm=h(kt),Bt=a(kt,"DIV",{class:!0});var ys=i(Bt);k(Gs.$$.fragment,ys),$m=h(ys),Bl=a(ys,"P",{});var IT=i(Bl);Bm=n(IT,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A MobileBERT"),IT.forEach(t),Fm=h(ys),k(ln.$$.fragment,ys),Em=h(ys),uo=a(ys,"P",{});var Oi=i(uo);jm=n(Oi,"If "),Fl=a(Oi,"CODE",{});var NT=i(Fl);Jm=n(NT,"token_ids_1"),NT.forEach(t),Cm=n(Oi," is "),El=a(Oi,"CODE",{});var WT=i(El);zm=n(WT,"None"),WT.forEach(t),Um=n(Oi,", this method only returns the first portion of the mask (0s)."),Oi.forEach(t),ys.forEach(t),xm=h(kt),dn=a(kt,"DIV",{class:!0});var Jp=i(dn);k(Vs.$$.fragment,Jp),Im=h(Jp),As=a(Jp,"P",{});var Cp=i(As);Nm=n(Cp,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),jl=a(Cp,"CODE",{});var ZT=i(jl);Wm=n(ZT,"prepare_for_model"),ZT.forEach(t),Zm=n(Cp," method."),Cp.forEach(t),Jp.forEach(t),kt.forEach(t),Gc=h(s),fo=a(s,"H2",{class:!0});var zp=i(fo);cn=a(zp,"A",{id:!0,class:!0,href:!0});var qT=i(cn);Jl=a(qT,"SPAN",{});var PT=i(Jl);k(Ss.$$.fragment,PT),PT.forEach(t),qT.forEach(t),qm=h(zp),Cl=a(zp,"SPAN",{});var RT=i(Cl);Pm=n(RT,"MobileBertTokenizerFast"),RT.forEach(t),zp.forEach(t),Vc=h(s),ct=a(s,"DIV",{class:!0});var Yt=i(ct);k(Xs.$$.fragment,Yt),Rm=h(Yt),Os=a(Yt,"P",{});var Up=i(Os);Gm=n(Up,"Construct a \u201Cfast\u201D MobileBERT tokenizer (backed by HuggingFace\u2019s "),zl=a(Up,"EM",{});var GT=i(zl);Vm=n(GT,"tokenizers"),GT.forEach(t),Am=n(Up," library). Based on WordPiece."),Up.forEach(t),Sm=h(Yt),Qs=a(Yt,"P",{});var xp=i(Qs);Xm=n(xp,"This tokenizer inherits from "),di=a(xp,"A",{href:!0});var VT=i(di);Om=n(VT,"PreTrainedTokenizerFast"),VT.forEach(t),Qm=n(xp,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),xp.forEach(t),Dm=h(Yt),Ht=a(Yt,"DIV",{class:!0});var Qi=i(Ht);k(Ds.$$.fragment,Qi),Lm=h(Qi),Ul=a(Qi,"P",{});var AT=i(Ul);Hm=n(AT,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A MobileBERT sequence has the following format:`),AT.forEach(t),Ym=h(Qi),Ls=a(Qi,"UL",{});var Ip=i(Ls);ci=a(Ip,"LI",{});var wT=i(ci);Km=n(wT,"single sequence: "),xl=a(wT,"CODE",{});var ST=i(xl);eu=n(ST,"[CLS] X [SEP]"),ST.forEach(t),wT.forEach(t),tu=h(Ip),pi=a(Ip,"LI",{});var $T=i(pi);ou=n($T,"pair of sequences: "),Il=a($T,"CODE",{});var XT=i(Il);nu=n(XT,"[CLS] A [SEP] B [SEP]"),XT.forEach(t),$T.forEach(t),Ip.forEach(t),Qi.forEach(t),su=h(Yt),Ft=a(Yt,"DIV",{class:!0});var Ts=i(Ft);k(Hs.$$.fragment,Ts),ru=h(Ts),Nl=a(Ts,"P",{});var OT=i(Nl);au=n(OT,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A MobileBERT"),OT.forEach(t),iu=h(Ts),k(pn.$$.fragment,Ts),lu=h(Ts),go=a(Ts,"P",{});var Di=i(go);du=n(Di,"If "),Wl=a(Di,"CODE",{});var QT=i(Wl);cu=n(QT,"token_ids_1"),QT.forEach(t),pu=n(Di," is "),Zl=a(Di,"CODE",{});var DT=i(Zl);hu=n(DT,"None"),DT.forEach(t),mu=n(Di,", this method only returns the first portion of the mask (0s)."),Di.forEach(t),Ts.forEach(t),Yt.forEach(t),Ac=h(s),_o=a(s,"H2",{class:!0});var Np=i(_o);hn=a(Np,"A",{id:!0,class:!0,href:!0});var LT=i(hn);ql=a(LT,"SPAN",{});var HT=i(ql);k(Ys.$$.fragment,HT),HT.forEach(t),LT.forEach(t),uu=h(Np),Pl=a(Np,"SPAN",{});var YT=i(Pl);fu=n(YT,"MobileBert specific outputs"),YT.forEach(t),Np.forEach(t),Sc=h(s),bo=a(s,"DIV",{class:!0});var Wp=i(bo);k(Ks.$$.fragment,Wp),gu=h(Wp),er=a(Wp,"P",{});var Zp=i(er);_u=n(Zp,"Output type of "),hi=a(Zp,"A",{href:!0});var KT=i(hi);bu=n(KT,"MobileBertForPreTraining"),KT.forEach(t),Mu=n(Zp,"."),Zp.forEach(t),Wp.forEach(t),Xc=h(s),Mo=a(s,"DIV",{class:!0});var qp=i(Mo);k(tr.$$.fragment,qp),yu=h(qp),or=a(qp,"P",{});var Pp=i(or);Tu=n(Pp,"Output type of "),mi=a(Pp,"A",{href:!0});var ev=i(mi);vu=n(ev,"TFMobileBertForPreTraining"),ev.forEach(t),ku=n(Pp,"."),Pp.forEach(t),qp.forEach(t),Oc=h(s),yo=a(s,"H2",{class:!0});var Rp=i(yo);mn=a(Rp,"A",{id:!0,class:!0,href:!0});var tv=i(mn);Rl=a(tv,"SPAN",{});var ov=i(Rl);k(nr.$$.fragment,ov),ov.forEach(t),tv.forEach(t),wu=h(Rp),Gl=a(Rp,"SPAN",{});var nv=i(Gl);$u=n(nv,"MobileBertModel"),nv.forEach(t),Rp.forEach(t),Qc=h(s),et=a(s,"DIV",{class:!0});var qt=i(et);k(sr.$$.fragment,qt),Bu=h(qt),Vl=a(qt,"P",{});var sv=i(Vl);Fu=n(sv,"The bare MobileBert Model transformer outputting raw hidden-states without any specific head on top."),sv.forEach(t),Eu=h(qt),rr=a(qt,"P",{});var Gp=i(rr);ju=n(Gp,"This model inherits from "),ui=a(Gp,"A",{href:!0});var rv=i(ui);Ju=n(rv,"PreTrainedModel"),rv.forEach(t),Cu=n(Gp,`. 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.)`),Gp.forEach(t),zu=h(qt),ar=a(qt,"P",{});var Vp=i(ar);Uu=n(Vp,"This model is also a PyTorch "),ir=a(Vp,"A",{href:!0,rel:!0});var av=i(ir);xu=n(av,"torch.nn.Module"),av.forEach(t),Iu=n(Vp,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Vp.forEach(t),Nu=h(qt),Al=a(qt,"P",{});var iv=i(Al);lr=a(iv,"A",{href:!0,rel:!0});var lv=i(lr);Wu=n(lv,"https://arxiv.org/pdf/2004.02984.pdf"),lv.forEach(t),iv.forEach(t),Zu=h(qt),Et=a(qt,"DIV",{class:!0});var vs=i(Et);k(dr.$$.fragment,vs),qu=h(vs),To=a(vs,"P",{});var Li=i(To);Pu=n(Li,"The "),fi=a(Li,"A",{href:!0});var dv=i(fi);Ru=n(dv,"MobileBertModel"),dv.forEach(t),Gu=n(Li," forward method, overrides the "),Sl=a(Li,"CODE",{});var cv=i(Sl);Vu=n(cv,"__call__"),cv.forEach(t),Au=n(Li," special method."),Li.forEach(t),Su=h(vs),k(un.$$.fragment,vs),Xu=h(vs),k(fn.$$.fragment,vs),vs.forEach(t),qt.forEach(t),Dc=h(s),vo=a(s,"H2",{class:!0});var Ap=i(vo);gn=a(Ap,"A",{id:!0,class:!0,href:!0});var pv=i(gn);Xl=a(pv,"SPAN",{});var hv=i(Xl);k(cr.$$.fragment,hv),hv.forEach(t),pv.forEach(t),Ou=h(Ap),Ol=a(Ap,"SPAN",{});var mv=i(Ol);Qu=n(mv,"MobileBertForPreTraining"),mv.forEach(t),Ap.forEach(t),Lc=h(s),pt=a(s,"DIV",{class:!0});var Kt=i(pt);k(pr.$$.fragment,Kt),Du=h(Kt),ko=a(Kt,"P",{});var Hi=i(ko);Lu=n(Hi,"MobileBert Model with two heads on top as done during the pretraining: a "),Ql=a(Hi,"CODE",{});var uv=i(Ql);Hu=n(uv,"masked language modeling"),uv.forEach(t),Yu=n(Hi,` head and a
`),Dl=a(Hi,"CODE",{});var fv=i(Dl);Ku=n(fv,"next sentence prediction (classification)"),fv.forEach(t),ef=n(Hi," head."),Hi.forEach(t),tf=h(Kt),hr=a(Kt,"P",{});var Sp=i(hr);of=n(Sp,"This model inherits from "),gi=a(Sp,"A",{href:!0});var gv=i(gi);nf=n(gv,"PreTrainedModel"),gv.forEach(t),sf=n(Sp,`. 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.)`),Sp.forEach(t),rf=h(Kt),mr=a(Kt,"P",{});var Xp=i(mr);af=n(Xp,"This model is also a PyTorch "),ur=a(Xp,"A",{href:!0,rel:!0});var _v=i(ur);lf=n(_v,"torch.nn.Module"),_v.forEach(t),df=n(Xp,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Xp.forEach(t),cf=h(Kt),jt=a(Kt,"DIV",{class:!0});var ks=i(jt);k(fr.$$.fragment,ks),pf=h(ks),wo=a(ks,"P",{});var Yi=i(wo);hf=n(Yi,"The "),_i=a(Yi,"A",{href:!0});var bv=i(_i);mf=n(bv,"MobileBertForPreTraining"),bv.forEach(t),uf=n(Yi," forward method, overrides the "),Ll=a(Yi,"CODE",{});var Mv=i(Ll);ff=n(Mv,"__call__"),Mv.forEach(t),gf=n(Yi," special method."),Yi.forEach(t),_f=h(ks),k(_n.$$.fragment,ks),bf=h(ks),k(bn.$$.fragment,ks),ks.forEach(t),Kt.forEach(t),Hc=h(s),$o=a(s,"H2",{class:!0});var Op=i($o);Mn=a(Op,"A",{id:!0,class:!0,href:!0});var yv=i(Mn);Hl=a(yv,"SPAN",{});var Tv=i(Hl);k(gr.$$.fragment,Tv),Tv.forEach(t),yv.forEach(t),Mf=h(Op),Yl=a(Op,"SPAN",{});var vv=i(Yl);yf=n(vv,"MobileBertForMaskedLM"),vv.forEach(t),Op.forEach(t),Yc=h(s),ht=a(s,"DIV",{class:!0});var eo=i(ht);k(_r.$$.fragment,eo),Tf=h(eo),br=a(eo,"P",{});var Qp=i(br);vf=n(Qp,"MobileBert Model with a "),Kl=a(Qp,"CODE",{});var kv=i(Kl);kf=n(kv,"language modeling"),kv.forEach(t),wf=n(Qp," head on top."),Qp.forEach(t),$f=h(eo),Mr=a(eo,"P",{});var Dp=i(Mr);Bf=n(Dp,"This model inherits from "),bi=a(Dp,"A",{href:!0});var wv=i(bi);Ff=n(wv,"PreTrainedModel"),wv.forEach(t),Ef=n(Dp,`. 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.)`),Dp.forEach(t),jf=h(eo),yr=a(eo,"P",{});var Lp=i(yr);Jf=n(Lp,"This model is also a PyTorch "),Tr=a(Lp,"A",{href:!0,rel:!0});var $v=i(Tr);Cf=n($v,"torch.nn.Module"),$v.forEach(t),zf=n(Lp,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Lp.forEach(t),Uf=h(eo),Jt=a(eo,"DIV",{class:!0});var ws=i(Jt);k(vr.$$.fragment,ws),xf=h(ws),Bo=a(ws,"P",{});var Ki=i(Bo);If=n(Ki,"The "),Mi=a(Ki,"A",{href:!0});var Bv=i(Mi);Nf=n(Bv,"MobileBertForMaskedLM"),Bv.forEach(t),Wf=n(Ki," forward method, overrides the "),ed=a(Ki,"CODE",{});var Fv=i(ed);Zf=n(Fv,"__call__"),Fv.forEach(t),qf=n(Ki," special method."),Ki.forEach(t),Pf=h(ws),k(yn.$$.fragment,ws),Rf=h(ws),k(Tn.$$.fragment,ws),ws.forEach(t),eo.forEach(t),Kc=h(s),Fo=a(s,"H2",{class:!0});var Hp=i(Fo);vn=a(Hp,"A",{id:!0,class:!0,href:!0});var Ev=i(vn);td=a(Ev,"SPAN",{});var jv=i(td);k(kr.$$.fragment,jv),jv.forEach(t),Ev.forEach(t),Gf=h(Hp),od=a(Hp,"SPAN",{});var Jv=i(od);Vf=n(Jv,"MobileBertForNextSentencePrediction"),Jv.forEach(t),Hp.forEach(t),ep=h(s),mt=a(s,"DIV",{class:!0});var to=i(mt);k(wr.$$.fragment,to),Af=h(to),$r=a(to,"P",{});var Yp=i($r);Sf=n(Yp,"MobileBert Model with a "),nd=a(Yp,"CODE",{});var Cv=i(nd);Xf=n(Cv,"next sentence prediction (classification)"),Cv.forEach(t),Of=n(Yp," head on top."),Yp.forEach(t),Qf=h(to),Br=a(to,"P",{});var Kp=i(Br);Df=n(Kp,"This model inherits from "),yi=a(Kp,"A",{href:!0});var zv=i(yi);Lf=n(zv,"PreTrainedModel"),zv.forEach(t),Hf=n(Kp,`. 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.)`),Kp.forEach(t),Yf=h(to),Fr=a(to,"P",{});var eh=i(Fr);Kf=n(eh,"This model is also a PyTorch "),Er=a(eh,"A",{href:!0,rel:!0});var Uv=i(Er);eg=n(Uv,"torch.nn.Module"),Uv.forEach(t),tg=n(eh,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),eh.forEach(t),og=h(to),Ct=a(to,"DIV",{class:!0});var $s=i(Ct);k(jr.$$.fragment,$s),ng=h($s),Eo=a($s,"P",{});var el=i(Eo);sg=n(el,"The "),Ti=a(el,"A",{href:!0});var xv=i(Ti);rg=n(xv,"MobileBertForNextSentencePrediction"),xv.forEach(t),ag=n(el," forward method, overrides the "),sd=a(el,"CODE",{});var Iv=i(sd);ig=n(Iv,"__call__"),Iv.forEach(t),lg=n(el," special method."),el.forEach(t),dg=h($s),k(kn.$$.fragment,$s),cg=h($s),k(wn.$$.fragment,$s),$s.forEach(t),to.forEach(t),tp=h(s),jo=a(s,"H2",{class:!0});var th=i(jo);$n=a(th,"A",{id:!0,class:!0,href:!0});var Nv=i($n);rd=a(Nv,"SPAN",{});var Wv=i(rd);k(Jr.$$.fragment,Wv),Wv.forEach(t),Nv.forEach(t),pg=h(th),ad=a(th,"SPAN",{});var Zv=i(ad);hg=n(Zv,"MobileBertForSequenceClassification"),Zv.forEach(t),th.forEach(t),op=h(s),ut=a(s,"DIV",{class:!0});var oo=i(ut);k(Cr.$$.fragment,oo),mg=h(oo),id=a(oo,"P",{});var qv=i(id);ug=n(qv,`MobileBert Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),qv.forEach(t),fg=h(oo),zr=a(oo,"P",{});var oh=i(zr);gg=n(oh,"This model inherits from "),vi=a(oh,"A",{href:!0});var Pv=i(vi);_g=n(Pv,"PreTrainedModel"),Pv.forEach(t),bg=n(oh,`. 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.)`),oh.forEach(t),Mg=h(oo),Ur=a(oo,"P",{});var nh=i(Ur);yg=n(nh,"This model is also a PyTorch "),xr=a(nh,"A",{href:!0,rel:!0});var Rv=i(xr);Tg=n(Rv,"torch.nn.Module"),Rv.forEach(t),vg=n(nh,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),nh.forEach(t),kg=h(oo),bt=a(oo,"DIV",{class:!0});var no=i(bt);k(Ir.$$.fragment,no),wg=h(no),Jo=a(no,"P",{});var tl=i(Jo);$g=n(tl,"The "),ki=a(tl,"A",{href:!0});var Gv=i(ki);Bg=n(Gv,"MobileBertForSequenceClassification"),Gv.forEach(t),Fg=n(tl," forward method, overrides the "),ld=a(tl,"CODE",{});var Vv=i(ld);Eg=n(Vv,"__call__"),Vv.forEach(t),jg=n(tl," special method."),tl.forEach(t),Jg=h(no),k(Bn.$$.fragment,no),Cg=h(no),k(Fn.$$.fragment,no),zg=h(no),k(En.$$.fragment,no),no.forEach(t),oo.forEach(t),np=h(s),Co=a(s,"H2",{class:!0});var sh=i(Co);jn=a(sh,"A",{id:!0,class:!0,href:!0});var Av=i(jn);dd=a(Av,"SPAN",{});var Sv=i(dd);k(Nr.$$.fragment,Sv),Sv.forEach(t),Av.forEach(t),Ug=h(sh),cd=a(sh,"SPAN",{});var Xv=i(cd);xg=n(Xv,"MobileBertForMultipleChoice"),Xv.forEach(t),sh.forEach(t),sp=h(s),ft=a(s,"DIV",{class:!0});var so=i(ft);k(Wr.$$.fragment,so),Ig=h(so),pd=a(so,"P",{});var Ov=i(pd);Ng=n(Ov,`MobileBert 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.`),Ov.forEach(t),Wg=h(so),Zr=a(so,"P",{});var rh=i(Zr);Zg=n(rh,"This model inherits from "),wi=a(rh,"A",{href:!0});var Qv=i(wi);qg=n(Qv,"PreTrainedModel"),Qv.forEach(t),Pg=n(rh,`. 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.)`),rh.forEach(t),Rg=h(so),qr=a(so,"P",{});var ah=i(qr);Gg=n(ah,"This model is also a PyTorch "),Pr=a(ah,"A",{href:!0,rel:!0});var Dv=i(Pr);Vg=n(Dv,"torch.nn.Module"),Dv.forEach(t),Ag=n(ah,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ah.forEach(t),Sg=h(so),zt=a(so,"DIV",{class:!0});var Bs=i(zt);k(Rr.$$.fragment,Bs),Xg=h(Bs),zo=a(Bs,"P",{});var ol=i(zo);Og=n(ol,"The "),$i=a(ol,"A",{href:!0});var Lv=i($i);Qg=n(Lv,"MobileBertForMultipleChoice"),Lv.forEach(t),Dg=n(ol," forward method, overrides the "),hd=a(ol,"CODE",{});var Hv=i(hd);Lg=n(Hv,"__call__"),Hv.forEach(t),Hg=n(ol," special method."),ol.forEach(t),Yg=h(Bs),k(Jn.$$.fragment,Bs),Kg=h(Bs),k(Cn.$$.fragment,Bs),Bs.forEach(t),so.forEach(t),rp=h(s),Uo=a(s,"H2",{class:!0});var ih=i(Uo);zn=a(ih,"A",{id:!0,class:!0,href:!0});var Yv=i(zn);md=a(Yv,"SPAN",{});var Kv=i(md);k(Gr.$$.fragment,Kv),Kv.forEach(t),Yv.forEach(t),e_=h(ih),ud=a(ih,"SPAN",{});var ek=i(ud);t_=n(ek,"MobileBertForTokenClassification"),ek.forEach(t),ih.forEach(t),ap=h(s),gt=a(s,"DIV",{class:!0});var ro=i(gt);k(Vr.$$.fragment,ro),o_=h(ro),fd=a(ro,"P",{});var tk=i(fd);n_=n(tk,`MobileBert 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.`),tk.forEach(t),s_=h(ro),Ar=a(ro,"P",{});var lh=i(Ar);r_=n(lh,"This model inherits from "),Bi=a(lh,"A",{href:!0});var ok=i(Bi);a_=n(ok,"PreTrainedModel"),ok.forEach(t),i_=n(lh,`. 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.)`),lh.forEach(t),l_=h(ro),Sr=a(ro,"P",{});var dh=i(Sr);d_=n(dh,"This model is also a PyTorch "),Xr=a(dh,"A",{href:!0,rel:!0});var nk=i(Xr);c_=n(nk,"torch.nn.Module"),nk.forEach(t),p_=n(dh,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),dh.forEach(t),h_=h(ro),Ut=a(ro,"DIV",{class:!0});var Fs=i(Ut);k(Or.$$.fragment,Fs),m_=h(Fs),xo=a(Fs,"P",{});var nl=i(xo);u_=n(nl,"The "),Fi=a(nl,"A",{href:!0});var sk=i(Fi);f_=n(sk,"MobileBertForTokenClassification"),sk.forEach(t),g_=n(nl," forward method, overrides the "),gd=a(nl,"CODE",{});var rk=i(gd);__=n(rk,"__call__"),rk.forEach(t),b_=n(nl," special method."),nl.forEach(t),M_=h(Fs),k(Un.$$.fragment,Fs),y_=h(Fs),k(xn.$$.fragment,Fs),Fs.forEach(t),ro.forEach(t),ip=h(s),Io=a(s,"H2",{class:!0});var ch=i(Io);In=a(ch,"A",{id:!0,class:!0,href:!0});var ak=i(In);_d=a(ak,"SPAN",{});var ik=i(_d);k(Qr.$$.fragment,ik),ik.forEach(t),ak.forEach(t),T_=h(ch),bd=a(ch,"SPAN",{});var lk=i(bd);v_=n(lk,"MobileBertForQuestionAnswering"),lk.forEach(t),ch.forEach(t),lp=h(s),_t=a(s,"DIV",{class:!0});var ao=i(_t);k(Dr.$$.fragment,ao),k_=h(ao),No=a(ao,"P",{});var sl=i(No);w_=n(sl,`MobileBert 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 `),Md=a(sl,"CODE",{});var dk=i(Md);$_=n(dk,"span start logits"),dk.forEach(t),B_=n(sl," and "),yd=a(sl,"CODE",{});var ck=i(yd);F_=n(ck,"span end logits"),ck.forEach(t),E_=n(sl,")."),sl.forEach(t),j_=h(ao),Lr=a(ao,"P",{});var ph=i(Lr);J_=n(ph,"This model inherits from "),Ei=a(ph,"A",{href:!0});var pk=i(Ei);C_=n(pk,"PreTrainedModel"),pk.forEach(t),z_=n(ph,`. 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.)`),ph.forEach(t),U_=h(ao),Hr=a(ao,"P",{});var hh=i(Hr);x_=n(hh,"This model is also a PyTorch "),Yr=a(hh,"A",{href:!0,rel:!0});var hk=i(Yr);I_=n(hk,"torch.nn.Module"),hk.forEach(t),N_=n(hh,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),hh.forEach(t),W_=h(ao),xt=a(ao,"DIV",{class:!0});var Es=i(xt);k(Kr.$$.fragment,Es),Z_=h(Es),Wo=a(Es,"P",{});var rl=i(Wo);q_=n(rl,"The "),ji=a(rl,"A",{href:!0});var mk=i(ji);P_=n(mk,"MobileBertForQuestionAnswering"),mk.forEach(t),R_=n(rl," forward method, overrides the "),Td=a(rl,"CODE",{});var uk=i(Td);G_=n(uk,"__call__"),uk.forEach(t),V_=n(rl," special method."),rl.forEach(t),A_=h(Es),k(Nn.$$.fragment,Es),S_=h(Es),k(Wn.$$.fragment,Es),Es.forEach(t),ao.forEach(t),dp=h(s),Zo=a(s,"H2",{class:!0});var mh=i(Zo);Zn=a(mh,"A",{id:!0,class:!0,href:!0});var fk=i(Zn);vd=a(fk,"SPAN",{});var gk=i(vd);k(ea.$$.fragment,gk),gk.forEach(t),fk.forEach(t),X_=h(mh),kd=a(mh,"SPAN",{});var _k=i(kd);O_=n(_k,"TFMobileBertModel"),_k.forEach(t),mh.forEach(t),cp=h(s),tt=a(s,"DIV",{class:!0});var Pt=i(tt);k(ta.$$.fragment,Pt),Q_=h(Pt),wd=a(Pt,"P",{});var bk=i(wd);D_=n(bk,"The bare MobileBert Model transformer outputting raw hidden-states without any specific head on top."),bk.forEach(t),L_=h(Pt),oa=a(Pt,"P",{});var uh=i(oa);H_=n(uh,"This model inherits from "),Ji=a(uh,"A",{href:!0});var Mk=i(Ji);Y_=n(Mk,"TFPreTrainedModel"),Mk.forEach(t),K_=n(uh,`. 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.)`),uh.forEach(t),eb=h(Pt),na=a(Pt,"P",{});var fh=i(na);tb=n(fh,"This model is also a "),sa=a(fh,"A",{href:!0,rel:!0});var yk=i(sa);ob=n(yk,"tf.keras.Model"),yk.forEach(t),nb=n(fh,` 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.`),fh.forEach(t),sb=h(Pt),k(qn.$$.fragment,Pt),rb=h(Pt),It=a(Pt,"DIV",{class:!0});var js=i(It);k(ra.$$.fragment,js),ab=h(js),qo=a(js,"P",{});var al=i(qo);ib=n(al,"The "),Ci=a(al,"A",{href:!0});var Tk=i(Ci);lb=n(Tk,"TFMobileBertModel"),Tk.forEach(t),db=n(al," forward method, overrides the "),$d=a(al,"CODE",{});var vk=i($d);cb=n(vk,"__call__"),vk.forEach(t),pb=n(al," special method."),al.forEach(t),hb=h(js),k(Pn.$$.fragment,js),mb=h(js),k(Rn.$$.fragment,js),js.forEach(t),Pt.forEach(t),pp=h(s),Po=a(s,"H2",{class:!0});var gh=i(Po);Gn=a(gh,"A",{id:!0,class:!0,href:!0});var kk=i(Gn);Bd=a(kk,"SPAN",{});var wk=i(Bd);k(aa.$$.fragment,wk),wk.forEach(t),kk.forEach(t),ub=h(gh),Fd=a(gh,"SPAN",{});var $k=i(Fd);fb=n($k,"TFMobileBertForPreTraining"),$k.forEach(t),gh.forEach(t),hp=h(s),ot=a(s,"DIV",{class:!0});var Rt=i(ot);k(ia.$$.fragment,Rt),gb=h(Rt),Ro=a(Rt,"P",{});var il=i(Ro);_b=n(il,"MobileBert Model with two heads on top as done during the pretraining: a "),Ed=a(il,"CODE",{});var Bk=i(Ed);bb=n(Bk,"masked language modeling"),Bk.forEach(t),Mb=n(il,` head and a
`),jd=a(il,"CODE",{});var Fk=i(jd);yb=n(Fk,"next sentence prediction (classification)"),Fk.forEach(t),Tb=n(il," head."),il.forEach(t),vb=h(Rt),la=a(Rt,"P",{});var _h=i(la);kb=n(_h,"This model inherits from "),zi=a(_h,"A",{href:!0});var Ek=i(zi);wb=n(Ek,"TFPreTrainedModel"),Ek.forEach(t),$b=n(_h,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),_h.forEach(t),Bb=h(Rt),da=a(Rt,"P",{});var bh=i(da);Fb=n(bh,"This model is also a "),ca=a(bh,"A",{href:!0,rel:!0});var jk=i(ca);Eb=n(jk,"tf.keras.Model"),jk.forEach(t),jb=n(bh,` 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.`),bh.forEach(t),Jb=h(Rt),k(Vn.$$.fragment,Rt),Cb=h(Rt),Nt=a(Rt,"DIV",{class:!0});var Js=i(Nt);k(pa.$$.fragment,Js),zb=h(Js),Go=a(Js,"P",{});var ll=i(Go);Ub=n(ll,"The "),Ui=a(ll,"A",{href:!0});var Jk=i(Ui);xb=n(Jk,"TFMobileBertForPreTraining"),Jk.forEach(t),Ib=n(ll," forward method, overrides the "),Jd=a(ll,"CODE",{});var Ck=i(Jd);Nb=n(Ck,"__call__"),Ck.forEach(t),Wb=n(ll," special method."),ll.forEach(t),Zb=h(Js),k(An.$$.fragment,Js),qb=h(Js),k(Sn.$$.fragment,Js),Js.forEach(t),Rt.forEach(t),mp=h(s),Vo=a(s,"H2",{class:!0});var Mh=i(Vo);Xn=a(Mh,"A",{id:!0,class:!0,href:!0});var zk=i(Xn);Cd=a(zk,"SPAN",{});var Uk=i(Cd);k(ha.$$.fragment,Uk),Uk.forEach(t),zk.forEach(t),Pb=h(Mh),zd=a(Mh,"SPAN",{});var xk=i(zd);Rb=n(xk,"TFMobileBertForMaskedLM"),xk.forEach(t),Mh.forEach(t),up=h(s),nt=a(s,"DIV",{class:!0});var Gt=i(nt);k(ma.$$.fragment,Gt),Gb=h(Gt),ua=a(Gt,"P",{});var yh=i(ua);Vb=n(yh,"MobileBert Model with a "),Ud=a(yh,"CODE",{});var Ik=i(Ud);Ab=n(Ik,"language modeling"),Ik.forEach(t),Sb=n(yh," head on top."),yh.forEach(t),Xb=h(Gt),fa=a(Gt,"P",{});var Th=i(fa);Ob=n(Th,"This model inherits from "),xi=a(Th,"A",{href:!0});var Nk=i(xi);Qb=n(Nk,"TFPreTrainedModel"),Nk.forEach(t),Db=n(Th,`. 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.)`),Th.forEach(t),Lb=h(Gt),ga=a(Gt,"P",{});var vh=i(ga);Hb=n(vh,"This model is also a "),_a=a(vh,"A",{href:!0,rel:!0});var Wk=i(_a);Yb=n(Wk,"tf.keras.Model"),Wk.forEach(t),Kb=n(vh,` 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.`),vh.forEach(t),eM=h(Gt),k(On.$$.fragment,Gt),tM=h(Gt),Mt=a(Gt,"DIV",{class:!0});var io=i(Mt);k(ba.$$.fragment,io),oM=h(io),Ao=a(io,"P",{});var dl=i(Ao);nM=n(dl,"The "),Ii=a(dl,"A",{href:!0});var Zk=i(Ii);sM=n(Zk,"TFMobileBertForMaskedLM"),Zk.forEach(t),rM=n(dl," forward method, overrides the "),xd=a(dl,"CODE",{});var qk=i(xd);aM=n(qk,"__call__"),qk.forEach(t),iM=n(dl," special method."),dl.forEach(t),lM=h(io),k(Qn.$$.fragment,io),dM=h(io),k(Dn.$$.fragment,io),cM=h(io),k(Ln.$$.fragment,io),io.forEach(t),Gt.forEach(t),fp=h(s),So=a(s,"H2",{class:!0});var kh=i(So);Hn=a(kh,"A",{id:!0,class:!0,href:!0});var Pk=i(Hn);Id=a(Pk,"SPAN",{});var Rk=i(Id);k(Ma.$$.fragment,Rk),Rk.forEach(t),Pk.forEach(t),pM=h(kh),Nd=a(kh,"SPAN",{});var Gk=i(Nd);hM=n(Gk,"TFMobileBertForNextSentencePrediction"),Gk.forEach(t),kh.forEach(t),gp=h(s),st=a(s,"DIV",{class:!0});var Vt=i(st);k(ya.$$.fragment,Vt),mM=h(Vt),Ta=a(Vt,"P",{});var wh=i(Ta);uM=n(wh,"MobileBert Model with a "),Wd=a(wh,"CODE",{});var Vk=i(Wd);fM=n(Vk,"next sentence prediction (classification)"),Vk.forEach(t),gM=n(wh," head on top."),wh.forEach(t),_M=h(Vt),va=a(Vt,"P",{});var $h=i(va);bM=n($h,"This model inherits from "),Ni=a($h,"A",{href:!0});var Ak=i(Ni);MM=n(Ak,"TFPreTrainedModel"),Ak.forEach(t),yM=n($h,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),$h.forEach(t),TM=h(Vt),ka=a(Vt,"P",{});var Bh=i(ka);vM=n(Bh,"This model is also a "),wa=a(Bh,"A",{href:!0,rel:!0});var Sk=i(wa);kM=n(Sk,"tf.keras.Model"),Sk.forEach(t),wM=n(Bh,` 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.`),Bh.forEach(t),$M=h(Vt),k(Yn.$$.fragment,Vt),BM=h(Vt),Wt=a(Vt,"DIV",{class:!0});var Cs=i(Wt);k($a.$$.fragment,Cs),FM=h(Cs),Xo=a(Cs,"P",{});var cl=i(Xo);EM=n(cl,"The "),Wi=a(cl,"A",{href:!0});var Xk=i(Wi);jM=n(Xk,"TFMobileBertForNextSentencePrediction"),Xk.forEach(t),JM=n(cl," forward method, overrides the "),Zd=a(cl,"CODE",{});var Ok=i(Zd);CM=n(Ok,"__call__"),Ok.forEach(t),zM=n(cl," special method."),cl.forEach(t),UM=h(Cs),k(Kn.$$.fragment,Cs),xM=h(Cs),k(es.$$.fragment,Cs),Cs.forEach(t),Vt.forEach(t),_p=h(s),Oo=a(s,"H2",{class:!0});var Fh=i(Oo);ts=a(Fh,"A",{id:!0,class:!0,href:!0});var Qk=i(ts);qd=a(Qk,"SPAN",{});var Dk=i(qd);k(Ba.$$.fragment,Dk),Dk.forEach(t),Qk.forEach(t),IM=h(Fh),Pd=a(Fh,"SPAN",{});var Lk=i(Pd);NM=n(Lk,"TFMobileBertForSequenceClassification"),Lk.forEach(t),Fh.forEach(t),bp=h(s),rt=a(s,"DIV",{class:!0});var At=i(rt);k(Fa.$$.fragment,At),WM=h(At),Rd=a(At,"P",{});var Hk=i(Rd);ZM=n(Hk,`MobileBert Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),Hk.forEach(t),qM=h(At),Ea=a(At,"P",{});var Eh=i(Ea);PM=n(Eh,"This model inherits from "),Zi=a(Eh,"A",{href:!0});var Yk=i(Zi);RM=n(Yk,"TFPreTrainedModel"),Yk.forEach(t),GM=n(Eh,`. 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.)`),Eh.forEach(t),VM=h(At),ja=a(At,"P",{});var jh=i(ja);AM=n(jh,"This model is also a "),Ja=a(jh,"A",{href:!0,rel:!0});var Kk=i(Ja);SM=n(Kk,"tf.keras.Model"),Kk.forEach(t),XM=n(jh,` 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.`),jh.forEach(t),OM=h(At),k(os.$$.fragment,At),QM=h(At),yt=a(At,"DIV",{class:!0});var lo=i(yt);k(Ca.$$.fragment,lo),DM=h(lo),Qo=a(lo,"P",{});var pl=i(Qo);LM=n(pl,"The "),qi=a(pl,"A",{href:!0});var ew=i(qi);HM=n(ew,"TFMobileBertForSequenceClassification"),ew.forEach(t),YM=n(pl," forward method, overrides the "),Gd=a(pl,"CODE",{});var tw=i(Gd);KM=n(tw,"__call__"),tw.forEach(t),ey=n(pl," special method."),pl.forEach(t),ty=h(lo),k(ns.$$.fragment,lo),oy=h(lo),k(ss.$$.fragment,lo),ny=h(lo),k(rs.$$.fragment,lo),lo.forEach(t),At.forEach(t),Mp=h(s),Do=a(s,"H2",{class:!0});var Jh=i(Do);as=a(Jh,"A",{id:!0,class:!0,href:!0});var ow=i(as);Vd=a(ow,"SPAN",{});var nw=i(Vd);k(za.$$.fragment,nw),nw.forEach(t),ow.forEach(t),sy=h(Jh),Ad=a(Jh,"SPAN",{});var sw=i(Ad);ry=n(sw,"TFMobileBertForMultipleChoice"),sw.forEach(t),Jh.forEach(t),yp=h(s),at=a(s,"DIV",{class:!0});var St=i(at);k(Ua.$$.fragment,St),ay=h(St),Sd=a(St,"P",{});var rw=i(Sd);iy=n(rw,`MobileBert 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.`),rw.forEach(t),ly=h(St),xa=a(St,"P",{});var Ch=i(xa);dy=n(Ch,"This model inherits from "),Pi=a(Ch,"A",{href:!0});var aw=i(Pi);cy=n(aw,"TFPreTrainedModel"),aw.forEach(t),py=n(Ch,`. 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.)`),Ch.forEach(t),hy=h(St),Ia=a(St,"P",{});var zh=i(Ia);my=n(zh,"This model is also a "),Na=a(zh,"A",{href:!0,rel:!0});var iw=i(Na);uy=n(iw,"tf.keras.Model"),iw.forEach(t),fy=n(zh,` 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.`),zh.forEach(t),gy=h(St),k(is.$$.fragment,St),_y=h(St),Zt=a(St,"DIV",{class:!0});var zs=i(Zt);k(Wa.$$.fragment,zs),by=h(zs),Lo=a(zs,"P",{});var hl=i(Lo);My=n(hl,"The "),Ri=a(hl,"A",{href:!0});var lw=i(Ri);yy=n(lw,"TFMobileBertForMultipleChoice"),lw.forEach(t),Ty=n(hl," forward method, overrides the "),Xd=a(hl,"CODE",{});var dw=i(Xd);vy=n(dw,"__call__"),dw.forEach(t),ky=n(hl," special method."),hl.forEach(t),wy=h(zs),k(ls.$$.fragment,zs),$y=h(zs),k(ds.$$.fragment,zs),zs.forEach(t),St.forEach(t),Tp=h(s),Ho=a(s,"H2",{class:!0});var Uh=i(Ho);cs=a(Uh,"A",{id:!0,class:!0,href:!0});var cw=i(cs);Od=a(cw,"SPAN",{});var pw=i(Od);k(Za.$$.fragment,pw),pw.forEach(t),cw.forEach(t),By=h(Uh),Qd=a(Uh,"SPAN",{});var hw=i(Qd);Fy=n(hw,"TFMobileBertForTokenClassification"),hw.forEach(t),Uh.forEach(t),vp=h(s),it=a(s,"DIV",{class:!0});var Xt=i(it);k(qa.$$.fragment,Xt),Ey=h(Xt),Dd=a(Xt,"P",{});var mw=i(Dd);jy=n(mw,`MobileBert 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.`),mw.forEach(t),Jy=h(Xt),Pa=a(Xt,"P",{});var xh=i(Pa);Cy=n(xh,"This model inherits from "),Gi=a(xh,"A",{href:!0});var uw=i(Gi);zy=n(uw,"TFPreTrainedModel"),uw.forEach(t),Uy=n(xh,`. 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.)`),xh.forEach(t),xy=h(Xt),Ra=a(Xt,"P",{});var Ih=i(Ra);Iy=n(Ih,"This model is also a "),Ga=a(Ih,"A",{href:!0,rel:!0});var fw=i(Ga);Ny=n(fw,"tf.keras.Model"),fw.forEach(t),Wy=n(Ih,` 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.`),Ih.forEach(t),Zy=h(Xt),k(ps.$$.fragment,Xt),qy=h(Xt),Tt=a(Xt,"DIV",{class:!0});var co=i(Tt);k(Va.$$.fragment,co),Py=h(co),Yo=a(co,"P",{});var ml=i(Yo);Ry=n(ml,"The "),Vi=a(ml,"A",{href:!0});var gw=i(Vi);Gy=n(gw,"TFMobileBertForTokenClassification"),gw.forEach(t),Vy=n(ml," forward method, overrides the "),Ld=a(ml,"CODE",{});var _w=i(Ld);Ay=n(_w,"__call__"),_w.forEach(t),Sy=n(ml," special method."),ml.forEach(t),Xy=h(co),k(hs.$$.fragment,co),Oy=h(co),k(ms.$$.fragment,co),Qy=h(co),k(us.$$.fragment,co),co.forEach(t),Xt.forEach(t),kp=h(s),Ko=a(s,"H2",{class:!0});var Nh=i(Ko);fs=a(Nh,"A",{id:!0,class:!0,href:!0});var bw=i(fs);Hd=a(bw,"SPAN",{});var Mw=i(Hd);k(Aa.$$.fragment,Mw),Mw.forEach(t),bw.forEach(t),Dy=h(Nh),Yd=a(Nh,"SPAN",{});var yw=i(Yd);Ly=n(yw,"TFMobileBertForQuestionAnswering"),yw.forEach(t),Nh.forEach(t),wp=h(s),lt=a(s,"DIV",{class:!0});var Ot=i(lt);k(Sa.$$.fragment,Ot),Hy=h(Ot),en=a(Ot,"P",{});var ul=i(en);Yy=n(ul,`MobileBert 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 `),Kd=a(ul,"CODE",{});var Tw=i(Kd);Ky=n(Tw,"span start logits"),Tw.forEach(t),eT=n(ul," and "),ec=a(ul,"CODE",{});var vw=i(ec);tT=n(vw,"span end logits"),vw.forEach(t),oT=n(ul,")."),ul.forEach(t),nT=h(Ot),Xa=a(Ot,"P",{});var Wh=i(Xa);sT=n(Wh,"This model inherits from "),Ai=a(Wh,"A",{href:!0});var kw=i(Ai);rT=n(kw,"TFPreTrainedModel"),kw.forEach(t),aT=n(Wh,`. 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.)`),Wh.forEach(t),iT=h(Ot),Oa=a(Ot,"P",{});var Zh=i(Oa);lT=n(Zh,"This model is also a "),Qa=a(Zh,"A",{href:!0,rel:!0});var ww=i(Qa);dT=n(ww,"tf.keras.Model"),ww.forEach(t),cT=n(Zh,` 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.`),Zh.forEach(t),pT=h(Ot),k(gs.$$.fragment,Ot),hT=h(Ot),vt=a(Ot,"DIV",{class:!0});var po=i(vt);k(Da.$$.fragment,po),mT=h(po),tn=a(po,"P",{});var fl=i(tn);uT=n(fl,"The "),Si=a(fl,"A",{href:!0});var $w=i(Si);fT=n($w,"TFMobileBertForQuestionAnswering"),$w.forEach(t),gT=n(fl," forward method, overrides the "),tc=a(fl,"CODE",{});var Bw=i(tc);_T=n(Bw,"__call__"),Bw.forEach(t),bT=n(fl," special method."),fl.forEach(t),MT=h(po),k(_s.$$.fragment,po),yT=h(po),k(bs.$$.fragment,po),TT=h(po),k(Ms.$$.fragment,po),po.forEach(t),Ot.forEach(t),this.h()},h(){g(d,"name","hf:doc:metadata"),g(d,"content",JSON.stringify(F2)),g(u,"id","mobilebert"),g(u,"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"),g(u,"href","#mobilebert"),g(m,"class","relative group"),g(re,"id","overview"),g(re,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(re,"href","#overview"),g(q,"class","relative group"),g(ie,"href","https://arxiv.org/abs/2004.02984"),g(ie,"rel","nofollow"),g(le,"href","https://huggingface.co/vshampor"),g(le,"rel","nofollow"),g(de,"href","https://github.com/google-research/mobilebert"),g(de,"rel","nofollow"),g(ae,"id","documentation-resources"),g(ae,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(ae,"href","#documentation-resources"),g(P,"class","relative group"),g(Ie,"href","../tasks/sequence_classification"),g(j,"href","../tasks/token_classification"),g(Ne,"href","../tasks/question_answering"),g(We,"href","../tasks/masked_language_modeling"),g(Ze,"href","../tasks/multiple_choice"),g(xe,"id","transformers.MobileBertConfig"),g(xe,"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"),g(xe,"href","#transformers.MobileBertConfig"),g(Y,"class","relative group"),g(oi,"href","/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertModel"),g(ni,"href","/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.TFMobileBertModel"),g(Is,"href","https://huggingface.co/google/mobilebert-uncased"),g(Is,"rel","nofollow"),g(si,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),g(ri,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),g(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(rn,"id","transformers.MobileBertTokenizer"),g(rn,"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"),g(rn,"href","#transformers.MobileBertTokenizer"),g(mo,"class","relative group"),g(ai,"href","/docs/transformers/v4.33.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),g(Lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(an,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(dn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(cn,"id","transformers.MobileBertTokenizerFast"),g(cn,"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"),g(cn,"href","#transformers.MobileBertTokenizerFast"),g(fo,"class","relative group"),g(di,"href","/docs/transformers/v4.33.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),g(Ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(hn,"id","transformers.models.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput"),g(hn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(hn,"href","#transformers.models.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput"),g(_o,"class","relative group"),g(hi,"href","/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertForPreTraining"),g(bo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(mi,"href","/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.TFMobileBertForPreTraining"),g(Mo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(mn,"id","transformers.MobileBertModel"),g(mn,"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"),g(mn,"href","#transformers.MobileBertModel"),g(yo,"class","relative group"),g(ui,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),g(ir,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(ir,"rel","nofollow"),g(lr,"href","https://arxiv.org/pdf/2004.02984.pdf"),g(lr,"rel","nofollow"),g(fi,"href","/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertModel"),g(Et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(gn,"id","transformers.MobileBertForPreTraining"),g(gn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(gn,"href","#transformers.MobileBertForPreTraining"),g(vo,"class","relative group"),g(gi,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),g(ur,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(ur,"rel","nofollow"),g(_i,"href","/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertForPreTraining"),g(jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Mn,"id","transformers.MobileBertForMaskedLM"),g(Mn,"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"),g(Mn,"href","#transformers.MobileBertForMaskedLM"),g($o,"class","relative group"),g(bi,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),g(Tr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(Tr,"rel","nofollow"),g(Mi,"href","/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertForMaskedLM"),g(Jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(vn,"id","transformers.MobileBertForNextSentencePrediction"),g(vn,"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"),g(vn,"href","#transformers.MobileBertForNextSentencePrediction"),g(Fo,"class","relative group"),g(yi,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),g(Er,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(Er,"rel","nofollow"),g(Ti,"href","/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertForNextSentencePrediction"),g(Ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g($n,"id","transformers.MobileBertForSequenceClassification"),g($n,"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"),g($n,"href","#transformers.MobileBertForSequenceClassification"),g(jo,"class","relative group"),g(vi,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),g(xr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(xr,"rel","nofollow"),g(ki,"href","/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertForSequenceClassification"),g(bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(jn,"id","transformers.MobileBertForMultipleChoice"),g(jn,"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"),g(jn,"href","#transformers.MobileBertForMultipleChoice"),g(Co,"class","relative group"),g(wi,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),g(Pr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(Pr,"rel","nofollow"),g($i,"href","/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertForMultipleChoice"),g(zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(zn,"id","transformers.MobileBertForTokenClassification"),g(zn,"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"),g(zn,"href","#transformers.MobileBertForTokenClassification"),g(Uo,"class","relative group"),g(Bi,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),g(Xr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(Xr,"rel","nofollow"),g(Fi,"href","/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertForTokenClassification"),g(Ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(In,"id","transformers.MobileBertForQuestionAnswering"),g(In,"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"),g(In,"href","#transformers.MobileBertForQuestionAnswering"),g(Io,"class","relative group"),g(Ei,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),g(Yr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(Yr,"rel","nofollow"),g(ji,"href","/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.MobileBertForQuestionAnswering"),g(xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(_t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Zn,"id","transformers.TFMobileBertModel"),g(Zn,"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"),g(Zn,"href","#transformers.TFMobileBertModel"),g(Zo,"class","relative group"),g(Ji,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.TFPreTrainedModel"),g(sa,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),g(sa,"rel","nofollow"),g(Ci,"href","/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.TFMobileBertModel"),g(It,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Gn,"id","transformers.TFMobileBertForPreTraining"),g(Gn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(Gn,"href","#transformers.TFMobileBertForPreTraining"),g(Po,"class","relative group"),g(zi,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.TFPreTrainedModel"),g(ca,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),g(ca,"rel","nofollow"),g(Ui,"href","/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.TFMobileBertForPreTraining"),g(Nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Xn,"id","transformers.TFMobileBertForMaskedLM"),g(Xn,"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"),g(Xn,"href","#transformers.TFMobileBertForMaskedLM"),g(Vo,"class","relative group"),g(xi,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.TFPreTrainedModel"),g(_a,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),g(_a,"rel","nofollow"),g(Ii,"href","/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.TFMobileBertForMaskedLM"),g(Mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Hn,"id","transformers.TFMobileBertForNextSentencePrediction"),g(Hn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(Hn,"href","#transformers.TFMobileBertForNextSentencePrediction"),g(So,"class","relative group"),g(Ni,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.TFPreTrainedModel"),g(wa,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),g(wa,"rel","nofollow"),g(Wi,"href","/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.TFMobileBertForNextSentencePrediction"),g(Wt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ts,"id","transformers.TFMobileBertForSequenceClassification"),g(ts,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(ts,"href","#transformers.TFMobileBertForSequenceClassification"),g(Oo,"class","relative group"),g(Zi,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.TFPreTrainedModel"),g(Ja,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),g(Ja,"rel","nofollow"),g(qi,"href","/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.TFMobileBertForSequenceClassification"),g(yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(as,"id","transformers.TFMobileBertForMultipleChoice"),g(as,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(as,"href","#transformers.TFMobileBertForMultipleChoice"),g(Do,"class","relative group"),g(Pi,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.TFPreTrainedModel"),g(Na,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),g(Na,"rel","nofollow"),g(Ri,"href","/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.TFMobileBertForMultipleChoice"),g(Zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(cs,"id","transformers.TFMobileBertForTokenClassification"),g(cs,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(cs,"href","#transformers.TFMobileBertForTokenClassification"),g(Ho,"class","relative group"),g(Gi,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.TFPreTrainedModel"),g(Ga,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),g(Ga,"rel","nofollow"),g(Vi,"href","/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.TFMobileBertForTokenClassification"),g(Tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(it,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(fs,"id","transformers.TFMobileBertForQuestionAnswering"),g(fs,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(fs,"href","#transformers.TFMobileBertForQuestionAnswering"),g(Ko,"class","relative group"),g(Ai,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.TFPreTrainedModel"),g(Qa,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),g(Qa,"rel","nofollow"),g(Si,"href","/docs/transformers/v4.33.0/en/model_doc/mobilebert#transformers.TFMobileBertForQuestionAnswering"),g(vt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(s,b){e(document.head,d),_(s,y,b),_(s,m,b),e(m,u),e(u,M),w(l,M,null),e(m,c),e(m,J),e(J,ye),_(s,me,b),_(s,q,b),e(q,re),e(re,K),w(T,K,null),e(q,Te),e(q,S),e(S,ve),_(s,ue,b),_(s,R,b),e(R,ke),e(R,ie),e(ie,O),e(R,we),_(s,fe,b),_(s,V,b),e(V,$e),_(s,ge,b),_(s,A,b),e(A,ce),e(ce,Be),_(s,te,b),_(s,z,b),e(z,I),_(s,_e,b),_(s,G,b),e(G,pe),e(pe,Fe),e(G,Q),e(G,he),e(he,Ee),_(s,x,b),_(s,se,b),e(se,D),e(se,le),e(le,je),e(se,L),e(se,de),e(de,Je),e(se,W),_(s,be,b),_(s,P,b),e(P,ae),e(ae,ee),w(U,ee,null),e(P,Ce),e(P,N),e(N,ze),_(s,Me,b),_(s,f,b),e(f,E),e(E,Ie),e(Ie,oe),e(f,Ve),e(f,qe),e(qe,j),e(j,Ae),e(f,Se),e(f,Pe),e(Pe,Ne),e(Ne,Xe),e(f,Z),e(f,X),e(X,We),e(We,Oe),e(f,H),e(f,Re),e(Re,Ze),e(Ze,Ue),_(s,Ge,b),_(s,Y,b),e(Y,xe),e(xe,gl),w(Us,gl,null),e(Y,qh),e(Y,_l),e(_l,Ph),_(s,qc,b),_(s,dt,b),w(xs,dt,null),e(dt,Rh),e(dt,Qt),e(Qt,Gh),e(Qt,oi),e(oi,Vh),e(Qt,Ah),e(Qt,ni),e(ni,Sh),e(Qt,Xh),e(Qt,Is),e(Is,Oh),e(Qt,Qh),e(dt,Dh),e(dt,ho),e(ho,Lh),e(ho,si),e(si,Hh),e(ho,Yh),e(ho,ri),e(ri,Kh),e(ho,em),e(dt,tm),w(sn,dt,null),e(dt,om),e(dt,bl),e(bl,nm),_(s,Pc,b),_(s,mo,b),e(mo,rn),e(rn,Ml),w(Ns,Ml,null),e(mo,sm),e(mo,yl),e(yl,rm),_(s,Rc,b),_(s,Ke,b),w(Ws,Ke,null),e(Ke,am),e(Ke,Tl),e(Tl,im),e(Ke,lm),e(Ke,Zs),e(Zs,dm),e(Zs,ai),e(ai,cm),e(Zs,pm),e(Ke,hm),e(Ke,Lt),w(qs,Lt,null),e(Lt,mm),e(Lt,vl),e(vl,um),e(Lt,fm),e(Lt,Ps),e(Ps,ii),e(ii,gm),e(ii,kl),e(kl,_m),e(Ps,bm),e(Ps,li),e(li,Mm),e(li,wl),e(wl,ym),e(Ke,Tm),e(Ke,an),w(Rs,an,null),e(an,vm),e(an,$l),e($l,km),e(Ke,wm),e(Ke,Bt),w(Gs,Bt,null),e(Bt,$m),e(Bt,Bl),e(Bl,Bm),e(Bt,Fm),w(ln,Bt,null),e(Bt,Em),e(Bt,uo),e(uo,jm),e(uo,Fl),e(Fl,Jm),e(uo,Cm),e(uo,El),e(El,zm),e(uo,Um),e(Ke,xm),e(Ke,dn),w(Vs,dn,null),e(dn,Im),e(dn,As),e(As,Nm),e(As,jl),e(jl,Wm),e(As,Zm),_(s,Gc,b),_(s,fo,b),e(fo,cn),e(cn,Jl),w(Ss,Jl,null),e(fo,qm),e(fo,Cl),e(Cl,Pm),_(s,Vc,b),_(s,ct,b),w(Xs,ct,null),e(ct,Rm),e(ct,Os),e(Os,Gm),e(Os,zl),e(zl,Vm),e(Os,Am),e(ct,Sm),e(ct,Qs),e(Qs,Xm),e(Qs,di),e(di,Om),e(Qs,Qm),e(ct,Dm),e(ct,Ht),w(Ds,Ht,null),e(Ht,Lm),e(Ht,Ul),e(Ul,Hm),e(Ht,Ym),e(Ht,Ls),e(Ls,ci),e(ci,Km),e(ci,xl),e(xl,eu),e(Ls,tu),e(Ls,pi),e(pi,ou),e(pi,Il),e(Il,nu),e(ct,su),e(ct,Ft),w(Hs,Ft,null),e(Ft,ru),e(Ft,Nl),e(Nl,au),e(Ft,iu),w(pn,Ft,null),e(Ft,lu),e(Ft,go),e(go,du),e(go,Wl),e(Wl,cu),e(go,pu),e(go,Zl),e(Zl,hu),e(go,mu),_(s,Ac,b),_(s,_o,b),e(_o,hn),e(hn,ql),w(Ys,ql,null),e(_o,uu),e(_o,Pl),e(Pl,fu),_(s,Sc,b),_(s,bo,b),w(Ks,bo,null),e(bo,gu),e(bo,er),e(er,_u),e(er,hi),e(hi,bu),e(er,Mu),_(s,Xc,b),_(s,Mo,b),w(tr,Mo,null),e(Mo,yu),e(Mo,or),e(or,Tu),e(or,mi),e(mi,vu),e(or,ku),_(s,Oc,b),_(s,yo,b),e(yo,mn),e(mn,Rl),w(nr,Rl,null),e(yo,wu),e(yo,Gl),e(Gl,$u),_(s,Qc,b),_(s,et,b),w(sr,et,null),e(et,Bu),e(et,Vl),e(Vl,Fu),e(et,Eu),e(et,rr),e(rr,ju),e(rr,ui),e(ui,Ju),e(rr,Cu),e(et,zu),e(et,ar),e(ar,Uu),e(ar,ir),e(ir,xu),e(ar,Iu),e(et,Nu),e(et,Al),e(Al,lr),e(lr,Wu),e(et,Zu),e(et,Et),w(dr,Et,null),e(Et,qu),e(Et,To),e(To,Pu),e(To,fi),e(fi,Ru),e(To,Gu),e(To,Sl),e(Sl,Vu),e(To,Au),e(Et,Su),w(un,Et,null),e(Et,Xu),w(fn,Et,null),_(s,Dc,b),_(s,vo,b),e(vo,gn),e(gn,Xl),w(cr,Xl,null),e(vo,Ou),e(vo,Ol),e(Ol,Qu),_(s,Lc,b),_(s,pt,b),w(pr,pt,null),e(pt,Du),e(pt,ko),e(ko,Lu),e(ko,Ql),e(Ql,Hu),e(ko,Yu),e(ko,Dl),e(Dl,Ku),e(ko,ef),e(pt,tf),e(pt,hr),e(hr,of),e(hr,gi),e(gi,nf),e(hr,sf),e(pt,rf),e(pt,mr),e(mr,af),e(mr,ur),e(ur,lf),e(mr,df),e(pt,cf),e(pt,jt),w(fr,jt,null),e(jt,pf),e(jt,wo),e(wo,hf),e(wo,_i),e(_i,mf),e(wo,uf),e(wo,Ll),e(Ll,ff),e(wo,gf),e(jt,_f),w(_n,jt,null),e(jt,bf),w(bn,jt,null),_(s,Hc,b),_(s,$o,b),e($o,Mn),e(Mn,Hl),w(gr,Hl,null),e($o,Mf),e($o,Yl),e(Yl,yf),_(s,Yc,b),_(s,ht,b),w(_r,ht,null),e(ht,Tf),e(ht,br),e(br,vf),e(br,Kl),e(Kl,kf),e(br,wf),e(ht,$f),e(ht,Mr),e(Mr,Bf),e(Mr,bi),e(bi,Ff),e(Mr,Ef),e(ht,jf),e(ht,yr),e(yr,Jf),e(yr,Tr),e(Tr,Cf),e(yr,zf),e(ht,Uf),e(ht,Jt),w(vr,Jt,null),e(Jt,xf),e(Jt,Bo),e(Bo,If),e(Bo,Mi),e(Mi,Nf),e(Bo,Wf),e(Bo,ed),e(ed,Zf),e(Bo,qf),e(Jt,Pf),w(yn,Jt,null),e(Jt,Rf),w(Tn,Jt,null),_(s,Kc,b),_(s,Fo,b),e(Fo,vn),e(vn,td),w(kr,td,null),e(Fo,Gf),e(Fo,od),e(od,Vf),_(s,ep,b),_(s,mt,b),w(wr,mt,null),e(mt,Af),e(mt,$r),e($r,Sf),e($r,nd),e(nd,Xf),e($r,Of),e(mt,Qf),e(mt,Br),e(Br,Df),e(Br,yi),e(yi,Lf),e(Br,Hf),e(mt,Yf),e(mt,Fr),e(Fr,Kf),e(Fr,Er),e(Er,eg),e(Fr,tg),e(mt,og),e(mt,Ct),w(jr,Ct,null),e(Ct,ng),e(Ct,Eo),e(Eo,sg),e(Eo,Ti),e(Ti,rg),e(Eo,ag),e(Eo,sd),e(sd,ig),e(Eo,lg),e(Ct,dg),w(kn,Ct,null),e(Ct,cg),w(wn,Ct,null),_(s,tp,b),_(s,jo,b),e(jo,$n),e($n,rd),w(Jr,rd,null),e(jo,pg),e(jo,ad),e(ad,hg),_(s,op,b),_(s,ut,b),w(Cr,ut,null),e(ut,mg),e(ut,id),e(id,ug),e(ut,fg),e(ut,zr),e(zr,gg),e(zr,vi),e(vi,_g),e(zr,bg),e(ut,Mg),e(ut,Ur),e(Ur,yg),e(Ur,xr),e(xr,Tg),e(Ur,vg),e(ut,kg),e(ut,bt),w(Ir,bt,null),e(bt,wg),e(bt,Jo),e(Jo,$g),e(Jo,ki),e(ki,Bg),e(Jo,Fg),e(Jo,ld),e(ld,Eg),e(Jo,jg),e(bt,Jg),w(Bn,bt,null),e(bt,Cg),w(Fn,bt,null),e(bt,zg),w(En,bt,null),_(s,np,b),_(s,Co,b),e(Co,jn),e(jn,dd),w(Nr,dd,null),e(Co,Ug),e(Co,cd),e(cd,xg),_(s,sp,b),_(s,ft,b),w(Wr,ft,null),e(ft,Ig),e(ft,pd),e(pd,Ng),e(ft,Wg),e(ft,Zr),e(Zr,Zg),e(Zr,wi),e(wi,qg),e(Zr,Pg),e(ft,Rg),e(ft,qr),e(qr,Gg),e(qr,Pr),e(Pr,Vg),e(qr,Ag),e(ft,Sg),e(ft,zt),w(Rr,zt,null),e(zt,Xg),e(zt,zo),e(zo,Og),e(zo,$i),e($i,Qg),e(zo,Dg),e(zo,hd),e(hd,Lg),e(zo,Hg),e(zt,Yg),w(Jn,zt,null),e(zt,Kg),w(Cn,zt,null),_(s,rp,b),_(s,Uo,b),e(Uo,zn),e(zn,md),w(Gr,md,null),e(Uo,e_),e(Uo,ud),e(ud,t_),_(s,ap,b),_(s,gt,b),w(Vr,gt,null),e(gt,o_),e(gt,fd),e(fd,n_),e(gt,s_),e(gt,Ar),e(Ar,r_),e(Ar,Bi),e(Bi,a_),e(Ar,i_),e(gt,l_),e(gt,Sr),e(Sr,d_),e(Sr,Xr),e(Xr,c_),e(Sr,p_),e(gt,h_),e(gt,Ut),w(Or,Ut,null),e(Ut,m_),e(Ut,xo),e(xo,u_),e(xo,Fi),e(Fi,f_),e(xo,g_),e(xo,gd),e(gd,__),e(xo,b_),e(Ut,M_),w(Un,Ut,null),e(Ut,y_),w(xn,Ut,null),_(s,ip,b),_(s,Io,b),e(Io,In),e(In,_d),w(Qr,_d,null),e(Io,T_),e(Io,bd),e(bd,v_),_(s,lp,b),_(s,_t,b),w(Dr,_t,null),e(_t,k_),e(_t,No),e(No,w_),e(No,Md),e(Md,$_),e(No,B_),e(No,yd),e(yd,F_),e(No,E_),e(_t,j_),e(_t,Lr),e(Lr,J_),e(Lr,Ei),e(Ei,C_),e(Lr,z_),e(_t,U_),e(_t,Hr),e(Hr,x_),e(Hr,Yr),e(Yr,I_),e(Hr,N_),e(_t,W_),e(_t,xt),w(Kr,xt,null),e(xt,Z_),e(xt,Wo),e(Wo,q_),e(Wo,ji),e(ji,P_),e(Wo,R_),e(Wo,Td),e(Td,G_),e(Wo,V_),e(xt,A_),w(Nn,xt,null),e(xt,S_),w(Wn,xt,null),_(s,dp,b),_(s,Zo,b),e(Zo,Zn),e(Zn,vd),w(ea,vd,null),e(Zo,X_),e(Zo,kd),e(kd,O_),_(s,cp,b),_(s,tt,b),w(ta,tt,null),e(tt,Q_),e(tt,wd),e(wd,D_),e(tt,L_),e(tt,oa),e(oa,H_),e(oa,Ji),e(Ji,Y_),e(oa,K_),e(tt,eb),e(tt,na),e(na,tb),e(na,sa),e(sa,ob),e(na,nb),e(tt,sb),w(qn,tt,null),e(tt,rb),e(tt,It),w(ra,It,null),e(It,ab),e(It,qo),e(qo,ib),e(qo,Ci),e(Ci,lb),e(qo,db),e(qo,$d),e($d,cb),e(qo,pb),e(It,hb),w(Pn,It,null),e(It,mb),w(Rn,It,null),_(s,pp,b),_(s,Po,b),e(Po,Gn),e(Gn,Bd),w(aa,Bd,null),e(Po,ub),e(Po,Fd),e(Fd,fb),_(s,hp,b),_(s,ot,b),w(ia,ot,null),e(ot,gb),e(ot,Ro),e(Ro,_b),e(Ro,Ed),e(Ed,bb),e(Ro,Mb),e(Ro,jd),e(jd,yb),e(Ro,Tb),e(ot,vb),e(ot,la),e(la,kb),e(la,zi),e(zi,wb),e(la,$b),e(ot,Bb),e(ot,da),e(da,Fb),e(da,ca),e(ca,Eb),e(da,jb),e(ot,Jb),w(Vn,ot,null),e(ot,Cb),e(ot,Nt),w(pa,Nt,null),e(Nt,zb),e(Nt,Go),e(Go,Ub),e(Go,Ui),e(Ui,xb),e(Go,Ib),e(Go,Jd),e(Jd,Nb),e(Go,Wb),e(Nt,Zb),w(An,Nt,null),e(Nt,qb),w(Sn,Nt,null),_(s,mp,b),_(s,Vo,b),e(Vo,Xn),e(Xn,Cd),w(ha,Cd,null),e(Vo,Pb),e(Vo,zd),e(zd,Rb),_(s,up,b),_(s,nt,b),w(ma,nt,null),e(nt,Gb),e(nt,ua),e(ua,Vb),e(ua,Ud),e(Ud,Ab),e(ua,Sb),e(nt,Xb),e(nt,fa),e(fa,Ob),e(fa,xi),e(xi,Qb),e(fa,Db),e(nt,Lb),e(nt,ga),e(ga,Hb),e(ga,_a),e(_a,Yb),e(ga,Kb),e(nt,eM),w(On,nt,null),e(nt,tM),e(nt,Mt),w(ba,Mt,null),e(Mt,oM),e(Mt,Ao),e(Ao,nM),e(Ao,Ii),e(Ii,sM),e(Ao,rM),e(Ao,xd),e(xd,aM),e(Ao,iM),e(Mt,lM),w(Qn,Mt,null),e(Mt,dM),w(Dn,Mt,null),e(Mt,cM),w(Ln,Mt,null),_(s,fp,b),_(s,So,b),e(So,Hn),e(Hn,Id),w(Ma,Id,null),e(So,pM),e(So,Nd),e(Nd,hM),_(s,gp,b),_(s,st,b),w(ya,st,null),e(st,mM),e(st,Ta),e(Ta,uM),e(Ta,Wd),e(Wd,fM),e(Ta,gM),e(st,_M),e(st,va),e(va,bM),e(va,Ni),e(Ni,MM),e(va,yM),e(st,TM),e(st,ka),e(ka,vM),e(ka,wa),e(wa,kM),e(ka,wM),e(st,$M),w(Yn,st,null),e(st,BM),e(st,Wt),w($a,Wt,null),e(Wt,FM),e(Wt,Xo),e(Xo,EM),e(Xo,Wi),e(Wi,jM),e(Xo,JM),e(Xo,Zd),e(Zd,CM),e(Xo,zM),e(Wt,UM),w(Kn,Wt,null),e(Wt,xM),w(es,Wt,null),_(s,_p,b),_(s,Oo,b),e(Oo,ts),e(ts,qd),w(Ba,qd,null),e(Oo,IM),e(Oo,Pd),e(Pd,NM),_(s,bp,b),_(s,rt,b),w(Fa,rt,null),e(rt,WM),e(rt,Rd),e(Rd,ZM),e(rt,qM),e(rt,Ea),e(Ea,PM),e(Ea,Zi),e(Zi,RM),e(Ea,GM),e(rt,VM),e(rt,ja),e(ja,AM),e(ja,Ja),e(Ja,SM),e(ja,XM),e(rt,OM),w(os,rt,null),e(rt,QM),e(rt,yt),w(Ca,yt,null),e(yt,DM),e(yt,Qo),e(Qo,LM),e(Qo,qi),e(qi,HM),e(Qo,YM),e(Qo,Gd),e(Gd,KM),e(Qo,ey),e(yt,ty),w(ns,yt,null),e(yt,oy),w(ss,yt,null),e(yt,ny),w(rs,yt,null),_(s,Mp,b),_(s,Do,b),e(Do,as),e(as,Vd),w(za,Vd,null),e(Do,sy),e(Do,Ad),e(Ad,ry),_(s,yp,b),_(s,at,b),w(Ua,at,null),e(at,ay),e(at,Sd),e(Sd,iy),e(at,ly),e(at,xa),e(xa,dy),e(xa,Pi),e(Pi,cy),e(xa,py),e(at,hy),e(at,Ia),e(Ia,my),e(Ia,Na),e(Na,uy),e(Ia,fy),e(at,gy),w(is,at,null),e(at,_y),e(at,Zt),w(Wa,Zt,null),e(Zt,by),e(Zt,Lo),e(Lo,My),e(Lo,Ri),e(Ri,yy),e(Lo,Ty),e(Lo,Xd),e(Xd,vy),e(Lo,ky),e(Zt,wy),w(ls,Zt,null),e(Zt,$y),w(ds,Zt,null),_(s,Tp,b),_(s,Ho,b),e(Ho,cs),e(cs,Od),w(Za,Od,null),e(Ho,By),e(Ho,Qd),e(Qd,Fy),_(s,vp,b),_(s,it,b),w(qa,it,null),e(it,Ey),e(it,Dd),e(Dd,jy),e(it,Jy),e(it,Pa),e(Pa,Cy),e(Pa,Gi),e(Gi,zy),e(Pa,Uy),e(it,xy),e(it,Ra),e(Ra,Iy),e(Ra,Ga),e(Ga,Ny),e(Ra,Wy),e(it,Zy),w(ps,it,null),e(it,qy),e(it,Tt),w(Va,Tt,null),e(Tt,Py),e(Tt,Yo),e(Yo,Ry),e(Yo,Vi),e(Vi,Gy),e(Yo,Vy),e(Yo,Ld),e(Ld,Ay),e(Yo,Sy),e(Tt,Xy),w(hs,Tt,null),e(Tt,Oy),w(ms,Tt,null),e(Tt,Qy),w(us,Tt,null),_(s,kp,b),_(s,Ko,b),e(Ko,fs),e(fs,Hd),w(Aa,Hd,null),e(Ko,Dy),e(Ko,Yd),e(Yd,Ly),_(s,wp,b),_(s,lt,b),w(Sa,lt,null),e(lt,Hy),e(lt,en),e(en,Yy),e(en,Kd),e(Kd,Ky),e(en,eT),e(en,ec),e(ec,tT),e(en,oT),e(lt,nT),e(lt,Xa),e(Xa,sT),e(Xa,Ai),e(Ai,rT),e(Xa,aT),e(lt,iT),e(lt,Oa),e(Oa,lT),e(Oa,Qa),e(Qa,dT),e(Oa,cT),e(lt,pT),w(gs,lt,null),e(lt,hT),e(lt,vt),w(Da,vt,null),e(vt,mT),e(vt,tn),e(tn,uT),e(tn,Si),e(Si,fT),e(tn,gT),e(tn,tc),e(tc,_T),e(tn,bT),e(vt,MT),w(_s,vt,null),e(vt,yT),w(bs,vt,null),e(vt,TT),w(Ms,vt,null),$p=!0},p(s,[b]){const La={};b&2&&(La.$$scope={dirty:b,ctx:s}),sn.$set(La);const oc={};b&2&&(oc.$$scope={dirty:b,ctx:s}),ln.$set(oc);const nc={};b&2&&(nc.$$scope={dirty:b,ctx:s}),pn.$set(nc);const sc={};b&2&&(sc.$$scope={dirty:b,ctx:s}),un.$set(sc);const Ha={};b&2&&(Ha.$$scope={dirty:b,ctx:s}),fn.$set(Ha);const rc={};b&2&&(rc.$$scope={dirty:b,ctx:s}),_n.$set(rc);const ac={};b&2&&(ac.$$scope={dirty:b,ctx:s}),bn.$set(ac);const ic={};b&2&&(ic.$$scope={dirty:b,ctx:s}),yn.$set(ic);const Ya={};b&2&&(Ya.$$scope={dirty:b,ctx:s}),Tn.$set(Ya);const lc={};b&2&&(lc.$$scope={dirty:b,ctx:s}),kn.$set(lc);const dc={};b&2&&(dc.$$scope={dirty:b,ctx:s}),wn.$set(dc);const cc={};b&2&&(cc.$$scope={dirty:b,ctx:s}),Bn.$set(cc);const pc={};b&2&&(pc.$$scope={dirty:b,ctx:s}),Fn.$set(pc);const hc={};b&2&&(hc.$$scope={dirty:b,ctx:s}),En.$set(hc);const Ka={};b&2&&(Ka.$$scope={dirty:b,ctx:s}),Jn.$set(Ka);const mc={};b&2&&(mc.$$scope={dirty:b,ctx:s}),Cn.$set(mc);const uc={};b&2&&(uc.$$scope={dirty:b,ctx:s}),Un.$set(uc);const on={};b&2&&(on.$$scope={dirty:b,ctx:s}),xn.$set(on);const fc={};b&2&&(fc.$$scope={dirty:b,ctx:s}),Nn.$set(fc);const gc={};b&2&&(gc.$$scope={dirty:b,ctx:s}),Wn.$set(gc);const ei={};b&2&&(ei.$$scope={dirty:b,ctx:s}),qn.$set(ei);const _c={};b&2&&(_c.$$scope={dirty:b,ctx:s}),Pn.$set(_c);const bc={};b&2&&(bc.$$scope={dirty:b,ctx:s}),Rn.$set(bc);const Mc={};b&2&&(Mc.$$scope={dirty:b,ctx:s}),Vn.$set(Mc);const wt={};b&2&&(wt.$$scope={dirty:b,ctx:s}),An.$set(wt);const yc={};b&2&&(yc.$$scope={dirty:b,ctx:s}),Sn.$set(yc);const Tc={};b&2&&(Tc.$$scope={dirty:b,ctx:s}),On.$set(Tc);const vc={};b&2&&(vc.$$scope={dirty:b,ctx:s}),Qn.$set(vc);const kc={};b&2&&(kc.$$scope={dirty:b,ctx:s}),Dn.$set(kc);const wc={};b&2&&(wc.$$scope={dirty:b,ctx:s}),Ln.$set(wc);const $c={};b&2&&($c.$$scope={dirty:b,ctx:s}),Yn.$set($c);const Bc={};b&2&&(Bc.$$scope={dirty:b,ctx:s}),Kn.$set(Bc);const Fc={};b&2&&(Fc.$$scope={dirty:b,ctx:s}),es.$set(Fc);const Ec={};b&2&&(Ec.$$scope={dirty:b,ctx:s}),os.$set(Ec);const jc={};b&2&&(jc.$$scope={dirty:b,ctx:s}),ns.$set(jc);const ti={};b&2&&(ti.$$scope={dirty:b,ctx:s}),ss.$set(ti);const Jc={};b&2&&(Jc.$$scope={dirty:b,ctx:s}),rs.$set(Jc);const Cc={};b&2&&(Cc.$$scope={dirty:b,ctx:s}),is.$set(Cc);const zc={};b&2&&(zc.$$scope={dirty:b,ctx:s}),ls.$set(zc);const $t={};b&2&&($t.$$scope={dirty:b,ctx:s}),ds.$set($t);const Dt={};b&2&&(Dt.$$scope={dirty:b,ctx:s}),ps.$set(Dt);const Uc={};b&2&&(Uc.$$scope={dirty:b,ctx:s}),hs.$set(Uc);const xc={};b&2&&(xc.$$scope={dirty:b,ctx:s}),ms.$set(xc);const Ic={};b&2&&(Ic.$$scope={dirty:b,ctx:s}),us.$set(Ic);const nn={};b&2&&(nn.$$scope={dirty:b,ctx:s}),gs.$set(nn);const Nc={};b&2&&(Nc.$$scope={dirty:b,ctx:s}),_s.$set(Nc);const Wc={};b&2&&(Wc.$$scope={dirty:b,ctx:s}),bs.$set(Wc);const Zc={};b&2&&(Zc.$$scope={dirty:b,ctx:s}),Ms.$set(Zc)},i(s){$p||($(l.$$.fragment,s),$(T.$$.fragment,s),$(U.$$.fragment,s),$(Us.$$.fragment,s),$(xs.$$.fragment,s),$(sn.$$.fragment,s),$(Ns.$$.fragment,s),$(Ws.$$.fragment,s),$(qs.$$.fragment,s),$(Rs.$$.fragment,s),$(Gs.$$.fragment,s),$(ln.$$.fragment,s),$(Vs.$$.fragment,s),$(Ss.$$.fragment,s),$(Xs.$$.fragment,s),$(Ds.$$.fragment,s),$(Hs.$$.fragment,s),$(pn.$$.fragment,s),$(Ys.$$.fragment,s),$(Ks.$$.fragment,s),$(tr.$$.fragment,s),$(nr.$$.fragment,s),$(sr.$$.fragment,s),$(dr.$$.fragment,s),$(un.$$.fragment,s),$(fn.$$.fragment,s),$(cr.$$.fragment,s),$(pr.$$.fragment,s),$(fr.$$.fragment,s),$(_n.$$.fragment,s),$(bn.$$.fragment,s),$(gr.$$.fragment,s),$(_r.$$.fragment,s),$(vr.$$.fragment,s),$(yn.$$.fragment,s),$(Tn.$$.fragment,s),$(kr.$$.fragment,s),$(wr.$$.fragment,s),$(jr.$$.fragment,s),$(kn.$$.fragment,s),$(wn.$$.fragment,s),$(Jr.$$.fragment,s),$(Cr.$$.fragment,s),$(Ir.$$.fragment,s),$(Bn.$$.fragment,s),$(Fn.$$.fragment,s),$(En.$$.fragment,s),$(Nr.$$.fragment,s),$(Wr.$$.fragment,s),$(Rr.$$.fragment,s),$(Jn.$$.fragment,s),$(Cn.$$.fragment,s),$(Gr.$$.fragment,s),$(Vr.$$.fragment,s),$(Or.$$.fragment,s),$(Un.$$.fragment,s),$(xn.$$.fragment,s),$(Qr.$$.fragment,s),$(Dr.$$.fragment,s),$(Kr.$$.fragment,s),$(Nn.$$.fragment,s),$(Wn.$$.fragment,s),$(ea.$$.fragment,s),$(ta.$$.fragment,s),$(qn.$$.fragment,s),$(ra.$$.fragment,s),$(Pn.$$.fragment,s),$(Rn.$$.fragment,s),$(aa.$$.fragment,s),$(ia.$$.fragment,s),$(Vn.$$.fragment,s),$(pa.$$.fragment,s),$(An.$$.fragment,s),$(Sn.$$.fragment,s),$(ha.$$.fragment,s),$(ma.$$.fragment,s),$(On.$$.fragment,s),$(ba.$$.fragment,s),$(Qn.$$.fragment,s),$(Dn.$$.fragment,s),$(Ln.$$.fragment,s),$(Ma.$$.fragment,s),$(ya.$$.fragment,s),$(Yn.$$.fragment,s),$($a.$$.fragment,s),$(Kn.$$.fragment,s),$(es.$$.fragment,s),$(Ba.$$.fragment,s),$(Fa.$$.fragment,s),$(os.$$.fragment,s),$(Ca.$$.fragment,s),$(ns.$$.fragment,s),$(ss.$$.fragment,s),$(rs.$$.fragment,s),$(za.$$.fragment,s),$(Ua.$$.fragment,s),$(is.$$.fragment,s),$(Wa.$$.fragment,s),$(ls.$$.fragment,s),$(ds.$$.fragment,s),$(Za.$$.fragment,s),$(qa.$$.fragment,s),$(ps.$$.fragment,s),$(Va.$$.fragment,s),$(hs.$$.fragment,s),$(ms.$$.fragment,s),$(us.$$.fragment,s),$(Aa.$$.fragment,s),$(Sa.$$.fragment,s),$(gs.$$.fragment,s),$(Da.$$.fragment,s),$(_s.$$.fragment,s),$(bs.$$.fragment,s),$(Ms.$$.fragment,s),$p=!0)},o(s){B(l.$$.fragment,s),B(T.$$.fragment,s),B(U.$$.fragment,s),B(Us.$$.fragment,s),B(xs.$$.fragment,s),B(sn.$$.fragment,s),B(Ns.$$.fragment,s),B(Ws.$$.fragment,s),B(qs.$$.fragment,s),B(Rs.$$.fragment,s),B(Gs.$$.fragment,s),B(ln.$$.fragment,s),B(Vs.$$.fragment,s),B(Ss.$$.fragment,s),B(Xs.$$.fragment,s),B(Ds.$$.fragment,s),B(Hs.$$.fragment,s),B(pn.$$.fragment,s),B(Ys.$$.fragment,s),B(Ks.$$.fragment,s),B(tr.$$.fragment,s),B(nr.$$.fragment,s),B(sr.$$.fragment,s),B(dr.$$.fragment,s),B(un.$$.fragment,s),B(fn.$$.fragment,s),B(cr.$$.fragment,s),B(pr.$$.fragment,s),B(fr.$$.fragment,s),B(_n.$$.fragment,s),B(bn.$$.fragment,s),B(gr.$$.fragment,s),B(_r.$$.fragment,s),B(vr.$$.fragment,s),B(yn.$$.fragment,s),B(Tn.$$.fragment,s),B(kr.$$.fragment,s),B(wr.$$.fragment,s),B(jr.$$.fragment,s),B(kn.$$.fragment,s),B(wn.$$.fragment,s),B(Jr.$$.fragment,s),B(Cr.$$.fragment,s),B(Ir.$$.fragment,s),B(Bn.$$.fragment,s),B(Fn.$$.fragment,s),B(En.$$.fragment,s),B(Nr.$$.fragment,s),B(Wr.$$.fragment,s),B(Rr.$$.fragment,s),B(Jn.$$.fragment,s),B(Cn.$$.fragment,s),B(Gr.$$.fragment,s),B(Vr.$$.fragment,s),B(Or.$$.fragment,s),B(Un.$$.fragment,s),B(xn.$$.fragment,s),B(Qr.$$.fragment,s),B(Dr.$$.fragment,s),B(Kr.$$.fragment,s),B(Nn.$$.fragment,s),B(Wn.$$.fragment,s),B(ea.$$.fragment,s),B(ta.$$.fragment,s),B(qn.$$.fragment,s),B(ra.$$.fragment,s),B(Pn.$$.fragment,s),B(Rn.$$.fragment,s),B(aa.$$.fragment,s),B(ia.$$.fragment,s),B(Vn.$$.fragment,s),B(pa.$$.fragment,s),B(An.$$.fragment,s),B(Sn.$$.fragment,s),B(ha.$$.fragment,s),B(ma.$$.fragment,s),B(On.$$.fragment,s),B(ba.$$.fragment,s),B(Qn.$$.fragment,s),B(Dn.$$.fragment,s),B(Ln.$$.fragment,s),B(Ma.$$.fragment,s),B(ya.$$.fragment,s),B(Yn.$$.fragment,s),B($a.$$.fragment,s),B(Kn.$$.fragment,s),B(es.$$.fragment,s),B(Ba.$$.fragment,s),B(Fa.$$.fragment,s),B(os.$$.fragment,s),B(Ca.$$.fragment,s),B(ns.$$.fragment,s),B(ss.$$.fragment,s),B(rs.$$.fragment,s),B(za.$$.fragment,s),B(Ua.$$.fragment,s),B(is.$$.fragment,s),B(Wa.$$.fragment,s),B(ls.$$.fragment,s),B(ds.$$.fragment,s),B(Za.$$.fragment,s),B(qa.$$.fragment,s),B(ps.$$.fragment,s),B(Va.$$.fragment,s),B(hs.$$.fragment,s),B(ms.$$.fragment,s),B(us.$$.fragment,s),B(Aa.$$.fragment,s),B(Sa.$$.fragment,s),B(gs.$$.fragment,s),B(Da.$$.fragment,s),B(_s.$$.fragment,s),B(bs.$$.fragment,s),B(Ms.$$.fragment,s),$p=!1},d(s){t(d),s&&t(y),s&&t(m),F(l),s&&t(me),s&&t(q),F(T),s&&t(ue),s&&t(R),s&&t(fe),s&&t(V),s&&t(ge),s&&t(A),s&&t(te),s&&t(z),s&&t(_e),s&&t(G),s&&t(x),s&&t(se),s&&t(be),s&&t(P),F(U),s&&t(Me),s&&t(f),s&&t(Ge),s&&t(Y),F(Us),s&&t(qc),s&&t(dt),F(xs),F(sn),s&&t(Pc),s&&t(mo),F(Ns),s&&t(Rc),s&&t(Ke),F(Ws),F(qs),F(Rs),F(Gs),F(ln),F(Vs),s&&t(Gc),s&&t(fo),F(Ss),s&&t(Vc),s&&t(ct),F(Xs),F(Ds),F(Hs),F(pn),s&&t(Ac),s&&t(_o),F(Ys),s&&t(Sc),s&&t(bo),F(Ks),s&&t(Xc),s&&t(Mo),F(tr),s&&t(Oc),s&&t(yo),F(nr),s&&t(Qc),s&&t(et),F(sr),F(dr),F(un),F(fn),s&&t(Dc),s&&t(vo),F(cr),s&&t(Lc),s&&t(pt),F(pr),F(fr),F(_n),F(bn),s&&t(Hc),s&&t($o),F(gr),s&&t(Yc),s&&t(ht),F(_r),F(vr),F(yn),F(Tn),s&&t(Kc),s&&t(Fo),F(kr),s&&t(ep),s&&t(mt),F(wr),F(jr),F(kn),F(wn),s&&t(tp),s&&t(jo),F(Jr),s&&t(op),s&&t(ut),F(Cr),F(Ir),F(Bn),F(Fn),F(En),s&&t(np),s&&t(Co),F(Nr),s&&t(sp),s&&t(ft),F(Wr),F(Rr),F(Jn),F(Cn),s&&t(rp),s&&t(Uo),F(Gr),s&&t(ap),s&&t(gt),F(Vr),F(Or),F(Un),F(xn),s&&t(ip),s&&t(Io),F(Qr),s&&t(lp),s&&t(_t),F(Dr),F(Kr),F(Nn),F(Wn),s&&t(dp),s&&t(Zo),F(ea),s&&t(cp),s&&t(tt),F(ta),F(qn),F(ra),F(Pn),F(Rn),s&&t(pp),s&&t(Po),F(aa),s&&t(hp),s&&t(ot),F(ia),F(Vn),F(pa),F(An),F(Sn),s&&t(mp),s&&t(Vo),F(ha),s&&t(up),s&&t(nt),F(ma),F(On),F(ba),F(Qn),F(Dn),F(Ln),s&&t(fp),s&&t(So),F(Ma),s&&t(gp),s&&t(st),F(ya),F(Yn),F($a),F(Kn),F(es),s&&t(_p),s&&t(Oo),F(Ba),s&&t(bp),s&&t(rt),F(Fa),F(os),F(Ca),F(ns),F(ss),F(rs),s&&t(Mp),s&&t(Do),F(za),s&&t(yp),s&&t(at),F(Ua),F(is),F(Wa),F(ls),F(ds),s&&t(Tp),s&&t(Ho),F(Za),s&&t(vp),s&&t(it),F(qa),F(ps),F(Va),F(hs),F(ms),F(us),s&&t(kp),s&&t(Ko),F(Aa),s&&t(wp),s&&t(lt),F(Sa),F(gs),F(Da),F(_s),F(bs),F(Ms)}}}const F2={local:"mobilebert",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.MobileBertConfig",title:"MobileBertConfig"},{local:"transformers.MobileBertTokenizer",title:"MobileBertTokenizer"},{local:"transformers.MobileBertTokenizerFast",title:"MobileBertTokenizerFast"},{local:"transformers.models.mobilebert.modeling_mobilebert.MobileBertForPreTrainingOutput",title:"MobileBert specific outputs"},{local:"transformers.MobileBertModel",title:"MobileBertModel"},{local:"transformers.MobileBertForPreTraining",title:"MobileBertForPreTraining"},{local:"transformers.MobileBertForMaskedLM",title:"MobileBertForMaskedLM"},{local:"transformers.MobileBertForNextSentencePrediction",title:"MobileBertForNextSentencePrediction"},{local:"transformers.MobileBertForSequenceClassification",title:"MobileBertForSequenceClassification"},{local:"transformers.MobileBertForMultipleChoice",title:"MobileBertForMultipleChoice"},{local:"transformers.MobileBertForTokenClassification",title:"MobileBertForTokenClassification"},{local:"transformers.MobileBertForQuestionAnswering",title:"MobileBertForQuestionAnswering"},{local:"transformers.TFMobileBertModel",title:"TFMobileBertModel"},{local:"transformers.TFMobileBertForPreTraining",title:"TFMobileBertForPreTraining"},{local:"transformers.TFMobileBertForMaskedLM",title:"TFMobileBertForMaskedLM"},{local:"transformers.TFMobileBertForNextSentencePrediction",title:"TFMobileBertForNextSentencePrediction"},{local:"transformers.TFMobileBertForSequenceClassification",title:"TFMobileBertForSequenceClassification"},{local:"transformers.TFMobileBertForMultipleChoice",title:"TFMobileBertForMultipleChoice"},{local:"transformers.TFMobileBertForTokenClassification",title:"TFMobileBertForTokenClassification"},{local:"transformers.TFMobileBertForQuestionAnswering",title:"TFMobileBertForQuestionAnswering"}],title:"MobileBERT"};function E2(C){return Cw(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class I2 extends Fw{constructor(d){super();Ew(this,d,E2,B2,jw,{})}}export{I2 as default,F2 as metadata};
