import{S as zm,i as vm,s as qm,e as n,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 Ho}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 ne}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=n("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=n("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=n("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=n("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=n("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=n("p"),_=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=n("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=n("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=n("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=n("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 Fm(q){let c,_,m,d,f;return{c(){c=n("p"),_=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=n("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 Wm(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=n("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=n("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=n("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=n("p"),_=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=n("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=n("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=n("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=n("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=n("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=n("p"),_=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=n("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=n("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=n("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=n("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=n("p"),_=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=n("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=n("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=n("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=n("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=n("p"),_=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=n("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=n("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 of(q){let c,_,m,d,f,t,p,B,Qr,Sa,ue,Ie,Oo,Jt,Pr,Ko,Yr,Ua,ae,Lr,St,Dr,Hr,Ut,Or,Kr,Ca,lo,el,Ea,io,en,tl,Za,co,sl,Ia,re,tn,ol,nl,sn,al,rl,Ct,ll,on,il,cl,Va,Ve,dl,Et,pl,ul,Fa,he,Fe,nn,Zt,hl,an,ml,Wa,P,rn,po,fl,gl,ln,uo,_l,yl,cn,ho,bl,Ml,dn,mo,wl,kl,pn,fo,Tl,Ra,me,We,un,It,zl,hn,vl,xa,A,Vt,ql,fe,Bl,go,$l,jl,Ft,Jl,Sl,Ul,ge,Cl,_o,El,Zl,yo,Il,Vl,Fl,Re,Wl,mn,Rl,Xa,_e,xe,fn,Wt,xl,gn,Xl,Na,F,Rt,Nl,_n,Gl,Al,xt,Ql,bo,Pl,Yl,Ll,le,Xt,Dl,yn,Hl,Ol,Nt,Mo,Kl,bn,ei,ti,wo,si,Mn,oi,ni,Xe,Gt,ai,At,ri,wn,li,ii,ci,H,Qt,di,kn,pi,ui,Ne,hi,ye,mi,Tn,fi,gi,zn,_i,yi,bi,ko,Pt,Ga,be,Ge,vn,Yt,Mi,qn,wi,Aa,Q,Lt,ki,Dt,Ti,Bn,zi,vi,qi,Ht,Bi,To,$i,ji,Ji,ie,Ot,Si,$n,Ui,Ci,Kt,zo,Ei,jn,Zi,Ii,vo,Vi,Jn,Fi,Wi,O,es,Ri,Sn,xi,Xi,Ae,Ni,Me,Gi,Un,Ai,Qi,Cn,Pi,Yi,Qa,we,Qe,En,ts,Li,Zn,Di,Pa,$,ss,Hi,In,Oi,Ki,os,ec,ns,tc,sc,oc,as,nc,qo,ac,rc,lc,rs,ic,ls,cc,dc,pc,is,uc,Vn,hc,mc,fc,Pe,gc,Ye,_c,K,cs,yc,ke,bc,Bo,Mc,wc,Fn,kc,Tc,zc,Le,vc,De,Ya,Te,He,Wn,ds,qc,Rn,Bc,La,j,ps,$c,us,jc,xn,Jc,Sc,Uc,hs,Cc,ms,Ec,Zc,Ic,fs,Vc,$o,Fc,Wc,Rc,gs,xc,_s,Xc,Nc,Gc,ys,Ac,Xn,Qc,Pc,Yc,Oe,Lc,Ke,Dc,ee,bs,Hc,ze,Oc,jo,Kc,ed,Nn,td,sd,od,et,nd,tt,Da,ve,st,Gn,Ms,ad,An,rd,Ha,J,ws,ld,Qn,id,cd,ks,dd,Ts,pd,ud,hd,zs,md,Jo,fd,gd,_d,vs,yd,qs,bd,Md,wd,Bs,kd,Pn,Td,zd,vd,ot,qd,nt,Bd,Y,$s,$d,qe,jd,So,Jd,Sd,Yn,Ud,Cd,Ed,at,Zd,rt,Id,lt,Oa,Be,it,Ln,js,Vd,Dn,Fd,Ka,S,Js,Wd,Hn,Rd,xd,Ss,Xd,Us,Nd,Gd,Ad,Cs,Qd,Uo,Pd,Yd,Ld,Es,Dd,Zs,Hd,Od,Kd,Is,ep,On,tp,sp,op,ct,np,dt,ap,te,Vs,rp,$e,lp,Co,ip,cp,Kn,dp,pp,up,pt,hp,ut,er,je,ht,ea,Fs,mp,ta,fp,tr,U,Ws,gp,sa,_p,yp,Rs,bp,xs,Mp,wp,kp,Xs,Tp,Eo,zp,vp,qp,Ns,Bp,Gs,$p,jp,Jp,As,Sp,oa,Up,Cp,Ep,mt,Zp,ft,Ip,se,Qs,Vp,Je,Fp,Zo,Wp,Rp,na,xp,Xp,Np,gt,Gp,_t,sr,Se,yt,aa,Ps,Ap,ra,Qp,or,C,Ys,Pp,Ue,Yp,la,Lp,Dp,ia,Hp,Op,Kp,Ls,eu,Ds,tu,su,ou,Hs,nu,Io,au,ru,lu,Os,iu,Ks,cu,du,pu,eo,uu,ca,hu,mu,fu,bt,gu,Mt,_u,oe,to,yu,Ce,bu,Vo,Mu,wu,da,ku,Tu,zu,wt,vu,kt,nr;return t=new ne({}),Jt=new ne({}),Zt=new ne({}),It=new ne({}),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}}}),Wt=new ne({}),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 ne({}),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 ne({}),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/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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 Ho({props:{$$slots:{default:[Em]},$$scope:{ctx:q}}}),De=new E({props:{anchor:"transformers.SqueezeBertModel.forward.example",$$slots:{default:[Zm]},$$scope:{ctx:q}}}),ds=new ne({}),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/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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 Ho({props:{$$slots:{default:[Fm]},$$scope:{ctx:q}}}),tt=new E({props:{anchor:"transformers.SqueezeBertForMaskedLM.forward.example",$$slots:{default:[Wm]},$$scope:{ctx:q}}}),Ms=new ne({}),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"}}),ot=new E({props:{anchor:"transformers.SqueezeBertForSequenceClassification.example",$$slots:{default:[Rm]},$$scope:{ctx:q}}}),nt=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/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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 Ho({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 ne({}),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/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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 Ho({props:{$$slots:{default:[Pm]},$$scope:{ctx:q}}}),ut=new E({props:{anchor:"transformers.SqueezeBertForMultipleChoice.forward.example",$$slots:{default:[Ym]},$$scope:{ctx:q}}}),Fs=new ne({}),Ws=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/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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 Ho({props:{$$slots:{default:[Hm]},$$scope:{ctx:q}}}),_t=new E({props:{anchor:"transformers.SqueezeBertForTokenClassification.forward.example",$$slots:{default:[Om]},$$scope:{ctx:q}}}),Ps=new ne({}),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}}}),to=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/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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 Ho({props:{$$slots:{default:[tf]},$$scope:{ctx:q}}}),kt=new E({props:{anchor:"transformers.SqueezeBertForQuestionAnswering.forward.example",$$slots:{default:[sf]},$$scope:{ctx:q}}}),{c(){c=n("meta"),_=u(),m=n("h1"),d=n("a"),f=n("span"),M(t.$$.fragment),p=u(),B=n("span"),Qr=l("SqueezeBERT"),Sa=u(),ue=n("h2"),Ie=n("a"),Oo=n("span"),M(Jt.$$.fragment),Pr=u(),Ko=n("span"),Yr=l("Overview"),Ua=u(),ae=n("p"),Lr=l("The SqueezeBERT model was proposed in "),St=n("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=n("a"),Or=l("grouped convolutions"),Kr=l(`
instead of fully-connected layers for the Q, K, V and FFN layers.`),Ca=u(),lo=n("p"),el=l("The abstract from the paper is the following:"),Ea=u(),io=n("p"),en=n("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(),co=n("p"),sl=l("Tips:"),Ia=u(),re=n("ul"),tn=n("li"),ol=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.`),nl=u(),sn=n("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=n("li"),ll=l(`For best results when finetuning on sequence classification tasks, it is recommended to start with the
`),on=n("em"),il=l("squeezebert/squeezebert-mnli-headless"),cl=l(" checkpoint."),Va=u(),Ve=n("p"),dl=l("This model was contributed by "),Et=n("a"),pl=l("forresti"),ul=l("."),Fa=u(),he=n("h2"),Fe=n("a"),nn=n("span"),M(Zt.$$.fragment),hl=u(),an=n("span"),ml=l("Documentation resources"),Wa=u(),P=n("ul"),rn=n("li"),po=n("a"),fl=l("Text classification task guide"),gl=u(),ln=n("li"),uo=n("a"),_l=l("Token classification task guide"),yl=u(),cn=n("li"),ho=n("a"),bl=l("Question answering task guide"),Ml=u(),dn=n("li"),mo=n("a"),wl=l("Masked language modeling task guide"),kl=u(),pn=n("li"),fo=n("a"),Tl=l("Multiple choice task guide"),Ra=u(),me=n("h2"),We=n("a"),un=n("span"),M(It.$$.fragment),zl=u(),hn=n("span"),vl=l("SqueezeBertConfig"),xa=u(),A=n("div"),M(Vt.$$.fragment),ql=u(),fe=n("p"),Bl=l("This is the configuration class to store the configuration of a "),go=n("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
`),Ft=n("a"),Jl=l("squeezebert/squeezebert-uncased"),Sl=l(" architecture."),Ul=u(),ge=n("p"),Cl=l("Configuration objects inherit from "),_o=n("a"),El=l("PretrainedConfig"),Zl=l(` and can be used to control the model outputs. Read the
documentation from `),yo=n("a"),Il=l("PretrainedConfig"),Vl=l(" for more information."),Fl=u(),M(Re.$$.fragment),Wl=u(),mn=n("p"),Rl=l(`Attributes: pretrained_config_archive_map (Dict[str, str]): A dictionary containing all the available pre-trained
checkpoints.`),Xa=u(),_e=n("h2"),xe=n("a"),fn=n("span"),M(Wt.$$.fragment),xl=u(),gn=n("span"),Xl=l("SqueezeBertTokenizer"),Na=u(),F=n("div"),M(Rt.$$.fragment),Nl=u(),_n=n("p"),Gl=l("Construct a SqueezeBERT tokenizer. Based on WordPiece."),Al=u(),xt=n("p"),Ql=l("This tokenizer inherits from "),bo=n("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=n("div"),M(Xt.$$.fragment),Dl=u(),yn=n("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=n("ul"),Mo=n("li"),Kl=l("single sequence: "),bn=n("code"),ei=l("[CLS] X [SEP]"),ti=u(),wo=n("li"),si=l("pair of sequences: "),Mn=n("code"),oi=l("[CLS] A [SEP] B [SEP]"),ni=u(),Xe=n("div"),M(Gt.$$.fragment),ai=u(),At=n("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 `),wn=n("code"),li=l("prepare_for_model"),ii=l(" method."),ci=u(),H=n("div"),M(Qt.$$.fragment),di=u(),kn=n("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=n("p"),mi=l("If "),Tn=n("code"),fi=l("token_ids_1"),gi=l(" is "),zn=n("code"),_i=l("None"),yi=l(", this method only returns the first portion of the mask (0s)."),bi=u(),ko=n("div"),M(Pt.$$.fragment),Ga=u(),be=n("h2"),Ge=n("a"),vn=n("span"),M(Yt.$$.fragment),Mi=u(),qn=n("span"),wi=l("SqueezeBertTokenizerFast"),Aa=u(),Q=n("div"),M(Lt.$$.fragment),ki=u(),Dt=n("p"),Ti=l("Construct a \u201Cfast\u201D SqueezeBERT tokenizer (backed by HuggingFace\u2019s "),Bn=n("em"),zi=l("tokenizers"),vi=l(" library). Based on WordPiece."),qi=u(),Ht=n("p"),Bi=l("This tokenizer inherits from "),To=n("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=n("div"),M(Ot.$$.fragment),Si=u(),$n=n("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=n("ul"),zo=n("li"),Ei=l("single sequence: "),jn=n("code"),Zi=l("[CLS] X [SEP]"),Ii=u(),vo=n("li"),Vi=l("pair of sequences: "),Jn=n("code"),Fi=l("[CLS] A [SEP] B [SEP]"),Wi=u(),O=n("div"),M(es.$$.fragment),Ri=u(),Sn=n("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=n("p"),Gi=l("If "),Un=n("code"),Ai=l("token_ids_1"),Qi=l(" is "),Cn=n("code"),Pi=l("None"),Yi=l(", this method only returns the first portion of the mask (0s)."),Qa=u(),we=n("h2"),Qe=n("a"),En=n("span"),M(ts.$$.fragment),Li=u(),Zn=n("span"),Di=l("SqueezeBertModel"),Pa=u(),$=n("div"),M(ss.$$.fragment),Hi=u(),In=n("p"),Oi=l("The bare SqueezeBERT Model transformer outputting raw hidden-states without any specific head on top."),Ki=u(),os=n("p"),ec=l("The SqueezeBERT model was proposed in "),ns=n("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`),oc=u(),as=n("p"),nc=l("This model inherits from "),qo=n("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=n("p"),ic=l("This model is also a PyTorch "),ls=n("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=n("p"),uc=l(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Vn=n("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=n("div"),M(cs.$$.fragment),yc=u(),ke=n("p"),bc=l("The "),Bo=n("a"),Mc=l("SqueezeBertModel"),wc=l(" forward method, overrides the "),Fn=n("code"),kc=l("__call__"),Tc=l(" special method."),zc=u(),M(Le.$$.fragment),vc=u(),M(De.$$.fragment),Ya=u(),Te=n("h2"),He=n("a"),Wn=n("span"),M(ds.$$.fragment),qc=u(),Rn=n("span"),Bc=l("SqueezeBertForMaskedLM"),La=u(),j=n("div"),M(ps.$$.fragment),$c=u(),us=n("p"),jc=l("SqueezeBERT Model with a "),xn=n("code"),Jc=l("language modeling"),Sc=l(" head on top."),Uc=u(),hs=n("p"),Cc=l("The SqueezeBERT model was proposed in "),ms=n("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=n("p"),Vc=l("This model inherits from "),$o=n("a"),Fc=l("PreTrainedModel"),Wc=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=n("p"),xc=l("This model is also a PyTorch "),_s=n("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=n("p"),Ac=l(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Xn=n("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=n("div"),M(bs.$$.fragment),Hc=u(),ze=n("p"),Oc=l("The "),jo=n("a"),Kc=l("SqueezeBertForMaskedLM"),ed=l(" forward method, overrides the "),Nn=n("code"),td=l("__call__"),sd=l(" special method."),od=u(),M(et.$$.fragment),nd=u(),M(tt.$$.fragment),Da=u(),ve=n("h2"),st=n("a"),Gn=n("span"),M(Ms.$$.fragment),ad=u(),An=n("span"),rd=l("SqueezeBertForSequenceClassification"),Ha=u(),J=n("div"),M(ws.$$.fragment),ld=u(),Qn=n("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=n("p"),dd=l("The SqueezeBERT model was proposed in "),Ts=n("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=n("p"),md=l("This model inherits from "),Jo=n("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=n("p"),yd=l("This model is also a PyTorch "),qs=n("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=n("p"),kd=l(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Pn=n("em"),Td=l("squeezebert/squeezebert-mnli-headless"),zd=l(" checkpoint as a starting point."),vd=u(),M(ot.$$.fragment),qd=u(),M(nt.$$.fragment),Bd=u(),Y=n("div"),M($s.$$.fragment),$d=u(),qe=n("p"),jd=l("The "),So=n("a"),Jd=l("SqueezeBertForSequenceClassification"),Sd=l(" forward method, overrides the "),Yn=n("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=n("h2"),it=n("a"),Ln=n("span"),M(js.$$.fragment),Vd=u(),Dn=n("span"),Fd=l("SqueezeBertForMultipleChoice"),Ka=u(),S=n("div"),M(Js.$$.fragment),Wd=u(),Hn=n("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=n("p"),Xd=l("The SqueezeBERT model was proposed in "),Us=n("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=n("p"),Qd=l("This model inherits from "),Uo=n("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=n("p"),Dd=l("This model is also a PyTorch "),Zs=n("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=n("p"),ep=l(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),On=n("em"),tp=l("squeezebert/squeezebert-mnli-headless"),sp=l(" checkpoint as a starting point."),op=u(),M(ct.$$.fragment),np=u(),M(dt.$$.fragment),ap=u(),te=n("div"),M(Vs.$$.fragment),rp=u(),$e=n("p"),lp=l("The "),Co=n("a"),ip=l("SqueezeBertForMultipleChoice"),cp=l(" forward method, overrides the "),Kn=n("code"),dp=l("__call__"),pp=l(" special method."),up=u(),M(pt.$$.fragment),hp=u(),M(ut.$$.fragment),er=u(),je=n("h2"),ht=n("a"),ea=n("span"),M(Fs.$$.fragment),mp=u(),ta=n("span"),fp=l("SqueezeBertForTokenClassification"),tr=u(),U=n("div"),M(Ws.$$.fragment),gp=u(),sa=n("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=n("p"),bp=l("The SqueezeBERT model was proposed in "),xs=n("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=n("p"),Tp=l("This model inherits from "),Eo=n("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=n("p"),Bp=l("This model is also a PyTorch "),Gs=n("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=n("p"),Sp=l(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),oa=n("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=n("div"),M(Qs.$$.fragment),Vp=u(),Je=n("p"),Fp=l("The "),Zo=n("a"),Wp=l("SqueezeBertForTokenClassification"),Rp=l(" forward method, overrides the "),na=n("code"),xp=l("__call__"),Xp=l(" special method."),Np=u(),M(gt.$$.fragment),Gp=u(),M(_t.$$.fragment),sr=u(),Se=n("h2"),yt=n("a"),aa=n("span"),M(Ps.$$.fragment),Ap=u(),ra=n("span"),Qp=l("SqueezeBertForQuestionAnswering"),or=u(),C=n("div"),M(Ys.$$.fragment),Pp=u(),Ue=n("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=n("code"),Lp=l("span start logits"),Dp=l(" and "),ia=n("code"),Hp=l("span end logits"),Op=l(")."),Kp=u(),Ls=n("p"),eu=l("The SqueezeBERT model was proposed in "),Ds=n("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`),ou=u(),Hs=n("p"),nu=l("This model inherits from "),Io=n("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=n("p"),iu=l("This model is also a PyTorch "),Ks=n("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(),eo=n("p"),uu=l(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),ca=n("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(),oe=n("div"),M(to.$$.fragment),yu=u(),Ce=n("p"),bu=l("The "),Vo=n("a"),Mu=l("SqueezeBertForQuestionAnswering"),wu=l(" forward method, overrides the "),da=n("code"),ku=l("__call__"),Tu=l(" special method."),zu=u(),M(wt.$$.fragment),vu=u(),M(kt.$$.fragment),this.h()},l(o){const y=Bm('[data-svelte="svelte-1phssyn"]',document.head);c=a(y,"META",{name:!0,content:!0}),y.forEach(s),_=h(o),m=a(o,"H1",{class:!0});var so=r(m);d=a(so,"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(so),B=a(so,"SPAN",{});var ha=r(B);Qr=i(ha,"SqueezeBERT"),ha.forEach(s),so.forEach(s),Sa=h(o),ue=a(o,"H2",{class:!0});var oo=r(ue);Ie=a(oo,"A",{id:!0,class:!0,href:!0});var ma=r(Ie);Oo=a(ma,"SPAN",{});var fa=r(Oo);w(Jt.$$.fragment,fa),fa.forEach(s),ma.forEach(s),Pr=h(oo),Ko=a(oo,"SPAN",{});var ga=r(Ko);Yr=i(ga,"Overview"),ga.forEach(s),oo.forEach(s),Ua=h(o),ae=a(o,"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(o),lo=a(o,"P",{});var ba=r(lo);el=i(ba,"The abstract from the paper is the following:"),ba.forEach(s),Ea=h(o),io=a(o,"P",{});var Ma=r(io);en=a(Ma,"EM",{});var wa=r(en);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(o),co=a(o,"P",{});var ka=r(co);sl=i(ka,"Tips:"),ka.forEach(s),Ia=h(o),re=a(o,"UL",{});var Ze=r(re);tn=a(Ze,"LI",{});var Ta=r(tn);ol=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),nl=h(Ze),sn=a(Ze,"LI",{});var za=r(sn);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 no=r(Ct);ll=i(no,`For best results when finetuning on sequence classification tasks, it is recommended to start with the
`),on=a(no,"EM",{});var va=r(on);il=i(va,"squeezebert/squeezebert-mnli-headless"),va.forEach(s),cl=i(no," checkpoint."),no.forEach(s),Ze.forEach(s),Va=h(o),Ve=a(o,"P",{});var ao=r(Ve);dl=i(ao,"This model was contributed by "),Et=a(ao,"A",{href:!0,rel:!0});var qa=r(Et);pl=i(qa,"forresti"),qa.forEach(s),ul=i(ao,"."),ao.forEach(s),Fa=h(o),he=a(o,"H2",{class:!0});var ro=r(he);Fe=a(ro,"A",{id:!0,class:!0,href:!0});var Ba=r(Fe);nn=a(Ba,"SPAN",{});var $a=r(nn);w(Zt.$$.fragment,$a),$a.forEach(s),Ba.forEach(s),hl=h(ro),an=a(ro,"SPAN",{});var ja=r(an);ml=i(ja,"Documentation resources"),ja.forEach(s),ro.forEach(s),Wa=h(o),P=a(o,"UL",{});var D=r(P);rn=a(D,"LI",{});var Ja=r(rn);po=a(Ja,"A",{href:!0});var Ju=r(po);fl=i(Ju,"Text classification task guide"),Ju.forEach(s),Ja.forEach(s),gl=h(D),ln=a(D,"LI",{});var Su=r(ln);uo=a(Su,"A",{href:!0});var Uu=r(uo);_l=i(Uu,"Token classification task guide"),Uu.forEach(s),Su.forEach(s),yl=h(D),cn=a(D,"LI",{});var Cu=r(cn);ho=a(Cu,"A",{href:!0});var Eu=r(ho);bl=i(Eu,"Question answering task guide"),Eu.forEach(s),Cu.forEach(s),Ml=h(D),dn=a(D,"LI",{});var Zu=r(dn);mo=a(Zu,"A",{href:!0});var Iu=r(mo);wl=i(Iu,"Masked language modeling task guide"),Iu.forEach(s),Zu.forEach(s),kl=h(D),pn=a(D,"LI",{});var Vu=r(pn);fo=a(Vu,"A",{href:!0});var Fu=r(fo);Tl=i(Fu,"Multiple choice task guide"),Fu.forEach(s),Vu.forEach(s),D.forEach(s),Ra=h(o),me=a(o,"H2",{class:!0});var ar=r(me);We=a(ar,"A",{id:!0,class:!0,href:!0});var Wu=r(We);un=a(Wu,"SPAN",{});var Ru=r(un);w(It.$$.fragment,Ru),Ru.forEach(s),Wu.forEach(s),zl=h(ar),hn=a(ar,"SPAN",{});var xu=r(hn);vl=i(xu,"SqueezeBertConfig"),xu.forEach(s),ar.forEach(s),xa=h(o),A=a(o,"DIV",{class:!0});var ce=r(A);w(Vt.$$.fragment,ce),ql=h(ce),fe=a(ce,"P",{});var Fo=r(fe);Bl=i(Fo,"This is the configuration class to store the configuration of a "),go=a(Fo,"A",{href:!0});var Xu=r(go);$l=i(Xu,"SqueezeBertModel"),Xu.forEach(s),jl=i(Fo,`. 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
`),Ft=a(Fo,"A",{href:!0,rel:!0});var Nu=r(Ft);Jl=i(Nu,"squeezebert/squeezebert-uncased"),Nu.forEach(s),Sl=i(Fo," architecture."),Fo.forEach(s),Ul=h(ce),ge=a(ce,"P",{});var Wo=r(ge);Cl=i(Wo,"Configuration objects inherit from "),_o=a(Wo,"A",{href:!0});var Gu=r(_o);El=i(Gu,"PretrainedConfig"),Gu.forEach(s),Zl=i(Wo,` and can be used to control the model outputs. Read the
documentation from `),yo=a(Wo,"A",{href:!0});var Au=r(yo);Il=i(Au,"PretrainedConfig"),Au.forEach(s),Vl=i(Wo," for more information."),Wo.forEach(s),Fl=h(ce),w(Re.$$.fragment,ce),Wl=h(ce),mn=a(ce,"P",{});var Qu=r(mn);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(o),_e=a(o,"H2",{class:!0});var rr=r(_e);xe=a(rr,"A",{id:!0,class:!0,href:!0});var Pu=r(xe);fn=a(Pu,"SPAN",{});var Yu=r(fn);w(Wt.$$.fragment,Yu),Yu.forEach(s),Pu.forEach(s),xl=h(rr),gn=a(rr,"SPAN",{});var Lu=r(gn);Xl=i(Lu,"SqueezeBertTokenizer"),Lu.forEach(s),rr.forEach(s),Na=h(o),F=a(o,"DIV",{class:!0});var L=r(F);w(Rt.$$.fragment,L),Nl=h(L),_n=a(L,"P",{});var Du=r(_n);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 "),bo=a(lr,"A",{href:!0});var Hu=r(bo);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 Ro=r(le);w(Xt.$$.fragment,Ro),Dl=h(Ro),yn=a(Ro,"P",{});var Ou=r(yn);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(Ro),Nt=a(Ro,"UL",{});var ir=r(Nt);Mo=a(ir,"LI",{});var qu=r(Mo);Kl=i(qu,"single sequence: "),bn=a(qu,"CODE",{});var Ku=r(bn);ei=i(Ku,"[CLS] X [SEP]"),Ku.forEach(s),qu.forEach(s),ti=h(ir),wo=a(ir,"LI",{});var Bu=r(wo);si=i(Bu,"pair of sequences: "),Mn=a(Bu,"CODE",{});var eh=r(Mn);oi=i(eh,"[CLS] A [SEP] B [SEP]"),eh.forEach(s),Bu.forEach(s),ir.forEach(s),Ro.forEach(s),ni=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 `),wn=a(dr,"CODE",{});var th=r(wn);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),kn=a(Tt,"P",{});var sh=r(kn);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 xo=r(ye);mi=i(xo,"If "),Tn=a(xo,"CODE",{});var oh=r(Tn);fi=i(oh,"token_ids_1"),oh.forEach(s),gi=i(xo," is "),zn=a(xo,"CODE",{});var nh=r(zn);_i=i(nh,"None"),nh.forEach(s),yi=i(xo,", this method only returns the first portion of the mask (0s)."),xo.forEach(s),Tt.forEach(s),bi=h(L),ko=a(L,"DIV",{class:!0});var ah=r(ko);w(Pt.$$.fragment,ah),ah.forEach(s),L.forEach(s),Ga=h(o),be=a(o,"H2",{class:!0});var pr=r(be);Ge=a(pr,"A",{id:!0,class:!0,href:!0});var rh=r(Ge);vn=a(rh,"SPAN",{});var lh=r(vn);w(Yt.$$.fragment,lh),lh.forEach(s),rh.forEach(s),Mi=h(pr),qn=a(pr,"SPAN",{});var ih=r(qn);wi=i(ih,"SqueezeBertTokenizerFast"),ih.forEach(s),pr.forEach(s),Aa=h(o),Q=a(o,"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 "),Bn=a(ur,"EM",{});var ch=r(Bn);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 "),To=a(hr,"A",{href:!0});var dh=r(To);$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 Xo=r(ie);w(Ot.$$.fragment,Xo),Si=h(Xo),$n=a(Xo,"P",{});var ph=r($n);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(Xo),Kt=a(Xo,"UL",{});var mr=r(Kt);zo=a(mr,"LI",{});var $u=r(zo);Ei=i($u,"single sequence: "),jn=a($u,"CODE",{});var uh=r(jn);Zi=i(uh,"[CLS] X [SEP]"),uh.forEach(s),$u.forEach(s),Ii=h(mr),vo=a(mr,"LI",{});var ju=r(vo);Vi=i(ju,"pair of sequences: "),Jn=a(ju,"CODE",{});var hh=r(Jn);Fi=i(hh,"[CLS] A [SEP] B [SEP]"),hh.forEach(s),ju.forEach(s),mr.forEach(s),Xo.forEach(s),Wi=h(de),O=a(de,"DIV",{class:!0});var zt=r(O);w(es.$$.fragment,zt),Ri=h(zt),Sn=a(zt,"P",{});var mh=r(Sn);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 No=r(Me);Gi=i(No,"If "),Un=a(No,"CODE",{});var fh=r(Un);Ai=i(fh,"token_ids_1"),fh.forEach(s),Qi=i(No," is "),Cn=a(No,"CODE",{});var gh=r(Cn);Pi=i(gh,"None"),gh.forEach(s),Yi=i(No,", this method only returns the first portion of the mask (0s)."),No.forEach(s),zt.forEach(s),de.forEach(s),Qa=h(o),we=a(o,"H2",{class:!0});var fr=r(we);Qe=a(fr,"A",{id:!0,class:!0,href:!0});var _h=r(Qe);En=a(_h,"SPAN",{});var yh=r(En);w(ts.$$.fragment,yh),yh.forEach(s),_h.forEach(s),Li=h(fr),Zn=a(fr,"SPAN",{});var bh=r(Zn);Di=i(bh,"SqueezeBertModel"),bh.forEach(s),fr.forEach(s),Pa=h(o),$=a(o,"DIV",{class:!0});var W=r($);w(ss.$$.fragment,W),Hi=h(W),In=a(W,"P",{});var Mh=r(In);Oi=i(Mh,"The bare SqueezeBERT Model transformer outputting raw hidden-states without any specific head on top."),Mh.forEach(s),Ki=h(W),os=a(W,"P",{});var gr=r(os);ec=i(gr,"The SqueezeBERT model was proposed in "),ns=a(gr,"A",{href:!0,rel:!0});var wh=r(ns);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),oc=h(W),as=a(W,"P",{});var _r=r(as);nc=i(_r,"This model inherits from "),qo=a(_r,"A",{href:!0});var kh=r(qo);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(W),rs=a(W,"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(W),is=a(W,"P",{});var br=r(is);uc=i(br,`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Vn=a(br,"EM",{});var zh=r(Vn);hc=i(zh,"squeezebert/squeezebert-mnli-headless"),zh.forEach(s),mc=i(br," checkpoint as a starting point."),br.forEach(s),fc=h(W),w(Pe.$$.fragment,W),gc=h(W),w(Ye.$$.fragment,W),_c=h(W),K=a(W,"DIV",{class:!0});var vt=r(K);w(cs.$$.fragment,vt),yc=h(vt),ke=a(vt,"P",{});var Go=r(ke);bc=i(Go,"The "),Bo=a(Go,"A",{href:!0});var vh=r(Bo);Mc=i(vh,"SqueezeBertModel"),vh.forEach(s),wc=i(Go," forward method, overrides the "),Fn=a(Go,"CODE",{});var qh=r(Fn);kc=i(qh,"__call__"),qh.forEach(s),Tc=i(Go," special method."),Go.forEach(s),zc=h(vt),w(Le.$$.fragment,vt),vc=h(vt),w(De.$$.fragment,vt),vt.forEach(s),W.forEach(s),Ya=h(o),Te=a(o,"H2",{class:!0});var Mr=r(Te);He=a(Mr,"A",{id:!0,class:!0,href:!0});var Bh=r(He);Wn=a(Bh,"SPAN",{});var $h=r(Wn);w(ds.$$.fragment,$h),$h.forEach(s),Bh.forEach(s),qc=h(Mr),Rn=a(Mr,"SPAN",{});var jh=r(Rn);Bc=i(jh,"SqueezeBertForMaskedLM"),jh.forEach(s),Mr.forEach(s),La=h(o),j=a(o,"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 "),xn=a(wr,"CODE",{});var Jh=r(xn);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 "),$o=a(Tr,"A",{href:!0});var Uh=r($o);Fc=i(Uh,"PreTrainedModel"),Uh.forEach(s),Wc=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
`),Xn=a(vr,"EM",{});var Eh=r(Xn);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 Ao=r(ze);Oc=i(Ao,"The "),jo=a(Ao,"A",{href:!0});var Zh=r(jo);Kc=i(Zh,"SqueezeBertForMaskedLM"),Zh.forEach(s),ed=i(Ao," forward method, overrides the "),Nn=a(Ao,"CODE",{});var Ih=r(Nn);td=i(Ih,"__call__"),Ih.forEach(s),sd=i(Ao," special method."),Ao.forEach(s),od=h(qt),w(et.$$.fragment,qt),nd=h(qt),w(tt.$$.fragment,qt),qt.forEach(s),R.forEach(s),Da=h(o),ve=a(o,"H2",{class:!0});var qr=r(ve);st=a(qr,"A",{id:!0,class:!0,href:!0});var Vh=r(st);Gn=a(Vh,"SPAN",{});var Fh=r(Gn);w(Ms.$$.fragment,Fh),Fh.forEach(s),Vh.forEach(s),ad=h(qr),An=a(qr,"SPAN",{});var Wh=r(An);rd=i(Wh,"SqueezeBertForSequenceClassification"),Wh.forEach(s),qr.forEach(s),Ha=h(o),J=a(o,"DIV",{class:!0});var x=r(J);w(ws.$$.fragment,x),ld=h(x),Qn=a(x,"P",{});var Rh=r(Qn);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 "),Jo=a($r,"A",{href:!0});var Xh=r(Jo);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
`),Pn=a(Jr,"EM",{});var Gh=r(Pn);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(ot.$$.fragment,x),qd=h(x),w(nt.$$.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 Qo=r(qe);jd=i(Qo,"The "),So=a(Qo,"A",{href:!0});var Ah=r(So);Jd=i(Ah,"SqueezeBertForSequenceClassification"),Ah.forEach(s),Sd=i(Qo," forward method, overrides the "),Yn=a(Qo,"CODE",{});var Qh=r(Yn);Ud=i(Qh,"__call__"),Qh.forEach(s),Cd=i(Qo," special method."),Qo.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(o),Be=a(o,"H2",{class:!0});var Sr=r(Be);it=a(Sr,"A",{id:!0,class:!0,href:!0});var Ph=r(it);Ln=a(Ph,"SPAN",{});var Yh=r(Ln);w(js.$$.fragment,Yh),Yh.forEach(s),Ph.forEach(s),Vd=h(Sr),Dn=a(Sr,"SPAN",{});var Lh=r(Dn);Fd=i(Lh,"SqueezeBertForMultipleChoice"),Lh.forEach(s),Sr.forEach(s),Ka=h(o),S=a(o,"DIV",{class:!0});var X=r(S);w(Js.$$.fragment,X),Wd=h(X),Hn=a(X,"P",{});var Dh=r(Hn);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 "),Uo=a(Cr,"A",{href:!0});var Oh=r(Uo);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
`),On=a(Zr,"EM",{});var em=r(On);tp=i(em,"squeezebert/squeezebert-mnli-headless"),em.forEach(s),sp=i(Zr," checkpoint as a starting point."),Zr.forEach(s),op=h(X),w(ct.$$.fragment,X),np=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 Po=r($e);lp=i(Po,"The "),Co=a(Po,"A",{href:!0});var tm=r(Co);ip=i(tm,"SqueezeBertForMultipleChoice"),tm.forEach(s),cp=i(Po," forward method, overrides the "),Kn=a(Po,"CODE",{});var sm=r(Kn);dp=i(sm,"__call__"),sm.forEach(s),pp=i(Po," special method."),Po.forEach(s),up=h(Bt),w(pt.$$.fragment,Bt),hp=h(Bt),w(ut.$$.fragment,Bt),Bt.forEach(s),X.forEach(s),er=h(o),je=a(o,"H2",{class:!0});var Ir=r(je);ht=a(Ir,"A",{id:!0,class:!0,href:!0});var om=r(ht);ea=a(om,"SPAN",{});var nm=r(ea);w(Fs.$$.fragment,nm),nm.forEach(s),om.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(o),U=a(o,"DIV",{class:!0});var N=r(U);w(Ws.$$.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 Fr=r(Xs);Tp=i(Fr,"This model inherits from "),Eo=a(Fr,"A",{href:!0});var im=r(Eo);zp=i(im,"PreTrainedModel"),im.forEach(s),vp=i(Fr,`. 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.)`),Fr.forEach(s),qp=h(N),Ns=a(N,"P",{});var Wr=r(Ns);Bp=i(Wr,"This model is also a PyTorch "),Gs=a(Wr,"A",{href:!0,rel:!0});var cm=r(Gs);$p=i(cm,"torch.nn.Module"),cm.forEach(s),jp=i(Wr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Wr.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
`),oa=a(Rr,"EM",{});var dm=r(oa);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 Yo=r(Je);Fp=i(Yo,"The "),Zo=a(Yo,"A",{href:!0});var pm=r(Zo);Wp=i(pm,"SqueezeBertForTokenClassification"),pm.forEach(s),Rp=i(Yo," forward method, overrides the "),na=a(Yo,"CODE",{});var um=r(na);xp=i(um,"__call__"),um.forEach(s),Xp=i(Yo," special method."),Yo.forEach(s),Np=h($t),w(gt.$$.fragment,$t),Gp=h($t),w(_t.$$.fragment,$t),$t.forEach(s),N.forEach(s),sr=h(o),Se=a(o,"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),or=h(o),C=a(o,"DIV",{class:!0});var G=r(C);w(Ys.$$.fragment,G),Pp=h(G),Ue=a(G,"P",{});var Lo=r(Ue);Yp=i(Lo,`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(Lo,"CODE",{});var gm=r(la);Lp=i(gm,"span start logits"),gm.forEach(s),Dp=i(Lo," and "),ia=a(Lo,"CODE",{});var _m=r(ia);Hp=i(_m,"span end logits"),_m.forEach(s),Op=i(Lo,")."),Lo.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),ou=h(G),Hs=a(G,"P",{});var Nr=r(Hs);nu=i(Nr,"This model inherits from "),Io=a(Nr,"A",{href:!0});var bm=r(Io);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),eo=a(G,"P",{});var Ar=r(eo);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),oe=a(G,"DIV",{class:!0});var jt=r(oe);w(to.$$.fragment,jt),yu=h(jt),Ce=a(jt,"P",{});var Do=r(Ce);bu=i(Do,"The "),Vo=a(Do,"A",{href:!0});var km=r(Vo);Mu=i(km,"SqueezeBertForQuestionAnswering"),km.forEach(s),wu=i(Do," forward method, overrides the "),da=a(Do,"CODE",{});var Tm=r(da);ku=i(Tm,"__call__"),Tm.forEach(s),Tu=i(Do," special method."),Do.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(nf)),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(Fe,"id","documentation-resources"),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","#documentation-resources"),g(he,"class","relative group"),g(po,"href","../tasks/sequence_classification"),g(uo,"href","../tasks/token_classification"),g(ho,"href","../tasks/question_answering"),g(mo,"href","../tasks/masked_language_modeling"),g(fo,"href","../tasks/multiple_choice"),g(We,"id","transformers.SqueezeBertConfig"),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","#transformers.SqueezeBertConfig"),g(me,"class","relative group"),g(go,"href","/docs/transformers/main/en/model_doc/squeezebert#transformers.SqueezeBertModel"),g(Ft,"href","https://huggingface.co/squeezebert/squeezebert-uncased"),g(Ft,"rel","nofollow"),g(_o,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),g(yo,"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(bo,"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(ko,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(F,"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(To,"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(ns,"href","https://arxiv.org/abs/2006.11316"),g(ns,"rel","nofollow"),g(qo,"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(Bo,"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($o,"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(jo,"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(Jo,"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(So,"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(Uo,"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(Co,"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(Eo,"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(Zo,"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(Io,"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(Vo,"href","/docs/transformers/main/en/model_doc/squeezebert#transformers.SqueezeBertForQuestionAnswering"),g(oe,"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(o,y){e(document.head,c),b(o,_,y),b(o,m,y),e(m,d),e(d,f),k(t,f,null),e(m,p),e(m,B),e(B,Qr),b(o,Sa,y),b(o,ue,y),e(ue,Ie),e(Ie,Oo),k(Jt,Oo,null),e(ue,Pr),e(ue,Ko),e(Ko,Yr),b(o,Ua,y),b(o,ae,y),e(ae,Lr),e(ae,St),e(St,Dr),e(ae,Hr),e(ae,Ut),e(Ut,Or),e(ae,Kr),b(o,Ca,y),b(o,lo,y),e(lo,el),b(o,Ea,y),b(o,io,y),e(io,en),e(en,tl),b(o,Za,y),b(o,co,y),e(co,sl),b(o,Ia,y),b(o,re,y),e(re,tn),e(tn,ol),e(re,nl),e(re,sn),e(sn,al),e(re,rl),e(re,Ct),e(Ct,ll),e(Ct,on),e(on,il),e(Ct,cl),b(o,Va,y),b(o,Ve,y),e(Ve,dl),e(Ve,Et),e(Et,pl),e(Ve,ul),b(o,Fa,y),b(o,he,y),e(he,Fe),e(Fe,nn),k(Zt,nn,null),e(he,hl),e(he,an),e(an,ml),b(o,Wa,y),b(o,P,y),e(P,rn),e(rn,po),e(po,fl),e(P,gl),e(P,ln),e(ln,uo),e(uo,_l),e(P,yl),e(P,cn),e(cn,ho),e(ho,bl),e(P,Ml),e(P,dn),e(dn,mo),e(mo,wl),e(P,kl),e(P,pn),e(pn,fo),e(fo,Tl),b(o,Ra,y),b(o,me,y),e(me,We),e(We,un),k(It,un,null),e(me,zl),e(me,hn),e(hn,vl),b(o,xa,y),b(o,A,y),k(Vt,A,null),e(A,ql),e(A,fe),e(fe,Bl),e(fe,go),e(go,$l),e(fe,jl),e(fe,Ft),e(Ft,Jl),e(fe,Sl),e(A,Ul),e(A,ge),e(ge,Cl),e(ge,_o),e(_o,El),e(ge,Zl),e(ge,yo),e(yo,Il),e(ge,Vl),e(A,Fl),k(Re,A,null),e(A,Wl),e(A,mn),e(mn,Rl),b(o,Xa,y),b(o,_e,y),e(_e,xe),e(xe,fn),k(Wt,fn,null),e(_e,xl),e(_e,gn),e(gn,Xl),b(o,Na,y),b(o,F,y),k(Rt,F,null),e(F,Nl),e(F,_n),e(_n,Gl),e(F,Al),e(F,xt),e(xt,Ql),e(xt,bo),e(bo,Pl),e(xt,Yl),e(F,Ll),e(F,le),k(Xt,le,null),e(le,Dl),e(le,yn),e(yn,Hl),e(le,Ol),e(le,Nt),e(Nt,Mo),e(Mo,Kl),e(Mo,bn),e(bn,ei),e(Nt,ti),e(Nt,wo),e(wo,si),e(wo,Mn),e(Mn,oi),e(F,ni),e(F,Xe),k(Gt,Xe,null),e(Xe,ai),e(Xe,At),e(At,ri),e(At,wn),e(wn,li),e(At,ii),e(F,ci),e(F,H),k(Qt,H,null),e(H,di),e(H,kn),e(kn,pi),e(H,ui),k(Ne,H,null),e(H,hi),e(H,ye),e(ye,mi),e(ye,Tn),e(Tn,fi),e(ye,gi),e(ye,zn),e(zn,_i),e(ye,yi),e(F,bi),e(F,ko),k(Pt,ko,null),b(o,Ga,y),b(o,be,y),e(be,Ge),e(Ge,vn),k(Yt,vn,null),e(be,Mi),e(be,qn),e(qn,wi),b(o,Aa,y),b(o,Q,y),k(Lt,Q,null),e(Q,ki),e(Q,Dt),e(Dt,Ti),e(Dt,Bn),e(Bn,zi),e(Dt,vi),e(Q,qi),e(Q,Ht),e(Ht,Bi),e(Ht,To),e(To,$i),e(Ht,ji),e(Q,Ji),e(Q,ie),k(Ot,ie,null),e(ie,Si),e(ie,$n),e($n,Ui),e(ie,Ci),e(ie,Kt),e(Kt,zo),e(zo,Ei),e(zo,jn),e(jn,Zi),e(Kt,Ii),e(Kt,vo),e(vo,Vi),e(vo,Jn),e(Jn,Fi),e(Q,Wi),e(Q,O),k(es,O,null),e(O,Ri),e(O,Sn),e(Sn,xi),e(O,Xi),k(Ae,O,null),e(O,Ni),e(O,Me),e(Me,Gi),e(Me,Un),e(Un,Ai),e(Me,Qi),e(Me,Cn),e(Cn,Pi),e(Me,Yi),b(o,Qa,y),b(o,we,y),e(we,Qe),e(Qe,En),k(ts,En,null),e(we,Li),e(we,Zn),e(Zn,Di),b(o,Pa,y),b(o,$,y),k(ss,$,null),e($,Hi),e($,In),e(In,Oi),e($,Ki),e($,os),e(os,ec),e(os,ns),e(ns,tc),e(os,sc),e($,oc),e($,as),e(as,nc),e(as,qo),e(qo,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,Vn),e(Vn,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,Bo),e(Bo,Mc),e(ke,wc),e(ke,Fn),e(Fn,kc),e(ke,Tc),e(K,zc),k(Le,K,null),e(K,vc),k(De,K,null),b(o,Ya,y),b(o,Te,y),e(Te,He),e(He,Wn),k(ds,Wn,null),e(Te,qc),e(Te,Rn),e(Rn,Bc),b(o,La,y),b(o,j,y),k(ps,j,null),e(j,$c),e(j,us),e(us,jc),e(us,xn),e(xn,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,$o),e($o,Fc),e(fs,Wc),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,Xn),e(Xn,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,jo),e(jo,Kc),e(ze,ed),e(ze,Nn),e(Nn,td),e(ze,sd),e(ee,od),k(et,ee,null),e(ee,nd),k(tt,ee,null),b(o,Da,y),b(o,ve,y),e(ve,st),e(st,Gn),k(Ms,Gn,null),e(ve,ad),e(ve,An),e(An,rd),b(o,Ha,y),b(o,J,y),k(ws,J,null),e(J,ld),e(J,Qn),e(Qn,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,Jo),e(Jo,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,Pn),e(Pn,Td),e(Bs,zd),e(J,vd),k(ot,J,null),e(J,qd),k(nt,J,null),e(J,Bd),e(J,Y),k($s,Y,null),e(Y,$d),e(Y,qe),e(qe,jd),e(qe,So),e(So,Jd),e(qe,Sd),e(qe,Yn),e(Yn,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(o,Oa,y),b(o,Be,y),e(Be,it),e(it,Ln),k(js,Ln,null),e(Be,Vd),e(Be,Dn),e(Dn,Fd),b(o,Ka,y),b(o,S,y),k(Js,S,null),e(S,Wd),e(S,Hn),e(Hn,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,Uo),e(Uo,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,On),e(On,tp),e(Is,sp),e(S,op),k(ct,S,null),e(S,np),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,Co),e(Co,ip),e($e,cp),e($e,Kn),e(Kn,dp),e($e,pp),e(te,up),k(pt,te,null),e(te,hp),k(ut,te,null),b(o,er,y),b(o,je,y),e(je,ht),e(ht,ea),k(Fs,ea,null),e(je,mp),e(je,ta),e(ta,fp),b(o,tr,y),b(o,U,y),k(Ws,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,Eo),e(Eo,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,oa),e(oa,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,Fp),e(Je,Zo),e(Zo,Wp),e(Je,Rp),e(Je,na),e(na,xp),e(Je,Xp),e(se,Np),k(gt,se,null),e(se,Gp),k(_t,se,null),b(o,sr,y),b(o,Se,y),e(Se,yt),e(yt,aa),k(Ps,aa,null),e(Se,Ap),e(Se,ra),e(ra,Qp),b(o,or,y),b(o,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,ou),e(C,Hs),e(Hs,nu),e(Hs,Io),e(Io,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,eo),e(eo,uu),e(eo,ca),e(ca,hu),e(eo,mu),e(C,fu),k(bt,C,null),e(C,gu),k(Mt,C,null),e(C,_u),e(C,oe),k(to,oe,null),e(oe,yu),e(oe,Ce),e(Ce,bu),e(Ce,Vo),e(Vo,Mu),e(Ce,wu),e(Ce,da),e(da,ku),e(Ce,Tu),e(oe,zu),k(wt,oe,null),e(oe,vu),k(kt,oe,null),nr=!0},p(o,[y]){const so={};y&2&&(so.$$scope={dirty:y,ctx:o}),Re.$set(so);const pa={};y&2&&(pa.$$scope={dirty:y,ctx:o}),Ne.$set(pa);const ua={};y&2&&(ua.$$scope={dirty:y,ctx:o}),Ae.$set(ua);const ha={};y&2&&(ha.$$scope={dirty:y,ctx:o}),Pe.$set(ha);const oo={};y&2&&(oo.$$scope={dirty:y,ctx:o}),Ye.$set(oo);const ma={};y&2&&(ma.$$scope={dirty:y,ctx:o}),Le.$set(ma);const fa={};y&2&&(fa.$$scope={dirty:y,ctx:o}),De.$set(fa);const ga={};y&2&&(ga.$$scope={dirty:y,ctx:o}),Oe.$set(ga);const Ee={};y&2&&(Ee.$$scope={dirty:y,ctx:o}),Ke.$set(Ee);const _a={};y&2&&(_a.$$scope={dirty:y,ctx:o}),et.$set(_a);const ya={};y&2&&(ya.$$scope={dirty:y,ctx:o}),tt.$set(ya);const ba={};y&2&&(ba.$$scope={dirty:y,ctx:o}),ot.$set(ba);const Ma={};y&2&&(Ma.$$scope={dirty:y,ctx:o}),nt.$set(Ma);const wa={};y&2&&(wa.$$scope={dirty:y,ctx:o}),at.$set(wa);const ka={};y&2&&(ka.$$scope={dirty:y,ctx:o}),rt.$set(ka);const Ze={};y&2&&(Ze.$$scope={dirty:y,ctx:o}),lt.$set(Ze);const Ta={};y&2&&(Ta.$$scope={dirty:y,ctx:o}),ct.$set(Ta);const za={};y&2&&(za.$$scope={dirty:y,ctx:o}),dt.$set(za);const no={};y&2&&(no.$$scope={dirty:y,ctx:o}),pt.$set(no);const va={};y&2&&(va.$$scope={dirty:y,ctx:o}),ut.$set(va);const ao={};y&2&&(ao.$$scope={dirty:y,ctx:o}),mt.$set(ao);const qa={};y&2&&(qa.$$scope={dirty:y,ctx:o}),ft.$set(qa);const ro={};y&2&&(ro.$$scope={dirty:y,ctx:o}),gt.$set(ro);const Ba={};y&2&&(Ba.$$scope={dirty:y,ctx:o}),_t.$set(Ba);const $a={};y&2&&($a.$$scope={dirty:y,ctx:o}),bt.$set($a);const ja={};y&2&&(ja.$$scope={dirty:y,ctx:o}),Mt.$set(ja);const D={};y&2&&(D.$$scope={dirty:y,ctx:o}),wt.$set(D);const Ja={};y&2&&(Ja.$$scope={dirty:y,ctx:o}),kt.$set(Ja)},i(o){nr||(T(t.$$.fragment,o),T(Jt.$$.fragment,o),T(Zt.$$.fragment,o),T(It.$$.fragment,o),T(Vt.$$.fragment,o),T(Re.$$.fragment,o),T(Wt.$$.fragment,o),T(Rt.$$.fragment,o),T(Xt.$$.fragment,o),T(Gt.$$.fragment,o),T(Qt.$$.fragment,o),T(Ne.$$.fragment,o),T(Pt.$$.fragment,o),T(Yt.$$.fragment,o),T(Lt.$$.fragment,o),T(Ot.$$.fragment,o),T(es.$$.fragment,o),T(Ae.$$.fragment,o),T(ts.$$.fragment,o),T(ss.$$.fragment,o),T(Pe.$$.fragment,o),T(Ye.$$.fragment,o),T(cs.$$.fragment,o),T(Le.$$.fragment,o),T(De.$$.fragment,o),T(ds.$$.fragment,o),T(ps.$$.fragment,o),T(Oe.$$.fragment,o),T(Ke.$$.fragment,o),T(bs.$$.fragment,o),T(et.$$.fragment,o),T(tt.$$.fragment,o),T(Ms.$$.fragment,o),T(ws.$$.fragment,o),T(ot.$$.fragment,o),T(nt.$$.fragment,o),T($s.$$.fragment,o),T(at.$$.fragment,o),T(rt.$$.fragment,o),T(lt.$$.fragment,o),T(js.$$.fragment,o),T(Js.$$.fragment,o),T(ct.$$.fragment,o),T(dt.$$.fragment,o),T(Vs.$$.fragment,o),T(pt.$$.fragment,o),T(ut.$$.fragment,o),T(Fs.$$.fragment,o),T(Ws.$$.fragment,o),T(mt.$$.fragment,o),T(ft.$$.fragment,o),T(Qs.$$.fragment,o),T(gt.$$.fragment,o),T(_t.$$.fragment,o),T(Ps.$$.fragment,o),T(Ys.$$.fragment,o),T(bt.$$.fragment,o),T(Mt.$$.fragment,o),T(to.$$.fragment,o),T(wt.$$.fragment,o),T(kt.$$.fragment,o),nr=!0)},o(o){z(t.$$.fragment,o),z(Jt.$$.fragment,o),z(Zt.$$.fragment,o),z(It.$$.fragment,o),z(Vt.$$.fragment,o),z(Re.$$.fragment,o),z(Wt.$$.fragment,o),z(Rt.$$.fragment,o),z(Xt.$$.fragment,o),z(Gt.$$.fragment,o),z(Qt.$$.fragment,o),z(Ne.$$.fragment,o),z(Pt.$$.fragment,o),z(Yt.$$.fragment,o),z(Lt.$$.fragment,o),z(Ot.$$.fragment,o),z(es.$$.fragment,o),z(Ae.$$.fragment,o),z(ts.$$.fragment,o),z(ss.$$.fragment,o),z(Pe.$$.fragment,o),z(Ye.$$.fragment,o),z(cs.$$.fragment,o),z(Le.$$.fragment,o),z(De.$$.fragment,o),z(ds.$$.fragment,o),z(ps.$$.fragment,o),z(Oe.$$.fragment,o),z(Ke.$$.fragment,o),z(bs.$$.fragment,o),z(et.$$.fragment,o),z(tt.$$.fragment,o),z(Ms.$$.fragment,o),z(ws.$$.fragment,o),z(ot.$$.fragment,o),z(nt.$$.fragment,o),z($s.$$.fragment,o),z(at.$$.fragment,o),z(rt.$$.fragment,o),z(lt.$$.fragment,o),z(js.$$.fragment,o),z(Js.$$.fragment,o),z(ct.$$.fragment,o),z(dt.$$.fragment,o),z(Vs.$$.fragment,o),z(pt.$$.fragment,o),z(ut.$$.fragment,o),z(Fs.$$.fragment,o),z(Ws.$$.fragment,o),z(mt.$$.fragment,o),z(ft.$$.fragment,o),z(Qs.$$.fragment,o),z(gt.$$.fragment,o),z(_t.$$.fragment,o),z(Ps.$$.fragment,o),z(Ys.$$.fragment,o),z(bt.$$.fragment,o),z(Mt.$$.fragment,o),z(to.$$.fragment,o),z(wt.$$.fragment,o),z(kt.$$.fragment,o),nr=!1},d(o){s(c),o&&s(_),o&&s(m),v(t),o&&s(Sa),o&&s(ue),v(Jt),o&&s(Ua),o&&s(ae),o&&s(Ca),o&&s(lo),o&&s(Ea),o&&s(io),o&&s(Za),o&&s(co),o&&s(Ia),o&&s(re),o&&s(Va),o&&s(Ve),o&&s(Fa),o&&s(he),v(Zt),o&&s(Wa),o&&s(P),o&&s(Ra),o&&s(me),v(It),o&&s(xa),o&&s(A),v(Vt),v(Re),o&&s(Xa),o&&s(_e),v(Wt),o&&s(Na),o&&s(F),v(Rt),v(Xt),v(Gt),v(Qt),v(Ne),v(Pt),o&&s(Ga),o&&s(be),v(Yt),o&&s(Aa),o&&s(Q),v(Lt),v(Ot),v(es),v(Ae),o&&s(Qa),o&&s(we),v(ts),o&&s(Pa),o&&s($),v(ss),v(Pe),v(Ye),v(cs),v(Le),v(De),o&&s(Ya),o&&s(Te),v(ds),o&&s(La),o&&s(j),v(ps),v(Oe),v(Ke),v(bs),v(et),v(tt),o&&s(Da),o&&s(ve),v(Ms),o&&s(Ha),o&&s(J),v(ws),v(ot),v(nt),v($s),v(at),v(rt),v(lt),o&&s(Oa),o&&s(Be),v(js),o&&s(Ka),o&&s(S),v(Js),v(ct),v(dt),v(Vs),v(pt),v(ut),o&&s(er),o&&s(je),v(Fs),o&&s(tr),o&&s(U),v(Ws),v(mt),v(ft),v(Qs),v(gt),v(_t),o&&s(sr),o&&s(Se),v(Ps),o&&s(or),o&&s(C),v(Ys),v(bt),v(Mt),v(to),v(wt),v(kt)}}}const nf={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,of,qm,{})}}export{hf as default,nf as metadata};
