import{S as zm,i as vm,s as qm,e as o,k as u,w as M,t as l,M as Bm,c as a,d as s,m as h,a as r,x as w,h as i,b as g,G as e,g as b,y as k,q as T,o as z,B as v,v as $m,L as Z}from"../../chunks/vendor-hf-doc-builder.js";import{T as Hn}from"../../chunks/Tip-hf-doc-builder.js";import{D as V}from"../../chunks/Docstring-hf-doc-builder.js";import{C as I}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as oe}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function jm(q){let c,_,m,d,f;return d=new I({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFNxdWVlemVCZXJ0Q29uZmlnJTJDJTIwU3F1ZWV6ZUJlcnRNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBTcXVlZXplQkVSVCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwU3F1ZWV6ZUJlcnRDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwY29uZmlndXJhdGlvbiUyMGFib3ZlJTBBbW9kZWwlMjAlM0QlMjBTcXVlZXplQmVydE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SqueezeBertConfig, SqueezeBertModel

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

<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 = SqueezeBertModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){c=o("p"),_=l("Examples:"),m=u(),M(d.$$.fragment)},l(t){c=a(t,"P",{});var p=r(c);_=i(p,"Examples:"),p.forEach(s),m=h(t),w(d.$$.fragment,t)},m(t,p){b(t,c,p),e(c,_),b(t,m,p),k(d,t,p),f=!0},p:Z,i(t){f||(T(d.$$.fragment,t),f=!0)},o(t){z(d.$$.fragment,t),f=!1},d(t){t&&s(c),t&&s(m),v(d,t)}}}function Jm(q){let c,_,m,d,f;return d=new I({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMEElN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTIwJTIwJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){c=o("p"),_=l("sequence pair mask has the following format:"),m=u(),M(d.$$.fragment)},l(t){c=a(t,"P",{});var p=r(c);_=i(p,"sequence pair mask has the following format:"),p.forEach(s),m=h(t),w(d.$$.fragment,t)},m(t,p){b(t,c,p),e(c,_),b(t,m,p),k(d,t,p),f=!0},p:Z,i(t){f||(T(d.$$.fragment,t),f=!0)},o(t){z(d.$$.fragment,t),f=!1},d(t){t&&s(c),t&&s(m),v(d,t)}}}function Sm(q){let c,_,m,d,f;return d=new I({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMEElN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTIwJTIwJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){c=o("p"),_=l("sequence pair mask has the following format:"),m=u(),M(d.$$.fragment)},l(t){c=a(t,"P",{});var p=r(c);_=i(p,"sequence pair mask has the following format:"),p.forEach(s),m=h(t),w(d.$$.fragment,t)},m(t,p){b(t,c,p),e(c,_),b(t,m,p),k(d,t,p),f=!0},p:Z,i(t){f||(T(d.$$.fragment,t),f=!0)},o(t){z(d.$$.fragment,t),f=!1},d(t){t&&s(c),t&&s(m),v(d,t)}}}function Um(q){let c,_,m,d,f;return d=new I({props:{code:"SW50ZXJuYWwlMjBjbGFzcyUyMGhpZXJhcmNoeSUzQSUwQVNxdWVlemVCZXJ0TW9kZWwlMEElMjAlMjAlMjAlMjBTcXVlZXplQmVydEVuY29kZXIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBTcXVlZXplQmVydE1vZHVsZSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMFNxdWVlemVCZXJ0U2VsZkF0dGVudGlvbiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMENvbnZBY3RpdmF0aW9uJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwQ29udkRyb3BvdXRMYXllck5vcm0=",highlighted:`Internal <span class="hljs-keyword">class</span> <span class="hljs-symbol">hierarchy:
<span class="hljs-symbol">SqueezeBertModel</span></span>
    <span class="hljs-symbol">SqueezeBertEncoder</span>
        <span class="hljs-symbol">SqueezeBertModule</span>
        <span class="hljs-symbol">SqueezeBertSelfAttention</span>
            <span class="hljs-symbol">ConvActivation</span>
            <span class="hljs-symbol">ConvDropoutLayerNorm</span>`}}),{c(){c=o("p"),_=l("Hierarchy:"),m=u(),M(d.$$.fragment)},l(t){c=a(t,"P",{});var p=r(c);_=i(p,"Hierarchy:"),p.forEach(s),m=h(t),w(d.$$.fragment,t)},m(t,p){b(t,c,p),e(c,_),b(t,m,p),k(d,t,p),f=!0},p:Z,i(t){f||(T(d.$$.fragment,t),f=!0)},o(t){z(d.$$.fragment,t),f=!1},d(t){t&&s(c),t&&s(m),v(d,t)}}}function Cm(q){let c,_,m,d,f;return d=new I({props:{code:"SW5wdXQlMjBkYXRhJTIwaXMlMjBpbiUyMCU1QmJhdGNoJTJDJTIwc2VxdWVuY2VfbGVuZ3RoJTJDJTIwaGlkZGVuX3NpemUlNUQlMjBmb3JtYXQuJTBBJTBBRGF0YSUyMGluc2lkZSUyMHRoZSUyMGVuY29kZXIlMjBpcyUyMGluJTIwJTVCYmF0Y2glMkMlMjBoaWRkZW5fc2l6ZSUyQyUyMHNlcXVlbmNlX2xlbmd0aCU1RCUyMGZvcm1hdC4lMjBCdXQlMkMlMjBpZiUyMCU2MG91dHB1dF9oaWRkZW5fc3RhdGVzJTIwJTNEJTNEJTIwVHJ1ZSU2MCUyQyUyMHRoZSUyMGRhdGElMjBmcm9tJTIwaW5zaWRlJTIwdGhlJTIwZW5jb2RlciUyMGlzJTIwcmV0dXJuZWQlMjBpbiUyMCU1QmJhdGNoJTJDJTIwc2VxdWVuY2VfbGVuZ3RoJTJDJTIwaGlkZGVuX3NpemUlNUQlMjBmb3JtYXQuJTBBJTBBVGhlJTIwZmluYWwlMjBvdXRwdXQlMjBvZiUyMHRoZSUyMGVuY29kZXIlMjBpcyUyMGluJTIwJTVCYmF0Y2glMkMlMjBzZXF1ZW5jZV9sZW5ndGglMkMlMjBoaWRkZW5fc2l6ZSU1RCUyMGZvcm1hdC4=",highlighted:`<span class="hljs-keyword">Input</span> data <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

Data inside the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, hidden_size, sequence_length] <span class="hljs-keyword">format</span>. But, <span class="hljs-keyword">if</span> \`output_hidden_states == <span class="hljs-keyword">True</span>\`, the data <span class="hljs-keyword">from</span> inside the encoder <span class="hljs-keyword">is</span> returned <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

The final output <span class="hljs-keyword">of</span> the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.`}}),{c(){c=o("p"),_=l("Data layouts:"),m=u(),M(d.$$.fragment)},l(t){c=a(t,"P",{});var p=r(c);_=i(p,"Data layouts:"),p.forEach(s),m=h(t),w(d.$$.fragment,t)},m(t,p){b(t,c,p),e(c,_),b(t,m,p),k(d,t,p),f=!0},p:Z,i(t){f||(T(d.$$.fragment,t),f=!0)},o(t){z(d.$$.fragment,t),f=!1},d(t){t&&s(c),t&&s(m),v(d,t)}}}function Em(q){let c,_,m,d,f;return{c(){c=o("p"),_=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=o("code"),d=l("Module"),f=l(`
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(t){c=a(t,"P",{});var p=r(c);_=i(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(p,"CODE",{});var B=r(m);d=i(B,"Module"),B.forEach(s),f=i(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(s)},m(t,p){b(t,c,p),e(c,_),e(c,m),e(m,d),e(c,f)},d(t){t&&s(c)}}}function Zm(q){let c,_,m,d,f;return d=new I({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBTcXVlZXplQmVydE1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJzcXVlZXplYmVydCUyRnNxdWVlemViZXJ0LXVuY2FzZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBTcXVlZXplQmVydE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJzcXVlZXplYmVydCUyRnNxdWVlemViZXJ0LXVuY2FzZWQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, SqueezeBertModel
<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;squeezebert/squeezebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertModel.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-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(){c=o("p"),_=l("Example:"),m=u(),M(d.$$.fragment)},l(t){c=a(t,"P",{});var p=r(c);_=i(p,"Example:"),p.forEach(s),m=h(t),w(d.$$.fragment,t)},m(t,p){b(t,c,p),e(c,_),b(t,m,p),k(d,t,p),f=!0},p:Z,i(t){f||(T(d.$$.fragment,t),f=!0)},o(t){z(d.$$.fragment,t),f=!1},d(t){t&&s(c),t&&s(m),v(d,t)}}}function Im(q){let c,_,m,d,f;return d=new I({props:{code:"SW50ZXJuYWwlMjBjbGFzcyUyMGhpZXJhcmNoeSUzQSUwQVNxdWVlemVCZXJ0TW9kZWwlMEElMjAlMjAlMjAlMjBTcXVlZXplQmVydEVuY29kZXIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBTcXVlZXplQmVydE1vZHVsZSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMFNxdWVlemVCZXJ0U2VsZkF0dGVudGlvbiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMENvbnZBY3RpdmF0aW9uJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwQ29udkRyb3BvdXRMYXllck5vcm0=",highlighted:`Internal <span class="hljs-keyword">class</span> <span class="hljs-symbol">hierarchy:
<span class="hljs-symbol">SqueezeBertModel</span></span>
    <span class="hljs-symbol">SqueezeBertEncoder</span>
        <span class="hljs-symbol">SqueezeBertModule</span>
        <span class="hljs-symbol">SqueezeBertSelfAttention</span>
            <span class="hljs-symbol">ConvActivation</span>
            <span class="hljs-symbol">ConvDropoutLayerNorm</span>`}}),{c(){c=o("p"),_=l("Hierarchy:"),m=u(),M(d.$$.fragment)},l(t){c=a(t,"P",{});var p=r(c);_=i(p,"Hierarchy:"),p.forEach(s),m=h(t),w(d.$$.fragment,t)},m(t,p){b(t,c,p),e(c,_),b(t,m,p),k(d,t,p),f=!0},p:Z,i(t){f||(T(d.$$.fragment,t),f=!0)},o(t){z(d.$$.fragment,t),f=!1},d(t){t&&s(c),t&&s(m),v(d,t)}}}function Vm(q){let c,_,m,d,f;return d=new I({props:{code:"SW5wdXQlMjBkYXRhJTIwaXMlMjBpbiUyMCU1QmJhdGNoJTJDJTIwc2VxdWVuY2VfbGVuZ3RoJTJDJTIwaGlkZGVuX3NpemUlNUQlMjBmb3JtYXQuJTBBJTBBRGF0YSUyMGluc2lkZSUyMHRoZSUyMGVuY29kZXIlMjBpcyUyMGluJTIwJTVCYmF0Y2glMkMlMjBoaWRkZW5fc2l6ZSUyQyUyMHNlcXVlbmNlX2xlbmd0aCU1RCUyMGZvcm1hdC4lMjBCdXQlMkMlMjBpZiUyMCU2MG91dHB1dF9oaWRkZW5fc3RhdGVzJTIwJTNEJTNEJTIwVHJ1ZSU2MCUyQyUyMHRoZSUyMGRhdGElMjBmcm9tJTIwaW5zaWRlJTIwdGhlJTIwZW5jb2RlciUyMGlzJTIwcmV0dXJuZWQlMjBpbiUyMCU1QmJhdGNoJTJDJTIwc2VxdWVuY2VfbGVuZ3RoJTJDJTIwaGlkZGVuX3NpemUlNUQlMjBmb3JtYXQuJTBBJTBBVGhlJTIwZmluYWwlMjBvdXRwdXQlMjBvZiUyMHRoZSUyMGVuY29kZXIlMjBpcyUyMGluJTIwJTVCYmF0Y2glMkMlMjBzZXF1ZW5jZV9sZW5ndGglMkMlMjBoaWRkZW5fc2l6ZSU1RCUyMGZvcm1hdC4=",highlighted:`<span class="hljs-keyword">Input</span> data <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

Data inside the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, hidden_size, sequence_length] <span class="hljs-keyword">format</span>. But, <span class="hljs-keyword">if</span> \`output_hidden_states == <span class="hljs-keyword">True</span>\`, the data <span class="hljs-keyword">from</span> inside the encoder <span class="hljs-keyword">is</span> returned <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

The final output <span class="hljs-keyword">of</span> the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.`}}),{c(){c=o("p"),_=l("Data layouts:"),m=u(),M(d.$$.fragment)},l(t){c=a(t,"P",{});var p=r(c);_=i(p,"Data layouts:"),p.forEach(s),m=h(t),w(d.$$.fragment,t)},m(t,p){b(t,c,p),e(c,_),b(t,m,p),k(d,t,p),f=!0},p:Z,i(t){f||(T(d.$$.fragment,t),f=!0)},o(t){z(d.$$.fragment,t),f=!1},d(t){t&&s(c),t&&s(m),v(d,t)}}}function Wm(q){let c,_,m,d,f;return{c(){c=o("p"),_=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=o("code"),d=l("Module"),f=l(`
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(t){c=a(t,"P",{});var p=r(c);_=i(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(p,"CODE",{});var B=r(m);d=i(B,"Module"),B.forEach(s),f=i(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(s)},m(t,p){b(t,c,p),e(c,_),e(c,m),e(m,d),e(c,f)},d(t){t&&s(c)}}}function Fm(q){let c,_,m,d,f;return d=new I({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBTcXVlZXplQmVydEZvck1hc2tlZExNJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJzcXVlZXplYmVydCUyRnNxdWVlemViZXJ0LXVuY2FzZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBTcXVlZXplQmVydEZvck1hc2tlZExNLmZyb21fcHJldHJhaW5lZCglMjJzcXVlZXplYmVydCUyRnNxdWVlemViZXJ0LXVuY2FzZWQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMlRoZSUyMGNhcGl0YWwlMjBvZiUyMEZyYW5jZSUyMGlzJTIwJTVCTUFTSyU1RC4lMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBJTIzJTIwcmV0cmlldmUlMjBpbmRleCUyMG9mJTIwJTVCTUFTSyU1RCUwQW1hc2tfdG9rZW5faW5kZXglMjAlM0QlMjAoaW5wdXRzLmlucHV0X2lkcyUyMCUzRCUzRCUyMHRva2VuaXplci5tYXNrX3Rva2VuX2lkKSU1QjAlNUQubm9uemVybyhhc190dXBsZSUzRFRydWUpJTVCMCU1RCUwQSUwQXByZWRpY3RlZF90b2tlbl9pZCUyMCUzRCUyMGxvZ2l0cyU1QjAlMkMlMjBtYXNrX3Rva2VuX2luZGV4JTVELmFyZ21heChheGlzJTNELTEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9rZW5pemVyKCUyMlRoZSUyMGNhcGl0YWwlMjBvZiUyMEZyYW5jZSUyMGlzJTIwUGFyaXMuJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklNUIlMjJpbnB1dF9pZHMlMjIlNUQlMEElMjMlMjBtYXNrJTIwbGFiZWxzJTIwb2YlMjBub24tJTVCTUFTSyU1RCUyMHRva2VucyUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLndoZXJlKGlucHV0cy5pbnB1dF9pZHMlMjAlM0QlM0QlMjB0b2tlbml6ZXIubWFza190b2tlbl9pZCUyQyUyMGxhYmVscyUyQyUyMC0xMDApJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzJTJDJTIwbGFiZWxzJTNEbGFiZWxzKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, SqueezeBertForMaskedLM
<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;squeezebert/squeezebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertForMaskedLM.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-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>labels = tokenizer(<span class="hljs-string">&quot;The capital of France is Paris.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># mask labels of non-[MASK] tokens</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.where(inputs.input_ids == tokenizer.mask_token_id, labels, -<span class="hljs-number">100</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)`}}),{c(){c=o("p"),_=l("Example:"),m=u(),M(d.$$.fragment)},l(t){c=a(t,"P",{});var p=r(c);_=i(p,"Example:"),p.forEach(s),m=h(t),w(d.$$.fragment,t)},m(t,p){b(t,c,p),e(c,_),b(t,m,p),k(d,t,p),f=!0},p:Z,i(t){f||(T(d.$$.fragment,t),f=!0)},o(t){z(d.$$.fragment,t),f=!1},d(t){t&&s(c),t&&s(m),v(d,t)}}}function Rm(q){let c,_,m,d,f;return d=new I({props:{code:"SW50ZXJuYWwlMjBjbGFzcyUyMGhpZXJhcmNoeSUzQSUwQVNxdWVlemVCZXJ0TW9kZWwlMEElMjAlMjAlMjAlMjBTcXVlZXplQmVydEVuY29kZXIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBTcXVlZXplQmVydE1vZHVsZSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMFNxdWVlemVCZXJ0U2VsZkF0dGVudGlvbiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMENvbnZBY3RpdmF0aW9uJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwQ29udkRyb3BvdXRMYXllck5vcm0=",highlighted:`Internal <span class="hljs-keyword">class</span> <span class="hljs-symbol">hierarchy:
<span class="hljs-symbol">SqueezeBertModel</span></span>
    <span class="hljs-symbol">SqueezeBertEncoder</span>
        <span class="hljs-symbol">SqueezeBertModule</span>
        <span class="hljs-symbol">SqueezeBertSelfAttention</span>
            <span class="hljs-symbol">ConvActivation</span>
            <span class="hljs-symbol">ConvDropoutLayerNorm</span>`}}),{c(){c=o("p"),_=l("Hierarchy:"),m=u(),M(d.$$.fragment)},l(t){c=a(t,"P",{});var p=r(c);_=i(p,"Hierarchy:"),p.forEach(s),m=h(t),w(d.$$.fragment,t)},m(t,p){b(t,c,p),e(c,_),b(t,m,p),k(d,t,p),f=!0},p:Z,i(t){f||(T(d.$$.fragment,t),f=!0)},o(t){z(d.$$.fragment,t),f=!1},d(t){t&&s(c),t&&s(m),v(d,t)}}}function xm(q){let c,_,m,d,f;return d=new I({props:{code:"SW5wdXQlMjBkYXRhJTIwaXMlMjBpbiUyMCU1QmJhdGNoJTJDJTIwc2VxdWVuY2VfbGVuZ3RoJTJDJTIwaGlkZGVuX3NpemUlNUQlMjBmb3JtYXQuJTBBJTBBRGF0YSUyMGluc2lkZSUyMHRoZSUyMGVuY29kZXIlMjBpcyUyMGluJTIwJTVCYmF0Y2glMkMlMjBoaWRkZW5fc2l6ZSUyQyUyMHNlcXVlbmNlX2xlbmd0aCU1RCUyMGZvcm1hdC4lMjBCdXQlMkMlMjBpZiUyMCU2MG91dHB1dF9oaWRkZW5fc3RhdGVzJTIwJTNEJTNEJTIwVHJ1ZSU2MCUyQyUyMHRoZSUyMGRhdGElMjBmcm9tJTIwaW5zaWRlJTIwdGhlJTIwZW5jb2RlciUyMGlzJTIwcmV0dXJuZWQlMjBpbiUyMCU1QmJhdGNoJTJDJTIwc2VxdWVuY2VfbGVuZ3RoJTJDJTIwaGlkZGVuX3NpemUlNUQlMjBmb3JtYXQuJTBBJTBBVGhlJTIwZmluYWwlMjBvdXRwdXQlMjBvZiUyMHRoZSUyMGVuY29kZXIlMjBpcyUyMGluJTIwJTVCYmF0Y2glMkMlMjBzZXF1ZW5jZV9sZW5ndGglMkMlMjBoaWRkZW5fc2l6ZSU1RCUyMGZvcm1hdC4=",highlighted:`<span class="hljs-keyword">Input</span> data <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

Data inside the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, hidden_size, sequence_length] <span class="hljs-keyword">format</span>. But, <span class="hljs-keyword">if</span> \`output_hidden_states == <span class="hljs-keyword">True</span>\`, the data <span class="hljs-keyword">from</span> inside the encoder <span class="hljs-keyword">is</span> returned <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

The final output <span class="hljs-keyword">of</span> the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.`}}),{c(){c=o("p"),_=l("Data layouts:"),m=u(),M(d.$$.fragment)},l(t){c=a(t,"P",{});var p=r(c);_=i(p,"Data layouts:"),p.forEach(s),m=h(t),w(d.$$.fragment,t)},m(t,p){b(t,c,p),e(c,_),b(t,m,p),k(d,t,p),f=!0},p:Z,i(t){f||(T(d.$$.fragment,t),f=!0)},o(t){z(d.$$.fragment,t),f=!1},d(t){t&&s(c),t&&s(m),v(d,t)}}}function Xm(q){let c,_,m,d,f;return{c(){c=o("p"),_=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=o("code"),d=l("Module"),f=l(`
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(t){c=a(t,"P",{});var p=r(c);_=i(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(p,"CODE",{});var B=r(m);d=i(B,"Module"),B.forEach(s),f=i(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(s)},m(t,p){b(t,c,p),e(c,_),e(c,m),e(m,d),e(c,f)},d(t){t&&s(c)}}}function Nm(q){let c,_,m,d,f;return d=new I({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMFNxdWVlemVCZXJ0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnNxdWVlemViZXJ0JTJGc3F1ZWV6ZWJlcnQtdW5jYXNlZCUyMiklMEFtb2RlbCUyMCUzRCUyMFNxdWVlemVCZXJ0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyc3F1ZWV6ZWJlcnQlMkZzcXVlZXplYmVydC11bmNhc2VkJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQXByZWRpY3RlZF9jbGFzc19pZCUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoKS5pdGVtKCklMEElMEElMjMlMjBUbyUyMHRyYWluJTIwYSUyMG1vZGVsJTIwb24lMjAlNjBudW1fbGFiZWxzJTYwJTIwY2xhc3NlcyUyQyUyMHlvdSUyMGNhbiUyMHBhc3MlMjAlNjBudW1fbGFiZWxzJTNEbnVtX2xhYmVscyU2MCUyMHRvJTIwJTYwLmZyb21fcHJldHJhaW5lZCguLi4pJTYwJTBBbnVtX2xhYmVscyUyMCUzRCUyMGxlbihtb2RlbC5jb25maWcuaWQybGFiZWwpJTBBbW9kZWwlMjAlM0QlMjBTcXVlZXplQmVydEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMnNxdWVlemViZXJ0JTJGc3F1ZWV6ZWJlcnQtdW5jYXNlZCUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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, SqueezeBertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-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><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.<span class="hljs-built_in">sum</span>(
<span class="hljs-meta">... </span>    torch.nn.functional.one_hot(predicted_class_ids[<span class="hljs-literal">None</span>, :].clone(), num_classes=num_labels), dim=<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>).to(torch.<span class="hljs-built_in">float</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){c=o("p"),_=l("Example of multi-label classification:"),m=u(),M(d.$$.fragment)},l(t){c=a(t,"P",{});var p=r(c);_=i(p,"Example of multi-label classification:"),p.forEach(s),m=h(t),w(d.$$.fragment,t)},m(t,p){b(t,c,p),e(c,_),b(t,m,p),k(d,t,p),f=!0},p:Z,i(t){f||(T(d.$$.fragment,t),f=!0)},o(t){z(d.$$.fragment,t),f=!1},d(t){t&&s(c),t&&s(m),v(d,t)}}}function Am(q){let c,_,m,d,f;return d=new I({props:{code:"SW50ZXJuYWwlMjBjbGFzcyUyMGhpZXJhcmNoeSUzQSUwQVNxdWVlemVCZXJ0TW9kZWwlMEElMjAlMjAlMjAlMjBTcXVlZXplQmVydEVuY29kZXIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBTcXVlZXplQmVydE1vZHVsZSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMFNxdWVlemVCZXJ0U2VsZkF0dGVudGlvbiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMENvbnZBY3RpdmF0aW9uJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwQ29udkRyb3BvdXRMYXllck5vcm0=",highlighted:`Internal <span class="hljs-keyword">class</span> <span class="hljs-symbol">hierarchy:
<span class="hljs-symbol">SqueezeBertModel</span></span>
    <span class="hljs-symbol">SqueezeBertEncoder</span>
        <span class="hljs-symbol">SqueezeBertModule</span>
        <span class="hljs-symbol">SqueezeBertSelfAttention</span>
            <span class="hljs-symbol">ConvActivation</span>
            <span class="hljs-symbol">ConvDropoutLayerNorm</span>`}}),{c(){c=o("p"),_=l("Hierarchy:"),m=u(),M(d.$$.fragment)},l(t){c=a(t,"P",{});var p=r(c);_=i(p,"Hierarchy:"),p.forEach(s),m=h(t),w(d.$$.fragment,t)},m(t,p){b(t,c,p),e(c,_),b(t,m,p),k(d,t,p),f=!0},p:Z,i(t){f||(T(d.$$.fragment,t),f=!0)},o(t){z(d.$$.fragment,t),f=!1},d(t){t&&s(c),t&&s(m),v(d,t)}}}function Qm(q){let c,_,m,d,f;return d=new I({props:{code:"SW5wdXQlMjBkYXRhJTIwaXMlMjBpbiUyMCU1QmJhdGNoJTJDJTIwc2VxdWVuY2VfbGVuZ3RoJTJDJTIwaGlkZGVuX3NpemUlNUQlMjBmb3JtYXQuJTBBJTBBRGF0YSUyMGluc2lkZSUyMHRoZSUyMGVuY29kZXIlMjBpcyUyMGluJTIwJTVCYmF0Y2glMkMlMjBoaWRkZW5fc2l6ZSUyQyUyMHNlcXVlbmNlX2xlbmd0aCU1RCUyMGZvcm1hdC4lMjBCdXQlMkMlMjBpZiUyMCU2MG91dHB1dF9oaWRkZW5fc3RhdGVzJTIwJTNEJTNEJTIwVHJ1ZSU2MCUyQyUyMHRoZSUyMGRhdGElMjBmcm9tJTIwaW5zaWRlJTIwdGhlJTIwZW5jb2RlciUyMGlzJTIwcmV0dXJuZWQlMjBpbiUyMCU1QmJhdGNoJTJDJTIwc2VxdWVuY2VfbGVuZ3RoJTJDJTIwaGlkZGVuX3NpemUlNUQlMjBmb3JtYXQuJTBBJTBBVGhlJTIwZmluYWwlMjBvdXRwdXQlMjBvZiUyMHRoZSUyMGVuY29kZXIlMjBpcyUyMGluJTIwJTVCYmF0Y2glMkMlMjBzZXF1ZW5jZV9sZW5ndGglMkMlMjBoaWRkZW5fc2l6ZSU1RCUyMGZvcm1hdC4=",highlighted:`<span class="hljs-keyword">Input</span> data <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

Data inside the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, hidden_size, sequence_length] <span class="hljs-keyword">format</span>. But, <span class="hljs-keyword">if</span> \`output_hidden_states == <span class="hljs-keyword">True</span>\`, the data <span class="hljs-keyword">from</span> inside the encoder <span class="hljs-keyword">is</span> returned <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

The final output <span class="hljs-keyword">of</span> the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.`}}),{c(){c=o("p"),_=l("Data layouts:"),m=u(),M(d.$$.fragment)},l(t){c=a(t,"P",{});var p=r(c);_=i(p,"Data layouts:"),p.forEach(s),m=h(t),w(d.$$.fragment,t)},m(t,p){b(t,c,p),e(c,_),b(t,m,p),k(d,t,p),f=!0},p:Z,i(t){f||(T(d.$$.fragment,t),f=!0)},o(t){z(d.$$.fragment,t),f=!1},d(t){t&&s(c),t&&s(m),v(d,t)}}}function Pm(q){let c,_,m,d,f;return{c(){c=o("p"),_=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=o("code"),d=l("Module"),f=l(`
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(t){c=a(t,"P",{});var p=r(c);_=i(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(p,"CODE",{});var B=r(m);d=i(B,"Module"),B.forEach(s),f=i(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(s)},m(t,p){b(t,c,p),e(c,_),e(c,m),e(m,d),e(c,f)},d(t){t&&s(c)}}}function Ym(q){let c,_,m,d,f;return d=new I({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBTcXVlZXplQmVydEZvck11bHRpcGxlQ2hvaWNlJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJzcXVlZXplYmVydCUyRnNxdWVlemViZXJ0LXVuY2FzZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBTcXVlZXplQmVydEZvck11bHRpcGxlQ2hvaWNlLmZyb21fcHJldHJhaW5lZCglMjJzcXVlZXplYmVydCUyRnNxdWVlemViZXJ0LXVuY2FzZWQlMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIySW4lMjBJdGFseSUyQyUyMHBpenphJTIwc2VydmVkJTIwaW4lMjBmb3JtYWwlMjBzZXR0aW5ncyUyQyUyMHN1Y2glMjBhcyUyMGF0JTIwYSUyMHJlc3RhdXJhbnQlMkMlMjBpcyUyMHByZXNlbnRlZCUyMHVuc2xpY2VkLiUyMiUwQWNob2ljZTAlMjAlM0QlMjAlMjJJdCUyMGlzJTIwZWF0ZW4lMjB3aXRoJTIwYSUyMGZvcmslMjBhbmQlMjBhJTIwa25pZmUuJTIyJTBBY2hvaWNlMSUyMCUzRCUyMCUyMkl0JTIwaXMlMjBlYXRlbiUyMHdoaWxlJTIwaGVsZCUyMGluJTIwdGhlJTIwaGFuZC4lMjIlMEFsYWJlbHMlMjAlM0QlMjB0b3JjaC50ZW5zb3IoMCkudW5zcXVlZXplKDApJTIwJTIwJTIzJTIwY2hvaWNlMCUyMGlzJTIwY29ycmVjdCUyMChhY2NvcmRpbmclMjB0byUyMFdpa2lwZWRpYSUyMCUzQikpJTJDJTIwYmF0Y2glMjBzaXplJTIwMSUwQSUwQWVuY29kaW5nJTIwJTNEJTIwdG9rZW5pemVyKCU1QnByb21wdCUyQyUyMHByb21wdCU1RCUyQyUyMCU1QmNob2ljZTAlMkMlMjBjaG9pY2UxJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUyQyUyMHBhZGRpbmclM0RUcnVlKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKiU3QmslM0ElMjB2LnVuc3F1ZWV6ZSgwKSUyMGZvciUyMGslMkMlMjB2JTIwaW4lMjBlbmNvZGluZy5pdGVtcygpJTdEJTJDJTIwbGFiZWxzJTNEbGFiZWxzKSUyMCUyMCUyMyUyMGJhdGNoJTIwc2l6ZSUyMGlzJTIwMSUwQSUwQSUyMyUyMHRoZSUyMGxpbmVhciUyMGNsYXNzaWZpZXIlMjBzdGlsbCUyMG5lZWRzJTIwdG8lMjBiZSUyMHRyYWluZWQlMEFsb3NzJTIwJTNEJTIwb3V0cHV0cy5sb3NzJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, SqueezeBertForMultipleChoice
<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;squeezebert/squeezebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-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(){c=o("p"),_=l("Example:"),m=u(),M(d.$$.fragment)},l(t){c=a(t,"P",{});var p=r(c);_=i(p,"Example:"),p.forEach(s),m=h(t),w(d.$$.fragment,t)},m(t,p){b(t,c,p),e(c,_),b(t,m,p),k(d,t,p),f=!0},p:Z,i(t){f||(T(d.$$.fragment,t),f=!0)},o(t){z(d.$$.fragment,t),f=!1},d(t){t&&s(c),t&&s(m),v(d,t)}}}function Lm(q){let c,_,m,d,f;return d=new I({props:{code:"SW50ZXJuYWwlMjBjbGFzcyUyMGhpZXJhcmNoeSUzQSUwQVNxdWVlemVCZXJ0TW9kZWwlMEElMjAlMjAlMjAlMjBTcXVlZXplQmVydEVuY29kZXIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBTcXVlZXplQmVydE1vZHVsZSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMFNxdWVlemVCZXJ0U2VsZkF0dGVudGlvbiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMENvbnZBY3RpdmF0aW9uJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwQ29udkRyb3BvdXRMYXllck5vcm0=",highlighted:`Internal <span class="hljs-keyword">class</span> <span class="hljs-symbol">hierarchy:
<span class="hljs-symbol">SqueezeBertModel</span></span>
    <span class="hljs-symbol">SqueezeBertEncoder</span>
        <span class="hljs-symbol">SqueezeBertModule</span>
        <span class="hljs-symbol">SqueezeBertSelfAttention</span>
            <span class="hljs-symbol">ConvActivation</span>
            <span class="hljs-symbol">ConvDropoutLayerNorm</span>`}}),{c(){c=o("p"),_=l("Hierarchy:"),m=u(),M(d.$$.fragment)},l(t){c=a(t,"P",{});var p=r(c);_=i(p,"Hierarchy:"),p.forEach(s),m=h(t),w(d.$$.fragment,t)},m(t,p){b(t,c,p),e(c,_),b(t,m,p),k(d,t,p),f=!0},p:Z,i(t){f||(T(d.$$.fragment,t),f=!0)},o(t){z(d.$$.fragment,t),f=!1},d(t){t&&s(c),t&&s(m),v(d,t)}}}function Dm(q){let c,_,m,d,f;return d=new I({props:{code:"SW5wdXQlMjBkYXRhJTIwaXMlMjBpbiUyMCU1QmJhdGNoJTJDJTIwc2VxdWVuY2VfbGVuZ3RoJTJDJTIwaGlkZGVuX3NpemUlNUQlMjBmb3JtYXQuJTBBJTBBRGF0YSUyMGluc2lkZSUyMHRoZSUyMGVuY29kZXIlMjBpcyUyMGluJTIwJTVCYmF0Y2glMkMlMjBoaWRkZW5fc2l6ZSUyQyUyMHNlcXVlbmNlX2xlbmd0aCU1RCUyMGZvcm1hdC4lMjBCdXQlMkMlMjBpZiUyMCU2MG91dHB1dF9oaWRkZW5fc3RhdGVzJTIwJTNEJTNEJTIwVHJ1ZSU2MCUyQyUyMHRoZSUyMGRhdGElMjBmcm9tJTIwaW5zaWRlJTIwdGhlJTIwZW5jb2RlciUyMGlzJTIwcmV0dXJuZWQlMjBpbiUyMCU1QmJhdGNoJTJDJTIwc2VxdWVuY2VfbGVuZ3RoJTJDJTIwaGlkZGVuX3NpemUlNUQlMjBmb3JtYXQuJTBBJTBBVGhlJTIwZmluYWwlMjBvdXRwdXQlMjBvZiUyMHRoZSUyMGVuY29kZXIlMjBpcyUyMGluJTIwJTVCYmF0Y2glMkMlMjBzZXF1ZW5jZV9sZW5ndGglMkMlMjBoaWRkZW5fc2l6ZSU1RCUyMGZvcm1hdC4=",highlighted:`<span class="hljs-keyword">Input</span> data <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

Data inside the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, hidden_size, sequence_length] <span class="hljs-keyword">format</span>. But, <span class="hljs-keyword">if</span> \`output_hidden_states == <span class="hljs-keyword">True</span>\`, the data <span class="hljs-keyword">from</span> inside the encoder <span class="hljs-keyword">is</span> returned <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

The final output <span class="hljs-keyword">of</span> the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.`}}),{c(){c=o("p"),_=l("Data layouts:"),m=u(),M(d.$$.fragment)},l(t){c=a(t,"P",{});var p=r(c);_=i(p,"Data layouts:"),p.forEach(s),m=h(t),w(d.$$.fragment,t)},m(t,p){b(t,c,p),e(c,_),b(t,m,p),k(d,t,p),f=!0},p:Z,i(t){f||(T(d.$$.fragment,t),f=!0)},o(t){z(d.$$.fragment,t),f=!1},d(t){t&&s(c),t&&s(m),v(d,t)}}}function Hm(q){let c,_,m,d,f;return{c(){c=o("p"),_=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=o("code"),d=l("Module"),f=l(`
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(t){c=a(t,"P",{});var p=r(c);_=i(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(p,"CODE",{});var B=r(m);d=i(B,"Module"),B.forEach(s),f=i(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(s)},m(t,p){b(t,c,p),e(c,_),e(c,m),e(m,d),e(c,f)},d(t){t&&s(c)}}}function Om(q){let c,_,m,d,f;return d=new I({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBTcXVlZXplQmVydEZvclRva2VuQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnNxdWVlemViZXJ0JTJGc3F1ZWV6ZWJlcnQtdW5jYXNlZCUyMiklMEFtb2RlbCUyMCUzRCUyMFNxdWVlemVCZXJ0Rm9yVG9rZW5DbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyc3F1ZWV6ZWJlcnQlMkZzcXVlZXplYmVydC11bmNhc2VkJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMEElMjAlMjAlMjAlMjAlMjJIdWdnaW5nRmFjZSUyMGlzJTIwYSUyMGNvbXBhbnklMjBiYXNlZCUyMGluJTIwUGFyaXMlMjBhbmQlMjBOZXclMjBZb3JrJTIyJTJDJTIwYWRkX3NwZWNpYWxfdG9rZW5zJTNERmFsc2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTBBKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoLTEpJTBBJTBBJTIzJTIwTm90ZSUyMHRoYXQlMjB0b2tlbnMlMjBhcmUlMjBjbGFzc2lmaWVkJTIwcmF0aGVyJTIwdGhlbiUyMGlucHV0JTIwd29yZHMlMjB3aGljaCUyMG1lYW5zJTIwdGhhdCUwQSUyMyUyMHRoZXJlJTIwbWlnaHQlMjBiZSUyMG1vcmUlMjBwcmVkaWN0ZWQlMjB0b2tlbiUyMGNsYXNzZXMlMjB0aGFuJTIwd29yZHMuJTBBJTIzJTIwTXVsdGlwbGUlMjB0b2tlbiUyMGNsYXNzZXMlMjBtaWdodCUyMGFjY291bnQlMjBmb3IlMjB0aGUlMjBzYW1lJTIwd29yZCUwQXByZWRpY3RlZF90b2tlbnNfY2xhc3NlcyUyMCUzRCUyMCU1Qm1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnQuaXRlbSgpJTVEJTIwZm9yJTIwdCUyMGluJTIwcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyU1QjAlNUQlNUQlMEElMEFsYWJlbHMlMjAlM0QlMjBwcmVkaWN0ZWRfdG9rZW5fY2xhc3NfaWRzJTBBbG9zcyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzJTJDJTIwbGFiZWxzJTNEbGFiZWxzKS5sb3Nz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, SqueezeBertForTokenClassification
<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;squeezebert/squeezebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertForTokenClassification.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){c=o("p"),_=l("Example:"),m=u(),M(d.$$.fragment)},l(t){c=a(t,"P",{});var p=r(c);_=i(p,"Example:"),p.forEach(s),m=h(t),w(d.$$.fragment,t)},m(t,p){b(t,c,p),e(c,_),b(t,m,p),k(d,t,p),f=!0},p:Z,i(t){f||(T(d.$$.fragment,t),f=!0)},o(t){z(d.$$.fragment,t),f=!1},d(t){t&&s(c),t&&s(m),v(d,t)}}}function Km(q){let c,_,m,d,f;return d=new I({props:{code:"SW50ZXJuYWwlMjBjbGFzcyUyMGhpZXJhcmNoeSUzQSUwQVNxdWVlemVCZXJ0TW9kZWwlMEElMjAlMjAlMjAlMjBTcXVlZXplQmVydEVuY29kZXIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBTcXVlZXplQmVydE1vZHVsZSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMFNxdWVlemVCZXJ0U2VsZkF0dGVudGlvbiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMENvbnZBY3RpdmF0aW9uJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwQ29udkRyb3BvdXRMYXllck5vcm0=",highlighted:`Internal <span class="hljs-keyword">class</span> <span class="hljs-symbol">hierarchy:
<span class="hljs-symbol">SqueezeBertModel</span></span>
    <span class="hljs-symbol">SqueezeBertEncoder</span>
        <span class="hljs-symbol">SqueezeBertModule</span>
        <span class="hljs-symbol">SqueezeBertSelfAttention</span>
            <span class="hljs-symbol">ConvActivation</span>
            <span class="hljs-symbol">ConvDropoutLayerNorm</span>`}}),{c(){c=o("p"),_=l("Hierarchy:"),m=u(),M(d.$$.fragment)},l(t){c=a(t,"P",{});var p=r(c);_=i(p,"Hierarchy:"),p.forEach(s),m=h(t),w(d.$$.fragment,t)},m(t,p){b(t,c,p),e(c,_),b(t,m,p),k(d,t,p),f=!0},p:Z,i(t){f||(T(d.$$.fragment,t),f=!0)},o(t){z(d.$$.fragment,t),f=!1},d(t){t&&s(c),t&&s(m),v(d,t)}}}function ef(q){let c,_,m,d,f;return d=new I({props:{code:"SW5wdXQlMjBkYXRhJTIwaXMlMjBpbiUyMCU1QmJhdGNoJTJDJTIwc2VxdWVuY2VfbGVuZ3RoJTJDJTIwaGlkZGVuX3NpemUlNUQlMjBmb3JtYXQuJTBBJTBBRGF0YSUyMGluc2lkZSUyMHRoZSUyMGVuY29kZXIlMjBpcyUyMGluJTIwJTVCYmF0Y2glMkMlMjBoaWRkZW5fc2l6ZSUyQyUyMHNlcXVlbmNlX2xlbmd0aCU1RCUyMGZvcm1hdC4lMjBCdXQlMkMlMjBpZiUyMCU2MG91dHB1dF9oaWRkZW5fc3RhdGVzJTIwJTNEJTNEJTIwVHJ1ZSU2MCUyQyUyMHRoZSUyMGRhdGElMjBmcm9tJTIwaW5zaWRlJTIwdGhlJTIwZW5jb2RlciUyMGlzJTIwcmV0dXJuZWQlMjBpbiUyMCU1QmJhdGNoJTJDJTIwc2VxdWVuY2VfbGVuZ3RoJTJDJTIwaGlkZGVuX3NpemUlNUQlMjBmb3JtYXQuJTBBJTBBVGhlJTIwZmluYWwlMjBvdXRwdXQlMjBvZiUyMHRoZSUyMGVuY29kZXIlMjBpcyUyMGluJTIwJTVCYmF0Y2glMkMlMjBzZXF1ZW5jZV9sZW5ndGglMkMlMjBoaWRkZW5fc2l6ZSU1RCUyMGZvcm1hdC4=",highlighted:`<span class="hljs-keyword">Input</span> data <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

Data inside the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, hidden_size, sequence_length] <span class="hljs-keyword">format</span>. But, <span class="hljs-keyword">if</span> \`output_hidden_states == <span class="hljs-keyword">True</span>\`, the data <span class="hljs-keyword">from</span> inside the encoder <span class="hljs-keyword">is</span> returned <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

The final output <span class="hljs-keyword">of</span> the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.`}}),{c(){c=o("p"),_=l("Data layouts:"),m=u(),M(d.$$.fragment)},l(t){c=a(t,"P",{});var p=r(c);_=i(p,"Data layouts:"),p.forEach(s),m=h(t),w(d.$$.fragment,t)},m(t,p){b(t,c,p),e(c,_),b(t,m,p),k(d,t,p),f=!0},p:Z,i(t){f||(T(d.$$.fragment,t),f=!0)},o(t){z(d.$$.fragment,t),f=!1},d(t){t&&s(c),t&&s(m),v(d,t)}}}function tf(q){let c,_,m,d,f;return{c(){c=o("p"),_=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=o("code"),d=l("Module"),f=l(`
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(t){c=a(t,"P",{});var p=r(c);_=i(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(p,"CODE",{});var B=r(m);d=i(B,"Module"),B.forEach(s),f=i(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(s)},m(t,p){b(t,c,p),e(c,_),e(c,m),e(m,d),e(c,f)},d(t){t&&s(c)}}}function sf(q){let c,_,m,d,f;return d=new I({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBTcXVlZXplQmVydEZvclF1ZXN0aW9uQW5zd2VyaW5nJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJzcXVlZXplYmVydCUyRnNxdWVlemViZXJ0LXVuY2FzZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBTcXVlZXplQmVydEZvclF1ZXN0aW9uQW5zd2VyaW5nLmZyb21fcHJldHJhaW5lZCglMjJzcXVlZXplYmVydCUyRnNxdWVlemViZXJ0LXVuY2FzZWQlMjIpJTBBJTBBcXVlc3Rpb24lMkMlMjB0ZXh0JTIwJTNEJTIwJTIyV2hvJTIwd2FzJTIwSmltJTIwSGVuc29uJTNGJTIyJTJDJTIwJTIySmltJTIwSGVuc29uJTIwd2FzJTIwYSUyMG5pY2UlMjBwdXBwZXQlMjIlMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIocXVlc3Rpb24lMkMlMjB0ZXh0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWFuc3dlcl9zdGFydF9pbmRleCUyMCUzRCUyMG91dHB1dHMuc3RhcnRfbG9naXRzLmFyZ21heCgpJTBBYW5zd2VyX2VuZF9pbmRleCUyMCUzRCUyMG91dHB1dHMuZW5kX2xvZ2l0cy5hcmdtYXgoKSUwQSUwQXByZWRpY3RfYW5zd2VyX3Rva2VucyUyMCUzRCUyMGlucHV0cy5pbnB1dF9pZHMlNUIwJTJDJTIwYW5zd2VyX3N0YXJ0X2luZGV4JTIwJTNBJTIwYW5zd2VyX2VuZF9pbmRleCUyMCUyQiUyMDElNUQlMEElMEElMjMlMjB0YXJnZXQlMjBpcyUyMCUyMm5pY2UlMjBwdXBwZXQlMjIlMEF0YXJnZXRfc3RhcnRfaW5kZXglMjAlM0QlMjB0b3JjaC50ZW5zb3IoJTVCMTQlNUQpJTBBdGFyZ2V0X2VuZF9pbmRleCUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxNSU1RCklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBzdGFydF9wb3NpdGlvbnMlM0R0YXJnZXRfc3RhcnRfaW5kZXglMkMlMjBlbmRfcG9zaXRpb25zJTNEdGFyZ2V0X2VuZF9pbmRleCklMEFsb3NzJTIwJTNEJTIwb3V0cHV0cy5sb3Nz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, SqueezeBertForQuestionAnswering
<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;squeezebert/squeezebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss`}}),{c(){c=o("p"),_=l("Example:"),m=u(),M(d.$$.fragment)},l(t){c=a(t,"P",{});var p=r(c);_=i(p,"Example:"),p.forEach(s),m=h(t),w(d.$$.fragment,t)},m(t,p){b(t,c,p),e(c,_),b(t,m,p),k(d,t,p),f=!0},p:Z,i(t){f||(T(d.$$.fragment,t),f=!0)},o(t){z(d.$$.fragment,t),f=!1},d(t){t&&s(c),t&&s(m),v(d,t)}}}function nf(q){let c,_,m,d,f,t,p,B,Qr,Sa,ue,Ie,On,Jt,Pr,Kn,Yr,Ua,ae,Lr,St,Dr,Hr,Ut,Or,Kr,Ca,ln,el,Ea,cn,eo,tl,Za,dn,sl,Ia,re,to,nl,ol,so,al,rl,Ct,ll,no,il,cl,Va,Ve,dl,Et,pl,ul,Wa,he,We,oo,Zt,hl,ao,ml,Fa,P,ro,pn,fl,gl,lo,un,_l,yl,io,hn,bl,Ml,co,mn,wl,kl,po,fn,Tl,Ra,me,Fe,uo,It,zl,ho,vl,xa,A,Vt,ql,fe,Bl,gn,$l,jl,Wt,Jl,Sl,Ul,ge,Cl,_n,El,Zl,yn,Il,Vl,Wl,Re,Fl,mo,Rl,Xa,_e,xe,fo,Ft,xl,go,Xl,Na,W,Rt,Nl,_o,Gl,Al,xt,Ql,bn,Pl,Yl,Ll,le,Xt,Dl,yo,Hl,Ol,Nt,Mn,Kl,bo,ei,ti,wn,si,Mo,ni,oi,Xe,Gt,ai,At,ri,wo,li,ii,ci,H,Qt,di,ko,pi,ui,Ne,hi,ye,mi,To,fi,gi,zo,_i,yi,bi,kn,Pt,Ga,be,Ge,vo,Yt,Mi,qo,wi,Aa,Q,Lt,ki,Dt,Ti,Bo,zi,vi,qi,Ht,Bi,Tn,$i,ji,Ji,ie,Ot,Si,$o,Ui,Ci,Kt,zn,Ei,jo,Zi,Ii,vn,Vi,Jo,Wi,Fi,O,es,Ri,So,xi,Xi,Ae,Ni,Me,Gi,Uo,Ai,Qi,Co,Pi,Yi,Qa,we,Qe,Eo,ts,Li,Zo,Di,Pa,$,ss,Hi,Io,Oi,Ki,ns,ec,os,tc,sc,nc,as,oc,qn,ac,rc,lc,rs,ic,ls,cc,dc,pc,is,uc,Vo,hc,mc,fc,Pe,gc,Ye,_c,K,cs,yc,ke,bc,Bn,Mc,wc,Wo,kc,Tc,zc,Le,vc,De,Ya,Te,He,Fo,ds,qc,Ro,Bc,La,j,ps,$c,us,jc,xo,Jc,Sc,Uc,hs,Cc,ms,Ec,Zc,Ic,fs,Vc,$n,Wc,Fc,Rc,gs,xc,_s,Xc,Nc,Gc,ys,Ac,Xo,Qc,Pc,Yc,Oe,Lc,Ke,Dc,ee,bs,Hc,ze,Oc,jn,Kc,ed,No,td,sd,nd,et,od,tt,Da,ve,st,Go,Ms,ad,Ao,rd,Ha,J,ws,ld,Qo,id,cd,ks,dd,Ts,pd,ud,hd,zs,md,Jn,fd,gd,_d,vs,yd,qs,bd,Md,wd,Bs,kd,Po,Td,zd,vd,nt,qd,ot,Bd,Y,$s,$d,qe,jd,Sn,Jd,Sd,Yo,Ud,Cd,Ed,at,Zd,rt,Id,lt,Oa,Be,it,Lo,js,Vd,Do,Wd,Ka,S,Js,Fd,Ho,Rd,xd,Ss,Xd,Us,Nd,Gd,Ad,Cs,Qd,Un,Pd,Yd,Ld,Es,Dd,Zs,Hd,Od,Kd,Is,ep,Oo,tp,sp,np,ct,op,dt,ap,te,Vs,rp,$e,lp,Cn,ip,cp,Ko,dp,pp,up,pt,hp,ut,er,je,ht,ea,Ws,mp,ta,fp,tr,U,Fs,gp,sa,_p,yp,Rs,bp,xs,Mp,wp,kp,Xs,Tp,En,zp,vp,qp,Ns,Bp,Gs,$p,jp,Jp,As,Sp,na,Up,Cp,Ep,mt,Zp,ft,Ip,se,Qs,Vp,Je,Wp,Zn,Fp,Rp,oa,xp,Xp,Np,gt,Gp,_t,sr,Se,yt,aa,Ps,Ap,ra,Qp,nr,C,Ys,Pp,Ue,Yp,la,Lp,Dp,ia,Hp,Op,Kp,Ls,eu,Ds,tu,su,nu,Hs,ou,In,au,ru,lu,Os,iu,Ks,cu,du,pu,en,uu,ca,hu,mu,fu,bt,gu,Mt,_u,ne,tn,yu,Ce,bu,Vn,Mu,wu,da,ku,Tu,zu,wt,vu,kt,or;return t=new oe({}),Jt=new oe({}),Zt=new oe({}),It=new oe({}),Vt=new V({props:{name:"class transformers.SqueezeBertConfig",anchor:"transformers.SqueezeBertConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"pad_token_id",val:" = 0"},{name:"embedding_size",val:" = 768"},{name:"q_groups",val:" = 4"},{name:"k_groups",val:" = 4"},{name:"v_groups",val:" = 4"},{name:"post_attention_groups",val:" = 1"},{name:"intermediate_groups",val:" = 4"},{name:"output_groups",val:" = 4"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.SqueezeBertConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the SqueezeBERT model. Defines the number of different tokens that can be represented by
the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/squeezebert#transformers.SqueezeBertModel">SqueezeBertModel</a>.`,name:"vocab_size"},{anchor:"transformers.SqueezeBertConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.SqueezeBertConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.SqueezeBertConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.SqueezeBertConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.SqueezeBertConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.SqueezeBertConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.SqueezeBertConfig.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.SqueezeBertConfig.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.SqueezeBertConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/bert#transformers.BertModel">BertModel</a> or <a href="/docs/transformers/main/en/model_doc/bert#transformers.TFBertModel">TFBertModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.SqueezeBertConfig.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.SqueezeBertConfig.layer_norm_eps",description:"<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;",name:"layer_norm_eps"},{anchor:"transformers.SqueezeBertConfig.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.SqueezeBertConfig.embedding_size",description:`<strong>embedding_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
The dimension of the word embedding vectors.`,name:"embedding_size"},{anchor:"transformers.SqueezeBertConfig.q_groups",description:`<strong>q_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of groups in Q layer.`,name:"q_groups"},{anchor:"transformers.SqueezeBertConfig.k_groups",description:`<strong>k_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of groups in K layer.`,name:"k_groups"},{anchor:"transformers.SqueezeBertConfig.v_groups",description:`<strong>v_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of groups in V layer.`,name:"v_groups"},{anchor:"transformers.SqueezeBertConfig.post_attention_groups",description:`<strong>post_attention_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of groups in the first feed forward network layer.`,name:"post_attention_groups"},{anchor:"transformers.SqueezeBertConfig.intermediate_groups",description:`<strong>intermediate_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of groups in the second feed forward network layer.`,name:"intermediate_groups"},{anchor:"transformers.SqueezeBertConfig.output_groups",description:`<strong>output_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of groups in the third feed forward network layer.`,name:"output_groups"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/squeezebert/configuration_squeezebert.py#L37"}}),Re=new E({props:{anchor:"transformers.SqueezeBertConfig.example",$$slots:{default:[jm]},$$scope:{ctx:q}}}),Ft=new oe({}),Rt=new V({props:{name:"class transformers.SqueezeBertTokenizer",anchor:"transformers.SqueezeBertTokenizer",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.SqueezeBertTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.SqueezeBertTokenizer.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.SqueezeBertTokenizer.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.SqueezeBertTokenizer.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.SqueezeBertTokenizer.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.SqueezeBertTokenizer.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.SqueezeBertTokenizer.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.SqueezeBertTokenizer.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.SqueezeBertTokenizer.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.SqueezeBertTokenizer.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.SqueezeBertTokenizer.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 SqueezeBERT).`,name:"strip_accents"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/squeezebert/tokenization_squeezebert.py#L79"}}),Xt=new V({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.SqueezeBertTokenizer.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.SqueezeBertTokenizer.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.SqueezeBertTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/squeezebert/tokenization_squeezebert.py#L211",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>
`}}),Gt=new V({props:{name:"get_special_tokens_mask",anchor:"transformers.SqueezeBertTokenizer.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.SqueezeBertTokenizer.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.SqueezeBertTokenizer.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.SqueezeBertTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/squeezebert/tokenization_squeezebert.py#L236",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>
`}}),Qt=new V({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.SqueezeBertTokenizer.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.SqueezeBertTokenizer.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.SqueezeBertTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/squeezebert/tokenization_squeezebert.py#L264",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>
`}}),Ne=new E({props:{anchor:"transformers.SqueezeBertTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[Jm]},$$scope:{ctx:q}}}),Pt=new V({props:{name:"save_vocabulary",anchor:"transformers.SqueezeBertTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/squeezebert/tokenization_squeezebert.py#L293"}}),Yt=new oe({}),Lt=new V({props:{name:"class transformers.SqueezeBertTokenizerFast",anchor:"transformers.SqueezeBertTokenizerFast",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.SqueezeBertTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.SqueezeBertTokenizerFast.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.SqueezeBertTokenizerFast.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.SqueezeBertTokenizerFast.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.SqueezeBertTokenizerFast.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.SqueezeBertTokenizerFast.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.SqueezeBertTokenizerFast.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.SqueezeBertTokenizerFast.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.SqueezeBertTokenizerFast.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.SqueezeBertTokenizerFast.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 SqueezeBERT).`,name:"strip_accents"},{anchor:"transformers.SqueezeBertTokenizerFast.wordpieces_prefix",description:`<strong>wordpieces_prefix</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;##&quot;</code>) &#x2014;
The prefix for subwords.`,name:"wordpieces_prefix"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/squeezebert/tokenization_squeezebert_fast.py#L69"}}),Ot=new V({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.SqueezeBertTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:""},{name:"token_ids_1",val:" = None"}],parametersDescription:[{anchor:"transformers.SqueezeBertTokenizerFast.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.SqueezeBertTokenizerFast.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/squeezebert/tokenization_squeezebert_fast.py#L157",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>
`}}),es=new V({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.SqueezeBertTokenizerFast.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.SqueezeBertTokenizerFast.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.SqueezeBertTokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/squeezebert/tokenization_squeezebert_fast.py#L181",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>
`}}),Ae=new E({props:{anchor:"transformers.SqueezeBertTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[Sm]},$$scope:{ctx:q}}}),ts=new oe({}),ss=new V({props:{name:"class transformers.SqueezeBertModel",anchor:"transformers.SqueezeBertModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SqueezeBertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/squeezebert#transformers.SqueezeBertConfig">SqueezeBertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/squeezebert/modeling_squeezebert.py#L547"}}),Pe=new E({props:{anchor:"transformers.SqueezeBertModel.example",$$slots:{default:[Um]},$$scope:{ctx:q}}}),Ye=new E({props:{anchor:"transformers.SqueezeBertModel.example-2",$$slots:{default:[Cm]},$$scope:{ctx:q}}}),cs=new V({props:{name:"forward",anchor:"transformers.SqueezeBertModel.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.FloatTensor] = 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.SqueezeBertModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.SqueezeBertModel.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.SqueezeBertModel.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.SqueezeBertModel.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.SqueezeBertModel.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.SqueezeBertModel.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.SqueezeBertModel.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.SqueezeBertModel.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.SqueezeBertModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/squeezebert/modeling_squeezebert.py#L572",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/en/model_doc/squeezebert#transformers.SqueezeBertConfig"
>SqueezeBertConfig</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/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Le=new Hn({props:{$$slots:{default:[Em]},$$scope:{ctx:q}}}),De=new E({props:{anchor:"transformers.SqueezeBertModel.forward.example",$$slots:{default:[Zm]},$$scope:{ctx:q}}}),ds=new oe({}),ps=new V({props:{name:"class transformers.SqueezeBertForMaskedLM",anchor:"transformers.SqueezeBertForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SqueezeBertForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/squeezebert#transformers.SqueezeBertConfig">SqueezeBertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/squeezebert/modeling_squeezebert.py#L647"}}),Oe=new E({props:{anchor:"transformers.SqueezeBertForMaskedLM.example",$$slots:{default:[Im]},$$scope:{ctx:q}}}),Ke=new E({props:{anchor:"transformers.SqueezeBertForMaskedLM.example-2",$$slots:{default:[Vm]},$$scope:{ctx:q}}}),bs=new V({props:{name:"forward",anchor:"transformers.SqueezeBertForMaskedLM.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.SqueezeBertForMaskedLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.SqueezeBertForMaskedLM.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.SqueezeBertForMaskedLM.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.SqueezeBertForMaskedLM.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.SqueezeBertForMaskedLM.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.SqueezeBertForMaskedLM.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.SqueezeBertForMaskedLM.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.SqueezeBertForMaskedLM.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.SqueezeBertForMaskedLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SqueezeBertForMaskedLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/squeezebert/modeling_squeezebert.py#L665",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/squeezebert#transformers.SqueezeBertConfig"
>SqueezeBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),et=new Hn({props:{$$slots:{default:[Wm]},$$scope:{ctx:q}}}),tt=new E({props:{anchor:"transformers.SqueezeBertForMaskedLM.forward.example",$$slots:{default:[Fm]},$$scope:{ctx:q}}}),Ms=new oe({}),ws=new V({props:{name:"class transformers.SqueezeBertForSequenceClassification",anchor:"transformers.SqueezeBertForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SqueezeBertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/squeezebert#transformers.SqueezeBertConfig">SqueezeBertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/squeezebert/modeling_squeezebert.py#L731"}}),nt=new E({props:{anchor:"transformers.SqueezeBertForSequenceClassification.example",$$slots:{default:[Rm]},$$scope:{ctx:q}}}),ot=new E({props:{anchor:"transformers.SqueezeBertForSequenceClassification.example-2",$$slots:{default:[xm]},$$scope:{ctx:q}}}),$s=new V({props:{name:"forward",anchor:"transformers.SqueezeBertForSequenceClassification.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.SqueezeBertForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.SqueezeBertForSequenceClassification.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.SqueezeBertForSequenceClassification.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.SqueezeBertForSequenceClassification.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.SqueezeBertForSequenceClassification.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.SqueezeBertForSequenceClassification.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.SqueezeBertForSequenceClassification.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.SqueezeBertForSequenceClassification.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.SqueezeBertForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SqueezeBertForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/squeezebert/modeling_squeezebert.py#L744",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/squeezebert#transformers.SqueezeBertConfig"
>SqueezeBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),at=new Hn({props:{$$slots:{default:[Xm]},$$scope:{ctx:q}}}),rt=new E({props:{anchor:"transformers.SqueezeBertForSequenceClassification.forward.example",$$slots:{default:[Nm]},$$scope:{ctx:q}}}),lt=new E({props:{anchor:"transformers.SqueezeBertForSequenceClassification.forward.example-2",$$slots:{default:[Gm]},$$scope:{ctx:q}}}),js=new oe({}),Js=new V({props:{name:"class transformers.SqueezeBertForMultipleChoice",anchor:"transformers.SqueezeBertForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SqueezeBertForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/squeezebert#transformers.SqueezeBertConfig">SqueezeBertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/squeezebert/modeling_squeezebert.py#L830"}}),ct=new E({props:{anchor:"transformers.SqueezeBertForMultipleChoice.example",$$slots:{default:[Am]},$$scope:{ctx:q}}}),dt=new E({props:{anchor:"transformers.SqueezeBertForMultipleChoice.example-2",$$slots:{default:[Qm]},$$scope:{ctx:q}}}),Vs=new V({props:{name:"forward",anchor:"transformers.SqueezeBertForMultipleChoice.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.SqueezeBertForMultipleChoice.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.SqueezeBertForMultipleChoice.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.SqueezeBertForMultipleChoice.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.SqueezeBertForMultipleChoice.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.SqueezeBertForMultipleChoice.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.SqueezeBertForMultipleChoice.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.SqueezeBertForMultipleChoice.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.SqueezeBertForMultipleChoice.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.SqueezeBertForMultipleChoice.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SqueezeBertForMultipleChoice.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 <em>num_choices</em> is the size of the second dimension of the input tensors. (see
<em>input_ids</em> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/squeezebert/modeling_squeezebert.py#L841",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/squeezebert#transformers.SqueezeBertConfig"
>SqueezeBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <em>(1,)</em>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices)</code>) \u2014 <em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),pt=new Hn({props:{$$slots:{default:[Pm]},$$scope:{ctx:q}}}),ut=new E({props:{anchor:"transformers.SqueezeBertForMultipleChoice.forward.example",$$slots:{default:[Ym]},$$scope:{ctx:q}}}),Ws=new oe({}),Fs=new V({props:{name:"class transformers.SqueezeBertForTokenClassification",anchor:"transformers.SqueezeBertForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SqueezeBertForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/squeezebert#transformers.SqueezeBertConfig">SqueezeBertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/squeezebert/modeling_squeezebert.py#L923"}}),mt=new E({props:{anchor:"transformers.SqueezeBertForTokenClassification.example",$$slots:{default:[Lm]},$$scope:{ctx:q}}}),ft=new E({props:{anchor:"transformers.SqueezeBertForTokenClassification.example-2",$$slots:{default:[Dm]},$$scope:{ctx:q}}}),Qs=new V({props:{name:"forward",anchor:"transformers.SqueezeBertForTokenClassification.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.SqueezeBertForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.SqueezeBertForTokenClassification.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.SqueezeBertForTokenClassification.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.SqueezeBertForTokenClassification.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.SqueezeBertForTokenClassification.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.SqueezeBertForTokenClassification.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.SqueezeBertForTokenClassification.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.SqueezeBertForTokenClassification.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.SqueezeBertForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SqueezeBertForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/squeezebert/modeling_squeezebert.py#L935",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/squeezebert#transformers.SqueezeBertConfig"
>SqueezeBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),gt=new Hn({props:{$$slots:{default:[Hm]},$$scope:{ctx:q}}}),_t=new E({props:{anchor:"transformers.SqueezeBertForTokenClassification.forward.example",$$slots:{default:[Om]},$$scope:{ctx:q}}}),Ps=new oe({}),Ys=new V({props:{name:"class transformers.SqueezeBertForQuestionAnswering",anchor:"transformers.SqueezeBertForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SqueezeBertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/squeezebert#transformers.SqueezeBertConfig">SqueezeBertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/squeezebert/modeling_squeezebert.py#L1001"}}),bt=new E({props:{anchor:"transformers.SqueezeBertForQuestionAnswering.example",$$slots:{default:[Km]},$$scope:{ctx:q}}}),Mt=new E({props:{anchor:"transformers.SqueezeBertForQuestionAnswering.example-2",$$slots:{default:[ef]},$$scope:{ctx:q}}}),tn=new V({props:{name:"forward",anchor:"transformers.SqueezeBertForQuestionAnswering.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.SqueezeBertForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.SqueezeBertForQuestionAnswering.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.SqueezeBertForQuestionAnswering.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.SqueezeBertForQuestionAnswering.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.SqueezeBertForQuestionAnswering.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.SqueezeBertForQuestionAnswering.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.SqueezeBertForQuestionAnswering.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.SqueezeBertForQuestionAnswering.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.SqueezeBertForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SqueezeBertForQuestionAnswering.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 (<em>sequence_length</em>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.SqueezeBertForQuestionAnswering.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 (<em>sequence_length</em>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/squeezebert/modeling_squeezebert.py#L1012",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/squeezebert#transformers.SqueezeBertConfig"
>SqueezeBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),wt=new Hn({props:{$$slots:{default:[tf]},$$scope:{ctx:q}}}),kt=new E({props:{anchor:"transformers.SqueezeBertForQuestionAnswering.forward.example",$$slots:{default:[sf]},$$scope:{ctx:q}}}),{c(){c=o("meta"),_=u(),m=o("h1"),d=o("a"),f=o("span"),M(t.$$.fragment),p=u(),B=o("span"),Qr=l("SqueezeBERT"),Sa=u(),ue=o("h2"),Ie=o("a"),On=o("span"),M(Jt.$$.fragment),Pr=u(),Kn=o("span"),Yr=l("Overview"),Ua=u(),ae=o("p"),Lr=l("The SqueezeBERT model was proposed in "),St=o("a"),Dr=l("SqueezeBERT: What can computer vision teach NLP about efficient neural networks?"),Hr=l(` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, Kurt W. Keutzer. It\u2019s a
bidirectional transformer similar to the BERT model. The key difference between the BERT architecture and the
SqueezeBERT architecture is that SqueezeBERT uses `),Ut=o("a"),Or=l("grouped convolutions"),Kr=l(`
instead of fully-connected layers for the Q, K, V and FFN layers.`),Ca=u(),ln=o("p"),el=l("The abstract from the paper is the following:"),Ea=u(),cn=o("p"),eo=o("em"),tl=l(`Humans read and write hundreds of billions of messages every day. Further, due to the availability of large datasets,
large computing systems, and better neural network models, natural language processing (NLP) technology has made
significant strides in understanding, proofreading, and organizing these messages. Thus, there is a significant
opportunity to deploy NLP in myriad applications to help web users, social networks, and businesses. In particular, we
consider smartphones and other mobile devices as crucial platforms for deploying NLP models at scale. However, today\u2019s
highly-accurate NLP neural network models such as BERT and RoBERTa are extremely computationally expensive, with
BERT-base taking 1.7 seconds to classify a text snippet on a Pixel 3 smartphone. In this work, we observe that methods
such as grouped convolutions have yielded significant speedups for computer vision networks, but many of these
techniques have not been adopted by NLP neural network designers. We demonstrate how to replace several operations in
self-attention layers with grouped convolutions, and we use this technique in a novel network architecture called
SqueezeBERT, which runs 4.3x faster than BERT-base on the Pixel 3 while achieving competitive accuracy on the GLUE test
set. The SqueezeBERT code will be released.`),Za=u(),dn=o("p"),sl=l("Tips:"),Ia=u(),re=o("ul"),to=o("li"),nl=l(`SqueezeBERT is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right
rather than the left.`),ol=u(),so=o("li"),al=l(`SqueezeBERT 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.`),rl=u(),Ct=o("li"),ll=l(`For best results when finetuning on sequence classification tasks, it is recommended to start with the
`),no=o("em"),il=l("squeezebert/squeezebert-mnli-headless"),cl=l(" checkpoint."),Va=u(),Ve=o("p"),dl=l("This model was contributed by "),Et=o("a"),pl=l("forresti"),ul=l("."),Wa=u(),he=o("h2"),We=o("a"),oo=o("span"),M(Zt.$$.fragment),hl=u(),ao=o("span"),ml=l("Documentation resources"),Fa=u(),P=o("ul"),ro=o("li"),pn=o("a"),fl=l("Text classification task guide"),gl=u(),lo=o("li"),un=o("a"),_l=l("Token classification task guide"),yl=u(),io=o("li"),hn=o("a"),bl=l("Question answering task guide"),Ml=u(),co=o("li"),mn=o("a"),wl=l("Masked language modeling task guide"),kl=u(),po=o("li"),fn=o("a"),Tl=l("Multiple choice task guide"),Ra=u(),me=o("h2"),Fe=o("a"),uo=o("span"),M(It.$$.fragment),zl=u(),ho=o("span"),vl=l("SqueezeBertConfig"),xa=u(),A=o("div"),M(Vt.$$.fragment),ql=u(),fe=o("p"),Bl=l("This is the configuration class to store the configuration of a "),gn=o("a"),$l=l("SqueezeBertModel"),jl=l(`. It is used to instantiate a
SqueezeBERT 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 SqueezeBERT
`),Wt=o("a"),Jl=l("squeezebert/squeezebert-uncased"),Sl=l(" architecture."),Ul=u(),ge=o("p"),Cl=l("Configuration objects inherit from "),_n=o("a"),El=l("PretrainedConfig"),Zl=l(` and can be used to control the model outputs. Read the
documentation from `),yn=o("a"),Il=l("PretrainedConfig"),Vl=l(" for more information."),Wl=u(),M(Re.$$.fragment),Fl=u(),mo=o("p"),Rl=l(`Attributes: pretrained_config_archive_map (Dict[str, str]): A dictionary containing all the available pre-trained
checkpoints.`),Xa=u(),_e=o("h2"),xe=o("a"),fo=o("span"),M(Ft.$$.fragment),xl=u(),go=o("span"),Xl=l("SqueezeBertTokenizer"),Na=u(),W=o("div"),M(Rt.$$.fragment),Nl=u(),_o=o("p"),Gl=l("Construct a SqueezeBERT tokenizer. Based on WordPiece."),Al=u(),xt=o("p"),Ql=l("This tokenizer inherits from "),bn=o("a"),Pl=l("PreTrainedTokenizer"),Yl=l(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Ll=u(),le=o("div"),M(Xt.$$.fragment),Dl=u(),yo=o("p"),Hl=l(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A SqueezeBERT sequence has the following format:`),Ol=u(),Nt=o("ul"),Mn=o("li"),Kl=l("single sequence: "),bo=o("code"),ei=l("[CLS] X [SEP]"),ti=u(),wn=o("li"),si=l("pair of sequences: "),Mo=o("code"),ni=l("[CLS] A [SEP] B [SEP]"),oi=u(),Xe=o("div"),M(Gt.$$.fragment),ai=u(),At=o("p"),ri=l(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),wo=o("code"),li=l("prepare_for_model"),ii=l(" method."),ci=u(),H=o("div"),M(Qt.$$.fragment),di=u(),ko=o("p"),pi=l("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A SqueezeBERT"),ui=u(),M(Ne.$$.fragment),hi=u(),ye=o("p"),mi=l("If "),To=o("code"),fi=l("token_ids_1"),gi=l(" is "),zo=o("code"),_i=l("None"),yi=l(", this method only returns the first portion of the mask (0s)."),bi=u(),kn=o("div"),M(Pt.$$.fragment),Ga=u(),be=o("h2"),Ge=o("a"),vo=o("span"),M(Yt.$$.fragment),Mi=u(),qo=o("span"),wi=l("SqueezeBertTokenizerFast"),Aa=u(),Q=o("div"),M(Lt.$$.fragment),ki=u(),Dt=o("p"),Ti=l("Construct a \u201Cfast\u201D SqueezeBERT tokenizer (backed by HuggingFace\u2019s "),Bo=o("em"),zi=l("tokenizers"),vi=l(" library). Based on WordPiece."),qi=u(),Ht=o("p"),Bi=l("This tokenizer inherits from "),Tn=o("a"),$i=l("PreTrainedTokenizerFast"),ji=l(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Ji=u(),ie=o("div"),M(Ot.$$.fragment),Si=u(),$o=o("p"),Ui=l(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A SqueezeBERT sequence has the following format:`),Ci=u(),Kt=o("ul"),zn=o("li"),Ei=l("single sequence: "),jo=o("code"),Zi=l("[CLS] X [SEP]"),Ii=u(),vn=o("li"),Vi=l("pair of sequences: "),Jo=o("code"),Wi=l("[CLS] A [SEP] B [SEP]"),Fi=u(),O=o("div"),M(es.$$.fragment),Ri=u(),So=o("p"),xi=l("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A SqueezeBERT"),Xi=u(),M(Ae.$$.fragment),Ni=u(),Me=o("p"),Gi=l("If "),Uo=o("code"),Ai=l("token_ids_1"),Qi=l(" is "),Co=o("code"),Pi=l("None"),Yi=l(", this method only returns the first portion of the mask (0s)."),Qa=u(),we=o("h2"),Qe=o("a"),Eo=o("span"),M(ts.$$.fragment),Li=u(),Zo=o("span"),Di=l("SqueezeBertModel"),Pa=u(),$=o("div"),M(ss.$$.fragment),Hi=u(),Io=o("p"),Oi=l("The bare SqueezeBERT Model transformer outputting raw hidden-states without any specific head on top."),Ki=u(),ns=o("p"),ec=l("The SqueezeBERT model was proposed in "),os=o("a"),tc=l(`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),sc=l(` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),nc=u(),as=o("p"),oc=l("This model inherits from "),qn=o("a"),ac=l("PreTrainedModel"),rc=l(`. 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.)`),lc=u(),rs=o("p"),ic=l("This model is also a PyTorch "),ls=o("a"),cc=l("torch.nn.Module"),dc=l(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),pc=u(),is=o("p"),uc=l(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Vo=o("em"),hc=l("squeezebert/squeezebert-mnli-headless"),mc=l(" checkpoint as a starting point."),fc=u(),M(Pe.$$.fragment),gc=u(),M(Ye.$$.fragment),_c=u(),K=o("div"),M(cs.$$.fragment),yc=u(),ke=o("p"),bc=l("The "),Bn=o("a"),Mc=l("SqueezeBertModel"),wc=l(" forward method, overrides the "),Wo=o("code"),kc=l("__call__"),Tc=l(" special method."),zc=u(),M(Le.$$.fragment),vc=u(),M(De.$$.fragment),Ya=u(),Te=o("h2"),He=o("a"),Fo=o("span"),M(ds.$$.fragment),qc=u(),Ro=o("span"),Bc=l("SqueezeBertForMaskedLM"),La=u(),j=o("div"),M(ps.$$.fragment),$c=u(),us=o("p"),jc=l("SqueezeBERT Model with a "),xo=o("code"),Jc=l("language modeling"),Sc=l(" head on top."),Uc=u(),hs=o("p"),Cc=l("The SqueezeBERT model was proposed in "),ms=o("a"),Ec=l(`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),Zc=l(` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),Ic=u(),fs=o("p"),Vc=l("This model inherits from "),$n=o("a"),Wc=l("PreTrainedModel"),Fc=l(`. 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.)`),Rc=u(),gs=o("p"),xc=l("This model is also a PyTorch "),_s=o("a"),Xc=l("torch.nn.Module"),Nc=l(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Gc=u(),ys=o("p"),Ac=l(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Xo=o("em"),Qc=l("squeezebert/squeezebert-mnli-headless"),Pc=l(" checkpoint as a starting point."),Yc=u(),M(Oe.$$.fragment),Lc=u(),M(Ke.$$.fragment),Dc=u(),ee=o("div"),M(bs.$$.fragment),Hc=u(),ze=o("p"),Oc=l("The "),jn=o("a"),Kc=l("SqueezeBertForMaskedLM"),ed=l(" forward method, overrides the "),No=o("code"),td=l("__call__"),sd=l(" special method."),nd=u(),M(et.$$.fragment),od=u(),M(tt.$$.fragment),Da=u(),ve=o("h2"),st=o("a"),Go=o("span"),M(Ms.$$.fragment),ad=u(),Ao=o("span"),rd=l("SqueezeBertForSequenceClassification"),Ha=u(),J=o("div"),M(ws.$$.fragment),ld=u(),Qo=o("p"),id=l(`SqueezeBERT Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),cd=u(),ks=o("p"),dd=l("The SqueezeBERT model was proposed in "),Ts=o("a"),pd=l(`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),ud=l(` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),hd=u(),zs=o("p"),md=l("This model inherits from "),Jn=o("a"),fd=l("PreTrainedModel"),gd=l(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),_d=u(),vs=o("p"),yd=l("This model is also a PyTorch "),qs=o("a"),bd=l("torch.nn.Module"),Md=l(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),wd=u(),Bs=o("p"),kd=l(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Po=o("em"),Td=l("squeezebert/squeezebert-mnli-headless"),zd=l(" checkpoint as a starting point."),vd=u(),M(nt.$$.fragment),qd=u(),M(ot.$$.fragment),Bd=u(),Y=o("div"),M($s.$$.fragment),$d=u(),qe=o("p"),jd=l("The "),Sn=o("a"),Jd=l("SqueezeBertForSequenceClassification"),Sd=l(" forward method, overrides the "),Yo=o("code"),Ud=l("__call__"),Cd=l(" special method."),Ed=u(),M(at.$$.fragment),Zd=u(),M(rt.$$.fragment),Id=u(),M(lt.$$.fragment),Oa=u(),Be=o("h2"),it=o("a"),Lo=o("span"),M(js.$$.fragment),Vd=u(),Do=o("span"),Wd=l("SqueezeBertForMultipleChoice"),Ka=u(),S=o("div"),M(Js.$$.fragment),Fd=u(),Ho=o("p"),Rd=l(`SqueezeBERT 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.`),xd=u(),Ss=o("p"),Xd=l("The SqueezeBERT model was proposed in "),Us=o("a"),Nd=l(`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),Gd=l(` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),Ad=u(),Cs=o("p"),Qd=l("This model inherits from "),Un=o("a"),Pd=l("PreTrainedModel"),Yd=l(`. 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.)`),Ld=u(),Es=o("p"),Dd=l("This model is also a PyTorch "),Zs=o("a"),Hd=l("torch.nn.Module"),Od=l(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Kd=u(),Is=o("p"),ep=l(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Oo=o("em"),tp=l("squeezebert/squeezebert-mnli-headless"),sp=l(" checkpoint as a starting point."),np=u(),M(ct.$$.fragment),op=u(),M(dt.$$.fragment),ap=u(),te=o("div"),M(Vs.$$.fragment),rp=u(),$e=o("p"),lp=l("The "),Cn=o("a"),ip=l("SqueezeBertForMultipleChoice"),cp=l(" forward method, overrides the "),Ko=o("code"),dp=l("__call__"),pp=l(" special method."),up=u(),M(pt.$$.fragment),hp=u(),M(ut.$$.fragment),er=u(),je=o("h2"),ht=o("a"),ea=o("span"),M(Ws.$$.fragment),mp=u(),ta=o("span"),fp=l("SqueezeBertForTokenClassification"),tr=u(),U=o("div"),M(Fs.$$.fragment),gp=u(),sa=o("p"),_p=l(`SqueezeBERT 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.`),yp=u(),Rs=o("p"),bp=l("The SqueezeBERT model was proposed in "),xs=o("a"),Mp=l(`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),wp=l(` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),kp=u(),Xs=o("p"),Tp=l("This model inherits from "),En=o("a"),zp=l("PreTrainedModel"),vp=l(`. 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.)`),qp=u(),Ns=o("p"),Bp=l("This model is also a PyTorch "),Gs=o("a"),$p=l("torch.nn.Module"),jp=l(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Jp=u(),As=o("p"),Sp=l(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),na=o("em"),Up=l("squeezebert/squeezebert-mnli-headless"),Cp=l(" checkpoint as a starting point."),Ep=u(),M(mt.$$.fragment),Zp=u(),M(ft.$$.fragment),Ip=u(),se=o("div"),M(Qs.$$.fragment),Vp=u(),Je=o("p"),Wp=l("The "),Zn=o("a"),Fp=l("SqueezeBertForTokenClassification"),Rp=l(" forward method, overrides the "),oa=o("code"),xp=l("__call__"),Xp=l(" special method."),Np=u(),M(gt.$$.fragment),Gp=u(),M(_t.$$.fragment),sr=u(),Se=o("h2"),yt=o("a"),aa=o("span"),M(Ps.$$.fragment),Ap=u(),ra=o("span"),Qp=l("SqueezeBertForQuestionAnswering"),nr=u(),C=o("div"),M(Ys.$$.fragment),Pp=u(),Ue=o("p"),Yp=l(`SqueezeBERT 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 `),la=o("code"),Lp=l("span start logits"),Dp=l(" and "),ia=o("code"),Hp=l("span end logits"),Op=l(")."),Kp=u(),Ls=o("p"),eu=l("The SqueezeBERT model was proposed in "),Ds=o("a"),tu=l(`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),su=l(` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),nu=u(),Hs=o("p"),ou=l("This model inherits from "),In=o("a"),au=l("PreTrainedModel"),ru=l(`. 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.)`),lu=u(),Os=o("p"),iu=l("This model is also a PyTorch "),Ks=o("a"),cu=l("torch.nn.Module"),du=l(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),pu=u(),en=o("p"),uu=l(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),ca=o("em"),hu=l("squeezebert/squeezebert-mnli-headless"),mu=l(" checkpoint as a starting point."),fu=u(),M(bt.$$.fragment),gu=u(),M(Mt.$$.fragment),_u=u(),ne=o("div"),M(tn.$$.fragment),yu=u(),Ce=o("p"),bu=l("The "),Vn=o("a"),Mu=l("SqueezeBertForQuestionAnswering"),wu=l(" forward method, overrides the "),da=o("code"),ku=l("__call__"),Tu=l(" special method."),zu=u(),M(wt.$$.fragment),vu=u(),M(kt.$$.fragment),this.h()},l(n){const y=Bm('[data-svelte="svelte-1phssyn"]',document.head);c=a(y,"META",{name:!0,content:!0}),y.forEach(s),_=h(n),m=a(n,"H1",{class:!0});var sn=r(m);d=a(sn,"A",{id:!0,class:!0,href:!0});var pa=r(d);f=a(pa,"SPAN",{});var ua=r(f);w(t.$$.fragment,ua),ua.forEach(s),pa.forEach(s),p=h(sn),B=a(sn,"SPAN",{});var ha=r(B);Qr=i(ha,"SqueezeBERT"),ha.forEach(s),sn.forEach(s),Sa=h(n),ue=a(n,"H2",{class:!0});var nn=r(ue);Ie=a(nn,"A",{id:!0,class:!0,href:!0});var ma=r(Ie);On=a(ma,"SPAN",{});var fa=r(On);w(Jt.$$.fragment,fa),fa.forEach(s),ma.forEach(s),Pr=h(nn),Kn=a(nn,"SPAN",{});var ga=r(Kn);Yr=i(ga,"Overview"),ga.forEach(s),nn.forEach(s),Ua=h(n),ae=a(n,"P",{});var Ee=r(ae);Lr=i(Ee,"The SqueezeBERT model was proposed in "),St=a(Ee,"A",{href:!0,rel:!0});var _a=r(St);Dr=i(_a,"SqueezeBERT: What can computer vision teach NLP about efficient neural networks?"),_a.forEach(s),Hr=i(Ee,` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, Kurt W. Keutzer. It\u2019s a
bidirectional transformer similar to the BERT model. The key difference between the BERT architecture and the
SqueezeBERT architecture is that SqueezeBERT uses `),Ut=a(Ee,"A",{href:!0,rel:!0});var ya=r(Ut);Or=i(ya,"grouped convolutions"),ya.forEach(s),Kr=i(Ee,`
instead of fully-connected layers for the Q, K, V and FFN layers.`),Ee.forEach(s),Ca=h(n),ln=a(n,"P",{});var ba=r(ln);el=i(ba,"The abstract from the paper is the following:"),ba.forEach(s),Ea=h(n),cn=a(n,"P",{});var Ma=r(cn);eo=a(Ma,"EM",{});var wa=r(eo);tl=i(wa,`Humans read and write hundreds of billions of messages every day. Further, due to the availability of large datasets,
large computing systems, and better neural network models, natural language processing (NLP) technology has made
significant strides in understanding, proofreading, and organizing these messages. Thus, there is a significant
opportunity to deploy NLP in myriad applications to help web users, social networks, and businesses. In particular, we
consider smartphones and other mobile devices as crucial platforms for deploying NLP models at scale. However, today\u2019s
highly-accurate NLP neural network models such as BERT and RoBERTa are extremely computationally expensive, with
BERT-base taking 1.7 seconds to classify a text snippet on a Pixel 3 smartphone. In this work, we observe that methods
such as grouped convolutions have yielded significant speedups for computer vision networks, but many of these
techniques have not been adopted by NLP neural network designers. We demonstrate how to replace several operations in
self-attention layers with grouped convolutions, and we use this technique in a novel network architecture called
SqueezeBERT, which runs 4.3x faster than BERT-base on the Pixel 3 while achieving competitive accuracy on the GLUE test
set. The SqueezeBERT code will be released.`),wa.forEach(s),Ma.forEach(s),Za=h(n),dn=a(n,"P",{});var ka=r(dn);sl=i(ka,"Tips:"),ka.forEach(s),Ia=h(n),re=a(n,"UL",{});var Ze=r(re);to=a(Ze,"LI",{});var Ta=r(to);nl=i(Ta,`SqueezeBERT is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right
rather than the left.`),Ta.forEach(s),ol=h(Ze),so=a(Ze,"LI",{});var za=r(so);al=i(za,`SqueezeBERT 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.`),za.forEach(s),rl=h(Ze),Ct=a(Ze,"LI",{});var on=r(Ct);ll=i(on,`For best results when finetuning on sequence classification tasks, it is recommended to start with the
`),no=a(on,"EM",{});var va=r(no);il=i(va,"squeezebert/squeezebert-mnli-headless"),va.forEach(s),cl=i(on," checkpoint."),on.forEach(s),Ze.forEach(s),Va=h(n),Ve=a(n,"P",{});var an=r(Ve);dl=i(an,"This model was contributed by "),Et=a(an,"A",{href:!0,rel:!0});var qa=r(Et);pl=i(qa,"forresti"),qa.forEach(s),ul=i(an,"."),an.forEach(s),Wa=h(n),he=a(n,"H2",{class:!0});var rn=r(he);We=a(rn,"A",{id:!0,class:!0,href:!0});var Ba=r(We);oo=a(Ba,"SPAN",{});var $a=r(oo);w(Zt.$$.fragment,$a),$a.forEach(s),Ba.forEach(s),hl=h(rn),ao=a(rn,"SPAN",{});var ja=r(ao);ml=i(ja,"Documentation resources"),ja.forEach(s),rn.forEach(s),Fa=h(n),P=a(n,"UL",{});var D=r(P);ro=a(D,"LI",{});var Ja=r(ro);pn=a(Ja,"A",{href:!0});var Ju=r(pn);fl=i(Ju,"Text classification task guide"),Ju.forEach(s),Ja.forEach(s),gl=h(D),lo=a(D,"LI",{});var Su=r(lo);un=a(Su,"A",{href:!0});var Uu=r(un);_l=i(Uu,"Token classification task guide"),Uu.forEach(s),Su.forEach(s),yl=h(D),io=a(D,"LI",{});var Cu=r(io);hn=a(Cu,"A",{href:!0});var Eu=r(hn);bl=i(Eu,"Question answering task guide"),Eu.forEach(s),Cu.forEach(s),Ml=h(D),co=a(D,"LI",{});var Zu=r(co);mn=a(Zu,"A",{href:!0});var Iu=r(mn);wl=i(Iu,"Masked language modeling task guide"),Iu.forEach(s),Zu.forEach(s),kl=h(D),po=a(D,"LI",{});var Vu=r(po);fn=a(Vu,"A",{href:!0});var Wu=r(fn);Tl=i(Wu,"Multiple choice task guide"),Wu.forEach(s),Vu.forEach(s),D.forEach(s),Ra=h(n),me=a(n,"H2",{class:!0});var ar=r(me);Fe=a(ar,"A",{id:!0,class:!0,href:!0});var Fu=r(Fe);uo=a(Fu,"SPAN",{});var Ru=r(uo);w(It.$$.fragment,Ru),Ru.forEach(s),Fu.forEach(s),zl=h(ar),ho=a(ar,"SPAN",{});var xu=r(ho);vl=i(xu,"SqueezeBertConfig"),xu.forEach(s),ar.forEach(s),xa=h(n),A=a(n,"DIV",{class:!0});var ce=r(A);w(Vt.$$.fragment,ce),ql=h(ce),fe=a(ce,"P",{});var Wn=r(fe);Bl=i(Wn,"This is the configuration class to store the configuration of a "),gn=a(Wn,"A",{href:!0});var Xu=r(gn);$l=i(Xu,"SqueezeBertModel"),Xu.forEach(s),jl=i(Wn,`. It is used to instantiate a
SqueezeBERT 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 SqueezeBERT
`),Wt=a(Wn,"A",{href:!0,rel:!0});var Nu=r(Wt);Jl=i(Nu,"squeezebert/squeezebert-uncased"),Nu.forEach(s),Sl=i(Wn," architecture."),Wn.forEach(s),Ul=h(ce),ge=a(ce,"P",{});var Fn=r(ge);Cl=i(Fn,"Configuration objects inherit from "),_n=a(Fn,"A",{href:!0});var Gu=r(_n);El=i(Gu,"PretrainedConfig"),Gu.forEach(s),Zl=i(Fn,` and can be used to control the model outputs. Read the
documentation from `),yn=a(Fn,"A",{href:!0});var Au=r(yn);Il=i(Au,"PretrainedConfig"),Au.forEach(s),Vl=i(Fn," for more information."),Fn.forEach(s),Wl=h(ce),w(Re.$$.fragment,ce),Fl=h(ce),mo=a(ce,"P",{});var Qu=r(mo);Rl=i(Qu,`Attributes: pretrained_config_archive_map (Dict[str, str]): A dictionary containing all the available pre-trained
checkpoints.`),Qu.forEach(s),ce.forEach(s),Xa=h(n),_e=a(n,"H2",{class:!0});var rr=r(_e);xe=a(rr,"A",{id:!0,class:!0,href:!0});var Pu=r(xe);fo=a(Pu,"SPAN",{});var Yu=r(fo);w(Ft.$$.fragment,Yu),Yu.forEach(s),Pu.forEach(s),xl=h(rr),go=a(rr,"SPAN",{});var Lu=r(go);Xl=i(Lu,"SqueezeBertTokenizer"),Lu.forEach(s),rr.forEach(s),Na=h(n),W=a(n,"DIV",{class:!0});var L=r(W);w(Rt.$$.fragment,L),Nl=h(L),_o=a(L,"P",{});var Du=r(_o);Gl=i(Du,"Construct a SqueezeBERT tokenizer. Based on WordPiece."),Du.forEach(s),Al=h(L),xt=a(L,"P",{});var lr=r(xt);Ql=i(lr,"This tokenizer inherits from "),bn=a(lr,"A",{href:!0});var Hu=r(bn);Pl=i(Hu,"PreTrainedTokenizer"),Hu.forEach(s),Yl=i(lr,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),lr.forEach(s),Ll=h(L),le=a(L,"DIV",{class:!0});var Rn=r(le);w(Xt.$$.fragment,Rn),Dl=h(Rn),yo=a(Rn,"P",{});var Ou=r(yo);Hl=i(Ou,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A SqueezeBERT sequence has the following format:`),Ou.forEach(s),Ol=h(Rn),Nt=a(Rn,"UL",{});var ir=r(Nt);Mn=a(ir,"LI",{});var qu=r(Mn);Kl=i(qu,"single sequence: "),bo=a(qu,"CODE",{});var Ku=r(bo);ei=i(Ku,"[CLS] X [SEP]"),Ku.forEach(s),qu.forEach(s),ti=h(ir),wn=a(ir,"LI",{});var Bu=r(wn);si=i(Bu,"pair of sequences: "),Mo=a(Bu,"CODE",{});var eh=r(Mo);ni=i(eh,"[CLS] A [SEP] B [SEP]"),eh.forEach(s),Bu.forEach(s),ir.forEach(s),Rn.forEach(s),oi=h(L),Xe=a(L,"DIV",{class:!0});var cr=r(Xe);w(Gt.$$.fragment,cr),ai=h(cr),At=a(cr,"P",{});var dr=r(At);ri=i(dr,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),wo=a(dr,"CODE",{});var th=r(wo);li=i(th,"prepare_for_model"),th.forEach(s),ii=i(dr," method."),dr.forEach(s),cr.forEach(s),ci=h(L),H=a(L,"DIV",{class:!0});var Tt=r(H);w(Qt.$$.fragment,Tt),di=h(Tt),ko=a(Tt,"P",{});var sh=r(ko);pi=i(sh,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A SqueezeBERT"),sh.forEach(s),ui=h(Tt),w(Ne.$$.fragment,Tt),hi=h(Tt),ye=a(Tt,"P",{});var xn=r(ye);mi=i(xn,"If "),To=a(xn,"CODE",{});var nh=r(To);fi=i(nh,"token_ids_1"),nh.forEach(s),gi=i(xn," is "),zo=a(xn,"CODE",{});var oh=r(zo);_i=i(oh,"None"),oh.forEach(s),yi=i(xn,", this method only returns the first portion of the mask (0s)."),xn.forEach(s),Tt.forEach(s),bi=h(L),kn=a(L,"DIV",{class:!0});var ah=r(kn);w(Pt.$$.fragment,ah),ah.forEach(s),L.forEach(s),Ga=h(n),be=a(n,"H2",{class:!0});var pr=r(be);Ge=a(pr,"A",{id:!0,class:!0,href:!0});var rh=r(Ge);vo=a(rh,"SPAN",{});var lh=r(vo);w(Yt.$$.fragment,lh),lh.forEach(s),rh.forEach(s),Mi=h(pr),qo=a(pr,"SPAN",{});var ih=r(qo);wi=i(ih,"SqueezeBertTokenizerFast"),ih.forEach(s),pr.forEach(s),Aa=h(n),Q=a(n,"DIV",{class:!0});var de=r(Q);w(Lt.$$.fragment,de),ki=h(de),Dt=a(de,"P",{});var ur=r(Dt);Ti=i(ur,"Construct a \u201Cfast\u201D SqueezeBERT tokenizer (backed by HuggingFace\u2019s "),Bo=a(ur,"EM",{});var ch=r(Bo);zi=i(ch,"tokenizers"),ch.forEach(s),vi=i(ur," library). Based on WordPiece."),ur.forEach(s),qi=h(de),Ht=a(de,"P",{});var hr=r(Ht);Bi=i(hr,"This tokenizer inherits from "),Tn=a(hr,"A",{href:!0});var dh=r(Tn);$i=i(dh,"PreTrainedTokenizerFast"),dh.forEach(s),ji=i(hr,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),hr.forEach(s),Ji=h(de),ie=a(de,"DIV",{class:!0});var Xn=r(ie);w(Ot.$$.fragment,Xn),Si=h(Xn),$o=a(Xn,"P",{});var ph=r($o);Ui=i(ph,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A SqueezeBERT sequence has the following format:`),ph.forEach(s),Ci=h(Xn),Kt=a(Xn,"UL",{});var mr=r(Kt);zn=a(mr,"LI",{});var $u=r(zn);Ei=i($u,"single sequence: "),jo=a($u,"CODE",{});var uh=r(jo);Zi=i(uh,"[CLS] X [SEP]"),uh.forEach(s),$u.forEach(s),Ii=h(mr),vn=a(mr,"LI",{});var ju=r(vn);Vi=i(ju,"pair of sequences: "),Jo=a(ju,"CODE",{});var hh=r(Jo);Wi=i(hh,"[CLS] A [SEP] B [SEP]"),hh.forEach(s),ju.forEach(s),mr.forEach(s),Xn.forEach(s),Fi=h(de),O=a(de,"DIV",{class:!0});var zt=r(O);w(es.$$.fragment,zt),Ri=h(zt),So=a(zt,"P",{});var mh=r(So);xi=i(mh,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A SqueezeBERT"),mh.forEach(s),Xi=h(zt),w(Ae.$$.fragment,zt),Ni=h(zt),Me=a(zt,"P",{});var Nn=r(Me);Gi=i(Nn,"If "),Uo=a(Nn,"CODE",{});var fh=r(Uo);Ai=i(fh,"token_ids_1"),fh.forEach(s),Qi=i(Nn," is "),Co=a(Nn,"CODE",{});var gh=r(Co);Pi=i(gh,"None"),gh.forEach(s),Yi=i(Nn,", this method only returns the first portion of the mask (0s)."),Nn.forEach(s),zt.forEach(s),de.forEach(s),Qa=h(n),we=a(n,"H2",{class:!0});var fr=r(we);Qe=a(fr,"A",{id:!0,class:!0,href:!0});var _h=r(Qe);Eo=a(_h,"SPAN",{});var yh=r(Eo);w(ts.$$.fragment,yh),yh.forEach(s),_h.forEach(s),Li=h(fr),Zo=a(fr,"SPAN",{});var bh=r(Zo);Di=i(bh,"SqueezeBertModel"),bh.forEach(s),fr.forEach(s),Pa=h(n),$=a(n,"DIV",{class:!0});var F=r($);w(ss.$$.fragment,F),Hi=h(F),Io=a(F,"P",{});var Mh=r(Io);Oi=i(Mh,"The bare SqueezeBERT Model transformer outputting raw hidden-states without any specific head on top."),Mh.forEach(s),Ki=h(F),ns=a(F,"P",{});var gr=r(ns);ec=i(gr,"The SqueezeBERT model was proposed in "),os=a(gr,"A",{href:!0,rel:!0});var wh=r(os);tc=i(wh,`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),wh.forEach(s),sc=i(gr,` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),gr.forEach(s),nc=h(F),as=a(F,"P",{});var _r=r(as);oc=i(_r,"This model inherits from "),qn=a(_r,"A",{href:!0});var kh=r(qn);ac=i(kh,"PreTrainedModel"),kh.forEach(s),rc=i(_r,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),_r.forEach(s),lc=h(F),rs=a(F,"P",{});var yr=r(rs);ic=i(yr,"This model is also a PyTorch "),ls=a(yr,"A",{href:!0,rel:!0});var Th=r(ls);cc=i(Th,"torch.nn.Module"),Th.forEach(s),dc=i(yr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),yr.forEach(s),pc=h(F),is=a(F,"P",{});var br=r(is);uc=i(br,`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Vo=a(br,"EM",{});var zh=r(Vo);hc=i(zh,"squeezebert/squeezebert-mnli-headless"),zh.forEach(s),mc=i(br," checkpoint as a starting point."),br.forEach(s),fc=h(F),w(Pe.$$.fragment,F),gc=h(F),w(Ye.$$.fragment,F),_c=h(F),K=a(F,"DIV",{class:!0});var vt=r(K);w(cs.$$.fragment,vt),yc=h(vt),ke=a(vt,"P",{});var Gn=r(ke);bc=i(Gn,"The "),Bn=a(Gn,"A",{href:!0});var vh=r(Bn);Mc=i(vh,"SqueezeBertModel"),vh.forEach(s),wc=i(Gn," forward method, overrides the "),Wo=a(Gn,"CODE",{});var qh=r(Wo);kc=i(qh,"__call__"),qh.forEach(s),Tc=i(Gn," special method."),Gn.forEach(s),zc=h(vt),w(Le.$$.fragment,vt),vc=h(vt),w(De.$$.fragment,vt),vt.forEach(s),F.forEach(s),Ya=h(n),Te=a(n,"H2",{class:!0});var Mr=r(Te);He=a(Mr,"A",{id:!0,class:!0,href:!0});var Bh=r(He);Fo=a(Bh,"SPAN",{});var $h=r(Fo);w(ds.$$.fragment,$h),$h.forEach(s),Bh.forEach(s),qc=h(Mr),Ro=a(Mr,"SPAN",{});var jh=r(Ro);Bc=i(jh,"SqueezeBertForMaskedLM"),jh.forEach(s),Mr.forEach(s),La=h(n),j=a(n,"DIV",{class:!0});var R=r(j);w(ps.$$.fragment,R),$c=h(R),us=a(R,"P",{});var wr=r(us);jc=i(wr,"SqueezeBERT Model with a "),xo=a(wr,"CODE",{});var Jh=r(xo);Jc=i(Jh,"language modeling"),Jh.forEach(s),Sc=i(wr," head on top."),wr.forEach(s),Uc=h(R),hs=a(R,"P",{});var kr=r(hs);Cc=i(kr,"The SqueezeBERT model was proposed in "),ms=a(kr,"A",{href:!0,rel:!0});var Sh=r(ms);Ec=i(Sh,`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),Sh.forEach(s),Zc=i(kr,` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),kr.forEach(s),Ic=h(R),fs=a(R,"P",{});var Tr=r(fs);Vc=i(Tr,"This model inherits from "),$n=a(Tr,"A",{href:!0});var Uh=r($n);Wc=i(Uh,"PreTrainedModel"),Uh.forEach(s),Fc=i(Tr,`. 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.)`),Tr.forEach(s),Rc=h(R),gs=a(R,"P",{});var zr=r(gs);xc=i(zr,"This model is also a PyTorch "),_s=a(zr,"A",{href:!0,rel:!0});var Ch=r(_s);Xc=i(Ch,"torch.nn.Module"),Ch.forEach(s),Nc=i(zr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),zr.forEach(s),Gc=h(R),ys=a(R,"P",{});var vr=r(ys);Ac=i(vr,`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Xo=a(vr,"EM",{});var Eh=r(Xo);Qc=i(Eh,"squeezebert/squeezebert-mnli-headless"),Eh.forEach(s),Pc=i(vr," checkpoint as a starting point."),vr.forEach(s),Yc=h(R),w(Oe.$$.fragment,R),Lc=h(R),w(Ke.$$.fragment,R),Dc=h(R),ee=a(R,"DIV",{class:!0});var qt=r(ee);w(bs.$$.fragment,qt),Hc=h(qt),ze=a(qt,"P",{});var An=r(ze);Oc=i(An,"The "),jn=a(An,"A",{href:!0});var Zh=r(jn);Kc=i(Zh,"SqueezeBertForMaskedLM"),Zh.forEach(s),ed=i(An," forward method, overrides the "),No=a(An,"CODE",{});var Ih=r(No);td=i(Ih,"__call__"),Ih.forEach(s),sd=i(An," special method."),An.forEach(s),nd=h(qt),w(et.$$.fragment,qt),od=h(qt),w(tt.$$.fragment,qt),qt.forEach(s),R.forEach(s),Da=h(n),ve=a(n,"H2",{class:!0});var qr=r(ve);st=a(qr,"A",{id:!0,class:!0,href:!0});var Vh=r(st);Go=a(Vh,"SPAN",{});var Wh=r(Go);w(Ms.$$.fragment,Wh),Wh.forEach(s),Vh.forEach(s),ad=h(qr),Ao=a(qr,"SPAN",{});var Fh=r(Ao);rd=i(Fh,"SqueezeBertForSequenceClassification"),Fh.forEach(s),qr.forEach(s),Ha=h(n),J=a(n,"DIV",{class:!0});var x=r(J);w(ws.$$.fragment,x),ld=h(x),Qo=a(x,"P",{});var Rh=r(Qo);id=i(Rh,`SqueezeBERT Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),Rh.forEach(s),cd=h(x),ks=a(x,"P",{});var Br=r(ks);dd=i(Br,"The SqueezeBERT model was proposed in "),Ts=a(Br,"A",{href:!0,rel:!0});var xh=r(Ts);pd=i(xh,`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),xh.forEach(s),ud=i(Br,` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),Br.forEach(s),hd=h(x),zs=a(x,"P",{});var $r=r(zs);md=i($r,"This model inherits from "),Jn=a($r,"A",{href:!0});var Xh=r(Jn);fd=i(Xh,"PreTrainedModel"),Xh.forEach(s),gd=i($r,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),$r.forEach(s),_d=h(x),vs=a(x,"P",{});var jr=r(vs);yd=i(jr,"This model is also a PyTorch "),qs=a(jr,"A",{href:!0,rel:!0});var Nh=r(qs);bd=i(Nh,"torch.nn.Module"),Nh.forEach(s),Md=i(jr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),jr.forEach(s),wd=h(x),Bs=a(x,"P",{});var Jr=r(Bs);kd=i(Jr,`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Po=a(Jr,"EM",{});var Gh=r(Po);Td=i(Gh,"squeezebert/squeezebert-mnli-headless"),Gh.forEach(s),zd=i(Jr," checkpoint as a starting point."),Jr.forEach(s),vd=h(x),w(nt.$$.fragment,x),qd=h(x),w(ot.$$.fragment,x),Bd=h(x),Y=a(x,"DIV",{class:!0});var pe=r(Y);w($s.$$.fragment,pe),$d=h(pe),qe=a(pe,"P",{});var Qn=r(qe);jd=i(Qn,"The "),Sn=a(Qn,"A",{href:!0});var Ah=r(Sn);Jd=i(Ah,"SqueezeBertForSequenceClassification"),Ah.forEach(s),Sd=i(Qn," forward method, overrides the "),Yo=a(Qn,"CODE",{});var Qh=r(Yo);Ud=i(Qh,"__call__"),Qh.forEach(s),Cd=i(Qn," special method."),Qn.forEach(s),Ed=h(pe),w(at.$$.fragment,pe),Zd=h(pe),w(rt.$$.fragment,pe),Id=h(pe),w(lt.$$.fragment,pe),pe.forEach(s),x.forEach(s),Oa=h(n),Be=a(n,"H2",{class:!0});var Sr=r(Be);it=a(Sr,"A",{id:!0,class:!0,href:!0});var Ph=r(it);Lo=a(Ph,"SPAN",{});var Yh=r(Lo);w(js.$$.fragment,Yh),Yh.forEach(s),Ph.forEach(s),Vd=h(Sr),Do=a(Sr,"SPAN",{});var Lh=r(Do);Wd=i(Lh,"SqueezeBertForMultipleChoice"),Lh.forEach(s),Sr.forEach(s),Ka=h(n),S=a(n,"DIV",{class:!0});var X=r(S);w(Js.$$.fragment,X),Fd=h(X),Ho=a(X,"P",{});var Dh=r(Ho);Rd=i(Dh,`SqueezeBERT 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.`),Dh.forEach(s),xd=h(X),Ss=a(X,"P",{});var Ur=r(Ss);Xd=i(Ur,"The SqueezeBERT model was proposed in "),Us=a(Ur,"A",{href:!0,rel:!0});var Hh=r(Us);Nd=i(Hh,`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),Hh.forEach(s),Gd=i(Ur,` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),Ur.forEach(s),Ad=h(X),Cs=a(X,"P",{});var Cr=r(Cs);Qd=i(Cr,"This model inherits from "),Un=a(Cr,"A",{href:!0});var Oh=r(Un);Pd=i(Oh,"PreTrainedModel"),Oh.forEach(s),Yd=i(Cr,`. 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.)`),Cr.forEach(s),Ld=h(X),Es=a(X,"P",{});var Er=r(Es);Dd=i(Er,"This model is also a PyTorch "),Zs=a(Er,"A",{href:!0,rel:!0});var Kh=r(Zs);Hd=i(Kh,"torch.nn.Module"),Kh.forEach(s),Od=i(Er,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Er.forEach(s),Kd=h(X),Is=a(X,"P",{});var Zr=r(Is);ep=i(Zr,`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Oo=a(Zr,"EM",{});var em=r(Oo);tp=i(em,"squeezebert/squeezebert-mnli-headless"),em.forEach(s),sp=i(Zr," checkpoint as a starting point."),Zr.forEach(s),np=h(X),w(ct.$$.fragment,X),op=h(X),w(dt.$$.fragment,X),ap=h(X),te=a(X,"DIV",{class:!0});var Bt=r(te);w(Vs.$$.fragment,Bt),rp=h(Bt),$e=a(Bt,"P",{});var Pn=r($e);lp=i(Pn,"The "),Cn=a(Pn,"A",{href:!0});var tm=r(Cn);ip=i(tm,"SqueezeBertForMultipleChoice"),tm.forEach(s),cp=i(Pn," forward method, overrides the "),Ko=a(Pn,"CODE",{});var sm=r(Ko);dp=i(sm,"__call__"),sm.forEach(s),pp=i(Pn," special method."),Pn.forEach(s),up=h(Bt),w(pt.$$.fragment,Bt),hp=h(Bt),w(ut.$$.fragment,Bt),Bt.forEach(s),X.forEach(s),er=h(n),je=a(n,"H2",{class:!0});var Ir=r(je);ht=a(Ir,"A",{id:!0,class:!0,href:!0});var nm=r(ht);ea=a(nm,"SPAN",{});var om=r(ea);w(Ws.$$.fragment,om),om.forEach(s),nm.forEach(s),mp=h(Ir),ta=a(Ir,"SPAN",{});var am=r(ta);fp=i(am,"SqueezeBertForTokenClassification"),am.forEach(s),Ir.forEach(s),tr=h(n),U=a(n,"DIV",{class:!0});var N=r(U);w(Fs.$$.fragment,N),gp=h(N),sa=a(N,"P",{});var rm=r(sa);_p=i(rm,`SqueezeBERT 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.`),rm.forEach(s),yp=h(N),Rs=a(N,"P",{});var Vr=r(Rs);bp=i(Vr,"The SqueezeBERT model was proposed in "),xs=a(Vr,"A",{href:!0,rel:!0});var lm=r(xs);Mp=i(lm,`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),lm.forEach(s),wp=i(Vr,` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),Vr.forEach(s),kp=h(N),Xs=a(N,"P",{});var Wr=r(Xs);Tp=i(Wr,"This model inherits from "),En=a(Wr,"A",{href:!0});var im=r(En);zp=i(im,"PreTrainedModel"),im.forEach(s),vp=i(Wr,`. 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.)`),Wr.forEach(s),qp=h(N),Ns=a(N,"P",{});var Fr=r(Ns);Bp=i(Fr,"This model is also a PyTorch "),Gs=a(Fr,"A",{href:!0,rel:!0});var cm=r(Gs);$p=i(cm,"torch.nn.Module"),cm.forEach(s),jp=i(Fr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Fr.forEach(s),Jp=h(N),As=a(N,"P",{});var Rr=r(As);Sp=i(Rr,`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),na=a(Rr,"EM",{});var dm=r(na);Up=i(dm,"squeezebert/squeezebert-mnli-headless"),dm.forEach(s),Cp=i(Rr," checkpoint as a starting point."),Rr.forEach(s),Ep=h(N),w(mt.$$.fragment,N),Zp=h(N),w(ft.$$.fragment,N),Ip=h(N),se=a(N,"DIV",{class:!0});var $t=r(se);w(Qs.$$.fragment,$t),Vp=h($t),Je=a($t,"P",{});var Yn=r(Je);Wp=i(Yn,"The "),Zn=a(Yn,"A",{href:!0});var pm=r(Zn);Fp=i(pm,"SqueezeBertForTokenClassification"),pm.forEach(s),Rp=i(Yn," forward method, overrides the "),oa=a(Yn,"CODE",{});var um=r(oa);xp=i(um,"__call__"),um.forEach(s),Xp=i(Yn," special method."),Yn.forEach(s),Np=h($t),w(gt.$$.fragment,$t),Gp=h($t),w(_t.$$.fragment,$t),$t.forEach(s),N.forEach(s),sr=h(n),Se=a(n,"H2",{class:!0});var xr=r(Se);yt=a(xr,"A",{id:!0,class:!0,href:!0});var hm=r(yt);aa=a(hm,"SPAN",{});var mm=r(aa);w(Ps.$$.fragment,mm),mm.forEach(s),hm.forEach(s),Ap=h(xr),ra=a(xr,"SPAN",{});var fm=r(ra);Qp=i(fm,"SqueezeBertForQuestionAnswering"),fm.forEach(s),xr.forEach(s),nr=h(n),C=a(n,"DIV",{class:!0});var G=r(C);w(Ys.$$.fragment,G),Pp=h(G),Ue=a(G,"P",{});var Ln=r(Ue);Yp=i(Ln,`SqueezeBERT 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 `),la=a(Ln,"CODE",{});var gm=r(la);Lp=i(gm,"span start logits"),gm.forEach(s),Dp=i(Ln," and "),ia=a(Ln,"CODE",{});var _m=r(ia);Hp=i(_m,"span end logits"),_m.forEach(s),Op=i(Ln,")."),Ln.forEach(s),Kp=h(G),Ls=a(G,"P",{});var Xr=r(Ls);eu=i(Xr,"The SqueezeBERT model was proposed in "),Ds=a(Xr,"A",{href:!0,rel:!0});var ym=r(Ds);tu=i(ym,`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),ym.forEach(s),su=i(Xr,` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),Xr.forEach(s),nu=h(G),Hs=a(G,"P",{});var Nr=r(Hs);ou=i(Nr,"This model inherits from "),In=a(Nr,"A",{href:!0});var bm=r(In);au=i(bm,"PreTrainedModel"),bm.forEach(s),ru=i(Nr,`. 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.)`),Nr.forEach(s),lu=h(G),Os=a(G,"P",{});var Gr=r(Os);iu=i(Gr,"This model is also a PyTorch "),Ks=a(Gr,"A",{href:!0,rel:!0});var Mm=r(Ks);cu=i(Mm,"torch.nn.Module"),Mm.forEach(s),du=i(Gr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Gr.forEach(s),pu=h(G),en=a(G,"P",{});var Ar=r(en);uu=i(Ar,`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),ca=a(Ar,"EM",{});var wm=r(ca);hu=i(wm,"squeezebert/squeezebert-mnli-headless"),wm.forEach(s),mu=i(Ar," checkpoint as a starting point."),Ar.forEach(s),fu=h(G),w(bt.$$.fragment,G),gu=h(G),w(Mt.$$.fragment,G),_u=h(G),ne=a(G,"DIV",{class:!0});var jt=r(ne);w(tn.$$.fragment,jt),yu=h(jt),Ce=a(jt,"P",{});var Dn=r(Ce);bu=i(Dn,"The "),Vn=a(Dn,"A",{href:!0});var km=r(Vn);Mu=i(km,"SqueezeBertForQuestionAnswering"),km.forEach(s),wu=i(Dn," forward method, overrides the "),da=a(Dn,"CODE",{});var Tm=r(da);ku=i(Tm,"__call__"),Tm.forEach(s),Tu=i(Dn," special method."),Dn.forEach(s),zu=h(jt),w(wt.$$.fragment,jt),vu=h(jt),w(kt.$$.fragment,jt),jt.forEach(s),G.forEach(s),this.h()},h(){g(c,"name","hf:doc:metadata"),g(c,"content",JSON.stringify(of)),g(d,"id","squeezebert"),g(d,"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(d,"href","#squeezebert"),g(m,"class","relative group"),g(Ie,"id","overview"),g(Ie,"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(Ie,"href","#overview"),g(ue,"class","relative group"),g(St,"href","https://arxiv.org/abs/2006.11316"),g(St,"rel","nofollow"),g(Ut,"href","https://blog.yani.io/filter-group-tutorial"),g(Ut,"rel","nofollow"),g(Et,"href","https://huggingface.co/forresti"),g(Et,"rel","nofollow"),g(We,"id","documentation-resources"),g(We,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(We,"href","#documentation-resources"),g(he,"class","relative group"),g(pn,"href","../tasks/sequence_classification"),g(un,"href","../tasks/token_classification"),g(hn,"href","../tasks/question_answering"),g(mn,"href","../tasks/masked_language_modeling"),g(fn,"href","../tasks/multiple_choice"),g(Fe,"id","transformers.SqueezeBertConfig"),g(Fe,"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(Fe,"href","#transformers.SqueezeBertConfig"),g(me,"class","relative group"),g(gn,"href","/docs/transformers/main/en/model_doc/squeezebert#transformers.SqueezeBertModel"),g(Wt,"href","https://huggingface.co/squeezebert/squeezebert-uncased"),g(Wt,"rel","nofollow"),g(_n,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),g(yn,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),g(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(xe,"id","transformers.SqueezeBertTokenizer"),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.SqueezeBertTokenizer"),g(_e,"class","relative group"),g(bn,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),g(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(kn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Ge,"id","transformers.SqueezeBertTokenizerFast"),g(Ge,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(Ge,"href","#transformers.SqueezeBertTokenizerFast"),g(be,"class","relative group"),g(Tn,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),g(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Qe,"id","transformers.SqueezeBertModel"),g(Qe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(Qe,"href","#transformers.SqueezeBertModel"),g(we,"class","relative group"),g(os,"href","https://arxiv.org/abs/2006.11316"),g(os,"rel","nofollow"),g(qn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),g(ls,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(ls,"rel","nofollow"),g(Bn,"href","/docs/transformers/main/en/model_doc/squeezebert#transformers.SqueezeBertModel"),g(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(He,"id","transformers.SqueezeBertForMaskedLM"),g(He,"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(He,"href","#transformers.SqueezeBertForMaskedLM"),g(Te,"class","relative group"),g(ms,"href","https://arxiv.org/abs/2006.11316"),g(ms,"rel","nofollow"),g($n,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),g(_s,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(_s,"rel","nofollow"),g(jn,"href","/docs/transformers/main/en/model_doc/squeezebert#transformers.SqueezeBertForMaskedLM"),g(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(j,"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,"id","transformers.SqueezeBertForSequenceClassification"),g(st,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(st,"href","#transformers.SqueezeBertForSequenceClassification"),g(ve,"class","relative group"),g(Ts,"href","https://arxiv.org/abs/2006.11316"),g(Ts,"rel","nofollow"),g(Jn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),g(qs,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(qs,"rel","nofollow"),g(Sn,"href","/docs/transformers/main/en/model_doc/squeezebert#transformers.SqueezeBertForSequenceClassification"),g(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(J,"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,"id","transformers.SqueezeBertForMultipleChoice"),g(it,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(it,"href","#transformers.SqueezeBertForMultipleChoice"),g(Be,"class","relative group"),g(Us,"href","https://arxiv.org/abs/2006.11316"),g(Us,"rel","nofollow"),g(Un,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),g(Zs,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(Zs,"rel","nofollow"),g(Cn,"href","/docs/transformers/main/en/model_doc/squeezebert#transformers.SqueezeBertForMultipleChoice"),g(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(S,"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,"id","transformers.SqueezeBertForTokenClassification"),g(ht,"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(ht,"href","#transformers.SqueezeBertForTokenClassification"),g(je,"class","relative group"),g(xs,"href","https://arxiv.org/abs/2006.11316"),g(xs,"rel","nofollow"),g(En,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),g(Gs,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(Gs,"rel","nofollow"),g(Zn,"href","/docs/transformers/main/en/model_doc/squeezebert#transformers.SqueezeBertForTokenClassification"),g(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(yt,"id","transformers.SqueezeBertForQuestionAnswering"),g(yt,"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(yt,"href","#transformers.SqueezeBertForQuestionAnswering"),g(Se,"class","relative group"),g(Ds,"href","https://arxiv.org/abs/2006.11316"),g(Ds,"rel","nofollow"),g(In,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),g(Ks,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(Ks,"rel","nofollow"),g(Vn,"href","/docs/transformers/main/en/model_doc/squeezebert#transformers.SqueezeBertForQuestionAnswering"),g(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(n,y){e(document.head,c),b(n,_,y),b(n,m,y),e(m,d),e(d,f),k(t,f,null),e(m,p),e(m,B),e(B,Qr),b(n,Sa,y),b(n,ue,y),e(ue,Ie),e(Ie,On),k(Jt,On,null),e(ue,Pr),e(ue,Kn),e(Kn,Yr),b(n,Ua,y),b(n,ae,y),e(ae,Lr),e(ae,St),e(St,Dr),e(ae,Hr),e(ae,Ut),e(Ut,Or),e(ae,Kr),b(n,Ca,y),b(n,ln,y),e(ln,el),b(n,Ea,y),b(n,cn,y),e(cn,eo),e(eo,tl),b(n,Za,y),b(n,dn,y),e(dn,sl),b(n,Ia,y),b(n,re,y),e(re,to),e(to,nl),e(re,ol),e(re,so),e(so,al),e(re,rl),e(re,Ct),e(Ct,ll),e(Ct,no),e(no,il),e(Ct,cl),b(n,Va,y),b(n,Ve,y),e(Ve,dl),e(Ve,Et),e(Et,pl),e(Ve,ul),b(n,Wa,y),b(n,he,y),e(he,We),e(We,oo),k(Zt,oo,null),e(he,hl),e(he,ao),e(ao,ml),b(n,Fa,y),b(n,P,y),e(P,ro),e(ro,pn),e(pn,fl),e(P,gl),e(P,lo),e(lo,un),e(un,_l),e(P,yl),e(P,io),e(io,hn),e(hn,bl),e(P,Ml),e(P,co),e(co,mn),e(mn,wl),e(P,kl),e(P,po),e(po,fn),e(fn,Tl),b(n,Ra,y),b(n,me,y),e(me,Fe),e(Fe,uo),k(It,uo,null),e(me,zl),e(me,ho),e(ho,vl),b(n,xa,y),b(n,A,y),k(Vt,A,null),e(A,ql),e(A,fe),e(fe,Bl),e(fe,gn),e(gn,$l),e(fe,jl),e(fe,Wt),e(Wt,Jl),e(fe,Sl),e(A,Ul),e(A,ge),e(ge,Cl),e(ge,_n),e(_n,El),e(ge,Zl),e(ge,yn),e(yn,Il),e(ge,Vl),e(A,Wl),k(Re,A,null),e(A,Fl),e(A,mo),e(mo,Rl),b(n,Xa,y),b(n,_e,y),e(_e,xe),e(xe,fo),k(Ft,fo,null),e(_e,xl),e(_e,go),e(go,Xl),b(n,Na,y),b(n,W,y),k(Rt,W,null),e(W,Nl),e(W,_o),e(_o,Gl),e(W,Al),e(W,xt),e(xt,Ql),e(xt,bn),e(bn,Pl),e(xt,Yl),e(W,Ll),e(W,le),k(Xt,le,null),e(le,Dl),e(le,yo),e(yo,Hl),e(le,Ol),e(le,Nt),e(Nt,Mn),e(Mn,Kl),e(Mn,bo),e(bo,ei),e(Nt,ti),e(Nt,wn),e(wn,si),e(wn,Mo),e(Mo,ni),e(W,oi),e(W,Xe),k(Gt,Xe,null),e(Xe,ai),e(Xe,At),e(At,ri),e(At,wo),e(wo,li),e(At,ii),e(W,ci),e(W,H),k(Qt,H,null),e(H,di),e(H,ko),e(ko,pi),e(H,ui),k(Ne,H,null),e(H,hi),e(H,ye),e(ye,mi),e(ye,To),e(To,fi),e(ye,gi),e(ye,zo),e(zo,_i),e(ye,yi),e(W,bi),e(W,kn),k(Pt,kn,null),b(n,Ga,y),b(n,be,y),e(be,Ge),e(Ge,vo),k(Yt,vo,null),e(be,Mi),e(be,qo),e(qo,wi),b(n,Aa,y),b(n,Q,y),k(Lt,Q,null),e(Q,ki),e(Q,Dt),e(Dt,Ti),e(Dt,Bo),e(Bo,zi),e(Dt,vi),e(Q,qi),e(Q,Ht),e(Ht,Bi),e(Ht,Tn),e(Tn,$i),e(Ht,ji),e(Q,Ji),e(Q,ie),k(Ot,ie,null),e(ie,Si),e(ie,$o),e($o,Ui),e(ie,Ci),e(ie,Kt),e(Kt,zn),e(zn,Ei),e(zn,jo),e(jo,Zi),e(Kt,Ii),e(Kt,vn),e(vn,Vi),e(vn,Jo),e(Jo,Wi),e(Q,Fi),e(Q,O),k(es,O,null),e(O,Ri),e(O,So),e(So,xi),e(O,Xi),k(Ae,O,null),e(O,Ni),e(O,Me),e(Me,Gi),e(Me,Uo),e(Uo,Ai),e(Me,Qi),e(Me,Co),e(Co,Pi),e(Me,Yi),b(n,Qa,y),b(n,we,y),e(we,Qe),e(Qe,Eo),k(ts,Eo,null),e(we,Li),e(we,Zo),e(Zo,Di),b(n,Pa,y),b(n,$,y),k(ss,$,null),e($,Hi),e($,Io),e(Io,Oi),e($,Ki),e($,ns),e(ns,ec),e(ns,os),e(os,tc),e(ns,sc),e($,nc),e($,as),e(as,oc),e(as,qn),e(qn,ac),e(as,rc),e($,lc),e($,rs),e(rs,ic),e(rs,ls),e(ls,cc),e(rs,dc),e($,pc),e($,is),e(is,uc),e(is,Vo),e(Vo,hc),e(is,mc),e($,fc),k(Pe,$,null),e($,gc),k(Ye,$,null),e($,_c),e($,K),k(cs,K,null),e(K,yc),e(K,ke),e(ke,bc),e(ke,Bn),e(Bn,Mc),e(ke,wc),e(ke,Wo),e(Wo,kc),e(ke,Tc),e(K,zc),k(Le,K,null),e(K,vc),k(De,K,null),b(n,Ya,y),b(n,Te,y),e(Te,He),e(He,Fo),k(ds,Fo,null),e(Te,qc),e(Te,Ro),e(Ro,Bc),b(n,La,y),b(n,j,y),k(ps,j,null),e(j,$c),e(j,us),e(us,jc),e(us,xo),e(xo,Jc),e(us,Sc),e(j,Uc),e(j,hs),e(hs,Cc),e(hs,ms),e(ms,Ec),e(hs,Zc),e(j,Ic),e(j,fs),e(fs,Vc),e(fs,$n),e($n,Wc),e(fs,Fc),e(j,Rc),e(j,gs),e(gs,xc),e(gs,_s),e(_s,Xc),e(gs,Nc),e(j,Gc),e(j,ys),e(ys,Ac),e(ys,Xo),e(Xo,Qc),e(ys,Pc),e(j,Yc),k(Oe,j,null),e(j,Lc),k(Ke,j,null),e(j,Dc),e(j,ee),k(bs,ee,null),e(ee,Hc),e(ee,ze),e(ze,Oc),e(ze,jn),e(jn,Kc),e(ze,ed),e(ze,No),e(No,td),e(ze,sd),e(ee,nd),k(et,ee,null),e(ee,od),k(tt,ee,null),b(n,Da,y),b(n,ve,y),e(ve,st),e(st,Go),k(Ms,Go,null),e(ve,ad),e(ve,Ao),e(Ao,rd),b(n,Ha,y),b(n,J,y),k(ws,J,null),e(J,ld),e(J,Qo),e(Qo,id),e(J,cd),e(J,ks),e(ks,dd),e(ks,Ts),e(Ts,pd),e(ks,ud),e(J,hd),e(J,zs),e(zs,md),e(zs,Jn),e(Jn,fd),e(zs,gd),e(J,_d),e(J,vs),e(vs,yd),e(vs,qs),e(qs,bd),e(vs,Md),e(J,wd),e(J,Bs),e(Bs,kd),e(Bs,Po),e(Po,Td),e(Bs,zd),e(J,vd),k(nt,J,null),e(J,qd),k(ot,J,null),e(J,Bd),e(J,Y),k($s,Y,null),e(Y,$d),e(Y,qe),e(qe,jd),e(qe,Sn),e(Sn,Jd),e(qe,Sd),e(qe,Yo),e(Yo,Ud),e(qe,Cd),e(Y,Ed),k(at,Y,null),e(Y,Zd),k(rt,Y,null),e(Y,Id),k(lt,Y,null),b(n,Oa,y),b(n,Be,y),e(Be,it),e(it,Lo),k(js,Lo,null),e(Be,Vd),e(Be,Do),e(Do,Wd),b(n,Ka,y),b(n,S,y),k(Js,S,null),e(S,Fd),e(S,Ho),e(Ho,Rd),e(S,xd),e(S,Ss),e(Ss,Xd),e(Ss,Us),e(Us,Nd),e(Ss,Gd),e(S,Ad),e(S,Cs),e(Cs,Qd),e(Cs,Un),e(Un,Pd),e(Cs,Yd),e(S,Ld),e(S,Es),e(Es,Dd),e(Es,Zs),e(Zs,Hd),e(Es,Od),e(S,Kd),e(S,Is),e(Is,ep),e(Is,Oo),e(Oo,tp),e(Is,sp),e(S,np),k(ct,S,null),e(S,op),k(dt,S,null),e(S,ap),e(S,te),k(Vs,te,null),e(te,rp),e(te,$e),e($e,lp),e($e,Cn),e(Cn,ip),e($e,cp),e($e,Ko),e(Ko,dp),e($e,pp),e(te,up),k(pt,te,null),e(te,hp),k(ut,te,null),b(n,er,y),b(n,je,y),e(je,ht),e(ht,ea),k(Ws,ea,null),e(je,mp),e(je,ta),e(ta,fp),b(n,tr,y),b(n,U,y),k(Fs,U,null),e(U,gp),e(U,sa),e(sa,_p),e(U,yp),e(U,Rs),e(Rs,bp),e(Rs,xs),e(xs,Mp),e(Rs,wp),e(U,kp),e(U,Xs),e(Xs,Tp),e(Xs,En),e(En,zp),e(Xs,vp),e(U,qp),e(U,Ns),e(Ns,Bp),e(Ns,Gs),e(Gs,$p),e(Ns,jp),e(U,Jp),e(U,As),e(As,Sp),e(As,na),e(na,Up),e(As,Cp),e(U,Ep),k(mt,U,null),e(U,Zp),k(ft,U,null),e(U,Ip),e(U,se),k(Qs,se,null),e(se,Vp),e(se,Je),e(Je,Wp),e(Je,Zn),e(Zn,Fp),e(Je,Rp),e(Je,oa),e(oa,xp),e(Je,Xp),e(se,Np),k(gt,se,null),e(se,Gp),k(_t,se,null),b(n,sr,y),b(n,Se,y),e(Se,yt),e(yt,aa),k(Ps,aa,null),e(Se,Ap),e(Se,ra),e(ra,Qp),b(n,nr,y),b(n,C,y),k(Ys,C,null),e(C,Pp),e(C,Ue),e(Ue,Yp),e(Ue,la),e(la,Lp),e(Ue,Dp),e(Ue,ia),e(ia,Hp),e(Ue,Op),e(C,Kp),e(C,Ls),e(Ls,eu),e(Ls,Ds),e(Ds,tu),e(Ls,su),e(C,nu),e(C,Hs),e(Hs,ou),e(Hs,In),e(In,au),e(Hs,ru),e(C,lu),e(C,Os),e(Os,iu),e(Os,Ks),e(Ks,cu),e(Os,du),e(C,pu),e(C,en),e(en,uu),e(en,ca),e(ca,hu),e(en,mu),e(C,fu),k(bt,C,null),e(C,gu),k(Mt,C,null),e(C,_u),e(C,ne),k(tn,ne,null),e(ne,yu),e(ne,Ce),e(Ce,bu),e(Ce,Vn),e(Vn,Mu),e(Ce,wu),e(Ce,da),e(da,ku),e(Ce,Tu),e(ne,zu),k(wt,ne,null),e(ne,vu),k(kt,ne,null),or=!0},p(n,[y]){const sn={};y&2&&(sn.$$scope={dirty:y,ctx:n}),Re.$set(sn);const pa={};y&2&&(pa.$$scope={dirty:y,ctx:n}),Ne.$set(pa);const ua={};y&2&&(ua.$$scope={dirty:y,ctx:n}),Ae.$set(ua);const ha={};y&2&&(ha.$$scope={dirty:y,ctx:n}),Pe.$set(ha);const nn={};y&2&&(nn.$$scope={dirty:y,ctx:n}),Ye.$set(nn);const ma={};y&2&&(ma.$$scope={dirty:y,ctx:n}),Le.$set(ma);const fa={};y&2&&(fa.$$scope={dirty:y,ctx:n}),De.$set(fa);const ga={};y&2&&(ga.$$scope={dirty:y,ctx:n}),Oe.$set(ga);const Ee={};y&2&&(Ee.$$scope={dirty:y,ctx:n}),Ke.$set(Ee);const _a={};y&2&&(_a.$$scope={dirty:y,ctx:n}),et.$set(_a);const ya={};y&2&&(ya.$$scope={dirty:y,ctx:n}),tt.$set(ya);const ba={};y&2&&(ba.$$scope={dirty:y,ctx:n}),nt.$set(ba);const Ma={};y&2&&(Ma.$$scope={dirty:y,ctx:n}),ot.$set(Ma);const wa={};y&2&&(wa.$$scope={dirty:y,ctx:n}),at.$set(wa);const ka={};y&2&&(ka.$$scope={dirty:y,ctx:n}),rt.$set(ka);const Ze={};y&2&&(Ze.$$scope={dirty:y,ctx:n}),lt.$set(Ze);const Ta={};y&2&&(Ta.$$scope={dirty:y,ctx:n}),ct.$set(Ta);const za={};y&2&&(za.$$scope={dirty:y,ctx:n}),dt.$set(za);const on={};y&2&&(on.$$scope={dirty:y,ctx:n}),pt.$set(on);const va={};y&2&&(va.$$scope={dirty:y,ctx:n}),ut.$set(va);const an={};y&2&&(an.$$scope={dirty:y,ctx:n}),mt.$set(an);const qa={};y&2&&(qa.$$scope={dirty:y,ctx:n}),ft.$set(qa);const rn={};y&2&&(rn.$$scope={dirty:y,ctx:n}),gt.$set(rn);const Ba={};y&2&&(Ba.$$scope={dirty:y,ctx:n}),_t.$set(Ba);const $a={};y&2&&($a.$$scope={dirty:y,ctx:n}),bt.$set($a);const ja={};y&2&&(ja.$$scope={dirty:y,ctx:n}),Mt.$set(ja);const D={};y&2&&(D.$$scope={dirty:y,ctx:n}),wt.$set(D);const Ja={};y&2&&(Ja.$$scope={dirty:y,ctx:n}),kt.$set(Ja)},i(n){or||(T(t.$$.fragment,n),T(Jt.$$.fragment,n),T(Zt.$$.fragment,n),T(It.$$.fragment,n),T(Vt.$$.fragment,n),T(Re.$$.fragment,n),T(Ft.$$.fragment,n),T(Rt.$$.fragment,n),T(Xt.$$.fragment,n),T(Gt.$$.fragment,n),T(Qt.$$.fragment,n),T(Ne.$$.fragment,n),T(Pt.$$.fragment,n),T(Yt.$$.fragment,n),T(Lt.$$.fragment,n),T(Ot.$$.fragment,n),T(es.$$.fragment,n),T(Ae.$$.fragment,n),T(ts.$$.fragment,n),T(ss.$$.fragment,n),T(Pe.$$.fragment,n),T(Ye.$$.fragment,n),T(cs.$$.fragment,n),T(Le.$$.fragment,n),T(De.$$.fragment,n),T(ds.$$.fragment,n),T(ps.$$.fragment,n),T(Oe.$$.fragment,n),T(Ke.$$.fragment,n),T(bs.$$.fragment,n),T(et.$$.fragment,n),T(tt.$$.fragment,n),T(Ms.$$.fragment,n),T(ws.$$.fragment,n),T(nt.$$.fragment,n),T(ot.$$.fragment,n),T($s.$$.fragment,n),T(at.$$.fragment,n),T(rt.$$.fragment,n),T(lt.$$.fragment,n),T(js.$$.fragment,n),T(Js.$$.fragment,n),T(ct.$$.fragment,n),T(dt.$$.fragment,n),T(Vs.$$.fragment,n),T(pt.$$.fragment,n),T(ut.$$.fragment,n),T(Ws.$$.fragment,n),T(Fs.$$.fragment,n),T(mt.$$.fragment,n),T(ft.$$.fragment,n),T(Qs.$$.fragment,n),T(gt.$$.fragment,n),T(_t.$$.fragment,n),T(Ps.$$.fragment,n),T(Ys.$$.fragment,n),T(bt.$$.fragment,n),T(Mt.$$.fragment,n),T(tn.$$.fragment,n),T(wt.$$.fragment,n),T(kt.$$.fragment,n),or=!0)},o(n){z(t.$$.fragment,n),z(Jt.$$.fragment,n),z(Zt.$$.fragment,n),z(It.$$.fragment,n),z(Vt.$$.fragment,n),z(Re.$$.fragment,n),z(Ft.$$.fragment,n),z(Rt.$$.fragment,n),z(Xt.$$.fragment,n),z(Gt.$$.fragment,n),z(Qt.$$.fragment,n),z(Ne.$$.fragment,n),z(Pt.$$.fragment,n),z(Yt.$$.fragment,n),z(Lt.$$.fragment,n),z(Ot.$$.fragment,n),z(es.$$.fragment,n),z(Ae.$$.fragment,n),z(ts.$$.fragment,n),z(ss.$$.fragment,n),z(Pe.$$.fragment,n),z(Ye.$$.fragment,n),z(cs.$$.fragment,n),z(Le.$$.fragment,n),z(De.$$.fragment,n),z(ds.$$.fragment,n),z(ps.$$.fragment,n),z(Oe.$$.fragment,n),z(Ke.$$.fragment,n),z(bs.$$.fragment,n),z(et.$$.fragment,n),z(tt.$$.fragment,n),z(Ms.$$.fragment,n),z(ws.$$.fragment,n),z(nt.$$.fragment,n),z(ot.$$.fragment,n),z($s.$$.fragment,n),z(at.$$.fragment,n),z(rt.$$.fragment,n),z(lt.$$.fragment,n),z(js.$$.fragment,n),z(Js.$$.fragment,n),z(ct.$$.fragment,n),z(dt.$$.fragment,n),z(Vs.$$.fragment,n),z(pt.$$.fragment,n),z(ut.$$.fragment,n),z(Ws.$$.fragment,n),z(Fs.$$.fragment,n),z(mt.$$.fragment,n),z(ft.$$.fragment,n),z(Qs.$$.fragment,n),z(gt.$$.fragment,n),z(_t.$$.fragment,n),z(Ps.$$.fragment,n),z(Ys.$$.fragment,n),z(bt.$$.fragment,n),z(Mt.$$.fragment,n),z(tn.$$.fragment,n),z(wt.$$.fragment,n),z(kt.$$.fragment,n),or=!1},d(n){s(c),n&&s(_),n&&s(m),v(t),n&&s(Sa),n&&s(ue),v(Jt),n&&s(Ua),n&&s(ae),n&&s(Ca),n&&s(ln),n&&s(Ea),n&&s(cn),n&&s(Za),n&&s(dn),n&&s(Ia),n&&s(re),n&&s(Va),n&&s(Ve),n&&s(Wa),n&&s(he),v(Zt),n&&s(Fa),n&&s(P),n&&s(Ra),n&&s(me),v(It),n&&s(xa),n&&s(A),v(Vt),v(Re),n&&s(Xa),n&&s(_e),v(Ft),n&&s(Na),n&&s(W),v(Rt),v(Xt),v(Gt),v(Qt),v(Ne),v(Pt),n&&s(Ga),n&&s(be),v(Yt),n&&s(Aa),n&&s(Q),v(Lt),v(Ot),v(es),v(Ae),n&&s(Qa),n&&s(we),v(ts),n&&s(Pa),n&&s($),v(ss),v(Pe),v(Ye),v(cs),v(Le),v(De),n&&s(Ya),n&&s(Te),v(ds),n&&s(La),n&&s(j),v(ps),v(Oe),v(Ke),v(bs),v(et),v(tt),n&&s(Da),n&&s(ve),v(Ms),n&&s(Ha),n&&s(J),v(ws),v(nt),v(ot),v($s),v(at),v(rt),v(lt),n&&s(Oa),n&&s(Be),v(js),n&&s(Ka),n&&s(S),v(Js),v(ct),v(dt),v(Vs),v(pt),v(ut),n&&s(er),n&&s(je),v(Ws),n&&s(tr),n&&s(U),v(Fs),v(mt),v(ft),v(Qs),v(gt),v(_t),n&&s(sr),n&&s(Se),v(Ps),n&&s(nr),n&&s(C),v(Ys),v(bt),v(Mt),v(tn),v(wt),v(kt)}}}const of={local:"squeezebert",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.SqueezeBertConfig",title:"SqueezeBertConfig"},{local:"transformers.SqueezeBertTokenizer",title:"SqueezeBertTokenizer"},{local:"transformers.SqueezeBertTokenizerFast",title:"SqueezeBertTokenizerFast"},{local:"transformers.SqueezeBertModel",title:"SqueezeBertModel"},{local:"transformers.SqueezeBertForMaskedLM",title:"SqueezeBertForMaskedLM"},{local:"transformers.SqueezeBertForSequenceClassification",title:"SqueezeBertForSequenceClassification"},{local:"transformers.SqueezeBertForMultipleChoice",title:"SqueezeBertForMultipleChoice"},{local:"transformers.SqueezeBertForTokenClassification",title:"SqueezeBertForTokenClassification"},{local:"transformers.SqueezeBertForQuestionAnswering",title:"SqueezeBertForQuestionAnswering"}],title:"SqueezeBERT"};function af(q){return $m(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class hf extends zm{constructor(c){super();vm(this,c,af,nf,qm,{})}}export{hf as default,of as metadata};
